From 5a458977113e4a0d3c389b03801cf6ce580d3935 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:14:04 -0700 Subject: mesa: set version to 7.3 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 3d874c8ba8..62cd03f5e2 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -31,7 +31,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 3 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.3-rc3" +#define MESA_VERSION_STRING "7.3" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 0e4805685035dc3ea26f169830843cd4cecd1a29 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:22:55 -0700 Subject: mesa: master is open for new development, eventually will be Mesa 7.5 --- Makefile | 8 ++++---- src/mesa/main/version.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/Makefile b/Makefile index c1e0f67223..840b41464f 100644 --- a/Makefile +++ b/Makefile @@ -174,10 +174,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.3 -LIB_NAME = MesaLib-7.3 -DEMO_NAME = MesaDemos-7.3 -GLUT_NAME = MesaGLUT-7.3 +DIRECTORY = Mesa-7.5-devel +LIB_NAME = MesaLib-7.5-devel +DEMO_NAME = MesaDemos-7.5-devel +GLUT_NAME = MesaGLUT-7.5-devel MAIN_FILES = \ $(DIRECTORY)/Makefile* \ diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 62cd03f5e2..f5bf6e2c85 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.3 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -29,9 +29,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 3 +#define MESA_MINOR 5 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.3" +#define MESA_VERSION_STRING "7.5-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 596b8fbbbf65cef227ce60216a57d4bbfd627099 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:32:08 -0700 Subject: mesa: added _mesa_fprintf() wrapper --- src/mesa/main/imports.c | 15 ++++++++++++++- src/mesa/main/imports.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 5cf1a2baa4..0c2c894eef 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -955,9 +955,22 @@ _mesa_printf( const char *fmtString, ... ) va_start( args, fmtString ); vsnprintf(s, MAXSTRING, fmtString, args); va_end( args ); - fprintf(stderr,"%s", s); + fprintf(stderr, "%s", s); } +/** Wrapper around fprintf(), using vsprintf() for the formatting. */ +void +_mesa_fprintf( FILE *f, const char *fmtString, ... ) +{ + char s[MAXSTRING]; + va_list args; + va_start( args, fmtString ); + vsnprintf(s, MAXSTRING, fmtString, args); + va_end( args ); + fprintf(f, "%s", s); +} + + /** Wrapper around vsprintf() */ int _mesa_vsprintf( char *str, const char *fmt, va_list args ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 13b571d1cb..ec270a0cb3 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -773,6 +773,9 @@ _mesa_snprintf( char *str, size_t size, const char *fmt, ... ); extern void _mesa_printf( const char *fmtString, ... ); +extern void +_mesa_fprintf( FILE *f, const char *fmtString, ... ); + extern int _mesa_vsprintf( char *str, const char *fmt, va_list args ); -- cgit v1.2.3 From cb136e0476a3ca4f3cb7730ccdd729ba3773e351 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:34:15 -0700 Subject: glsl: set shader->CompileStatus in _slang_compile() --- src/mesa/shader/shader_api.c | 5 ++++- src/mesa/shader/slang/slang_compile.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index b3d66c5bab..acee34dc5b 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1357,7 +1357,10 @@ _mesa_compile_shader(GLcontext *ctx, GLuint shaderObj) if (!sh) return; - sh->CompileStatus = _slang_compile(ctx, sh); + /* this call will set the sh->CompileStatus field to indicate if + * compilation was successful. + */ + (void) _slang_compile(ctx, sh); } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 818b90b7a8..456ec4411f 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2794,6 +2794,8 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) _mesa_print_program(shader->Program); #endif + shader->CompileStatus = success; + return success; } -- cgit v1.2.3 From d0038930312f96468a9159a1221c3f4c56bddaa4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:34:43 -0700 Subject: glsl: new _mesa_write_shader_to_file() function Used to log a shader to a file. Includes shader source code, the info log and generated GPU instructions. --- src/mesa/shader/prog_print.c | 411 ++++++++++++++++++++++++++----------------- src/mesa/shader/prog_print.h | 4 + 2 files changed, 256 insertions(+), 159 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 0ec13a415c..09019dffef 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -3,6 +3,7 @@ * Version: 7.3 * * 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"), @@ -401,90 +402,98 @@ _mesa_condcode_string(GLuint condcode) static void -print_dst_reg(const struct prog_dst_register *dstReg, gl_prog_print_mode mode, - const struct gl_program *prog) +fprint_dst_reg(FILE * f, + const struct prog_dst_register *dstReg, + gl_prog_print_mode mode, + const struct gl_program *prog) { - _mesa_printf("%s%s", - reg_string((enum register_file) dstReg->File, - dstReg->Index, mode, dstReg->RelAddr, prog), - _mesa_writemask_string(dstReg->WriteMask)); + _mesa_fprintf(f, "%s%s", + reg_string((enum register_file) dstReg->File, + dstReg->Index, mode, dstReg->RelAddr, prog), + _mesa_writemask_string(dstReg->WriteMask)); if (dstReg->CondMask != COND_TR) { - _mesa_printf(" (%s.%s)", - _mesa_condcode_string(dstReg->CondMask), - _mesa_swizzle_string(dstReg->CondSwizzle, GL_FALSE, GL_FALSE)); + _mesa_fprintf(f, " (%s.%s)", + _mesa_condcode_string(dstReg->CondMask), + _mesa_swizzle_string(dstReg->CondSwizzle, + GL_FALSE, GL_FALSE)); } #if 0 - _mesa_printf("%s[%d]%s", + _mesa_fprintf(f, "%s[%d]%s", file_string((enum register_file) dstReg->File, mode), dstReg->Index, _mesa_writemask_string(dstReg->WriteMask)); #endif } + static void -print_src_reg(const struct prog_src_register *srcReg, gl_prog_print_mode mode, - const struct gl_program *prog) +fprint_src_reg(FILE *f, + const struct prog_src_register *srcReg, + gl_prog_print_mode mode, + const struct gl_program *prog) { - _mesa_printf("%s%s", - reg_string((enum register_file) srcReg->File, - srcReg->Index, mode, srcReg->RelAddr, prog), - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->NegateBase, GL_FALSE)); + _mesa_fprintf(f, "%s%s", + reg_string((enum register_file) srcReg->File, + srcReg->Index, mode, srcReg->RelAddr, prog), + _mesa_swizzle_string(srcReg->Swizzle, + srcReg->NegateBase, GL_FALSE)); #if 0 - _mesa_printf("%s[%d]%s", - file_string((enum register_file) srcReg->File, mode), - srcReg->Index, - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->NegateBase, GL_FALSE)); + _mesa_fprintf(f, "%s[%d]%s", + file_string((enum register_file) srcReg->File, mode), + srcReg->Index, + _mesa_swizzle_string(srcReg->Swizzle, + srcReg->NegateBase, GL_FALSE)); #endif } + static void -print_comment(const struct prog_instruction *inst) +fprint_comment(FILE *f, const struct prog_instruction *inst) { if (inst->Comment) - _mesa_printf("; # %s\n", inst->Comment); + _mesa_fprintf(f, "; # %s\n", inst->Comment); else - _mesa_printf(";\n"); + _mesa_fprintf(f, ";\n"); } static void -print_alu_instruction(const struct prog_instruction *inst, - const char *opcode_string, GLuint numRegs, - gl_prog_print_mode mode, - const struct gl_program *prog) +fprint_alu_instruction(FILE *f, + const struct prog_instruction *inst, + const char *opcode_string, GLuint numRegs, + gl_prog_print_mode mode, + const struct gl_program *prog) { GLuint j; - _mesa_printf("%s", opcode_string); + _mesa_fprintf(f, "%s", opcode_string); if (inst->CondUpdate) - _mesa_printf(".C"); + _mesa_fprintf(f, ".C"); /* frag prog only */ if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); + _mesa_fprintf(f, "_SAT"); - _mesa_printf(" "); + _mesa_fprintf(f, " "); if (inst->DstReg.File != PROGRAM_UNDEFINED) { - print_dst_reg(&inst->DstReg, mode, prog); + fprint_dst_reg(f, &inst->DstReg, mode, prog); } else { - _mesa_printf(" ???"); + _mesa_fprintf(f, " ???"); } if (numRegs > 0) - _mesa_printf(", "); + _mesa_fprintf(f, ", "); for (j = 0; j < numRegs; j++) { - print_src_reg(inst->SrcReg + j, mode, prog); + fprint_src_reg(f, inst->SrcReg + j, mode, prog); if (j + 1 < numRegs) - _mesa_printf(", "); + _mesa_fprintf(f, ", "); } - print_comment(inst); + fprint_comment(f, inst); } @@ -492,23 +501,18 @@ void _mesa_print_alu_instruction(const struct prog_instruction *inst, const char *opcode_string, GLuint numRegs) { - print_alu_instruction(inst, opcode_string, numRegs, PROG_PRINT_DEBUG, NULL); -} - - -void -_mesa_print_instruction(const struct prog_instruction *inst) -{ - /* note: 4th param should be ignored for PROG_PRINT_DEBUG */ - _mesa_print_instruction_opt(inst, 0, PROG_PRINT_DEBUG, NULL); + fprint_alu_instruction(stdout, inst, opcode_string, + numRegs, PROG_PRINT_DEBUG, NULL); } /** * Print a single vertex/fragment program instruction. */ -GLint -_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent, +static GLint +_mesa_fprint_instruction_opt(FILE *f, + const struct prog_instruction *inst, + GLint indent, gl_prog_print_mode mode, const struct gl_program *prog) { @@ -521,15 +525,15 @@ _mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent, indent -= 3; } for (i = 0; i < indent; i++) { - _mesa_printf(" "); + _mesa_fprintf(f, " "); } switch (inst->Opcode) { case OPCODE_PRINT: - _mesa_printf("PRINT '%s'", inst->Data); + _mesa_fprintf(f, "PRINT '%s'", inst->Data); if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - _mesa_printf(", "); - _mesa_printf("%s[%d]%s", + _mesa_fprintf(f, ", "); + _mesa_fprintf(f, "%s[%d]%s", file_string((enum register_file) inst->SrcReg[0].File, mode), inst->SrcReg[0].Index, @@ -537,259 +541,295 @@ _mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent, inst->SrcReg[0].NegateBase, GL_FALSE)); } if (inst->Comment) - _mesa_printf(" # %s", inst->Comment); - print_comment(inst); + _mesa_fprintf(f, " # %s", inst->Comment); + fprint_comment(f, inst); break; case OPCODE_SWZ: - _mesa_printf("SWZ"); + _mesa_fprintf(f, "SWZ"); if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); - _mesa_printf(" "); - print_dst_reg(&inst->DstReg, mode, prog); - _mesa_printf(", %s[%d], %s", + _mesa_fprintf(f, "_SAT"); + _mesa_fprintf(f, " "); + fprint_dst_reg(f, &inst->DstReg, mode, prog); + _mesa_fprintf(f, ", %s[%d], %s", file_string((enum register_file) inst->SrcReg[0].File, mode), inst->SrcReg[0].Index, _mesa_swizzle_string(inst->SrcReg[0].Swizzle, inst->SrcReg[0].NegateBase, GL_TRUE)); - print_comment(inst); + fprint_comment(f, inst); break; case OPCODE_TEX: case OPCODE_TXP: case OPCODE_TXL: case OPCODE_TXB: - _mesa_printf("%s", _mesa_opcode_string(inst->Opcode)); + _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); - _mesa_printf(" "); - print_dst_reg(&inst->DstReg, mode, prog); - _mesa_printf(", "); - print_src_reg(&inst->SrcReg[0], mode, prog); - _mesa_printf(", texture[%d], ", inst->TexSrcUnit); + _mesa_fprintf(f, "_SAT"); + _mesa_fprintf(f, " "); + fprint_dst_reg(f, &inst->DstReg, mode, prog); + _mesa_fprintf(f, ", "); + fprint_src_reg(f, &inst->SrcReg[0], mode, prog); + _mesa_fprintf(f, ", texture[%d], ", inst->TexSrcUnit); switch (inst->TexSrcTarget) { - case TEXTURE_1D_INDEX: _mesa_printf("1D"); break; - case TEXTURE_2D_INDEX: _mesa_printf("2D"); break; - case TEXTURE_3D_INDEX: _mesa_printf("3D"); break; - case TEXTURE_CUBE_INDEX: _mesa_printf("CUBE"); break; - case TEXTURE_RECT_INDEX: _mesa_printf("RECT"); break; + case TEXTURE_1D_INDEX: _mesa_fprintf(f, "1D"); break; + case TEXTURE_2D_INDEX: _mesa_fprintf(f, "2D"); break; + case TEXTURE_3D_INDEX: _mesa_fprintf(f, "3D"); break; + case TEXTURE_CUBE_INDEX: _mesa_fprintf(f, "CUBE"); break; + case TEXTURE_RECT_INDEX: _mesa_fprintf(f, "RECT"); break; default: ; } - print_comment(inst); + fprint_comment(f, inst); break; case OPCODE_KIL: - _mesa_printf("%s", _mesa_opcode_string(inst->Opcode)); - _mesa_printf(" "); - print_src_reg(&inst->SrcReg[0], mode, prog); - print_comment(inst); + _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + _mesa_fprintf(f, " "); + fprint_src_reg(f, &inst->SrcReg[0], mode, prog); + fprint_comment(f, inst); break; case OPCODE_KIL_NV: - _mesa_printf("%s", _mesa_opcode_string(inst->Opcode)); - _mesa_printf(" "); - _mesa_printf("%s.%s", + _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + _mesa_fprintf(f, " "); + _mesa_fprintf(f, "%s.%s", _mesa_condcode_string(inst->DstReg.CondMask), _mesa_swizzle_string(inst->DstReg.CondSwizzle, GL_FALSE, GL_FALSE)); - print_comment(inst); + fprint_comment(f, inst); break; case OPCODE_ARL: - _mesa_printf("ARL "); - print_dst_reg(&inst->DstReg, mode, prog); - _mesa_printf(", "); - print_src_reg(&inst->SrcReg[0], mode, prog); - print_comment(inst); + _mesa_fprintf(f, "ARL "); + fprint_dst_reg(f, &inst->DstReg, mode, prog); + _mesa_fprintf(f, ", "); + fprint_src_reg(f, &inst->SrcReg[0], mode, prog); + fprint_comment(f, inst); break; case OPCODE_BRA: - _mesa_printf("BRA %d (%s%s)", + _mesa_fprintf(f, "BRA %d (%s%s)", inst->BranchTarget, _mesa_condcode_string(inst->DstReg.CondMask), _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); - print_comment(inst); + fprint_comment(f, inst); break; case OPCODE_IF: if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { /* Use ordinary register */ - _mesa_printf("IF "); - print_src_reg(&inst->SrcReg[0], mode, prog); - _mesa_printf("; "); + _mesa_fprintf(f, "IF "); + fprint_src_reg(f, &inst->SrcReg[0], mode, prog); + _mesa_fprintf(f, "; "); } else { /* Use cond codes */ - _mesa_printf("IF (%s%s);", + _mesa_fprintf(f, "IF (%s%s);", _mesa_condcode_string(inst->DstReg.CondMask), _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); } - _mesa_printf(" # (if false, goto %d)", inst->BranchTarget); - print_comment(inst); + _mesa_fprintf(f, " # (if false, goto %d)", inst->BranchTarget); + fprint_comment(f, inst); return indent + 3; case OPCODE_ELSE: - _mesa_printf("ELSE; # (goto %d)\n", inst->BranchTarget); + _mesa_fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget); return indent + 3; case OPCODE_ENDIF: - _mesa_printf("ENDIF;\n"); + _mesa_fprintf(f, "ENDIF;\n"); break; case OPCODE_BGNLOOP: - _mesa_printf("BGNLOOP; # (end at %d)\n", inst->BranchTarget); + _mesa_fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget); return indent + 3; case OPCODE_ENDLOOP: - _mesa_printf("ENDLOOP; # (goto %d)\n", inst->BranchTarget); + _mesa_fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget); break; case OPCODE_BRK: case OPCODE_CONT: - _mesa_printf("%s (%s%s); # (goto %d)", + _mesa_fprintf(f, "%s (%s%s); # (goto %d)", _mesa_opcode_string(inst->Opcode), _mesa_condcode_string(inst->DstReg.CondMask), _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE), inst->BranchTarget); - print_comment(inst); + fprint_comment(f, inst); break; case OPCODE_BGNSUB: if (mode == PROG_PRINT_NV) { - _mesa_printf("%s:\n", inst->Comment); /* comment is label */ + _mesa_fprintf(f, "%s:\n", inst->Comment); /* comment is label */ return indent; } else { - _mesa_printf("BGNSUB"); - print_comment(inst); + _mesa_fprintf(f, "BGNSUB"); + fprint_comment(f, inst); return indent + 3; } case OPCODE_ENDSUB: if (mode == PROG_PRINT_DEBUG) { - _mesa_printf("ENDSUB"); - print_comment(inst); + _mesa_fprintf(f, "ENDSUB"); + fprint_comment(f, inst); } break; case OPCODE_CAL: if (mode == PROG_PRINT_NV) { - _mesa_printf("CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget); + _mesa_fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget); } else { - _mesa_printf("CAL %u", inst->BranchTarget); - print_comment(inst); + _mesa_fprintf(f, "CAL %u", inst->BranchTarget); + fprint_comment(f, inst); } break; case OPCODE_RET: - _mesa_printf("RET (%s%s)", + _mesa_fprintf(f, "RET (%s%s)", _mesa_condcode_string(inst->DstReg.CondMask), _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); - print_comment(inst); + fprint_comment(f, inst); break; case OPCODE_END: - _mesa_printf("END\n"); + _mesa_fprintf(f, "END\n"); break; case OPCODE_NOP: if (mode == PROG_PRINT_DEBUG) { - _mesa_printf("NOP"); - print_comment(inst); + _mesa_fprintf(f, "NOP"); + fprint_comment(f, inst); } else if (inst->Comment) { /* ARB/NV extensions don't have NOP instruction */ - _mesa_printf("# %s\n", inst->Comment); + _mesa_fprintf(f, "# %s\n", inst->Comment); } break; /* XXX may need other special-case instructions */ default: /* typical alu instruction */ - print_alu_instruction(inst, - _mesa_opcode_string(inst->Opcode), - _mesa_num_inst_src_regs(inst->Opcode), - mode, prog); + fprint_alu_instruction(f, inst, + _mesa_opcode_string(inst->Opcode), + _mesa_num_inst_src_regs(inst->Opcode), + mode, prog); break; } return indent; } -/** - * Print program to stdout, default options. - */ +GLint +_mesa_print_instruction_opt(const struct prog_instruction *inst, + GLint indent, + gl_prog_print_mode mode, + const struct gl_program *prog) +{ + return _mesa_fprint_instruction_opt(stdout, inst, indent, mode, prog); +} + + void -_mesa_print_program(const struct gl_program *prog) +_mesa_print_instruction(const struct prog_instruction *inst) { - _mesa_print_program_opt(prog, PROG_PRINT_DEBUG, GL_TRUE); + /* note: 4th param should be ignored for PROG_PRINT_DEBUG */ + _mesa_fprint_instruction_opt(stdout, inst, 0, PROG_PRINT_DEBUG, NULL); } + /** * Print program, with options. */ -void -_mesa_print_program_opt(const struct gl_program *prog, - gl_prog_print_mode mode, - GLboolean lineNumbers) +static void +_mesa_fprint_program_opt(FILE *f, + const struct gl_program *prog, + gl_prog_print_mode mode, + GLboolean lineNumbers) { GLuint i, indent = 0; switch (prog->Target) { case GL_VERTEX_PROGRAM_ARB: if (mode == PROG_PRINT_ARB) - _mesa_printf("!!ARBvp1.0\n"); + _mesa_fprintf(f, "!!ARBvp1.0\n"); else if (mode == PROG_PRINT_NV) - _mesa_printf("!!VP1.0\n"); + _mesa_fprintf(f, "!!VP1.0\n"); else - _mesa_printf("# Vertex Program/Shader\n"); + _mesa_fprintf(f, "# Vertex Program/Shader\n"); break; case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: if (mode == PROG_PRINT_ARB) - _mesa_printf("!!ARBfp1.0\n"); + _mesa_fprintf(f, "!!ARBfp1.0\n"); else if (mode == PROG_PRINT_NV) - _mesa_printf("!!FP1.0\n"); + _mesa_fprintf(f, "!!FP1.0\n"); else - _mesa_printf("# Fragment Program/Shader\n"); + _mesa_fprintf(f, "# Fragment Program/Shader\n"); break; } for (i = 0; i < prog->NumInstructions; i++) { if (lineNumbers) - _mesa_printf("%3d: ", i); - indent = _mesa_print_instruction_opt(prog->Instructions + i, + _mesa_fprintf(f, "%3d: ", i); + indent = _mesa_fprint_instruction_opt(f, prog->Instructions + i, indent, mode, prog); } } /** - * Print all of a program's parameters. + * Print program to stdout, default options. */ void -_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog) +_mesa_print_program(const struct gl_program *prog) +{ + _mesa_fprint_program_opt(stdout, prog, PROG_PRINT_DEBUG, GL_TRUE); +} + + +/** + * Print all of a program's parameters/fields to given file. + */ +static void +_mesa_fprint_program_parameters(FILE *f, + GLcontext *ctx, + const struct gl_program *prog) { GLuint i; - _mesa_printf("InputsRead: 0x%x\n", prog->InputsRead); - _mesa_printf("OutputsWritten: 0x%x\n", prog->OutputsWritten); - _mesa_printf("NumInstructions=%d\n", prog->NumInstructions); - _mesa_printf("NumTemporaries=%d\n", prog->NumTemporaries); - _mesa_printf("NumParameters=%d\n", prog->NumParameters); - _mesa_printf("NumAttributes=%d\n", prog->NumAttributes); - _mesa_printf("NumAddressRegs=%d\n", prog->NumAddressRegs); - _mesa_printf("Samplers=[ "); + _mesa_fprintf(f, "InputsRead: 0x%x\n", prog->InputsRead); + _mesa_fprintf(f, "OutputsWritten: 0x%x\n", prog->OutputsWritten); + _mesa_fprintf(f, "NumInstructions=%d\n", prog->NumInstructions); + _mesa_fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries); + _mesa_fprintf(f, "NumParameters=%d\n", prog->NumParameters); + _mesa_fprintf(f, "NumAttributes=%d\n", prog->NumAttributes); + _mesa_fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs); + _mesa_fprintf(f, "Samplers=[ "); for (i = 0; i < MAX_SAMPLERS; i++) { - _mesa_printf("%d ", prog->SamplerUnits[i]); + _mesa_fprintf(f, "%d ", prog->SamplerUnits[i]); } - _mesa_printf("]\n"); + _mesa_fprintf(f, "]\n"); _mesa_load_state_parameters(ctx, prog->Parameters); #if 0 - _mesa_printf("Local Params:\n"); + _mesa_fprintf(f, "Local Params:\n"); for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){ const GLfloat *p = prog->LocalParams[i]; - _mesa_printf("%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); + _mesa_fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); } #endif _mesa_print_parameter_list(prog->Parameters); } +/** + * Print all of a program's parameters/fields to stdout. + */ void -_mesa_print_parameter_list(const struct gl_program_parameter_list *list) +_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog) +{ + _mesa_fprint_program_parameters(stdout, ctx, prog); +} + + +/** + * Print a program parameter list to given file. + */ +static void +_mesa_fprint_parameter_list(FILE *f, + const struct gl_program_parameter_list *list) { const gl_prog_print_mode mode = PROG_PRINT_DEBUG; GLuint i; @@ -797,22 +837,75 @@ _mesa_print_parameter_list(const struct gl_program_parameter_list *list) if (!list) return; - _mesa_printf("param list %p\n", (void *) list); + _mesa_fprintf(f, "param list %p\n", (void *) list); for (i = 0; i < list->NumParameters; i++){ struct gl_program_parameter *param = list->Parameters + i; const GLfloat *v = list->ParameterValues[i]; - _mesa_printf("param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}", + _mesa_fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}", i, param->Size, file_string(list->Parameters[i].Type, mode), param->Name, v[0], v[1], v[2], v[3]); if (param->Flags & PROG_PARAM_BIT_CENTROID) - _mesa_printf(" Centroid"); + _mesa_fprintf(f, " Centroid"); if (param->Flags & PROG_PARAM_BIT_INVARIANT) - _mesa_printf(" Invariant"); + _mesa_fprintf(f, " Invariant"); if (param->Flags & PROG_PARAM_BIT_FLAT) - _mesa_printf(" Flat"); + _mesa_fprintf(f, " Flat"); if (param->Flags & PROG_PARAM_BIT_LINEAR) - _mesa_printf(" Linear"); - _mesa_printf("\n"); + _mesa_fprintf(f, " Linear"); + _mesa_fprintf(f, "\n"); + } +} + + +/** + * Print a program parameter list to stdout. + */ +void +_mesa_print_parameter_list(const struct gl_program_parameter_list *list) +{ + _mesa_fprint_parameter_list(stdout, list); +} + + +/** + * Write shader and associated info to a file. + */ +void +_mesa_write_shader_to_file(const struct gl_shader *shader) +{ + const char *type; + char filename[100]; + FILE *f; + + if (shader->Type == GL_FRAGMENT_SHADER) + type = "frag"; + else + type = "vert"; + + snprintf(filename, strlen(filename), "shader_%u.%s", shader->Name, type); + f = fopen(filename, "w"); + if (!f) { + fprintf(stderr, "Unable to open %s for writing\n", filename); + return; } + + fprintf(f, "/* Shader %u source */\n", shader->Name); + fputs(shader->Source, f); + fprintf(f, "\n"); + + fprintf(f, "/* Compile status: %s */\n", + shader->CompileStatus ? "ok" : "fail"); + if (!shader->CompileStatus) { + fprintf(f, "/* Log Info: */\n"); + fputs(shader->InfoLog, f); + } + else { + fprintf(f, "/* GPU code */\n"); + _mesa_fprint_program_opt(f, shader->Program, PROG_PRINT_DEBUG, GL_TRUE); + } + + fclose(f); } + + diff --git a/src/mesa/shader/prog_print.h b/src/mesa/shader/prog_print.h index cd9e388e82..a64a3126e8 100644 --- a/src/mesa/shader/prog_print.h +++ b/src/mesa/shader/prog_print.h @@ -72,4 +72,8 @@ extern void _mesa_print_parameter_list(const struct gl_program_parameter_list *list); +extern void +_mesa_write_shader_to_file(const struct gl_shader *shader); + + #endif /* PROG_PRINT_H */ -- cgit v1.2.3 From f9152f316a6e1a2277d32e0beb31d6355d205e21 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:35:51 -0700 Subject: glsl: call _mesa_write_shader_to_file(). Debug-only, disabled --- src/mesa/shader/slang/slang_compile.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 456ec4411f..40460e0c7e 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2796,6 +2796,10 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->CompileStatus = success; +#if 0 + _mesa_write_shader_to_file(shader); +#endif + return success; } -- cgit v1.2.3 From d61b8896bcd6059ced5bbeed7274aafcdde872ea Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 14:55:20 -0700 Subject: glapi: XML spec for GL_ARB_framebuffer_object --- src/mesa/glapi/ARB_framebuffer_object.xml | 269 ++++++++++++++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 src/mesa/glapi/ARB_framebuffer_object.xml (limited to 'src') diff --git a/src/mesa/glapi/ARB_framebuffer_object.xml b/src/mesa/glapi/ARB_framebuffer_object.xml new file mode 100644 index 0000000000..b700e7e77d --- /dev/null +++ b/src/mesa/glapi/ARB_framebuffer_object.xml @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 4397974662295b02b0a933360b7d5a7644104d96 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 14:56:14 -0700 Subject: glapi: include ARB_framebuffer_object.xml --- src/mesa/glapi/gl_API.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index 951fd95799..8212fc2477 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -7946,6 +7946,9 @@ + + + -- cgit v1.2.3 From 27d08f0ed28792de9b9f0a977c13ee7ea7c0cf46 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:02:00 -0700 Subject: mesa: regenerated GL API files --- src/mesa/drivers/dri/common/extension_helper.h | 190 +- src/mesa/glapi/dispatch.h | 427 +- src/mesa/glapi/glapioffsets.h | 422 +- src/mesa/glapi/glapitable.h | 419 +- src/mesa/glapi/glapitemp.h | 280 +- src/mesa/glapi/glprocs.h | 1048 ++--- src/mesa/main/enums.c | 5704 ++++++++++++------------ src/mesa/sparc/glapi_sparc.S | 53 +- src/mesa/x86-64/glapi_x86-64.S | 1996 +++++---- src/mesa/x86/glapi_x86.S | 127 +- 10 files changed, 5570 insertions(+), 5096 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index b977ebf015..0d641f25f7 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -119,9 +119,10 @@ static const char ActiveTextureARB_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_blit) +#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 @@ -433,17 +434,18 @@ static const char Color4ubVertex3fvSUN_names[] = ""; #endif -#if defined(need_GL_EXT_texture_array) +#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 GetListParameterivSGIX_names[] = +static const char GetListParameterfvSGIX_names[] = "iip\0" /* Parameter signature */ - "glGetListParameterivSGIX\0" + "glGetListParameterfvSGIX\0" ""; #endif @@ -777,6 +779,13 @@ static const char VertexAttribs4fvNV_names[] = ""; #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 */ @@ -946,9 +955,10 @@ static const char VertexAttribs3fvNV_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -1077,13 +1087,6 @@ static const char AreTexturesResident_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) -static const char IsRenderbufferEXT_names[] = - "i\0" /* Parameter signature */ - "glIsRenderbufferEXT\0" - ""; -#endif - #if defined(need_GL_VERSION_2_0) || defined(need_GL_ATI_separate_stencil) static const char StencilOpSeparate_names[] = "iiii\0" /* Parameter signature */ @@ -1171,9 +1174,10 @@ static const char TexCoord2fNormal3fVertex3fSUN_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -1364,9 +1368,10 @@ static const char SpriteParameterfvSGIX_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -1554,13 +1559,6 @@ static const char FragmentLightivSGIX_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) -static const char DeleteRenderbuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glDeleteRenderbuffersEXT\0" - ""; -#endif - #if defined(need_GL_EXT_pixel_transform) static const char PixelTransformParameterfvEXT_names[] = "iip\0" /* Parameter signature */ @@ -1621,9 +1619,10 @@ static const char WindowPos2dMESA_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -1673,10 +1672,11 @@ static const char IndexFuncEXT_names[] = ""; #endif -#if defined(need_GL_SGIX_list_priority) -static const char GetListParameterfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetListParameterfvSGIX\0" +#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 @@ -1763,13 +1763,6 @@ static const char DeleteFencesNV_names[] = ""; #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 */ @@ -1894,6 +1887,13 @@ static const char MatrixIndexuivARB_names[] = ""; #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 */ @@ -1944,9 +1944,10 @@ static const char VertexAttrib2dvNV_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -1973,9 +1974,10 @@ static const char SetFenceNV_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -2105,9 +2107,10 @@ static const char Tangent3fvEXT_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -2488,9 +2491,10 @@ static const char MapParameterivNV_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -2952,9 +2956,10 @@ static const char WindowPos2ivMESA_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -3125,13 +3130,6 @@ static const char ReplacementCodeuiSUN_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) -static const char FramebufferTexture2DEXT_names[] = - "iiiii\0" /* Parameter signature */ - "glFramebufferTexture2DEXT\0" - ""; -#endif - #if defined(need_GL_NV_vertex_program) static const char VertexAttribPointerNV_names[] = "iiiip\0" /* Parameter signature */ @@ -3139,13 +3137,21 @@ static const char VertexAttribPointerNV_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 */ @@ -3264,9 +3270,10 @@ static const char VertexAttrib3fvARB_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -3360,9 +3367,10 @@ static const char GetPixelTexGenParameterfvSGIS_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -3374,10 +3382,10 @@ static const char GetProgramParameterdvNV_names[] = ""; #endif -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameterfEXT_names[] = - "iif\0" /* Parameter signature */ - "glPixelTransformParameterfEXT\0" +#if defined(need_GL_SGIX_instruments) +static const char PollInstrumentsSGIX_names[] = + "p\0" /* Parameter signature */ + "glPollInstrumentsSGIX\0" ""; #endif @@ -3709,9 +3717,10 @@ static const char MultiDrawArraysEXT_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -4530,6 +4539,13 @@ static const char Minmax_names[] = ""; #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_1_4) || defined(need_GL_EXT_fog_coord) static const char FogCoorddvEXT_names[] = "p\0" /* Parameter signature */ @@ -4605,10 +4621,11 @@ static const char WeightdvARB_names[] = ""; #endif -#if defined(need_GL_SGIX_instruments) -static const char PollInstrumentsSGIX_names[] = - "p\0" /* Parameter signature */ - "glPollInstrumentsSGIX\0" +#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 @@ -4684,9 +4701,10 @@ static const char MultiTexCoord2fvARB_names[] = ""; #endif -#if defined(need_GL_EXT_framebuffer_object) +#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 @@ -4742,6 +4760,13 @@ static const char Tangent3svEXT_names[] = ""; #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 */ @@ -4823,10 +4848,11 @@ static const char FragmentMaterialivSGIX_names[] = ""; #endif -#if defined(need_GL_NV_vertex_array_range) -static const char VertexArrayRangeNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexArrayRangeNV\0" +#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 @@ -4892,6 +4918,32 @@ static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = { }; #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_matrix_palette) static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = { { MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 }, @@ -5319,22 +5371,22 @@ static const struct dri_extension_function GL_EXT_framebuffer_blit_functions[] = #if defined(need_GL_EXT_framebuffer_object) static const struct dri_extension_function GL_EXT_framebuffer_object_functions[] = { { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 }, - { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 }, { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 }, { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 }, - { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_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 }, - { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_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 @@ -5415,8 +5467,8 @@ static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = #if defined(need_GL_EXT_pixel_transform) static const struct dri_extension_function GL_EXT_pixel_transform_functions[] = { { PixelTransformParameterfvEXT_names, PixelTransformParameterfvEXT_remap_index, -1 }, - { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 }, { PixelTransformParameterfEXT_names, PixelTransformParameterfEXT_remap_index, -1 }, + { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 }, { PixelTransformParameterivEXT_names, PixelTransformParameterivEXT_remap_index, -1 }, { NULL, 0, 0 } }; @@ -5716,8 +5768,8 @@ static const struct dri_extension_function GL_NV_register_combiners2_functions[] #if defined(need_GL_NV_vertex_array_range) static const struct dri_extension_function GL_NV_vertex_array_range_functions[] = { - { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, -1 }, { VertexArrayRangeNV_names, VertexArrayRangeNV_remap_index, -1 }, + { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, -1 }, { NULL, 0, 0 } }; #endif @@ -5946,11 +5998,11 @@ static const struct dri_extension_function GL_SGIX_instruments_functions[] = { #if defined(need_GL_SGIX_list_priority) static const struct dri_extension_function GL_SGIX_list_priority_functions[] = { { ListParameterfSGIX_names, ListParameterfSGIX_remap_index, -1 }, - { GetListParameterivSGIX_names, GetListParameterivSGIX_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 @@ -5965,9 +6017,9 @@ static const struct dri_extension_function GL_SGIX_pixel_texture_functions[] = { #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 }, + { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 }, { NULL, 0, 0 } }; #endif diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index f019aa6aaf..d7f21692ed 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -1743,6 +1743,9 @@ #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_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters #define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) #define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) @@ -2373,7 +2376,7 @@ #else -#define driDispatchRemapTable_size 362 +#define driDispatchRemapTable_size 363 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define AttachShader_remap_index 0 @@ -2529,215 +2532,216 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define GetActiveAttribARB_remap_index 150 #define GetAttribLocationARB_remap_index 151 #define DrawBuffersARB_remap_index 152 -#define PolygonOffsetEXT_remap_index 153 -#define GetPixelTexGenParameterfvSGIS_remap_index 154 -#define GetPixelTexGenParameterivSGIS_remap_index 155 -#define PixelTexGenParameterfSGIS_remap_index 156 -#define PixelTexGenParameterfvSGIS_remap_index 157 -#define PixelTexGenParameteriSGIS_remap_index 158 -#define PixelTexGenParameterivSGIS_remap_index 159 -#define SampleMaskSGIS_remap_index 160 -#define SamplePatternSGIS_remap_index 161 -#define ColorPointerEXT_remap_index 162 -#define EdgeFlagPointerEXT_remap_index 163 -#define IndexPointerEXT_remap_index 164 -#define NormalPointerEXT_remap_index 165 -#define TexCoordPointerEXT_remap_index 166 -#define VertexPointerEXT_remap_index 167 -#define PointParameterfEXT_remap_index 168 -#define PointParameterfvEXT_remap_index 169 -#define LockArraysEXT_remap_index 170 -#define UnlockArraysEXT_remap_index 171 -#define CullParameterdvEXT_remap_index 172 -#define CullParameterfvEXT_remap_index 173 -#define SecondaryColor3bEXT_remap_index 174 -#define SecondaryColor3bvEXT_remap_index 175 -#define SecondaryColor3dEXT_remap_index 176 -#define SecondaryColor3dvEXT_remap_index 177 -#define SecondaryColor3fEXT_remap_index 178 -#define SecondaryColor3fvEXT_remap_index 179 -#define SecondaryColor3iEXT_remap_index 180 -#define SecondaryColor3ivEXT_remap_index 181 -#define SecondaryColor3sEXT_remap_index 182 -#define SecondaryColor3svEXT_remap_index 183 -#define SecondaryColor3ubEXT_remap_index 184 -#define SecondaryColor3ubvEXT_remap_index 185 -#define SecondaryColor3uiEXT_remap_index 186 -#define SecondaryColor3uivEXT_remap_index 187 -#define SecondaryColor3usEXT_remap_index 188 -#define SecondaryColor3usvEXT_remap_index 189 -#define SecondaryColorPointerEXT_remap_index 190 -#define MultiDrawArraysEXT_remap_index 191 -#define MultiDrawElementsEXT_remap_index 192 -#define FogCoordPointerEXT_remap_index 193 -#define FogCoorddEXT_remap_index 194 -#define FogCoorddvEXT_remap_index 195 -#define FogCoordfEXT_remap_index 196 -#define FogCoordfvEXT_remap_index 197 -#define PixelTexGenSGIX_remap_index 198 -#define BlendFuncSeparateEXT_remap_index 199 -#define FlushVertexArrayRangeNV_remap_index 200 -#define VertexArrayRangeNV_remap_index 201 -#define CombinerInputNV_remap_index 202 -#define CombinerOutputNV_remap_index 203 -#define CombinerParameterfNV_remap_index 204 -#define CombinerParameterfvNV_remap_index 205 -#define CombinerParameteriNV_remap_index 206 -#define CombinerParameterivNV_remap_index 207 -#define FinalCombinerInputNV_remap_index 208 -#define GetCombinerInputParameterfvNV_remap_index 209 -#define GetCombinerInputParameterivNV_remap_index 210 -#define GetCombinerOutputParameterfvNV_remap_index 211 -#define GetCombinerOutputParameterivNV_remap_index 212 -#define GetFinalCombinerInputParameterfvNV_remap_index 213 -#define GetFinalCombinerInputParameterivNV_remap_index 214 -#define ResizeBuffersMESA_remap_index 215 -#define WindowPos2dMESA_remap_index 216 -#define WindowPos2dvMESA_remap_index 217 -#define WindowPos2fMESA_remap_index 218 -#define WindowPos2fvMESA_remap_index 219 -#define WindowPos2iMESA_remap_index 220 -#define WindowPos2ivMESA_remap_index 221 -#define WindowPos2sMESA_remap_index 222 -#define WindowPos2svMESA_remap_index 223 -#define WindowPos3dMESA_remap_index 224 -#define WindowPos3dvMESA_remap_index 225 -#define WindowPos3fMESA_remap_index 226 -#define WindowPos3fvMESA_remap_index 227 -#define WindowPos3iMESA_remap_index 228 -#define WindowPos3ivMESA_remap_index 229 -#define WindowPos3sMESA_remap_index 230 -#define WindowPos3svMESA_remap_index 231 -#define WindowPos4dMESA_remap_index 232 -#define WindowPos4dvMESA_remap_index 233 -#define WindowPos4fMESA_remap_index 234 -#define WindowPos4fvMESA_remap_index 235 -#define WindowPos4iMESA_remap_index 236 -#define WindowPos4ivMESA_remap_index 237 -#define WindowPos4sMESA_remap_index 238 -#define WindowPos4svMESA_remap_index 239 -#define MultiModeDrawArraysIBM_remap_index 240 -#define MultiModeDrawElementsIBM_remap_index 241 -#define DeleteFencesNV_remap_index 242 -#define FinishFenceNV_remap_index 243 -#define GenFencesNV_remap_index 244 -#define GetFenceivNV_remap_index 245 -#define IsFenceNV_remap_index 246 -#define SetFenceNV_remap_index 247 -#define TestFenceNV_remap_index 248 -#define AreProgramsResidentNV_remap_index 249 -#define BindProgramNV_remap_index 250 -#define DeleteProgramsNV_remap_index 251 -#define ExecuteProgramNV_remap_index 252 -#define GenProgramsNV_remap_index 253 -#define GetProgramParameterdvNV_remap_index 254 -#define GetProgramParameterfvNV_remap_index 255 -#define GetProgramStringNV_remap_index 256 -#define GetProgramivNV_remap_index 257 -#define GetTrackMatrixivNV_remap_index 258 -#define GetVertexAttribPointervNV_remap_index 259 -#define GetVertexAttribdvNV_remap_index 260 -#define GetVertexAttribfvNV_remap_index 261 -#define GetVertexAttribivNV_remap_index 262 -#define IsProgramNV_remap_index 263 -#define LoadProgramNV_remap_index 264 -#define ProgramParameters4dvNV_remap_index 265 -#define ProgramParameters4fvNV_remap_index 266 -#define RequestResidentProgramsNV_remap_index 267 -#define TrackMatrixNV_remap_index 268 -#define VertexAttrib1dNV_remap_index 269 -#define VertexAttrib1dvNV_remap_index 270 -#define VertexAttrib1fNV_remap_index 271 -#define VertexAttrib1fvNV_remap_index 272 -#define VertexAttrib1sNV_remap_index 273 -#define VertexAttrib1svNV_remap_index 274 -#define VertexAttrib2dNV_remap_index 275 -#define VertexAttrib2dvNV_remap_index 276 -#define VertexAttrib2fNV_remap_index 277 -#define VertexAttrib2fvNV_remap_index 278 -#define VertexAttrib2sNV_remap_index 279 -#define VertexAttrib2svNV_remap_index 280 -#define VertexAttrib3dNV_remap_index 281 -#define VertexAttrib3dvNV_remap_index 282 -#define VertexAttrib3fNV_remap_index 283 -#define VertexAttrib3fvNV_remap_index 284 -#define VertexAttrib3sNV_remap_index 285 -#define VertexAttrib3svNV_remap_index 286 -#define VertexAttrib4dNV_remap_index 287 -#define VertexAttrib4dvNV_remap_index 288 -#define VertexAttrib4fNV_remap_index 289 -#define VertexAttrib4fvNV_remap_index 290 -#define VertexAttrib4sNV_remap_index 291 -#define VertexAttrib4svNV_remap_index 292 -#define VertexAttrib4ubNV_remap_index 293 -#define VertexAttrib4ubvNV_remap_index 294 -#define VertexAttribPointerNV_remap_index 295 -#define VertexAttribs1dvNV_remap_index 296 -#define VertexAttribs1fvNV_remap_index 297 -#define VertexAttribs1svNV_remap_index 298 -#define VertexAttribs2dvNV_remap_index 299 -#define VertexAttribs2fvNV_remap_index 300 -#define VertexAttribs2svNV_remap_index 301 -#define VertexAttribs3dvNV_remap_index 302 -#define VertexAttribs3fvNV_remap_index 303 -#define VertexAttribs3svNV_remap_index 304 -#define VertexAttribs4dvNV_remap_index 305 -#define VertexAttribs4fvNV_remap_index 306 -#define VertexAttribs4svNV_remap_index 307 -#define VertexAttribs4ubvNV_remap_index 308 -#define AlphaFragmentOp1ATI_remap_index 309 -#define AlphaFragmentOp2ATI_remap_index 310 -#define AlphaFragmentOp3ATI_remap_index 311 -#define BeginFragmentShaderATI_remap_index 312 -#define BindFragmentShaderATI_remap_index 313 -#define ColorFragmentOp1ATI_remap_index 314 -#define ColorFragmentOp2ATI_remap_index 315 -#define ColorFragmentOp3ATI_remap_index 316 -#define DeleteFragmentShaderATI_remap_index 317 -#define EndFragmentShaderATI_remap_index 318 -#define GenFragmentShadersATI_remap_index 319 -#define PassTexCoordATI_remap_index 320 -#define SampleMapATI_remap_index 321 -#define SetFragmentShaderConstantATI_remap_index 322 -#define PointParameteriNV_remap_index 323 -#define PointParameterivNV_remap_index 324 -#define ActiveStencilFaceEXT_remap_index 325 -#define BindVertexArrayAPPLE_remap_index 326 -#define DeleteVertexArraysAPPLE_remap_index 327 -#define GenVertexArraysAPPLE_remap_index 328 -#define IsVertexArrayAPPLE_remap_index 329 -#define GetProgramNamedParameterdvNV_remap_index 330 -#define GetProgramNamedParameterfvNV_remap_index 331 -#define ProgramNamedParameter4dNV_remap_index 332 -#define ProgramNamedParameter4dvNV_remap_index 333 -#define ProgramNamedParameter4fNV_remap_index 334 -#define ProgramNamedParameter4fvNV_remap_index 335 -#define DepthBoundsEXT_remap_index 336 -#define BlendEquationSeparateEXT_remap_index 337 -#define BindFramebufferEXT_remap_index 338 -#define BindRenderbufferEXT_remap_index 339 -#define CheckFramebufferStatusEXT_remap_index 340 -#define DeleteFramebuffersEXT_remap_index 341 -#define DeleteRenderbuffersEXT_remap_index 342 -#define FramebufferRenderbufferEXT_remap_index 343 -#define FramebufferTexture1DEXT_remap_index 344 -#define FramebufferTexture2DEXT_remap_index 345 -#define FramebufferTexture3DEXT_remap_index 346 -#define GenFramebuffersEXT_remap_index 347 -#define GenRenderbuffersEXT_remap_index 348 -#define GenerateMipmapEXT_remap_index 349 -#define GetFramebufferAttachmentParameterivEXT_remap_index 350 -#define GetRenderbufferParameterivEXT_remap_index 351 -#define IsFramebufferEXT_remap_index 352 -#define IsRenderbufferEXT_remap_index 353 -#define RenderbufferStorageEXT_remap_index 354 -#define BlitFramebufferEXT_remap_index 355 -#define FramebufferTextureLayerEXT_remap_index 356 -#define StencilFuncSeparateATI_remap_index 357 -#define ProgramEnvParameters4fvEXT_remap_index 358 -#define ProgramLocalParameters4fvEXT_remap_index 359 -#define GetQueryObjecti64vEXT_remap_index 360 -#define GetQueryObjectui64vEXT_remap_index 361 +#define RenderbufferStorageMultisample_remap_index 153 +#define PolygonOffsetEXT_remap_index 154 +#define GetPixelTexGenParameterfvSGIS_remap_index 155 +#define GetPixelTexGenParameterivSGIS_remap_index 156 +#define PixelTexGenParameterfSGIS_remap_index 157 +#define PixelTexGenParameterfvSGIS_remap_index 158 +#define PixelTexGenParameteriSGIS_remap_index 159 +#define PixelTexGenParameterivSGIS_remap_index 160 +#define SampleMaskSGIS_remap_index 161 +#define SamplePatternSGIS_remap_index 162 +#define ColorPointerEXT_remap_index 163 +#define EdgeFlagPointerEXT_remap_index 164 +#define IndexPointerEXT_remap_index 165 +#define NormalPointerEXT_remap_index 166 +#define TexCoordPointerEXT_remap_index 167 +#define VertexPointerEXT_remap_index 168 +#define PointParameterfEXT_remap_index 169 +#define PointParameterfvEXT_remap_index 170 +#define LockArraysEXT_remap_index 171 +#define UnlockArraysEXT_remap_index 172 +#define CullParameterdvEXT_remap_index 173 +#define CullParameterfvEXT_remap_index 174 +#define SecondaryColor3bEXT_remap_index 175 +#define SecondaryColor3bvEXT_remap_index 176 +#define SecondaryColor3dEXT_remap_index 177 +#define SecondaryColor3dvEXT_remap_index 178 +#define SecondaryColor3fEXT_remap_index 179 +#define SecondaryColor3fvEXT_remap_index 180 +#define SecondaryColor3iEXT_remap_index 181 +#define SecondaryColor3ivEXT_remap_index 182 +#define SecondaryColor3sEXT_remap_index 183 +#define SecondaryColor3svEXT_remap_index 184 +#define SecondaryColor3ubEXT_remap_index 185 +#define SecondaryColor3ubvEXT_remap_index 186 +#define SecondaryColor3uiEXT_remap_index 187 +#define SecondaryColor3uivEXT_remap_index 188 +#define SecondaryColor3usEXT_remap_index 189 +#define SecondaryColor3usvEXT_remap_index 190 +#define SecondaryColorPointerEXT_remap_index 191 +#define MultiDrawArraysEXT_remap_index 192 +#define MultiDrawElementsEXT_remap_index 193 +#define FogCoordPointerEXT_remap_index 194 +#define FogCoorddEXT_remap_index 195 +#define FogCoorddvEXT_remap_index 196 +#define FogCoordfEXT_remap_index 197 +#define FogCoordfvEXT_remap_index 198 +#define PixelTexGenSGIX_remap_index 199 +#define BlendFuncSeparateEXT_remap_index 200 +#define FlushVertexArrayRangeNV_remap_index 201 +#define VertexArrayRangeNV_remap_index 202 +#define CombinerInputNV_remap_index 203 +#define CombinerOutputNV_remap_index 204 +#define CombinerParameterfNV_remap_index 205 +#define CombinerParameterfvNV_remap_index 206 +#define CombinerParameteriNV_remap_index 207 +#define CombinerParameterivNV_remap_index 208 +#define FinalCombinerInputNV_remap_index 209 +#define GetCombinerInputParameterfvNV_remap_index 210 +#define GetCombinerInputParameterivNV_remap_index 211 +#define GetCombinerOutputParameterfvNV_remap_index 212 +#define GetCombinerOutputParameterivNV_remap_index 213 +#define GetFinalCombinerInputParameterfvNV_remap_index 214 +#define GetFinalCombinerInputParameterivNV_remap_index 215 +#define ResizeBuffersMESA_remap_index 216 +#define WindowPos2dMESA_remap_index 217 +#define WindowPos2dvMESA_remap_index 218 +#define WindowPos2fMESA_remap_index 219 +#define WindowPos2fvMESA_remap_index 220 +#define WindowPos2iMESA_remap_index 221 +#define WindowPos2ivMESA_remap_index 222 +#define WindowPos2sMESA_remap_index 223 +#define WindowPos2svMESA_remap_index 224 +#define WindowPos3dMESA_remap_index 225 +#define WindowPos3dvMESA_remap_index 226 +#define WindowPos3fMESA_remap_index 227 +#define WindowPos3fvMESA_remap_index 228 +#define WindowPos3iMESA_remap_index 229 +#define WindowPos3ivMESA_remap_index 230 +#define WindowPos3sMESA_remap_index 231 +#define WindowPos3svMESA_remap_index 232 +#define WindowPos4dMESA_remap_index 233 +#define WindowPos4dvMESA_remap_index 234 +#define WindowPos4fMESA_remap_index 235 +#define WindowPos4fvMESA_remap_index 236 +#define WindowPos4iMESA_remap_index 237 +#define WindowPos4ivMESA_remap_index 238 +#define WindowPos4sMESA_remap_index 239 +#define WindowPos4svMESA_remap_index 240 +#define MultiModeDrawArraysIBM_remap_index 241 +#define MultiModeDrawElementsIBM_remap_index 242 +#define DeleteFencesNV_remap_index 243 +#define FinishFenceNV_remap_index 244 +#define GenFencesNV_remap_index 245 +#define GetFenceivNV_remap_index 246 +#define IsFenceNV_remap_index 247 +#define SetFenceNV_remap_index 248 +#define TestFenceNV_remap_index 249 +#define AreProgramsResidentNV_remap_index 250 +#define BindProgramNV_remap_index 251 +#define DeleteProgramsNV_remap_index 252 +#define ExecuteProgramNV_remap_index 253 +#define GenProgramsNV_remap_index 254 +#define GetProgramParameterdvNV_remap_index 255 +#define GetProgramParameterfvNV_remap_index 256 +#define GetProgramStringNV_remap_index 257 +#define GetProgramivNV_remap_index 258 +#define GetTrackMatrixivNV_remap_index 259 +#define GetVertexAttribPointervNV_remap_index 260 +#define GetVertexAttribdvNV_remap_index 261 +#define GetVertexAttribfvNV_remap_index 262 +#define GetVertexAttribivNV_remap_index 263 +#define IsProgramNV_remap_index 264 +#define LoadProgramNV_remap_index 265 +#define ProgramParameters4dvNV_remap_index 266 +#define ProgramParameters4fvNV_remap_index 267 +#define RequestResidentProgramsNV_remap_index 268 +#define TrackMatrixNV_remap_index 269 +#define VertexAttrib1dNV_remap_index 270 +#define VertexAttrib1dvNV_remap_index 271 +#define VertexAttrib1fNV_remap_index 272 +#define VertexAttrib1fvNV_remap_index 273 +#define VertexAttrib1sNV_remap_index 274 +#define VertexAttrib1svNV_remap_index 275 +#define VertexAttrib2dNV_remap_index 276 +#define VertexAttrib2dvNV_remap_index 277 +#define VertexAttrib2fNV_remap_index 278 +#define VertexAttrib2fvNV_remap_index 279 +#define VertexAttrib2sNV_remap_index 280 +#define VertexAttrib2svNV_remap_index 281 +#define VertexAttrib3dNV_remap_index 282 +#define VertexAttrib3dvNV_remap_index 283 +#define VertexAttrib3fNV_remap_index 284 +#define VertexAttrib3fvNV_remap_index 285 +#define VertexAttrib3sNV_remap_index 286 +#define VertexAttrib3svNV_remap_index 287 +#define VertexAttrib4dNV_remap_index 288 +#define VertexAttrib4dvNV_remap_index 289 +#define VertexAttrib4fNV_remap_index 290 +#define VertexAttrib4fvNV_remap_index 291 +#define VertexAttrib4sNV_remap_index 292 +#define VertexAttrib4svNV_remap_index 293 +#define VertexAttrib4ubNV_remap_index 294 +#define VertexAttrib4ubvNV_remap_index 295 +#define VertexAttribPointerNV_remap_index 296 +#define VertexAttribs1dvNV_remap_index 297 +#define VertexAttribs1fvNV_remap_index 298 +#define VertexAttribs1svNV_remap_index 299 +#define VertexAttribs2dvNV_remap_index 300 +#define VertexAttribs2fvNV_remap_index 301 +#define VertexAttribs2svNV_remap_index 302 +#define VertexAttribs3dvNV_remap_index 303 +#define VertexAttribs3fvNV_remap_index 304 +#define VertexAttribs3svNV_remap_index 305 +#define VertexAttribs4dvNV_remap_index 306 +#define VertexAttribs4fvNV_remap_index 307 +#define VertexAttribs4svNV_remap_index 308 +#define VertexAttribs4ubvNV_remap_index 309 +#define AlphaFragmentOp1ATI_remap_index 310 +#define AlphaFragmentOp2ATI_remap_index 311 +#define AlphaFragmentOp3ATI_remap_index 312 +#define BeginFragmentShaderATI_remap_index 313 +#define BindFragmentShaderATI_remap_index 314 +#define ColorFragmentOp1ATI_remap_index 315 +#define ColorFragmentOp2ATI_remap_index 316 +#define ColorFragmentOp3ATI_remap_index 317 +#define DeleteFragmentShaderATI_remap_index 318 +#define EndFragmentShaderATI_remap_index 319 +#define GenFragmentShadersATI_remap_index 320 +#define PassTexCoordATI_remap_index 321 +#define SampleMapATI_remap_index 322 +#define SetFragmentShaderConstantATI_remap_index 323 +#define PointParameteriNV_remap_index 324 +#define PointParameterivNV_remap_index 325 +#define ActiveStencilFaceEXT_remap_index 326 +#define BindVertexArrayAPPLE_remap_index 327 +#define DeleteVertexArraysAPPLE_remap_index 328 +#define GenVertexArraysAPPLE_remap_index 329 +#define IsVertexArrayAPPLE_remap_index 330 +#define GetProgramNamedParameterdvNV_remap_index 331 +#define GetProgramNamedParameterfvNV_remap_index 332 +#define ProgramNamedParameter4dNV_remap_index 333 +#define ProgramNamedParameter4dvNV_remap_index 334 +#define ProgramNamedParameter4fNV_remap_index 335 +#define ProgramNamedParameter4fvNV_remap_index 336 +#define DepthBoundsEXT_remap_index 337 +#define BlendEquationSeparateEXT_remap_index 338 +#define BindFramebufferEXT_remap_index 339 +#define BindRenderbufferEXT_remap_index 340 +#define CheckFramebufferStatusEXT_remap_index 341 +#define DeleteFramebuffersEXT_remap_index 342 +#define DeleteRenderbuffersEXT_remap_index 343 +#define FramebufferRenderbufferEXT_remap_index 344 +#define FramebufferTexture1DEXT_remap_index 345 +#define FramebufferTexture2DEXT_remap_index 346 +#define FramebufferTexture3DEXT_remap_index 347 +#define GenFramebuffersEXT_remap_index 348 +#define GenRenderbuffersEXT_remap_index 349 +#define GenerateMipmapEXT_remap_index 350 +#define GetFramebufferAttachmentParameterivEXT_remap_index 351 +#define GetRenderbufferParameterivEXT_remap_index 352 +#define IsFramebufferEXT_remap_index 353 +#define IsRenderbufferEXT_remap_index 354 +#define RenderbufferStorageEXT_remap_index 355 +#define BlitFramebufferEXT_remap_index 356 +#define FramebufferTextureLayerEXT_remap_index 357 +#define StencilFuncSeparateATI_remap_index 358 +#define ProgramEnvParameters4fvEXT_remap_index 359 +#define ProgramLocalParameters4fvEXT_remap_index 360 +#define GetQueryObjecti64vEXT_remap_index 361 +#define GetQueryObjectui64vEXT_remap_index 362 #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]) @@ -3198,6 +3202,9 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #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_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) diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index 43c265924b..f412234ac5 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -593,216 +593,217 @@ #define _gloffset_GetActiveAttribARB 558 #define _gloffset_GetAttribLocationARB 559 #define _gloffset_DrawBuffersARB 560 -#define _gloffset_PolygonOffsetEXT 561 -#define _gloffset_GetPixelTexGenParameterfvSGIS 562 -#define _gloffset_GetPixelTexGenParameterivSGIS 563 -#define _gloffset_PixelTexGenParameterfSGIS 564 -#define _gloffset_PixelTexGenParameterfvSGIS 565 -#define _gloffset_PixelTexGenParameteriSGIS 566 -#define _gloffset_PixelTexGenParameterivSGIS 567 -#define _gloffset_SampleMaskSGIS 568 -#define _gloffset_SamplePatternSGIS 569 -#define _gloffset_ColorPointerEXT 570 -#define _gloffset_EdgeFlagPointerEXT 571 -#define _gloffset_IndexPointerEXT 572 -#define _gloffset_NormalPointerEXT 573 -#define _gloffset_TexCoordPointerEXT 574 -#define _gloffset_VertexPointerEXT 575 -#define _gloffset_PointParameterfEXT 576 -#define _gloffset_PointParameterfvEXT 577 -#define _gloffset_LockArraysEXT 578 -#define _gloffset_UnlockArraysEXT 579 -#define _gloffset_CullParameterdvEXT 580 -#define _gloffset_CullParameterfvEXT 581 -#define _gloffset_SecondaryColor3bEXT 582 -#define _gloffset_SecondaryColor3bvEXT 583 -#define _gloffset_SecondaryColor3dEXT 584 -#define _gloffset_SecondaryColor3dvEXT 585 -#define _gloffset_SecondaryColor3fEXT 586 -#define _gloffset_SecondaryColor3fvEXT 587 -#define _gloffset_SecondaryColor3iEXT 588 -#define _gloffset_SecondaryColor3ivEXT 589 -#define _gloffset_SecondaryColor3sEXT 590 -#define _gloffset_SecondaryColor3svEXT 591 -#define _gloffset_SecondaryColor3ubEXT 592 -#define _gloffset_SecondaryColor3ubvEXT 593 -#define _gloffset_SecondaryColor3uiEXT 594 -#define _gloffset_SecondaryColor3uivEXT 595 -#define _gloffset_SecondaryColor3usEXT 596 -#define _gloffset_SecondaryColor3usvEXT 597 -#define _gloffset_SecondaryColorPointerEXT 598 -#define _gloffset_MultiDrawArraysEXT 599 -#define _gloffset_MultiDrawElementsEXT 600 -#define _gloffset_FogCoordPointerEXT 601 -#define _gloffset_FogCoorddEXT 602 -#define _gloffset_FogCoorddvEXT 603 -#define _gloffset_FogCoordfEXT 604 -#define _gloffset_FogCoordfvEXT 605 -#define _gloffset_PixelTexGenSGIX 606 -#define _gloffset_BlendFuncSeparateEXT 607 -#define _gloffset_FlushVertexArrayRangeNV 608 -#define _gloffset_VertexArrayRangeNV 609 -#define _gloffset_CombinerInputNV 610 -#define _gloffset_CombinerOutputNV 611 -#define _gloffset_CombinerParameterfNV 612 -#define _gloffset_CombinerParameterfvNV 613 -#define _gloffset_CombinerParameteriNV 614 -#define _gloffset_CombinerParameterivNV 615 -#define _gloffset_FinalCombinerInputNV 616 -#define _gloffset_GetCombinerInputParameterfvNV 617 -#define _gloffset_GetCombinerInputParameterivNV 618 -#define _gloffset_GetCombinerOutputParameterfvNV 619 -#define _gloffset_GetCombinerOutputParameterivNV 620 -#define _gloffset_GetFinalCombinerInputParameterfvNV 621 -#define _gloffset_GetFinalCombinerInputParameterivNV 622 -#define _gloffset_ResizeBuffersMESA 623 -#define _gloffset_WindowPos2dMESA 624 -#define _gloffset_WindowPos2dvMESA 625 -#define _gloffset_WindowPos2fMESA 626 -#define _gloffset_WindowPos2fvMESA 627 -#define _gloffset_WindowPos2iMESA 628 -#define _gloffset_WindowPos2ivMESA 629 -#define _gloffset_WindowPos2sMESA 630 -#define _gloffset_WindowPos2svMESA 631 -#define _gloffset_WindowPos3dMESA 632 -#define _gloffset_WindowPos3dvMESA 633 -#define _gloffset_WindowPos3fMESA 634 -#define _gloffset_WindowPos3fvMESA 635 -#define _gloffset_WindowPos3iMESA 636 -#define _gloffset_WindowPos3ivMESA 637 -#define _gloffset_WindowPos3sMESA 638 -#define _gloffset_WindowPos3svMESA 639 -#define _gloffset_WindowPos4dMESA 640 -#define _gloffset_WindowPos4dvMESA 641 -#define _gloffset_WindowPos4fMESA 642 -#define _gloffset_WindowPos4fvMESA 643 -#define _gloffset_WindowPos4iMESA 644 -#define _gloffset_WindowPos4ivMESA 645 -#define _gloffset_WindowPos4sMESA 646 -#define _gloffset_WindowPos4svMESA 647 -#define _gloffset_MultiModeDrawArraysIBM 648 -#define _gloffset_MultiModeDrawElementsIBM 649 -#define _gloffset_DeleteFencesNV 650 -#define _gloffset_FinishFenceNV 651 -#define _gloffset_GenFencesNV 652 -#define _gloffset_GetFenceivNV 653 -#define _gloffset_IsFenceNV 654 -#define _gloffset_SetFenceNV 655 -#define _gloffset_TestFenceNV 656 -#define _gloffset_AreProgramsResidentNV 657 -#define _gloffset_BindProgramNV 658 -#define _gloffset_DeleteProgramsNV 659 -#define _gloffset_ExecuteProgramNV 660 -#define _gloffset_GenProgramsNV 661 -#define _gloffset_GetProgramParameterdvNV 662 -#define _gloffset_GetProgramParameterfvNV 663 -#define _gloffset_GetProgramStringNV 664 -#define _gloffset_GetProgramivNV 665 -#define _gloffset_GetTrackMatrixivNV 666 -#define _gloffset_GetVertexAttribPointervNV 667 -#define _gloffset_GetVertexAttribdvNV 668 -#define _gloffset_GetVertexAttribfvNV 669 -#define _gloffset_GetVertexAttribivNV 670 -#define _gloffset_IsProgramNV 671 -#define _gloffset_LoadProgramNV 672 -#define _gloffset_ProgramParameters4dvNV 673 -#define _gloffset_ProgramParameters4fvNV 674 -#define _gloffset_RequestResidentProgramsNV 675 -#define _gloffset_TrackMatrixNV 676 -#define _gloffset_VertexAttrib1dNV 677 -#define _gloffset_VertexAttrib1dvNV 678 -#define _gloffset_VertexAttrib1fNV 679 -#define _gloffset_VertexAttrib1fvNV 680 -#define _gloffset_VertexAttrib1sNV 681 -#define _gloffset_VertexAttrib1svNV 682 -#define _gloffset_VertexAttrib2dNV 683 -#define _gloffset_VertexAttrib2dvNV 684 -#define _gloffset_VertexAttrib2fNV 685 -#define _gloffset_VertexAttrib2fvNV 686 -#define _gloffset_VertexAttrib2sNV 687 -#define _gloffset_VertexAttrib2svNV 688 -#define _gloffset_VertexAttrib3dNV 689 -#define _gloffset_VertexAttrib3dvNV 690 -#define _gloffset_VertexAttrib3fNV 691 -#define _gloffset_VertexAttrib3fvNV 692 -#define _gloffset_VertexAttrib3sNV 693 -#define _gloffset_VertexAttrib3svNV 694 -#define _gloffset_VertexAttrib4dNV 695 -#define _gloffset_VertexAttrib4dvNV 696 -#define _gloffset_VertexAttrib4fNV 697 -#define _gloffset_VertexAttrib4fvNV 698 -#define _gloffset_VertexAttrib4sNV 699 -#define _gloffset_VertexAttrib4svNV 700 -#define _gloffset_VertexAttrib4ubNV 701 -#define _gloffset_VertexAttrib4ubvNV 702 -#define _gloffset_VertexAttribPointerNV 703 -#define _gloffset_VertexAttribs1dvNV 704 -#define _gloffset_VertexAttribs1fvNV 705 -#define _gloffset_VertexAttribs1svNV 706 -#define _gloffset_VertexAttribs2dvNV 707 -#define _gloffset_VertexAttribs2fvNV 708 -#define _gloffset_VertexAttribs2svNV 709 -#define _gloffset_VertexAttribs3dvNV 710 -#define _gloffset_VertexAttribs3fvNV 711 -#define _gloffset_VertexAttribs3svNV 712 -#define _gloffset_VertexAttribs4dvNV 713 -#define _gloffset_VertexAttribs4fvNV 714 -#define _gloffset_VertexAttribs4svNV 715 -#define _gloffset_VertexAttribs4ubvNV 716 -#define _gloffset_AlphaFragmentOp1ATI 717 -#define _gloffset_AlphaFragmentOp2ATI 718 -#define _gloffset_AlphaFragmentOp3ATI 719 -#define _gloffset_BeginFragmentShaderATI 720 -#define _gloffset_BindFragmentShaderATI 721 -#define _gloffset_ColorFragmentOp1ATI 722 -#define _gloffset_ColorFragmentOp2ATI 723 -#define _gloffset_ColorFragmentOp3ATI 724 -#define _gloffset_DeleteFragmentShaderATI 725 -#define _gloffset_EndFragmentShaderATI 726 -#define _gloffset_GenFragmentShadersATI 727 -#define _gloffset_PassTexCoordATI 728 -#define _gloffset_SampleMapATI 729 -#define _gloffset_SetFragmentShaderConstantATI 730 -#define _gloffset_PointParameteriNV 731 -#define _gloffset_PointParameterivNV 732 -#define _gloffset_ActiveStencilFaceEXT 733 -#define _gloffset_BindVertexArrayAPPLE 734 -#define _gloffset_DeleteVertexArraysAPPLE 735 -#define _gloffset_GenVertexArraysAPPLE 736 -#define _gloffset_IsVertexArrayAPPLE 737 -#define _gloffset_GetProgramNamedParameterdvNV 738 -#define _gloffset_GetProgramNamedParameterfvNV 739 -#define _gloffset_ProgramNamedParameter4dNV 740 -#define _gloffset_ProgramNamedParameter4dvNV 741 -#define _gloffset_ProgramNamedParameter4fNV 742 -#define _gloffset_ProgramNamedParameter4fvNV 743 -#define _gloffset_DepthBoundsEXT 744 -#define _gloffset_BlendEquationSeparateEXT 745 -#define _gloffset_BindFramebufferEXT 746 -#define _gloffset_BindRenderbufferEXT 747 -#define _gloffset_CheckFramebufferStatusEXT 748 -#define _gloffset_DeleteFramebuffersEXT 749 -#define _gloffset_DeleteRenderbuffersEXT 750 -#define _gloffset_FramebufferRenderbufferEXT 751 -#define _gloffset_FramebufferTexture1DEXT 752 -#define _gloffset_FramebufferTexture2DEXT 753 -#define _gloffset_FramebufferTexture3DEXT 754 -#define _gloffset_GenFramebuffersEXT 755 -#define _gloffset_GenRenderbuffersEXT 756 -#define _gloffset_GenerateMipmapEXT 757 -#define _gloffset_GetFramebufferAttachmentParameterivEXT 758 -#define _gloffset_GetRenderbufferParameterivEXT 759 -#define _gloffset_IsFramebufferEXT 760 -#define _gloffset_IsRenderbufferEXT 761 -#define _gloffset_RenderbufferStorageEXT 762 -#define _gloffset_BlitFramebufferEXT 763 -#define _gloffset_FramebufferTextureLayerEXT 764 -#define _gloffset_StencilFuncSeparateATI 765 -#define _gloffset_ProgramEnvParameters4fvEXT 766 -#define _gloffset_ProgramLocalParameters4fvEXT 767 -#define _gloffset_GetQueryObjecti64vEXT 768 -#define _gloffset_GetQueryObjectui64vEXT 769 -#define _gloffset_FIRST_DYNAMIC 770 +#define _gloffset_RenderbufferStorageMultisample 561 +#define _gloffset_PolygonOffsetEXT 562 +#define _gloffset_GetPixelTexGenParameterfvSGIS 563 +#define _gloffset_GetPixelTexGenParameterivSGIS 564 +#define _gloffset_PixelTexGenParameterfSGIS 565 +#define _gloffset_PixelTexGenParameterfvSGIS 566 +#define _gloffset_PixelTexGenParameteriSGIS 567 +#define _gloffset_PixelTexGenParameterivSGIS 568 +#define _gloffset_SampleMaskSGIS 569 +#define _gloffset_SamplePatternSGIS 570 +#define _gloffset_ColorPointerEXT 571 +#define _gloffset_EdgeFlagPointerEXT 572 +#define _gloffset_IndexPointerEXT 573 +#define _gloffset_NormalPointerEXT 574 +#define _gloffset_TexCoordPointerEXT 575 +#define _gloffset_VertexPointerEXT 576 +#define _gloffset_PointParameterfEXT 577 +#define _gloffset_PointParameterfvEXT 578 +#define _gloffset_LockArraysEXT 579 +#define _gloffset_UnlockArraysEXT 580 +#define _gloffset_CullParameterdvEXT 581 +#define _gloffset_CullParameterfvEXT 582 +#define _gloffset_SecondaryColor3bEXT 583 +#define _gloffset_SecondaryColor3bvEXT 584 +#define _gloffset_SecondaryColor3dEXT 585 +#define _gloffset_SecondaryColor3dvEXT 586 +#define _gloffset_SecondaryColor3fEXT 587 +#define _gloffset_SecondaryColor3fvEXT 588 +#define _gloffset_SecondaryColor3iEXT 589 +#define _gloffset_SecondaryColor3ivEXT 590 +#define _gloffset_SecondaryColor3sEXT 591 +#define _gloffset_SecondaryColor3svEXT 592 +#define _gloffset_SecondaryColor3ubEXT 593 +#define _gloffset_SecondaryColor3ubvEXT 594 +#define _gloffset_SecondaryColor3uiEXT 595 +#define _gloffset_SecondaryColor3uivEXT 596 +#define _gloffset_SecondaryColor3usEXT 597 +#define _gloffset_SecondaryColor3usvEXT 598 +#define _gloffset_SecondaryColorPointerEXT 599 +#define _gloffset_MultiDrawArraysEXT 600 +#define _gloffset_MultiDrawElementsEXT 601 +#define _gloffset_FogCoordPointerEXT 602 +#define _gloffset_FogCoorddEXT 603 +#define _gloffset_FogCoorddvEXT 604 +#define _gloffset_FogCoordfEXT 605 +#define _gloffset_FogCoordfvEXT 606 +#define _gloffset_PixelTexGenSGIX 607 +#define _gloffset_BlendFuncSeparateEXT 608 +#define _gloffset_FlushVertexArrayRangeNV 609 +#define _gloffset_VertexArrayRangeNV 610 +#define _gloffset_CombinerInputNV 611 +#define _gloffset_CombinerOutputNV 612 +#define _gloffset_CombinerParameterfNV 613 +#define _gloffset_CombinerParameterfvNV 614 +#define _gloffset_CombinerParameteriNV 615 +#define _gloffset_CombinerParameterivNV 616 +#define _gloffset_FinalCombinerInputNV 617 +#define _gloffset_GetCombinerInputParameterfvNV 618 +#define _gloffset_GetCombinerInputParameterivNV 619 +#define _gloffset_GetCombinerOutputParameterfvNV 620 +#define _gloffset_GetCombinerOutputParameterivNV 621 +#define _gloffset_GetFinalCombinerInputParameterfvNV 622 +#define _gloffset_GetFinalCombinerInputParameterivNV 623 +#define _gloffset_ResizeBuffersMESA 624 +#define _gloffset_WindowPos2dMESA 625 +#define _gloffset_WindowPos2dvMESA 626 +#define _gloffset_WindowPos2fMESA 627 +#define _gloffset_WindowPos2fvMESA 628 +#define _gloffset_WindowPos2iMESA 629 +#define _gloffset_WindowPos2ivMESA 630 +#define _gloffset_WindowPos2sMESA 631 +#define _gloffset_WindowPos2svMESA 632 +#define _gloffset_WindowPos3dMESA 633 +#define _gloffset_WindowPos3dvMESA 634 +#define _gloffset_WindowPos3fMESA 635 +#define _gloffset_WindowPos3fvMESA 636 +#define _gloffset_WindowPos3iMESA 637 +#define _gloffset_WindowPos3ivMESA 638 +#define _gloffset_WindowPos3sMESA 639 +#define _gloffset_WindowPos3svMESA 640 +#define _gloffset_WindowPos4dMESA 641 +#define _gloffset_WindowPos4dvMESA 642 +#define _gloffset_WindowPos4fMESA 643 +#define _gloffset_WindowPos4fvMESA 644 +#define _gloffset_WindowPos4iMESA 645 +#define _gloffset_WindowPos4ivMESA 646 +#define _gloffset_WindowPos4sMESA 647 +#define _gloffset_WindowPos4svMESA 648 +#define _gloffset_MultiModeDrawArraysIBM 649 +#define _gloffset_MultiModeDrawElementsIBM 650 +#define _gloffset_DeleteFencesNV 651 +#define _gloffset_FinishFenceNV 652 +#define _gloffset_GenFencesNV 653 +#define _gloffset_GetFenceivNV 654 +#define _gloffset_IsFenceNV 655 +#define _gloffset_SetFenceNV 656 +#define _gloffset_TestFenceNV 657 +#define _gloffset_AreProgramsResidentNV 658 +#define _gloffset_BindProgramNV 659 +#define _gloffset_DeleteProgramsNV 660 +#define _gloffset_ExecuteProgramNV 661 +#define _gloffset_GenProgramsNV 662 +#define _gloffset_GetProgramParameterdvNV 663 +#define _gloffset_GetProgramParameterfvNV 664 +#define _gloffset_GetProgramStringNV 665 +#define _gloffset_GetProgramivNV 666 +#define _gloffset_GetTrackMatrixivNV 667 +#define _gloffset_GetVertexAttribPointervNV 668 +#define _gloffset_GetVertexAttribdvNV 669 +#define _gloffset_GetVertexAttribfvNV 670 +#define _gloffset_GetVertexAttribivNV 671 +#define _gloffset_IsProgramNV 672 +#define _gloffset_LoadProgramNV 673 +#define _gloffset_ProgramParameters4dvNV 674 +#define _gloffset_ProgramParameters4fvNV 675 +#define _gloffset_RequestResidentProgramsNV 676 +#define _gloffset_TrackMatrixNV 677 +#define _gloffset_VertexAttrib1dNV 678 +#define _gloffset_VertexAttrib1dvNV 679 +#define _gloffset_VertexAttrib1fNV 680 +#define _gloffset_VertexAttrib1fvNV 681 +#define _gloffset_VertexAttrib1sNV 682 +#define _gloffset_VertexAttrib1svNV 683 +#define _gloffset_VertexAttrib2dNV 684 +#define _gloffset_VertexAttrib2dvNV 685 +#define _gloffset_VertexAttrib2fNV 686 +#define _gloffset_VertexAttrib2fvNV 687 +#define _gloffset_VertexAttrib2sNV 688 +#define _gloffset_VertexAttrib2svNV 689 +#define _gloffset_VertexAttrib3dNV 690 +#define _gloffset_VertexAttrib3dvNV 691 +#define _gloffset_VertexAttrib3fNV 692 +#define _gloffset_VertexAttrib3fvNV 693 +#define _gloffset_VertexAttrib3sNV 694 +#define _gloffset_VertexAttrib3svNV 695 +#define _gloffset_VertexAttrib4dNV 696 +#define _gloffset_VertexAttrib4dvNV 697 +#define _gloffset_VertexAttrib4fNV 698 +#define _gloffset_VertexAttrib4fvNV 699 +#define _gloffset_VertexAttrib4sNV 700 +#define _gloffset_VertexAttrib4svNV 701 +#define _gloffset_VertexAttrib4ubNV 702 +#define _gloffset_VertexAttrib4ubvNV 703 +#define _gloffset_VertexAttribPointerNV 704 +#define _gloffset_VertexAttribs1dvNV 705 +#define _gloffset_VertexAttribs1fvNV 706 +#define _gloffset_VertexAttribs1svNV 707 +#define _gloffset_VertexAttribs2dvNV 708 +#define _gloffset_VertexAttribs2fvNV 709 +#define _gloffset_VertexAttribs2svNV 710 +#define _gloffset_VertexAttribs3dvNV 711 +#define _gloffset_VertexAttribs3fvNV 712 +#define _gloffset_VertexAttribs3svNV 713 +#define _gloffset_VertexAttribs4dvNV 714 +#define _gloffset_VertexAttribs4fvNV 715 +#define _gloffset_VertexAttribs4svNV 716 +#define _gloffset_VertexAttribs4ubvNV 717 +#define _gloffset_AlphaFragmentOp1ATI 718 +#define _gloffset_AlphaFragmentOp2ATI 719 +#define _gloffset_AlphaFragmentOp3ATI 720 +#define _gloffset_BeginFragmentShaderATI 721 +#define _gloffset_BindFragmentShaderATI 722 +#define _gloffset_ColorFragmentOp1ATI 723 +#define _gloffset_ColorFragmentOp2ATI 724 +#define _gloffset_ColorFragmentOp3ATI 725 +#define _gloffset_DeleteFragmentShaderATI 726 +#define _gloffset_EndFragmentShaderATI 727 +#define _gloffset_GenFragmentShadersATI 728 +#define _gloffset_PassTexCoordATI 729 +#define _gloffset_SampleMapATI 730 +#define _gloffset_SetFragmentShaderConstantATI 731 +#define _gloffset_PointParameteriNV 732 +#define _gloffset_PointParameterivNV 733 +#define _gloffset_ActiveStencilFaceEXT 734 +#define _gloffset_BindVertexArrayAPPLE 735 +#define _gloffset_DeleteVertexArraysAPPLE 736 +#define _gloffset_GenVertexArraysAPPLE 737 +#define _gloffset_IsVertexArrayAPPLE 738 +#define _gloffset_GetProgramNamedParameterdvNV 739 +#define _gloffset_GetProgramNamedParameterfvNV 740 +#define _gloffset_ProgramNamedParameter4dNV 741 +#define _gloffset_ProgramNamedParameter4dvNV 742 +#define _gloffset_ProgramNamedParameter4fNV 743 +#define _gloffset_ProgramNamedParameter4fvNV 744 +#define _gloffset_DepthBoundsEXT 745 +#define _gloffset_BlendEquationSeparateEXT 746 +#define _gloffset_BindFramebufferEXT 747 +#define _gloffset_BindRenderbufferEXT 748 +#define _gloffset_CheckFramebufferStatusEXT 749 +#define _gloffset_DeleteFramebuffersEXT 750 +#define _gloffset_DeleteRenderbuffersEXT 751 +#define _gloffset_FramebufferRenderbufferEXT 752 +#define _gloffset_FramebufferTexture1DEXT 753 +#define _gloffset_FramebufferTexture2DEXT 754 +#define _gloffset_FramebufferTexture3DEXT 755 +#define _gloffset_GenFramebuffersEXT 756 +#define _gloffset_GenRenderbuffersEXT 757 +#define _gloffset_GenerateMipmapEXT 758 +#define _gloffset_GetFramebufferAttachmentParameterivEXT 759 +#define _gloffset_GetRenderbufferParameterivEXT 760 +#define _gloffset_IsFramebufferEXT 761 +#define _gloffset_IsRenderbufferEXT 762 +#define _gloffset_RenderbufferStorageEXT 763 +#define _gloffset_BlitFramebufferEXT 764 +#define _gloffset_FramebufferTextureLayerEXT 765 +#define _gloffset_StencilFuncSeparateATI 766 +#define _gloffset_ProgramEnvParameters4fvEXT 767 +#define _gloffset_ProgramLocalParameters4fvEXT 768 +#define _gloffset_GetQueryObjecti64vEXT 769 +#define _gloffset_GetQueryObjectui64vEXT 770 +#define _gloffset_FIRST_DYNAMIC 771 #else @@ -959,6 +960,7 @@ #define _gloffset_GetActiveAttribARB driDispatchRemapTable[GetActiveAttribARB_remap_index] #define _gloffset_GetAttribLocationARB driDispatchRemapTable[GetAttribLocationARB_remap_index] #define _gloffset_DrawBuffersARB driDispatchRemapTable[DrawBuffersARB_remap_index] +#define _gloffset_RenderbufferStorageMultisample driDispatchRemapTable[RenderbufferStorageMultisample_remap_index] #define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index] #define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index] #define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index] diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 5d9d40a8a2..2ae9bf6738 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -601,215 +601,216 @@ struct _glapi_table void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */ GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */ void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */ - void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */ - void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */ - void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */ - void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */ - void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */ - void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */ - void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */ - void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */ - void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */ - void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */ - void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */ - void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */ - void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */ - void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */ - void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */ - void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */ - void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */ - void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */ - void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */ - void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */ - void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */ - void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */ - void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */ - void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */ - void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */ - void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */ - void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */ - void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */ - void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */ - void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */ - void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */ - void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */ - void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */ - void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */ - void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */ - void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */ - void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */ - void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */ - void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */ - void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */ - void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */ - void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */ - void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */ - void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */ - void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */ - void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */ - void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */ - void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */ - void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */ - void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */ - void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */ - void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */ - void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */ - void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */ - void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */ - void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */ - void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */ - void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */ - void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */ - void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */ - void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */ - void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */ - void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */ - void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */ - void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */ - void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */ - void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */ - void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */ - void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */ - void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */ - void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */ - void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */ - void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */ - void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */ - void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */ - void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */ - void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */ - void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */ - void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */ - void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */ - void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */ - void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */ - void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */ - void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */ - void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */ - void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */ - void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */ - void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */ - void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */ - void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */ - void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */ - GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */ - void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */ - GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */ - GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */ - void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */ - void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */ - void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */ - void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */ - void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */ - void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */ - void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */ - void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */ - void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */ - void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 667 */ - void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */ - void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */ - void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */ - GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */ - void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */ - void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 673 */ - void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 674 */ - void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 675 */ - void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 676 */ - void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 677 */ - void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 678 */ - void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 679 */ - void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 680 */ - void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 681 */ - void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 682 */ - void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 683 */ - void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 684 */ - void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 685 */ - void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 686 */ - void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 687 */ - void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 688 */ - void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 689 */ - void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 690 */ - void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 691 */ - void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 692 */ - void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 693 */ - void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 694 */ - void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 695 */ - void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 696 */ - void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 697 */ - void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 698 */ - void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 699 */ - void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 700 */ - void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 701 */ - void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 702 */ - void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 703 */ - void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 704 */ - void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 705 */ - void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 706 */ - void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 707 */ - void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 708 */ - void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 709 */ - void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 710 */ - void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 711 */ - void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 712 */ - void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 713 */ - void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 714 */ - void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 715 */ - void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 716 */ - void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 717 */ - void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 718 */ - void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 719 */ - void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 720 */ - void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 721 */ - void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 722 */ - void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 723 */ - void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 724 */ - void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 725 */ - void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 726 */ - GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 727 */ - void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 728 */ - void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 729 */ - void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 730 */ - void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 731 */ - void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 732 */ - void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 733 */ - void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 734 */ - void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 735 */ - void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 736 */ - GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 737 */ - void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 738 */ - void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 739 */ - void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 740 */ - void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 741 */ - void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 742 */ - void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 743 */ - void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 744 */ - void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 745 */ - void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 746 */ - void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 747 */ - GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 748 */ - void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 749 */ - void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 750 */ - void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 751 */ - void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 752 */ - void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */ - void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 754 */ - void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 755 */ - void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 756 */ - void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 757 */ - void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 758 */ - void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 759 */ - GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 760 */ - GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 761 */ - void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 762 */ - void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 763 */ - void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 764 */ - void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 765 */ - void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 766 */ - void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */ - void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 768 */ - void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 769 */ + void (GLAPIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); /* 561 */ + void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 562 */ + void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 563 */ + void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 564 */ + void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 565 */ + void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 566 */ + void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 567 */ + void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 568 */ + void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 569 */ + void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 570 */ + void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 571 */ + void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 572 */ + void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */ + void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */ + void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */ + void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 576 */ + void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 577 */ + void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 578 */ + void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 579 */ + void (GLAPIENTRYP UnlockArraysEXT)(void); /* 580 */ + void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 581 */ + void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 582 */ + void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 583 */ + void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 584 */ + void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 585 */ + void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 586 */ + void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 587 */ + void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 588 */ + void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 589 */ + void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 590 */ + void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 591 */ + void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 592 */ + void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 593 */ + void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 594 */ + void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 595 */ + void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 596 */ + void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 597 */ + void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 598 */ + void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 599 */ + void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 600 */ + void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 601 */ + void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 602 */ + void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 603 */ + void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 604 */ + void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 605 */ + void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 606 */ + void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 607 */ + void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 608 */ + void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 609 */ + void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 610 */ + void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 611 */ + void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 612 */ + void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 613 */ + void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 614 */ + void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 615 */ + void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 616 */ + void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 617 */ + void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 618 */ + void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 619 */ + void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 620 */ + void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 621 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 622 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 623 */ + void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 624 */ + void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 625 */ + void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 626 */ + void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 627 */ + void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 628 */ + void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 629 */ + void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 630 */ + void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 631 */ + void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 632 */ + void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 633 */ + void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 634 */ + void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 635 */ + void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 636 */ + void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 637 */ + void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 638 */ + void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 639 */ + void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 640 */ + void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 641 */ + void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 642 */ + void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 643 */ + void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 644 */ + void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 645 */ + void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 646 */ + void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 647 */ + void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 648 */ + void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 649 */ + void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 650 */ + void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 651 */ + void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 652 */ + void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 653 */ + void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 654 */ + GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 655 */ + void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 656 */ + GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 657 */ + GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 658 */ + void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 659 */ + void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 660 */ + void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 661 */ + void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 662 */ + void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 663 */ + void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 664 */ + void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 665 */ + void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 666 */ + void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 667 */ + void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 668 */ + void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 669 */ + void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 670 */ + void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 671 */ + GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 672 */ + void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 673 */ + void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 674 */ + void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 675 */ + void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 676 */ + void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 677 */ + void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 678 */ + void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 679 */ + void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 680 */ + void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 681 */ + void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 682 */ + void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 683 */ + void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 684 */ + void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 685 */ + void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 686 */ + void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 687 */ + void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 688 */ + void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 689 */ + void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 690 */ + void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 691 */ + void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 692 */ + void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 693 */ + void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 694 */ + void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 695 */ + void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 696 */ + void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 697 */ + void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 698 */ + void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 699 */ + void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 700 */ + void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 701 */ + void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 702 */ + void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 703 */ + void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 704 */ + void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 705 */ + void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 706 */ + void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 707 */ + void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */ + void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */ + void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */ + void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */ + void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */ + void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */ + void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */ + void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */ + void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */ + void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 717 */ + void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 718 */ + void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 719 */ + void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 720 */ + void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 721 */ + void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 722 */ + void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 723 */ + void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 724 */ + void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 725 */ + void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 726 */ + void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 727 */ + GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 728 */ + void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 729 */ + void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 730 */ + void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 731 */ + void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 732 */ + void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 733 */ + void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 734 */ + void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 735 */ + void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 736 */ + void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 737 */ + GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 738 */ + void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 739 */ + void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 740 */ + void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 741 */ + void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 742 */ + void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 743 */ + void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 744 */ + void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 745 */ + void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 746 */ + void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 747 */ + void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 748 */ + GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 749 */ + void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 750 */ + void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 751 */ + void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 752 */ + void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */ + void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 754 */ + void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 755 */ + void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 756 */ + void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 757 */ + void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 758 */ + void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 759 */ + void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 760 */ + GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 761 */ + GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 762 */ + void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 763 */ + void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 764 */ + void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 765 */ + void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 766 */ + void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */ + void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */ + void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 769 */ + void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 770 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 09259f4704..960d70e081 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -4006,63 +4006,68 @@ KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs) DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs)); } +KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) +{ + 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(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) { DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLfloat * params) { DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLint * params) { DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, GLfloat param) { DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, const GLfloat * params) { DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, GLint param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, GLint param) { DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLenum pname, const GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLenum pname, const GLint * params) { DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLclampf value, GLboolean invert); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLclampf value, GLboolean invert) { DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_570)(GLenum pattern); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_570)(GLenum pattern) { DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern)); } @@ -4112,9 +4117,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param) DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLfloat param) { DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param)); } @@ -4134,9 +4139,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * p DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params) { DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } @@ -4151,16 +4156,16 @@ KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void) DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n")); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLdouble * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLdouble * params) { DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLfloat * params) { DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } @@ -4405,9 +4410,9 @@ KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord) DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum mode); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum mode) { DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode)); } @@ -4422,9 +4427,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfac DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_608)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_608)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) { DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); } @@ -4789,65 +4794,65 @@ KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v) DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) { DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) { DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLsizei n, const GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLsizei n, const GLuint * fences) { DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence) { DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLsizei n, GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLsizei n, GLuint * fences) { DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence, GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence, GLenum pname, GLint * params) { DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence) { RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence, GLenum condition); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence, GLenum condition) { DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_657)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_657)(GLuint fence) { RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence)); } @@ -5272,37 +5277,37 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face) { DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array) { DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays) { DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays) { DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array) { RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array)); } @@ -5337,9 +5342,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax) { DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); } @@ -5349,141 +5354,236 @@ KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA) DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA) { DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA)); } +KEYWORD1 void KEYWORD2 NAME(BindFramebuffer)(GLenum target, GLuint framebuffer) +{ + DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebuffer(0x%x, %d);\n", target, framebuffer)); +} + KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer) { DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer)); } +KEYWORD1 void KEYWORD2 NAME(BindRenderbuffer)(GLenum target, GLuint renderbuffer) +{ + DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbuffer(0x%x, %d);\n", target, renderbuffer)); +} + KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer) { DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer)); } +KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatus)(GLenum target) +{ + RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatus(0x%x);\n", target)); +} + KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target) { RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target)); } +KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffers)(GLsizei n, const GLuint * framebuffers) +{ + DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffers(%d, %p);\n", n, (const void *) framebuffers)); +} + KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers) { DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); } +KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers) +{ + DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers)); +} + KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers) { DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); } +KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +{ + DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbuffer(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer)); +} + KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer)); } +KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +{ + DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); +} + KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); } +KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +{ + DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); +} + KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); } +KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) +{ + DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3D(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset)); +} + KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) { DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset)); } +KEYWORD1 void KEYWORD2 NAME(GenFramebuffers)(GLsizei n, GLuint * framebuffers) +{ + DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffers(%d, %p);\n", n, (const void *) framebuffers)); +} + KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers) { DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); } +KEYWORD1 void KEYWORD2 NAME(GenRenderbuffers)(GLsizei n, GLuint * renderbuffers) +{ + DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers)); +} + KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers) { DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); } +KEYWORD1 void KEYWORD2 NAME(GenerateMipmap)(GLenum target) +{ + DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmap(0x%x);\n", target)); +} + KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target) { DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target)); } +KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint * params) +{ + DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameteriv(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params)); +} + KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params) { DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params)); } +KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebuffer)(GLuint framebuffer) +{ + RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebuffer(%d);\n", framebuffer)); +} + KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer) { RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer)); } +KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbuffer)(GLuint renderbuffer) +{ + RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbuffer(%d);\n", renderbuffer)); +} + KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer) { RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer)); } +KEYWORD1 void KEYWORD2 NAME(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +{ + DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorage(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height)); +} + KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) { DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +KEYWORD1 void KEYWORD2 NAME(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) +{ + DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); } +KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) +{ + DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayer(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer)); +} + KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) { DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) { DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLint64EXT * params) { DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLuint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLuint64EXT * params) { DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } @@ -6063,8 +6163,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(GetActiveAttribARB), TABLE_ENTRY(GetAttribLocationARB), TABLE_ENTRY(DrawBuffersARB), + TABLE_ENTRY(RenderbufferStorageMultisample), TABLE_ENTRY(PolygonOffsetEXT), - TABLE_ENTRY(_dispatch_stub_562), TABLE_ENTRY(_dispatch_stub_563), TABLE_ENTRY(_dispatch_stub_564), TABLE_ENTRY(_dispatch_stub_565), @@ -6072,6 +6172,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(_dispatch_stub_567), TABLE_ENTRY(_dispatch_stub_568), TABLE_ENTRY(_dispatch_stub_569), + TABLE_ENTRY(_dispatch_stub_570), TABLE_ENTRY(ColorPointerEXT), TABLE_ENTRY(EdgeFlagPointerEXT), TABLE_ENTRY(IndexPointerEXT), @@ -6082,8 +6183,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(PointParameterfvEXT), TABLE_ENTRY(LockArraysEXT), TABLE_ENTRY(UnlockArraysEXT), - TABLE_ENTRY(_dispatch_stub_580), TABLE_ENTRY(_dispatch_stub_581), + TABLE_ENTRY(_dispatch_stub_582), TABLE_ENTRY(SecondaryColor3bEXT), TABLE_ENTRY(SecondaryColor3bvEXT), TABLE_ENTRY(SecondaryColor3dEXT), @@ -6108,7 +6209,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(FogCoorddvEXT), TABLE_ENTRY(FogCoordfEXT), TABLE_ENTRY(FogCoordfvEXT), - TABLE_ENTRY(_dispatch_stub_606), + TABLE_ENTRY(_dispatch_stub_607), TABLE_ENTRY(BlendFuncSeparateEXT), TABLE_ENTRY(FlushVertexArrayRangeNV), TABLE_ENTRY(VertexArrayRangeNV), @@ -6150,7 +6251,6 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(WindowPos4ivMESA), TABLE_ENTRY(WindowPos4sMESA), TABLE_ENTRY(WindowPos4svMESA), - TABLE_ENTRY(_dispatch_stub_648), TABLE_ENTRY(_dispatch_stub_649), TABLE_ENTRY(_dispatch_stub_650), TABLE_ENTRY(_dispatch_stub_651), @@ -6159,6 +6259,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(_dispatch_stub_654), TABLE_ENTRY(_dispatch_stub_655), TABLE_ENTRY(_dispatch_stub_656), + TABLE_ENTRY(_dispatch_stub_657), TABLE_ENTRY(AreProgramsResidentNV), TABLE_ENTRY(BindProgramNV), TABLE_ENTRY(DeleteProgramsNV), @@ -6235,19 +6336,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(SetFragmentShaderConstantATI), TABLE_ENTRY(PointParameteriNV), TABLE_ENTRY(PointParameterivNV), - TABLE_ENTRY(_dispatch_stub_733), TABLE_ENTRY(_dispatch_stub_734), TABLE_ENTRY(_dispatch_stub_735), TABLE_ENTRY(_dispatch_stub_736), TABLE_ENTRY(_dispatch_stub_737), + TABLE_ENTRY(_dispatch_stub_738), TABLE_ENTRY(GetProgramNamedParameterdvNV), TABLE_ENTRY(GetProgramNamedParameterfvNV), TABLE_ENTRY(ProgramNamedParameter4dNV), TABLE_ENTRY(ProgramNamedParameter4dvNV), TABLE_ENTRY(ProgramNamedParameter4fNV), TABLE_ENTRY(ProgramNamedParameter4fvNV), - TABLE_ENTRY(_dispatch_stub_744), TABLE_ENTRY(_dispatch_stub_745), + TABLE_ENTRY(_dispatch_stub_746), TABLE_ENTRY(BindFramebufferEXT), TABLE_ENTRY(BindRenderbufferEXT), TABLE_ENTRY(CheckFramebufferStatusEXT), @@ -6265,13 +6366,13 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(IsFramebufferEXT), TABLE_ENTRY(IsRenderbufferEXT), TABLE_ENTRY(RenderbufferStorageEXT), - TABLE_ENTRY(_dispatch_stub_763), + TABLE_ENTRY(_dispatch_stub_764), TABLE_ENTRY(FramebufferTextureLayerEXT), - TABLE_ENTRY(_dispatch_stub_765), TABLE_ENTRY(_dispatch_stub_766), TABLE_ENTRY(_dispatch_stub_767), TABLE_ENTRY(_dispatch_stub_768), TABLE_ENTRY(_dispatch_stub_769), + TABLE_ENTRY(_dispatch_stub_770), /* A whole bunch of no-op functions. These might be called * when someone tries to call a dynamically-registered * extension function without a current rendering context. @@ -6639,6 +6740,25 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(PointParameteri), TABLE_ENTRY(PointParameteriv), TABLE_ENTRY(BlendEquationSeparate), + TABLE_ENTRY(BindFramebuffer), + TABLE_ENTRY(BindRenderbuffer), + TABLE_ENTRY(CheckFramebufferStatus), + TABLE_ENTRY(DeleteFramebuffers), + TABLE_ENTRY(DeleteRenderbuffers), + TABLE_ENTRY(FramebufferRenderbuffer), + TABLE_ENTRY(FramebufferTexture1D), + TABLE_ENTRY(FramebufferTexture2D), + TABLE_ENTRY(FramebufferTexture3D), + TABLE_ENTRY(GenFramebuffers), + TABLE_ENTRY(GenRenderbuffers), + TABLE_ENTRY(GenerateMipmap), + TABLE_ENTRY(GetFramebufferAttachmentParameteriv), + TABLE_ENTRY(GetRenderbufferParameteriv), + TABLE_ENTRY(IsFramebuffer), + TABLE_ENTRY(IsRenderbuffer), + TABLE_ENTRY(RenderbufferStorage), + TABLE_ENTRY(BlitFramebuffer), + TABLE_ENTRY(FramebufferTextureLayer), }; #endif /*UNUSED_TABLE_NAME*/ diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index 5a99d505ec..ba652bc3c6 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -613,6 +613,7 @@ static const char gl_string_table[] = "glGetActiveAttribARB\0" "glGetAttribLocationARB\0" "glDrawBuffersARB\0" + "glRenderbufferStorageMultisample\0" "glPolygonOffsetEXT\0" "glGetPixelTexGenParameterfvSGIS\0" "glGetPixelTexGenParameterivSGIS\0" @@ -1101,6 +1102,25 @@ static const char gl_string_table[] = "glPointParameteriv\0" "glBlendEquationSeparate\0" "glBlendEquationSeparateATI\0" + "glBindFramebuffer\0" + "glBindRenderbuffer\0" + "glCheckFramebufferStatus\0" + "glDeleteFramebuffers\0" + "glDeleteRenderbuffers\0" + "glFramebufferRenderbuffer\0" + "glFramebufferTexture1D\0" + "glFramebufferTexture2D\0" + "glFramebufferTexture3D\0" + "glGenFramebuffers\0" + "glGenRenderbuffers\0" + "glGenerateMipmap\0" + "glGetFramebufferAttachmentParameteriv\0" + "glGetRenderbufferParameteriv\0" + "glIsFramebuffer\0" + "glIsRenderbuffer\0" + "glRenderbufferStorage\0" + "glBlitFramebuffer\0" + "glFramebufferTextureLayer\0" ; @@ -1118,7 +1138,6 @@ static const char gl_string_table[] = #define gl_dispatch_stub_364 mgl_dispatch_stub_364 #define gl_dispatch_stub_365 mgl_dispatch_stub_365 #define gl_dispatch_stub_366 mgl_dispatch_stub_366 -#define gl_dispatch_stub_562 mgl_dispatch_stub_562 #define gl_dispatch_stub_563 mgl_dispatch_stub_563 #define gl_dispatch_stub_564 mgl_dispatch_stub_564 #define gl_dispatch_stub_565 mgl_dispatch_stub_565 @@ -1126,10 +1145,10 @@ static const char gl_string_table[] = #define gl_dispatch_stub_567 mgl_dispatch_stub_567 #define gl_dispatch_stub_568 mgl_dispatch_stub_568 #define gl_dispatch_stub_569 mgl_dispatch_stub_569 -#define gl_dispatch_stub_580 mgl_dispatch_stub_580 +#define gl_dispatch_stub_570 mgl_dispatch_stub_570 #define gl_dispatch_stub_581 mgl_dispatch_stub_581 -#define gl_dispatch_stub_606 mgl_dispatch_stub_606 -#define gl_dispatch_stub_648 mgl_dispatch_stub_648 +#define gl_dispatch_stub_582 mgl_dispatch_stub_582 +#define gl_dispatch_stub_607 mgl_dispatch_stub_607 #define gl_dispatch_stub_649 mgl_dispatch_stub_649 #define gl_dispatch_stub_650 mgl_dispatch_stub_650 #define gl_dispatch_stub_651 mgl_dispatch_stub_651 @@ -1138,19 +1157,20 @@ static const char gl_string_table[] = #define gl_dispatch_stub_654 mgl_dispatch_stub_654 #define gl_dispatch_stub_655 mgl_dispatch_stub_655 #define gl_dispatch_stub_656 mgl_dispatch_stub_656 -#define gl_dispatch_stub_733 mgl_dispatch_stub_733 +#define gl_dispatch_stub_657 mgl_dispatch_stub_657 #define gl_dispatch_stub_734 mgl_dispatch_stub_734 #define gl_dispatch_stub_735 mgl_dispatch_stub_735 #define gl_dispatch_stub_736 mgl_dispatch_stub_736 #define gl_dispatch_stub_737 mgl_dispatch_stub_737 -#define gl_dispatch_stub_744 mgl_dispatch_stub_744 +#define gl_dispatch_stub_738 mgl_dispatch_stub_738 #define gl_dispatch_stub_745 mgl_dispatch_stub_745 -#define gl_dispatch_stub_763 mgl_dispatch_stub_763 -#define gl_dispatch_stub_765 mgl_dispatch_stub_765 +#define gl_dispatch_stub_746 mgl_dispatch_stub_746 +#define gl_dispatch_stub_764 mgl_dispatch_stub_764 #define gl_dispatch_stub_766 mgl_dispatch_stub_766 #define gl_dispatch_stub_767 mgl_dispatch_stub_767 #define gl_dispatch_stub_768 mgl_dispatch_stub_768 #define gl_dispatch_stub_769 mgl_dispatch_stub_769 +#define gl_dispatch_stub_770 mgl_dispatch_stub_770 #endif /* USE_MGL_NAMESPACE */ @@ -1169,7 +1189,6 @@ extern void gl_dispatch_stub_363(void); extern void gl_dispatch_stub_364(void); extern void gl_dispatch_stub_365(void); extern void gl_dispatch_stub_366(void); -extern void gl_dispatch_stub_562(void); extern void gl_dispatch_stub_563(void); extern void gl_dispatch_stub_564(void); extern void gl_dispatch_stub_565(void); @@ -1177,10 +1196,10 @@ extern void gl_dispatch_stub_566(void); extern void gl_dispatch_stub_567(void); extern void gl_dispatch_stub_568(void); extern void gl_dispatch_stub_569(void); -extern void gl_dispatch_stub_580(void); +extern void gl_dispatch_stub_570(void); extern void gl_dispatch_stub_581(void); -extern void gl_dispatch_stub_606(void); -extern void gl_dispatch_stub_648(void); +extern void gl_dispatch_stub_582(void); +extern void gl_dispatch_stub_607(void); extern void gl_dispatch_stub_649(void); extern void gl_dispatch_stub_650(void); extern void gl_dispatch_stub_651(void); @@ -1189,19 +1208,20 @@ extern void gl_dispatch_stub_653(void); extern void gl_dispatch_stub_654(void); extern void gl_dispatch_stub_655(void); extern void gl_dispatch_stub_656(void); -extern void gl_dispatch_stub_733(void); +extern void gl_dispatch_stub_657(void); extern void gl_dispatch_stub_734(void); extern void gl_dispatch_stub_735(void); extern void gl_dispatch_stub_736(void); extern void gl_dispatch_stub_737(void); -extern void gl_dispatch_stub_744(void); +extern void gl_dispatch_stub_738(void); extern void gl_dispatch_stub_745(void); -extern void gl_dispatch_stub_763(void); -extern void gl_dispatch_stub_765(void); +extern void gl_dispatch_stub_746(void); +extern void gl_dispatch_stub_764(void); extern void gl_dispatch_stub_766(void); extern void gl_dispatch_stub_767(void); extern void gl_dispatch_stub_768(void); extern void gl_dispatch_stub_769(void); +extern void gl_dispatch_stub_770(void); #endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ static const glprocs_table_t static_functions[] = { @@ -1766,494 +1786,514 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET( 8890, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), NAME_FUNC_OFFSET( 8911, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), NAME_FUNC_OFFSET( 8934, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET( 8951, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), - NAME_FUNC_OFFSET( 8970, gl_dispatch_stub_562, gl_dispatch_stub_562, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9002, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9034, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_PixelTexGenParameterfSGIS), - NAME_FUNC_OFFSET( 9062, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9091, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameteriSGIS), - NAME_FUNC_OFFSET( 9119, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9148, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET( 9165, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET( 9185, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), - NAME_FUNC_OFFSET( 9203, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), - NAME_FUNC_OFFSET( 9224, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), - NAME_FUNC_OFFSET( 9242, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), - NAME_FUNC_OFFSET( 9261, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), - NAME_FUNC_OFFSET( 9282, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), - NAME_FUNC_OFFSET( 9301, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET( 9322, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET( 9344, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), - NAME_FUNC_OFFSET( 9360, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), - NAME_FUNC_OFFSET( 9378, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_CullParameterdvEXT), - NAME_FUNC_OFFSET( 9399, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterfvEXT), - NAME_FUNC_OFFSET( 9420, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET( 9442, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET( 9465, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET( 9487, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET( 9510, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET( 9532, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET( 9555, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET( 9577, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET( 9600, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET( 9622, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET( 9645, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET( 9668, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET( 9692, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET( 9715, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET( 9739, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET( 9762, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET( 9786, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET( 9813, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET( 9834, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET( 9857, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET( 9878, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET( 9893, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET( 9909, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET( 9924, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET( 9940, gl_dispatch_stub_606, gl_dispatch_stub_606, NULL, _gloffset_PixelTexGenSGIX), - NAME_FUNC_OFFSET( 9958, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET( 9981, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), - NAME_FUNC_OFFSET(10007, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), - NAME_FUNC_OFFSET(10028, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), - NAME_FUNC_OFFSET(10046, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), - NAME_FUNC_OFFSET(10065, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), - NAME_FUNC_OFFSET(10088, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), - NAME_FUNC_OFFSET(10112, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), - NAME_FUNC_OFFSET(10135, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), - NAME_FUNC_OFFSET(10159, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), - NAME_FUNC_OFFSET(10182, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10214, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10246, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), - NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), - NAME_FUNC_OFFSET(10312, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10349, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10386, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), - NAME_FUNC_OFFSET(10406, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(10424, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(10443, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(10461, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(10480, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(10498, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(10517, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(10535, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(10554, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(10572, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(10591, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(10609, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(10628, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(10646, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(10665, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(10683, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(10702, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), - NAME_FUNC_OFFSET(10720, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), - NAME_FUNC_OFFSET(10739, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), - NAME_FUNC_OFFSET(10757, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), - NAME_FUNC_OFFSET(10776, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), - NAME_FUNC_OFFSET(10794, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), - NAME_FUNC_OFFSET(10813, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), - NAME_FUNC_OFFSET(10831, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), - NAME_FUNC_OFFSET(10850, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, _gloffset_MultiModeDrawArraysIBM), - NAME_FUNC_OFFSET(10875, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawElementsIBM), - NAME_FUNC_OFFSET(10902, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_DeleteFencesNV), - NAME_FUNC_OFFSET(10919, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_FinishFenceNV), - NAME_FUNC_OFFSET(10935, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_GenFencesNV), - NAME_FUNC_OFFSET(10949, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GetFenceivNV), - NAME_FUNC_OFFSET(10964, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_IsFenceNV), - NAME_FUNC_OFFSET(10976, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_SetFenceNV), - NAME_FUNC_OFFSET(10989, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_TestFenceNV), - NAME_FUNC_OFFSET(11003, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), - NAME_FUNC_OFFSET(11027, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(11043, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(11062, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), - NAME_FUNC_OFFSET(11081, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(11097, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), - NAME_FUNC_OFFSET(11123, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), - NAME_FUNC_OFFSET(11149, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), - NAME_FUNC_OFFSET(11170, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), - NAME_FUNC_OFFSET(11187, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), - NAME_FUNC_OFFSET(11208, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(11236, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), - NAME_FUNC_OFFSET(11258, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), - NAME_FUNC_OFFSET(11280, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), - NAME_FUNC_OFFSET(11302, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(11316, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), - NAME_FUNC_OFFSET(11332, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), - NAME_FUNC_OFFSET(11357, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), - NAME_FUNC_OFFSET(11382, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), - NAME_FUNC_OFFSET(11410, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), - NAME_FUNC_OFFSET(11426, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), - NAME_FUNC_OFFSET(11445, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), - NAME_FUNC_OFFSET(11465, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), - NAME_FUNC_OFFSET(11484, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), - NAME_FUNC_OFFSET(11504, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), - NAME_FUNC_OFFSET(11523, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), - NAME_FUNC_OFFSET(11543, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), - NAME_FUNC_OFFSET(11562, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), - NAME_FUNC_OFFSET(11582, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), - NAME_FUNC_OFFSET(11601, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), - NAME_FUNC_OFFSET(11621, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), - NAME_FUNC_OFFSET(11640, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), - NAME_FUNC_OFFSET(11660, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), - NAME_FUNC_OFFSET(11679, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), - NAME_FUNC_OFFSET(11699, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), - NAME_FUNC_OFFSET(11718, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), - NAME_FUNC_OFFSET(11738, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), - NAME_FUNC_OFFSET(11757, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), - NAME_FUNC_OFFSET(11777, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), - NAME_FUNC_OFFSET(11796, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), - NAME_FUNC_OFFSET(11816, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), - NAME_FUNC_OFFSET(11835, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), - NAME_FUNC_OFFSET(11855, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), - NAME_FUNC_OFFSET(11874, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), - NAME_FUNC_OFFSET(11894, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), - NAME_FUNC_OFFSET(11914, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), - NAME_FUNC_OFFSET(11935, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), - NAME_FUNC_OFFSET(11959, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), - NAME_FUNC_OFFSET(11980, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), - NAME_FUNC_OFFSET(12001, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), - NAME_FUNC_OFFSET(12022, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), - NAME_FUNC_OFFSET(12043, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), - NAME_FUNC_OFFSET(12064, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), - NAME_FUNC_OFFSET(12085, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), - NAME_FUNC_OFFSET(12106, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), - NAME_FUNC_OFFSET(12127, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), - NAME_FUNC_OFFSET(12148, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), - NAME_FUNC_OFFSET(12169, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), - NAME_FUNC_OFFSET(12190, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), - NAME_FUNC_OFFSET(12211, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), - NAME_FUNC_OFFSET(12233, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), - NAME_FUNC_OFFSET(12255, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), - NAME_FUNC_OFFSET(12277, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), - NAME_FUNC_OFFSET(12299, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), - NAME_FUNC_OFFSET(12324, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), - NAME_FUNC_OFFSET(12348, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), - NAME_FUNC_OFFSET(12370, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), - NAME_FUNC_OFFSET(12392, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), - NAME_FUNC_OFFSET(12414, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), - NAME_FUNC_OFFSET(12440, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), - NAME_FUNC_OFFSET(12463, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), - NAME_FUNC_OFFSET(12487, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), - NAME_FUNC_OFFSET(12505, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), - NAME_FUNC_OFFSET(12520, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), - NAME_FUNC_OFFSET(12551, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(12571, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(12592, gl_dispatch_stub_733, gl_dispatch_stub_733, NULL, _gloffset_ActiveStencilFaceEXT), - NAME_FUNC_OFFSET(12615, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, _gloffset_BindVertexArrayAPPLE), - NAME_FUNC_OFFSET(12638, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(12664, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, _gloffset_GenVertexArraysAPPLE), - NAME_FUNC_OFFSET(12687, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(12708, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), - NAME_FUNC_OFFSET(12739, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), - NAME_FUNC_OFFSET(12770, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), - NAME_FUNC_OFFSET(12798, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), - NAME_FUNC_OFFSET(12827, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), - NAME_FUNC_OFFSET(12855, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), - NAME_FUNC_OFFSET(12884, gl_dispatch_stub_744, gl_dispatch_stub_744, NULL, _gloffset_DepthBoundsEXT), - NAME_FUNC_OFFSET(12901, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(12928, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(12949, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(12971, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(12999, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(13023, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(13048, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(13077, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(13103, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(13129, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(13155, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(13176, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(13198, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(13218, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(13259, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(13291, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(13310, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(13330, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(13355, gl_dispatch_stub_763, gl_dispatch_stub_763, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(13376, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), - NAME_FUNC_OFFSET(13405, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_StencilFuncSeparateATI), - NAME_FUNC_OFFSET(13430, gl_dispatch_stub_766, gl_dispatch_stub_766, NULL, _gloffset_ProgramEnvParameters4fvEXT), - NAME_FUNC_OFFSET(13459, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_ProgramLocalParameters4fvEXT), - NAME_FUNC_OFFSET(13490, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_GetQueryObjecti64vEXT), - NAME_FUNC_OFFSET(13514, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_GetQueryObjectui64vEXT), - NAME_FUNC_OFFSET(13539, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET(13557, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET(13574, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET(13590, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET(13615, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET(13635, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET(13655, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET(13678, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET(13701, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET(13721, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), - NAME_FUNC_OFFSET(13738, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET(13755, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), - NAME_FUNC_OFFSET(13770, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET(13794, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET(13813, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET(13832, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET(13848, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET(13867, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET(13890, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(13906, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(13922, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET(13949, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET(13976, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET(13996, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14015, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14034, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14064, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14094, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14124, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14154, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET(14173, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET(14196, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET(14221, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET(14246, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET(14273, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET(14301, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET(14328, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET(14356, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET(14385, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET(14414, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET(14440, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET(14471, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET(14502, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET(14526, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET(14549, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), - NAME_FUNC_OFFSET(14567, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET(14596, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET(14625, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), - NAME_FUNC_OFFSET(14640, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET(14666, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET(14692, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET(14707, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET(14719, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET(14739, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET(14756, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET(14772, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET(14791, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET(14814, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET(14830, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET(14852, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET(14870, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET(14889, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET(14907, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET(14926, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET(14944, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET(14963, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET(14981, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET(15000, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET(15018, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET(15037, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET(15055, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET(15074, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET(15092, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET(15111, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET(15129, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET(15148, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET(15166, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET(15185, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET(15203, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET(15222, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET(15240, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET(15259, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET(15277, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET(15296, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET(15314, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET(15333, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET(15351, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET(15370, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET(15388, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET(15407, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET(15425, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET(15444, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), - NAME_FUNC_OFFSET(15467, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET(15490, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET(15513, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET(15536, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET(15559, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET(15576, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET(15599, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET(15622, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET(15645, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET(15671, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET(15697, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET(15723, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET(15747, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET(15774, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET(15800, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET(15820, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET(15840, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET(15860, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), - NAME_FUNC_OFFSET(15883, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), - NAME_FUNC_OFFSET(15907, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), - NAME_FUNC_OFFSET(15930, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), - NAME_FUNC_OFFSET(15954, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET(15971, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET(15989, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET(16006, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET(16024, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET(16041, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET(16059, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET(16076, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET(16094, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET(16111, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET(16129, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET(16146, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET(16164, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET(16181, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET(16199, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET(16216, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET(16234, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET(16251, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET(16269, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET(16288, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET(16307, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET(16326, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET(16345, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET(16365, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET(16385, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(16405, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), - NAME_FUNC_OFFSET(16423, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(16440, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(16458, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(16475, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(16493, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), - NAME_FUNC_OFFSET(16511, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(16528, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(16546, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), - NAME_FUNC_OFFSET(16565, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), - NAME_FUNC_OFFSET(16584, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), - NAME_FUNC_OFFSET(16603, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(16625, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(16638, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(16651, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(16667, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(16683, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(16696, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(16719, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(16739, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(16758, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(16769, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(16781, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(16795, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(16808, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(16824, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(16835, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(16848, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(16867, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(16887, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(16900, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(16910, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(16926, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(16945, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(16963, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(16984, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(16999, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(17014, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(17028, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(17043, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(17055, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(17068, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(17080, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(17093, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(17105, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(17118, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(17130, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(17143, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(17155, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(17168, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17180, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17193, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17205, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(17218, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(17230, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(17243, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(17262, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(17281, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(17300, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(17313, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(17331, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(17352, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(17370, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(17390, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17404, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17421, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(17437, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(17456, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17474, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17495, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17517, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17536, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17558, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17581, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(17600, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(17620, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(17639, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(17659, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(17678, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(17698, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(17717, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(17737, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(17756, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(17776, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(17796, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(17817, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(17837, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(17858, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(17878, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(17899, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(17923, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(17941, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(17961, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(17979, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(17991, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(18004, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(18016, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(18029, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18049, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18073, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18087, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18104, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18119, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18137, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18151, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18168, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18183, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18201, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18215, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18232, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18247, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18265, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18279, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18296, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18311, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18329, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18343, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18360, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18375, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18393, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18407, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18424, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18439, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18457, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18471, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18488, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18503, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18521, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18535, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18552, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18567, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18585, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(18602, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(18622, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(18639, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18665, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18694, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(18709, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(18727, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(18746, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(18770, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET( 8951, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample), + NAME_FUNC_OFFSET( 8984, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), + NAME_FUNC_OFFSET( 9003, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9035, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_GetPixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9067, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfSGIS), + NAME_FUNC_OFFSET( 9095, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9124, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameteriSGIS), + NAME_FUNC_OFFSET( 9152, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_PixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9181, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET( 9198, gl_dispatch_stub_570, gl_dispatch_stub_570, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET( 9218, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), + NAME_FUNC_OFFSET( 9236, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), + NAME_FUNC_OFFSET( 9257, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), + NAME_FUNC_OFFSET( 9275, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), + NAME_FUNC_OFFSET( 9294, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), + NAME_FUNC_OFFSET( 9315, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), + NAME_FUNC_OFFSET( 9334, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET( 9355, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET( 9377, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), + NAME_FUNC_OFFSET( 9393, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), + NAME_FUNC_OFFSET( 9411, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterdvEXT), + NAME_FUNC_OFFSET( 9432, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_CullParameterfvEXT), + NAME_FUNC_OFFSET( 9453, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET( 9475, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET( 9498, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET( 9520, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET( 9543, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET( 9565, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET( 9588, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET( 9610, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET( 9633, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET( 9655, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET( 9678, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET( 9701, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET( 9725, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET( 9748, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET( 9772, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET( 9795, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET( 9819, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET( 9846, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET( 9867, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET( 9890, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET( 9911, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET( 9926, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET( 9942, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET( 9957, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET( 9973, gl_dispatch_stub_607, gl_dispatch_stub_607, NULL, _gloffset_PixelTexGenSGIX), + NAME_FUNC_OFFSET( 9991, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(10014, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), + NAME_FUNC_OFFSET(10040, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), + NAME_FUNC_OFFSET(10061, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), + NAME_FUNC_OFFSET(10079, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), + NAME_FUNC_OFFSET(10098, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), + NAME_FUNC_OFFSET(10121, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), + NAME_FUNC_OFFSET(10145, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), + NAME_FUNC_OFFSET(10168, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), + NAME_FUNC_OFFSET(10192, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), + NAME_FUNC_OFFSET(10215, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10247, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), + NAME_FUNC_OFFSET(10312, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), + NAME_FUNC_OFFSET(10345, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10382, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10419, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), + NAME_FUNC_OFFSET(10439, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(10457, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(10476, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(10494, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(10513, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(10531, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(10550, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(10568, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(10587, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(10605, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(10624, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(10642, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(10661, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(10679, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(10698, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(10716, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(10735, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), + NAME_FUNC_OFFSET(10753, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), + NAME_FUNC_OFFSET(10772, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), + NAME_FUNC_OFFSET(10790, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), + NAME_FUNC_OFFSET(10809, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), + NAME_FUNC_OFFSET(10827, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), + NAME_FUNC_OFFSET(10846, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), + NAME_FUNC_OFFSET(10864, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), + NAME_FUNC_OFFSET(10883, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawArraysIBM), + NAME_FUNC_OFFSET(10908, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_MultiModeDrawElementsIBM), + NAME_FUNC_OFFSET(10935, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_DeleteFencesNV), + NAME_FUNC_OFFSET(10952, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_FinishFenceNV), + NAME_FUNC_OFFSET(10968, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GenFencesNV), + NAME_FUNC_OFFSET(10982, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_GetFenceivNV), + NAME_FUNC_OFFSET(10997, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_IsFenceNV), + NAME_FUNC_OFFSET(11009, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_SetFenceNV), + NAME_FUNC_OFFSET(11022, gl_dispatch_stub_657, gl_dispatch_stub_657, NULL, _gloffset_TestFenceNV), + NAME_FUNC_OFFSET(11036, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), + NAME_FUNC_OFFSET(11060, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(11076, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(11095, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), + NAME_FUNC_OFFSET(11114, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(11130, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), + NAME_FUNC_OFFSET(11156, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), + NAME_FUNC_OFFSET(11182, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), + NAME_FUNC_OFFSET(11203, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), + NAME_FUNC_OFFSET(11220, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), + NAME_FUNC_OFFSET(11241, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(11269, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), + NAME_FUNC_OFFSET(11291, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), + NAME_FUNC_OFFSET(11313, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), + NAME_FUNC_OFFSET(11335, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(11349, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), + NAME_FUNC_OFFSET(11365, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), + NAME_FUNC_OFFSET(11390, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), + NAME_FUNC_OFFSET(11415, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), + NAME_FUNC_OFFSET(11443, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), + NAME_FUNC_OFFSET(11459, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), + NAME_FUNC_OFFSET(11478, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), + NAME_FUNC_OFFSET(11498, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), + NAME_FUNC_OFFSET(11517, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), + NAME_FUNC_OFFSET(11537, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), + NAME_FUNC_OFFSET(11556, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), + NAME_FUNC_OFFSET(11576, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), + NAME_FUNC_OFFSET(11595, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), + NAME_FUNC_OFFSET(11615, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), + NAME_FUNC_OFFSET(11634, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), + NAME_FUNC_OFFSET(11654, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), + NAME_FUNC_OFFSET(11673, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), + NAME_FUNC_OFFSET(11693, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), + NAME_FUNC_OFFSET(11712, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), + NAME_FUNC_OFFSET(11732, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), + NAME_FUNC_OFFSET(11751, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), + NAME_FUNC_OFFSET(11771, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), + NAME_FUNC_OFFSET(11790, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), + NAME_FUNC_OFFSET(11810, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), + NAME_FUNC_OFFSET(11829, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), + NAME_FUNC_OFFSET(11849, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), + NAME_FUNC_OFFSET(11868, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), + NAME_FUNC_OFFSET(11888, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), + NAME_FUNC_OFFSET(11907, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), + NAME_FUNC_OFFSET(11927, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), + NAME_FUNC_OFFSET(11947, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), + NAME_FUNC_OFFSET(11968, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), + NAME_FUNC_OFFSET(11992, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), + NAME_FUNC_OFFSET(12013, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), + NAME_FUNC_OFFSET(12034, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), + NAME_FUNC_OFFSET(12055, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), + NAME_FUNC_OFFSET(12076, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), + NAME_FUNC_OFFSET(12097, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), + NAME_FUNC_OFFSET(12118, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), + NAME_FUNC_OFFSET(12139, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), + NAME_FUNC_OFFSET(12160, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), + NAME_FUNC_OFFSET(12181, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), + NAME_FUNC_OFFSET(12202, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), + NAME_FUNC_OFFSET(12223, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), + NAME_FUNC_OFFSET(12244, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), + NAME_FUNC_OFFSET(12266, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), + NAME_FUNC_OFFSET(12288, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), + NAME_FUNC_OFFSET(12310, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), + NAME_FUNC_OFFSET(12332, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), + NAME_FUNC_OFFSET(12357, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), + NAME_FUNC_OFFSET(12381, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), + NAME_FUNC_OFFSET(12403, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), + NAME_FUNC_OFFSET(12425, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), + NAME_FUNC_OFFSET(12447, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), + NAME_FUNC_OFFSET(12473, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), + NAME_FUNC_OFFSET(12496, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), + NAME_FUNC_OFFSET(12520, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), + NAME_FUNC_OFFSET(12538, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), + NAME_FUNC_OFFSET(12553, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), + NAME_FUNC_OFFSET(12584, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(12604, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(12625, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, _gloffset_ActiveStencilFaceEXT), + NAME_FUNC_OFFSET(12648, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, _gloffset_BindVertexArrayAPPLE), + NAME_FUNC_OFFSET(12671, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(12697, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_GenVertexArraysAPPLE), + NAME_FUNC_OFFSET(12720, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(12741, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), + NAME_FUNC_OFFSET(12772, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), + NAME_FUNC_OFFSET(12803, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), + NAME_FUNC_OFFSET(12831, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), + NAME_FUNC_OFFSET(12860, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), + NAME_FUNC_OFFSET(12888, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), + NAME_FUNC_OFFSET(12917, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_DepthBoundsEXT), + NAME_FUNC_OFFSET(12934, gl_dispatch_stub_746, gl_dispatch_stub_746, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(12961, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(12982, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(13004, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(13032, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(13056, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(13081, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(13110, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(13136, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(13162, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(13188, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(13209, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(13231, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(13251, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(13292, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(13324, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(13343, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(13363, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(13388, gl_dispatch_stub_764, gl_dispatch_stub_764, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(13409, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(13438, gl_dispatch_stub_766, gl_dispatch_stub_766, NULL, _gloffset_StencilFuncSeparateATI), + NAME_FUNC_OFFSET(13463, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_ProgramEnvParameters4fvEXT), + NAME_FUNC_OFFSET(13492, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_ProgramLocalParameters4fvEXT), + NAME_FUNC_OFFSET(13523, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_GetQueryObjecti64vEXT), + NAME_FUNC_OFFSET(13547, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_GetQueryObjectui64vEXT), + NAME_FUNC_OFFSET(13572, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET(13590, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET(13607, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET(13623, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET(13648, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET(13668, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET(13688, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET(13711, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET(13734, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET(13754, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), + NAME_FUNC_OFFSET(13771, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET(13788, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), + NAME_FUNC_OFFSET(13803, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET(13827, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET(13846, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET(13865, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET(13881, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET(13900, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET(13923, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(13939, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(13955, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET(13982, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET(14009, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET(14029, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14048, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14067, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14097, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14127, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14157, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14187, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET(14206, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET(14229, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET(14254, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET(14279, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET(14306, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET(14334, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET(14361, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET(14389, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET(14418, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET(14447, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET(14473, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET(14504, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET(14535, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET(14559, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET(14582, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), + NAME_FUNC_OFFSET(14600, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET(14629, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET(14658, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), + NAME_FUNC_OFFSET(14673, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET(14699, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET(14725, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET(14740, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET(14752, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET(14772, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET(14789, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET(14805, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET(14824, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET(14847, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET(14863, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET(14885, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET(14903, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET(14922, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET(14940, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET(14959, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET(14977, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET(14996, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET(15014, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET(15033, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET(15051, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET(15070, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET(15088, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET(15107, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET(15125, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET(15144, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET(15162, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET(15181, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET(15199, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET(15218, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET(15236, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET(15255, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET(15273, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET(15292, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET(15310, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET(15329, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET(15347, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET(15366, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET(15384, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET(15403, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET(15421, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET(15440, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET(15458, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET(15477, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), + NAME_FUNC_OFFSET(15500, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET(15523, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET(15546, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET(15569, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET(15592, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET(15609, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET(15632, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET(15655, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET(15678, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET(15704, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET(15730, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET(15756, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET(15780, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET(15807, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET(15833, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET(15853, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET(15873, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET(15893, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), + NAME_FUNC_OFFSET(15916, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), + NAME_FUNC_OFFSET(15940, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), + NAME_FUNC_OFFSET(15963, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), + NAME_FUNC_OFFSET(15987, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET(16004, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET(16022, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET(16039, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET(16057, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET(16074, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET(16092, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET(16109, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET(16127, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET(16144, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET(16162, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET(16179, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET(16197, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET(16214, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET(16232, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET(16249, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET(16267, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET(16284, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET(16302, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET(16321, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET(16340, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET(16359, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET(16378, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET(16398, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET(16418, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET(16438, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), + NAME_FUNC_OFFSET(16456, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(16473, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(16491, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(16508, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(16526, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), + NAME_FUNC_OFFSET(16544, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(16561, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(16579, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), + NAME_FUNC_OFFSET(16598, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), + NAME_FUNC_OFFSET(16617, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), + NAME_FUNC_OFFSET(16636, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(16658, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(16671, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(16684, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(16700, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(16716, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(16729, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(16752, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(16772, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(16791, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(16802, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(16814, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(16828, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(16841, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(16857, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(16868, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(16881, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(16900, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(16920, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(16933, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(16943, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(16959, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(16978, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(16996, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(17017, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(17032, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(17047, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(17061, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(17076, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(17088, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(17101, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(17113, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(17126, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(17138, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(17151, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(17163, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(17176, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(17188, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(17201, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(17213, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(17226, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(17238, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(17251, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(17263, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(17276, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(17295, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(17314, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(17333, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(17346, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(17364, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(17385, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(17403, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(17423, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17437, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17454, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(17470, gl_dispatch_stub_570, gl_dispatch_stub_570, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(17489, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17507, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17528, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17550, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17569, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17591, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17614, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(17633, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(17653, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(17672, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(17692, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(17711, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(17731, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(17750, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(17770, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(17789, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(17809, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(17829, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(17850, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(17870, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(17891, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(17911, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(17932, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(17956, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(17974, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(17994, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(18012, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(18024, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(18037, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(18049, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(18062, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18082, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18106, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18120, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18137, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18152, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18170, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18184, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18201, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18216, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18234, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18248, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18265, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18280, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18298, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18312, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18329, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18344, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18362, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18376, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18393, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18408, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18426, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18440, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18457, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18472, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18490, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18504, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18521, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18536, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18554, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18568, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18585, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18600, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18618, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(18635, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(18655, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(18672, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(18698, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(18727, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(18742, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(18760, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(18779, gl_dispatch_stub_746, gl_dispatch_stub_746, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(18803, gl_dispatch_stub_746, gl_dispatch_stub_746, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(18830, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(18848, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(18867, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(18892, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(18913, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(18935, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(18961, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(18984, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(19007, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(19030, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(19048, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(19067, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(19084, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(19122, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(19151, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(19167, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(19184, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(19206, gl_dispatch_stub_764, gl_dispatch_stub_764, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(19224, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 4796f3027a..a864f5a070 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -180,21 +180,37 @@ LONGSTRING static const char enum_string_table[] = "GL_COLOR_ARRAY_SIZE\0" "GL_COLOR_ARRAY_STRIDE\0" "GL_COLOR_ARRAY_TYPE\0" + "GL_COLOR_ATTACHMENT0\0" "GL_COLOR_ATTACHMENT0_EXT\0" + "GL_COLOR_ATTACHMENT1\0" + "GL_COLOR_ATTACHMENT10\0" "GL_COLOR_ATTACHMENT10_EXT\0" + "GL_COLOR_ATTACHMENT11\0" "GL_COLOR_ATTACHMENT11_EXT\0" + "GL_COLOR_ATTACHMENT12\0" "GL_COLOR_ATTACHMENT12_EXT\0" + "GL_COLOR_ATTACHMENT13\0" "GL_COLOR_ATTACHMENT13_EXT\0" + "GL_COLOR_ATTACHMENT14\0" "GL_COLOR_ATTACHMENT14_EXT\0" + "GL_COLOR_ATTACHMENT15\0" "GL_COLOR_ATTACHMENT15_EXT\0" "GL_COLOR_ATTACHMENT1_EXT\0" + "GL_COLOR_ATTACHMENT2\0" "GL_COLOR_ATTACHMENT2_EXT\0" + "GL_COLOR_ATTACHMENT3\0" "GL_COLOR_ATTACHMENT3_EXT\0" + "GL_COLOR_ATTACHMENT4\0" "GL_COLOR_ATTACHMENT4_EXT\0" + "GL_COLOR_ATTACHMENT5\0" "GL_COLOR_ATTACHMENT5_EXT\0" + "GL_COLOR_ATTACHMENT6\0" "GL_COLOR_ATTACHMENT6_EXT\0" + "GL_COLOR_ATTACHMENT7\0" "GL_COLOR_ATTACHMENT7_EXT\0" + "GL_COLOR_ATTACHMENT8\0" "GL_COLOR_ATTACHMENT8_EXT\0" + "GL_COLOR_ATTACHMENT9\0" "GL_COLOR_ATTACHMENT9_EXT\0" "GL_COLOR_BUFFER_BIT\0" "GL_COLOR_CLEAR_VALUE\0" @@ -348,6 +364,8 @@ LONGSTRING static const char enum_string_table[] = "GL_DECR_WRAP_EXT\0" "GL_DELETE_STATUS\0" "GL_DEPTH\0" + "GL_DEPTH24_STENCIL8\0" + "GL_DEPTH_ATTACHMENT\0" "GL_DEPTH_ATTACHMENT_EXT\0" "GL_DEPTH_BIAS\0" "GL_DEPTH_BITS\0" @@ -369,6 +387,8 @@ LONGSTRING static const char enum_string_table[] = "GL_DEPTH_FUNC\0" "GL_DEPTH_RANGE\0" "GL_DEPTH_SCALE\0" + "GL_DEPTH_STENCIL\0" + "GL_DEPTH_STENCIL_ATTACHMENT\0" "GL_DEPTH_STENCIL_NV\0" "GL_DEPTH_STENCIL_TO_BGRA_NV\0" "GL_DEPTH_STENCIL_TO_RGBA_NV\0" @@ -437,6 +457,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DRAW_BUFFER9\0" "GL_DRAW_BUFFER9_ARB\0" "GL_DRAW_BUFFER9_ATI\0" + "GL_DRAW_FRAMEBUFFER\0" "GL_DRAW_FRAMEBUFFER_BINDING_EXT\0" "GL_DRAW_FRAMEBUFFER_EXT\0" "GL_DRAW_PIXEL_TOKEN\0" @@ -522,23 +543,44 @@ LONGSTRING static const char enum_string_table[] = "GL_FRAGMENT_SHADER\0" "GL_FRAGMENT_SHADER_ARB\0" "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0" + "GL_FRAMEBUFFER\0" + "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING\0" + "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE\0" + "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\0" "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\0" "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0" "GL_FRAMEBUFFER_BINDING_EXT\0" + "GL_FRAMEBUFFER_COMPLETE\0" "GL_FRAMEBUFFER_COMPLETE_EXT\0" + "GL_FRAMEBUFFER_DEFAULT\0" "GL_FRAMEBUFFER_EXT\0" + "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT\0" "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\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_READ_BUFFER_EXT\0" "GL_FRAMEBUFFER_STATUS_ERROR_EXT\0" + "GL_FRAMEBUFFER_UNDEFINED\0" + "GL_FRAMEBUFFER_UNSUPPORTED\0" "GL_FRAMEBUFFER_UNSUPPORTED_EXT\0" "GL_FRONT\0" "GL_FRONT_AND_BACK\0" @@ -611,6 +653,7 @@ LONGSTRING static const char enum_string_table[] = "GL_INCR\0" "GL_INCR_WRAP\0" "GL_INCR_WRAP_EXT\0" + "GL_INDEX\0" "GL_INDEX_ARRAY\0" "GL_INDEX_ARRAY_BUFFER_BINDING\0" "GL_INDEX_ARRAY_BUFFER_BINDING_ARB\0" @@ -646,6 +689,7 @@ LONGSTRING static const char enum_string_table[] = "GL_INT_VEC4\0" "GL_INT_VEC4_ARB\0" "GL_INVALID_ENUM\0" + "GL_INVALID_FRAMEBUFFER_OPERATION\0" "GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0" "GL_INVALID_OPERATION\0" "GL_INVALID_VALUE\0" @@ -890,6 +934,7 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB\0" "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\0" "GL_MAX_RENDERBUFFER_SIZE_EXT\0" + "GL_MAX_SAMPLES\0" "GL_MAX_SHININESS_NV\0" "GL_MAX_SPOT_EXPONENT_NV\0" "GL_MAX_TEXTURE_COORDS\0" @@ -1257,6 +1302,7 @@ LONGSTRING static const char enum_string_table[] = "GL_R3_G3_B2\0" "GL_RASTER_POSITION_UNCLIPPED_IBM\0" "GL_READ_BUFFER\0" + "GL_READ_FRAMEBUFFER\0" "GL_READ_FRAMEBUFFER_BINDING_EXT\0" "GL_READ_FRAMEBUFFER_EXT\0" "GL_READ_ONLY\0" @@ -1273,10 +1319,21 @@ LONGSTRING static const char enum_string_table[] = "GL_REFLECTION_MAP_ARB\0" "GL_REFLECTION_MAP_NV\0" "GL_RENDER\0" + "GL_RENDERBUFFER\0" + "GL_RENDERBUFFER_ALPHA_SIZE\0" "GL_RENDERBUFFER_BINDING_EXT\0" + "GL_RENDERBUFFER_BLUE_SIZE\0" + "GL_RENDERBUFFER_DEPTH_SIZE\0" "GL_RENDERBUFFER_EXT\0" + "GL_RENDERBUFFER_GREEN_SIZE\0" + "GL_RENDERBUFFER_HEIGHT\0" "GL_RENDERBUFFER_HEIGHT_EXT\0" + "GL_RENDERBUFFER_INTERNAL_FORMAT\0" "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0" + "GL_RENDERBUFFER_RED_SIZE\0" + "GL_RENDERBUFFER_SAMPLES\0" + "GL_RENDERBUFFER_STENCIL_SIZE\0" + "GL_RENDERBUFFER_WIDTH\0" "GL_RENDERBUFFER_WIDTH_EXT\0" "GL_RENDERER\0" "GL_RENDER_MODE\0" @@ -1420,6 +1477,7 @@ LONGSTRING static const char enum_string_table[] = "GL_SRC_ALPHA\0" "GL_SRC_ALPHA_SATURATE\0" "GL_SRC_COLOR\0" + "GL_SRGB\0" "GL_STACK_OVERFLOW\0" "GL_STACK_UNDERFLOW\0" "GL_STATIC_COPY\0" @@ -1429,6 +1487,7 @@ LONGSTRING static const char enum_string_table[] = "GL_STATIC_READ\0" "GL_STATIC_READ_ARB\0" "GL_STENCIL\0" + "GL_STENCIL_ATTACHMENT\0" "GL_STENCIL_ATTACHMENT_EXT\0" "GL_STENCIL_BACK_FAIL\0" "GL_STENCIL_BACK_FAIL_ATI\0" @@ -1654,6 +1713,7 @@ LONGSTRING static const char enum_string_table[] = "GL_TEXTURE_RED_SIZE_EXT\0" "GL_TEXTURE_RESIDENT\0" "GL_TEXTURE_STACK_DEPTH\0" + "GL_TEXTURE_STENCIL_SIZE\0" "GL_TEXTURE_TOO_LARGE_EXT\0" "GL_TEXTURE_UNSIGNED_REMAP_MODE_NV\0" "GL_TEXTURE_WIDTH\0" @@ -1692,10 +1752,12 @@ LONGSTRING static const char enum_string_table[] = "GL_UNSIGNED_BYTE_3_3_2\0" "GL_UNSIGNED_INT\0" "GL_UNSIGNED_INT_10_10_10_2\0" + "GL_UNSIGNED_INT_24_8\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" "GL_UNSIGNED_INT_8_8_8_8_REV\0" + "GL_UNSIGNED_NORMALIZED\0" "GL_UNSIGNED_SHORT\0" "GL_UNSIGNED_SHORT_1_5_5_5_REV\0" "GL_UNSIGNED_SHORT_4_4_4_4\0" @@ -1785,7 +1847,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1748] = +static const enum_elt all_enums[1810] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -1932,2896 +1994,2982 @@ static const enum_elt all_enums[1748] = { 2414, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ { 2434, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ { 2456, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ - { 2476, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ - { 2501, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ - { 2527, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ - { 2553, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ - { 2579, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ - { 2605, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ - { 2631, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ - { 2657, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ - { 2682, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ - { 2707, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ - { 2732, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ - { 2757, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ - { 2782, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ - { 2807, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ - { 2832, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ - { 2857, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ - { 2882, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ - { 2902, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ - { 2923, 0x00001900 }, /* GL_COLOR_INDEX */ - { 2938, 0x00001603 }, /* GL_COLOR_INDEXES */ - { 2955, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ - { 2973, 0x00000B57 }, /* GL_COLOR_MATERIAL */ - { 2991, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ - { 3014, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ - { 3042, 0x000080B1 }, /* GL_COLOR_MATRIX */ - { 3058, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ - { 3078, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ - { 3106, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 3138, 0x00008458 }, /* GL_COLOR_SUM */ - { 3151, 0x00008458 }, /* GL_COLOR_SUM_ARB */ - { 3168, 0x000080D0 }, /* GL_COLOR_TABLE */ - { 3183, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ - { 3209, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ - { 3239, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ - { 3269, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ - { 3289, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ - { 3313, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ - { 3338, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ - { 3367, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ - { 3396, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ - { 3418, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ - { 3444, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ - { 3470, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ - { 3496, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ - { 3526, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ - { 3556, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - { 3586, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ - { 3620, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ - { 3654, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - { 3684, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ - { 3718, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ - { 3752, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ - { 3776, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ - { 3804, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ - { 3832, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ - { 3853, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ - { 3878, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ - { 3899, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ - { 3924, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ - { 3949, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ - { 3968, 0x00008570 }, /* GL_COMBINE */ - { 3979, 0x00008503 }, /* GL_COMBINE4 */ - { 3991, 0x00008572 }, /* GL_COMBINE_ALPHA */ - { 4008, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ - { 4029, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ - { 4050, 0x00008570 }, /* GL_COMBINE_ARB */ - { 4065, 0x00008570 }, /* GL_COMBINE_EXT */ - { 4080, 0x00008571 }, /* GL_COMBINE_RGB */ - { 4095, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ - { 4114, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ - { 4133, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ - { 4169, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ - { 4193, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ - { 4221, 0x00001300 }, /* GL_COMPILE */ - { 4232, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ - { 4255, 0x00008B81 }, /* GL_COMPILE_STATUS */ - { 4273, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ - { 4293, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ - { 4317, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ - { 4341, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ - { 4369, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ - { 4393, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - { 4423, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ - { 4457, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ - { 4485, 0x000084ED }, /* GL_COMPRESSED_RGB */ - { 4503, 0x000084EE }, /* GL_COMPRESSED_RGBA */ - { 4522, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ - { 4545, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - { 4574, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - { 4607, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - { 4640, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - { 4673, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ - { 4695, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - { 4723, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - { 4755, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ - { 4785, 0x00008576 }, /* GL_CONSTANT */ - { 4797, 0x00008003 }, /* GL_CONSTANT_ALPHA */ - { 4815, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ - { 4837, 0x00008576 }, /* GL_CONSTANT_ARB */ - { 4853, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ - { 4877, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ - { 4899, 0x00008001 }, /* GL_CONSTANT_COLOR */ - { 4917, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ - { 4939, 0x00008576 }, /* GL_CONSTANT_EXT */ - { 4955, 0x00008010 }, /* GL_CONVOLUTION_1D */ - { 4973, 0x00008011 }, /* GL_CONVOLUTION_2D */ - { 4991, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ - { 5019, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ - { 5050, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ - { 5077, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ - { 5108, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ - { 5135, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ - { 5166, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ - { 5194, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ - { 5226, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ - { 5248, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ - { 5274, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ - { 5296, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ - { 5322, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ - { 5343, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ - { 5368, 0x00008862 }, /* GL_COORD_REPLACE */ - { 5385, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ - { 5406, 0x00008862 }, /* GL_COORD_REPLACE_NV */ - { 5426, 0x00001503 }, /* GL_COPY */ - { 5434, 0x0000150C }, /* GL_COPY_INVERTED */ - { 5451, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ - { 5471, 0x00000B44 }, /* GL_CULL_FACE */ - { 5484, 0x00000B45 }, /* GL_CULL_FACE_MODE */ - { 5502, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ - { 5521, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - { 5553, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - { 5588, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ - { 5609, 0x00000001 }, /* GL_CURRENT_BIT */ - { 5624, 0x00000B00 }, /* GL_CURRENT_COLOR */ - { 5641, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ - { 5662, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ - { 5688, 0x00000B01 }, /* GL_CURRENT_INDEX */ - { 5705, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ - { 5727, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ - { 5755, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ - { 5776, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - { 5810, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ - { 5843, 0x00000B02 }, /* GL_CURRENT_NORMAL */ - { 5861, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - { 5891, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ - { 5910, 0x00008865 }, /* GL_CURRENT_QUERY */ - { 5927, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ - { 5948, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ - { 5972, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ - { 5999, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ - { 6023, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ - { 6050, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ - { 6083, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - { 6116, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ - { 6143, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ - { 6169, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ - { 6194, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - { 6223, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ - { 6245, 0x00000900 }, /* GL_CW */ - { 6251, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ - { 6272, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ - { 6293, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ - { 6313, 0x00002101 }, /* GL_DECAL */ - { 6322, 0x00001E03 }, /* GL_DECR */ - { 6330, 0x00008508 }, /* GL_DECR_WRAP */ - { 6343, 0x00008508 }, /* GL_DECR_WRAP_EXT */ - { 6360, 0x00008B80 }, /* GL_DELETE_STATUS */ - { 6377, 0x00001801 }, /* GL_DEPTH */ - { 6386, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 6410, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 6424, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 6438, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 6458, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 6483, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 6503, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 6521, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 6542, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 6561, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 6582, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 6607, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 6633, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 6654, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 6679, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 6705, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 6726, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 6751, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 6777, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 6791, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 6806, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 6821, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 6841, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 6869, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 6897, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 6911, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 6933, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 6959, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 6978, 0x00001201 }, /* GL_DIFFUSE */ - { 6989, 0x00000BD0 }, /* GL_DITHER */ - { 6999, 0x00000A02 }, /* GL_DOMAIN */ - { 7009, 0x00001100 }, /* GL_DONT_CARE */ - { 7022, 0x000086AE }, /* GL_DOT3_RGB */ - { 7034, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7047, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7064, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7081, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7097, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7113, 0x0000140A }, /* GL_DOUBLE */ - { 7123, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 7139, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 7154, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 7170, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 7190, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 7210, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 7226, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 7243, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 7264, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 7285, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 7302, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 7323, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 7344, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 7361, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 7382, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 7403, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 7420, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 7441, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 7462, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 7479, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 7500, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 7521, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 7538, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 7559, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 7580, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 7600, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 7620, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 7636, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 7656, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 7676, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 7692, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 7712, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 7732, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 7748, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 7768, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 7788, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 7804, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 7824, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 7844, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 7860, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 7880, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 7900, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 7916, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 7936, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 7956, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 7972, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 7992, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8012, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8028, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8048, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8068, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 8100, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 8124, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 8144, 0x00000304 }, /* GL_DST_ALPHA */ - { 8157, 0x00000306 }, /* GL_DST_COLOR */ - { 8170, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 8186, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 8206, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 8222, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 8242, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 8258, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 8278, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 8291, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 8310, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 8344, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 8382, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 8409, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 8435, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 8459, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 8491, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 8527, 0x00001600 }, /* GL_EMISSION */ - { 8539, 0x00002000 }, /* GL_ENABLE_BIT */ - { 8553, 0x00000202 }, /* GL_EQUAL */ - { 8562, 0x00001509 }, /* GL_EQUIV */ - { 8571, 0x00010000 }, /* GL_EVAL_BIT */ - { 8583, 0x00000800 }, /* GL_EXP */ - { 8590, 0x00000801 }, /* GL_EXP2 */ - { 8598, 0x00001F03 }, /* GL_EXTENSIONS */ - { 8612, 0x00002400 }, /* GL_EYE_LINEAR */ - { 8626, 0x00002502 }, /* GL_EYE_PLANE */ - { 8639, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 8664, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 8681, 0x00000000 }, /* GL_FALSE */ - { 8690, 0x00001101 }, /* GL_FASTEST */ - { 8701, 0x00001C01 }, /* GL_FEEDBACK */ - { 8713, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 8740, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 8764, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 8788, 0x00001B02 }, /* GL_FILL */ - { 8796, 0x00001D00 }, /* GL_FLAT */ - { 8804, 0x00001406 }, /* GL_FLOAT */ - { 8813, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 8827, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 8845, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 8859, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 8877, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 8891, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 8909, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 8923, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 8941, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 8955, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 8973, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 8987, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 9005, 0x00000B60 }, /* GL_FOG */ - { 9012, 0x00000080 }, /* GL_FOG_BIT */ - { 9023, 0x00000B66 }, /* GL_FOG_COLOR */ - { 9036, 0x00008451 }, /* GL_FOG_COORD */ - { 9049, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 9067, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 9091, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 9130, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 9173, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 9205, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 9236, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 9265, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 9290, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 9309, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 9343, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 9370, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 9396, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 9420, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 9437, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 9452, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 9476, 0x00000B64 }, /* GL_FOG_END */ - { 9487, 0x00000C54 }, /* GL_FOG_HINT */ - { 9499, 0x00000B61 }, /* GL_FOG_INDEX */ - { 9512, 0x00000B65 }, /* GL_FOG_MODE */ - { 9524, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 9543, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 9568, 0x00000B63 }, /* GL_FOG_START */ - { 9581, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 9599, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 9623, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 9642, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 9665, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 9700, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 9742, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 9784, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 9833, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 9885, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 9929, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 9973, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 10000, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 10028, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 10047, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 10088, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 10129, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 10171, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 10222, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 10260, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 10309, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 10351, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 10383, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 10414, 0x00000404 }, /* GL_FRONT */ - { 10423, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 10441, 0x00000B46 }, /* GL_FRONT_FACE */ - { 10455, 0x00000400 }, /* GL_FRONT_LEFT */ - { 10469, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 10484, 0x00008006 }, /* GL_FUNC_ADD */ - { 10496, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 10512, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 10537, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 10566, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 10583, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 10604, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 10623, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 10647, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 10676, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 10700, 0x00000206 }, /* GL_GEQUAL */ - { 10710, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ - { 10735, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ - { 10763, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - { 10797, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ - { 10819, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - { 10847, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ - { 10884, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ - { 10903, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ - { 10922, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ - { 10941, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ - { 10960, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ - { 10979, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ - { 10998, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ - { 11022, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - { 11054, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ - { 11080, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 11114, 0x00008C46 }, /* GL_GL_SLUMINANCE */ - { 11131, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ - { 11149, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ - { 11174, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ - { 11197, 0x00008C40 }, /* GL_GL_SRGB */ - { 11208, 0x00008C41 }, /* GL_GL_SRGB8 */ - { 11220, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ - { 11239, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ - { 11256, 0x00000204 }, /* GL_GREATER */ - { 11267, 0x00001904 }, /* GL_GREEN */ - { 11276, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 11290, 0x00000D53 }, /* GL_GREEN_BITS */ - { 11304, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 11319, 0x00008000 }, /* GL_HINT_BIT */ - { 11331, 0x00008024 }, /* GL_HISTOGRAM */ - { 11344, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 11368, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 11396, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 11419, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 11446, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 11463, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 11483, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 11507, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 11531, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 11559, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 11587, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 11619, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 11641, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 11667, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 11685, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 11707, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 11726, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 11749, 0x0000862A }, /* GL_IDENTITY_NV */ - { 11764, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 11784, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 11824, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 11862, 0x00001E02 }, /* GL_INCR */ - { 11870, 0x00008507 }, /* GL_INCR_WRAP */ - { 11883, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 11900, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 11915, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 11945, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 11979, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 12002, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 12024, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 12044, 0x00000D51 }, /* GL_INDEX_BITS */ - { 12058, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 12079, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 12097, 0x00000C30 }, /* GL_INDEX_MODE */ - { 12111, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 12127, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 12142, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 12161, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 12180, 0x00001404 }, /* GL_INT */ - { 12187, 0x00008049 }, /* GL_INTENSITY */ - { 12200, 0x0000804C }, /* GL_INTENSITY12 */ - { 12215, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 12234, 0x0000804D }, /* GL_INTENSITY16 */ - { 12249, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 12268, 0x0000804A }, /* GL_INTENSITY4 */ - { 12282, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 12300, 0x0000804B }, /* GL_INTENSITY8 */ - { 12314, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 12332, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 12349, 0x00008575 }, /* GL_INTERPOLATE */ - { 12364, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 12383, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 12402, 0x00008B53 }, /* GL_INT_VEC2 */ - { 12414, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 12430, 0x00008B54 }, /* GL_INT_VEC3 */ - { 12442, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 12458, 0x00008B55 }, /* GL_INT_VEC4 */ - { 12470, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 12486, 0x00000500 }, /* GL_INVALID_ENUM */ - { 12502, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 12539, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 12560, 0x00000501 }, /* GL_INVALID_VALUE */ - { 12577, 0x0000862B }, /* GL_INVERSE_NV */ - { 12591, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 12615, 0x0000150A }, /* GL_INVERT */ - { 12625, 0x00001E00 }, /* GL_KEEP */ - { 12633, 0x00000406 }, /* GL_LEFT */ - { 12641, 0x00000203 }, /* GL_LEQUAL */ - { 12651, 0x00000201 }, /* GL_LESS */ - { 12659, 0x00004000 }, /* GL_LIGHT0 */ - { 12669, 0x00004001 }, /* GL_LIGHT1 */ - { 12679, 0x00004002 }, /* GL_LIGHT2 */ - { 12689, 0x00004003 }, /* GL_LIGHT3 */ - { 12699, 0x00004004 }, /* GL_LIGHT4 */ - { 12709, 0x00004005 }, /* GL_LIGHT5 */ - { 12719, 0x00004006 }, /* GL_LIGHT6 */ - { 12729, 0x00004007 }, /* GL_LIGHT7 */ - { 12739, 0x00000B50 }, /* GL_LIGHTING */ - { 12751, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 12767, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 12790, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 12819, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 12852, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 12880, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 12904, 0x00001B01 }, /* GL_LINE */ - { 12912, 0x00002601 }, /* GL_LINEAR */ - { 12922, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 12944, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 12974, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 13005, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 13029, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 13054, 0x00000001 }, /* GL_LINES */ - { 13063, 0x00000004 }, /* GL_LINE_BIT */ - { 13075, 0x00000002 }, /* GL_LINE_LOOP */ - { 13088, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 13108, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 13123, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 13143, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 13159, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 13183, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 13206, 0x00000003 }, /* GL_LINE_STRIP */ - { 13220, 0x00000702 }, /* GL_LINE_TOKEN */ - { 13234, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 13248, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 13274, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 13294, 0x00008B82 }, /* GL_LINK_STATUS */ - { 13309, 0x00000B32 }, /* GL_LIST_BASE */ - { 13322, 0x00020000 }, /* GL_LIST_BIT */ - { 13334, 0x00000B33 }, /* GL_LIST_INDEX */ - { 13348, 0x00000B30 }, /* GL_LIST_MODE */ - { 13361, 0x00000101 }, /* GL_LOAD */ - { 13369, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 13381, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 13398, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 13412, 0x00001909 }, /* GL_LUMINANCE */ - { 13425, 0x00008041 }, /* GL_LUMINANCE12 */ - { 13440, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 13463, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 13490, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 13512, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 13538, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 13557, 0x00008042 }, /* GL_LUMINANCE16 */ - { 13572, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 13595, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 13622, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 13641, 0x0000803F }, /* GL_LUMINANCE4 */ - { 13655, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 13676, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 13701, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 13719, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 13740, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 13765, 0x00008040 }, /* GL_LUMINANCE8 */ - { 13779, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 13800, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 13825, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 13843, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 13862, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 13878, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 13898, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 13920, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 13934, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 13949, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 13973, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 13997, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 14021, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 14045, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 14062, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 14079, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 14107, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 14136, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 14165, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 14194, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 14223, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 14252, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 14281, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 14309, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 14337, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 14365, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 14393, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 14421, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 14449, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 14477, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 14505, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 14533, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 14549, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 14569, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 14591, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 14605, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 14620, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 14644, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 14668, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 14692, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 14716, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 14733, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 14750, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 14778, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 14807, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 14836, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 14865, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 14894, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 14923, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 14952, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 14980, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 15008, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 15036, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 15064, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 15092, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 15120, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 15148, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 15176, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 15204, 0x00000D10 }, /* GL_MAP_COLOR */ - { 15217, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 15232, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 15247, 0x00008630 }, /* GL_MATRIX0_NV */ - { 15261, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 15277, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 15293, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 15309, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 15325, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 15341, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 15357, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 15373, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 15389, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 15405, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 15421, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 15436, 0x00008631 }, /* GL_MATRIX1_NV */ - { 15450, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 15466, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 15482, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 15498, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 15514, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 15530, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 15546, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 15562, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 15578, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 15594, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 15610, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 15625, 0x00008632 }, /* GL_MATRIX2_NV */ - { 15639, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 15655, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 15671, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 15686, 0x00008633 }, /* GL_MATRIX3_NV */ - { 15700, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 15715, 0x00008634 }, /* GL_MATRIX4_NV */ - { 15729, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 15744, 0x00008635 }, /* GL_MATRIX5_NV */ - { 15758, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 15773, 0x00008636 }, /* GL_MATRIX6_NV */ - { 15787, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 15802, 0x00008637 }, /* GL_MATRIX7_NV */ - { 15816, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 15831, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 15846, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 15872, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 15906, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 15937, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 15970, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 16001, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 16016, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 16038, 0x00008008 }, /* GL_MAX */ - { 16045, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 16068, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 16100, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 16126, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 16159, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 16185, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 16219, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 16238, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 16267, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 16299, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 16335, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 16371, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 16411, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 16437, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 16467, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 16492, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 16521, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 16550, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 16583, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 16603, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 16627, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 16651, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 16675, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 16700, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 16718, 0x00008008 }, /* GL_MAX_EXT */ - { 16729, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 16764, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 16803, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 16817, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 16837, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 16875, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 16904, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 16928, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 16956, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 16979, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 17016, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 17052, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 17079, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 17108, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 17142, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 17178, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 17205, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 17237, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 17273, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 17302, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 17331, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 17359, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 17397, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 17441, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 17484, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 17518, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 17557, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 17594, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 17632, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 17675, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 17718, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 17748, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 17779, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 17815, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 17851, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 17881, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 17915, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 17948, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 17977, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 17997, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 18021, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 18043, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 18069, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 18096, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 18127, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 18151, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 18185, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 18205, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 18232, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 18253, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 18278, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 18303, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 18338, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 18360, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 18386, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 18408, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 18434, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 18468, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 18506, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 18539, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 18576, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 18600, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 18621, 0x00008007 }, /* GL_MIN */ - { 18628, 0x0000802E }, /* GL_MINMAX */ - { 18638, 0x0000802E }, /* GL_MINMAX_EXT */ - { 18652, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 18669, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 18690, 0x00008030 }, /* GL_MINMAX_SINK */ - { 18705, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 18724, 0x00008007 }, /* GL_MIN_EXT */ - { 18735, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 18754, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 18777, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 18800, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 18820, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 18840, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 18870, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 18898, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 18926, 0x00001700 }, /* GL_MODELVIEW */ - { 18939, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 18957, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 18976, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 18995, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 19014, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 19033, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 19052, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 19071, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 19090, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 19109, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 19128, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 19147, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 19165, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 19184, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 19203, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 19222, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 19241, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 19260, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 19279, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 19298, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 19317, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 19336, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 19355, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 19373, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 19392, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 19411, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 19429, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 19447, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 19465, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 19483, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 19501, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 19519, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 19537, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 19557, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 19584, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 19609, 0x00002100 }, /* GL_MODULATE */ - { 19621, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 19641, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 19668, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 19693, 0x00000103 }, /* GL_MULT */ - { 19701, 0x0000809D }, /* GL_MULTISAMPLE */ - { 19716, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 19736, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 19755, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 19774, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 19798, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 19821, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 19851, 0x00002A25 }, /* GL_N3F_V3F */ - { 19862, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 19882, 0x0000150E }, /* GL_NAND */ - { 19890, 0x00002600 }, /* GL_NEAREST */ - { 19901, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 19932, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 19964, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 19989, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 20015, 0x00000200 }, /* GL_NEVER */ - { 20024, 0x00001102 }, /* GL_NICEST */ - { 20034, 0x00000000 }, /* GL_NONE */ - { 20042, 0x00001505 }, /* GL_NOOP */ - { 20050, 0x00001508 }, /* GL_NOR */ - { 20057, 0x00000BA1 }, /* GL_NORMALIZE */ - { 20070, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 20086, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 20117, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 20152, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 20176, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 20199, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 20220, 0x00008511 }, /* GL_NORMAL_MAP */ - { 20234, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 20252, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 20269, 0x00000205 }, /* GL_NOTEQUAL */ - { 20281, 0x00000000 }, /* GL_NO_ERROR */ - { 20293, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 20327, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 20365, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 20397, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 20439, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 20469, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 20509, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 20540, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 20569, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 20597, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 20627, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 20644, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 20670, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 20686, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 20721, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 20743, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 20762, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 20792, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 20813, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 20841, 0x00000001 }, /* GL_ONE */ - { 20848, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 20876, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 20908, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 20936, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 20968, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 20991, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 21014, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 21037, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 21060, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 21078, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 21100, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 21122, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 21138, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 21158, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 21178, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 21196, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 21218, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 21240, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 21256, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 21276, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 21296, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 21314, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 21336, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 21358, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 21374, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 21394, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 21414, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 21435, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 21454, 0x00001507 }, /* GL_OR */ - { 21460, 0x00000A01 }, /* GL_ORDER */ - { 21469, 0x0000150D }, /* GL_OR_INVERTED */ - { 21484, 0x0000150B }, /* GL_OR_REVERSE */ - { 21498, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 21515, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 21533, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 21554, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 21574, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 21592, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 21611, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 21631, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 21651, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 21669, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 21688, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 21713, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 21737, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 21758, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 21780, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 21802, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 21827, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 21851, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 21872, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 21894, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 21916, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 21938, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 21969, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 21989, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 22014, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 22034, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 22059, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 22079, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 22104, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 22124, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 22149, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 22169, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 22194, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 22214, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 22239, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 22259, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 22284, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 22304, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 22329, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 22349, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 22374, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 22394, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 22419, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 22437, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 22470, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 22495, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 22530, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 22557, 0x00001B00 }, /* GL_POINT */ - { 22566, 0x00000000 }, /* GL_POINTS */ - { 22576, 0x00000002 }, /* GL_POINT_BIT */ - { 22589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 22619, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 22653, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 22687, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 22722, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 22751, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 22784, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 22817, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 22851, 0x00000B11 }, /* GL_POINT_SIZE */ - { 22865, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 22891, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 22909, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 22931, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 22953, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 22976, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 22994, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 23016, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 23038, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 23061, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 23081, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 23097, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 23118, 0x00008861 }, /* GL_POINT_SPRITE */ - { 23134, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 23154, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 23183, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 23202, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 23228, 0x00000701 }, /* GL_POINT_TOKEN */ - { 23243, 0x00000009 }, /* GL_POLYGON */ - { 23254, 0x00000008 }, /* GL_POLYGON_BIT */ - { 23269, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 23285, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 23308, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 23333, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 23356, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 23379, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 23403, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 23427, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 23445, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 23468, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 23487, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 23510, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 23527, 0x00001203 }, /* GL_POSITION */ - { 23539, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 23571, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 23607, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 23640, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 23677, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 23708, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 23743, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 23775, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 23811, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 23844, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 23876, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 23912, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 23945, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 23982, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 24012, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 24046, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 24077, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 24112, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 24143, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 24178, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 24210, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 24246, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 24276, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 24310, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 24341, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 24376, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 24408, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 24439, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 24474, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 24506, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 24542, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 24571, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 24604, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 24634, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 24668, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 24707, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 24740, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 24780, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 24814, 0x00008578 }, /* GL_PREVIOUS */ - { 24826, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 24842, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 24858, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 24875, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 24896, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 24917, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 24950, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 24982, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 25005, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 25028, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 25058, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 25087, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 25115, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 25137, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 25165, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 25193, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 25215, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 25236, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 25276, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 25315, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 25345, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 25380, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 25413, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 25447, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 25486, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 25525, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 25547, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 25573, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 25597, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 25620, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 25642, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 25663, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 25684, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 25711, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 25743, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 25775, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 25810, 0x00001701 }, /* GL_PROJECTION */ - { 25824, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 25845, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 25871, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 25892, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 25911, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 25934, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25973, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 26011, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 26031, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 26061, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 26085, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 26105, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 26135, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 26159, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 26179, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 26212, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 26238, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 26268, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 26299, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 26329, 0x00002003 }, /* GL_Q */ - { 26334, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 26359, 0x00000007 }, /* GL_QUADS */ - { 26368, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 26385, 0x00000008 }, /* GL_QUAD_STRIP */ - { 26399, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 26421, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 26447, 0x00008866 }, /* GL_QUERY_RESULT */ - { 26463, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 26483, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 26509, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 26539, 0x00002002 }, /* GL_R */ - { 26544, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 26556, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 26589, 0x00000C02 }, /* GL_READ_BUFFER */ - { 26604, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 26636, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 26660, 0x000088B8 }, /* GL_READ_ONLY */ - { 26673, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 26690, 0x000088BA }, /* GL_READ_WRITE */ - { 26704, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 26722, 0x00001903 }, /* GL_RED */ - { 26729, 0x00008016 }, /* GL_REDUCE */ - { 26739, 0x00008016 }, /* GL_REDUCE_EXT */ - { 26753, 0x00000D15 }, /* GL_RED_BIAS */ - { 26765, 0x00000D52 }, /* GL_RED_BITS */ - { 26777, 0x00000D14 }, /* GL_RED_SCALE */ - { 26790, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 26808, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 26830, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 26851, 0x00001C00 }, /* GL_RENDER */ - { 26861, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 26889, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 26909, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 26936, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 26972, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 26998, 0x00001F01 }, /* GL_RENDERER */ - { 27010, 0x00000C40 }, /* GL_RENDER_MODE */ - { 27025, 0x00002901 }, /* GL_REPEAT */ - { 27035, 0x00001E01 }, /* GL_REPLACE */ - { 27046, 0x00008062 }, /* GL_REPLACE_EXT */ - { 27061, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 27084, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 27102, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 27124, 0x00000102 }, /* GL_RETURN */ - { 27134, 0x00001907 }, /* GL_RGB */ - { 27141, 0x00008052 }, /* GL_RGB10 */ - { 27150, 0x00008059 }, /* GL_RGB10_A2 */ - { 27162, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 27178, 0x00008052 }, /* GL_RGB10_EXT */ - { 27191, 0x00008053 }, /* GL_RGB12 */ - { 27200, 0x00008053 }, /* GL_RGB12_EXT */ - { 27213, 0x00008054 }, /* GL_RGB16 */ - { 27222, 0x00008054 }, /* GL_RGB16_EXT */ - { 27235, 0x0000804E }, /* GL_RGB2_EXT */ - { 27247, 0x0000804F }, /* GL_RGB4 */ - { 27255, 0x0000804F }, /* GL_RGB4_EXT */ - { 27267, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 27280, 0x00008050 }, /* GL_RGB5 */ - { 27288, 0x00008057 }, /* GL_RGB5_A1 */ - { 27299, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 27314, 0x00008050 }, /* GL_RGB5_EXT */ - { 27326, 0x00008051 }, /* GL_RGB8 */ - { 27334, 0x00008051 }, /* GL_RGB8_EXT */ - { 27346, 0x00001908 }, /* GL_RGBA */ - { 27354, 0x0000805A }, /* GL_RGBA12 */ - { 27364, 0x0000805A }, /* GL_RGBA12_EXT */ - { 27378, 0x0000805B }, /* GL_RGBA16 */ - { 27388, 0x0000805B }, /* GL_RGBA16_EXT */ - { 27402, 0x00008055 }, /* GL_RGBA2 */ - { 27411, 0x00008055 }, /* GL_RGBA2_EXT */ - { 27424, 0x00008056 }, /* GL_RGBA4 */ - { 27433, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 27452, 0x00008056 }, /* GL_RGBA4_EXT */ - { 27465, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 27479, 0x00008058 }, /* GL_RGBA8 */ - { 27488, 0x00008058 }, /* GL_RGBA8_EXT */ - { 27501, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 27519, 0x00000C31 }, /* GL_RGBA_MODE */ - { 27532, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 27545, 0x000083A0 }, /* GL_RGB_S3TC */ - { 27557, 0x00008573 }, /* GL_RGB_SCALE */ - { 27570, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 27587, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 27604, 0x00000407 }, /* GL_RIGHT */ - { 27613, 0x00002000 }, /* GL_S */ - { 27618, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 27632, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 27653, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 27667, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 27688, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 27702, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 27718, 0x000080A9 }, /* GL_SAMPLES */ - { 27729, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 27745, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 27760, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 27778, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 27800, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 27828, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 27860, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 27883, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 27910, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 27928, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 27951, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 27973, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 27992, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 28015, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 28041, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 28071, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 28096, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 28125, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 28140, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 28155, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 28171, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 28196, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 28236, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 28280, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 28313, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 28343, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 28375, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 28405, 0x00001C02 }, /* GL_SELECT */ - { 28415, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 28443, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 28468, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 28484, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 28511, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 28542, 0x0000150F }, /* GL_SET */ - { 28549, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 28570, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 28594, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 28609, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 28624, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 28652, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 28675, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 28705, 0x00001601 }, /* GL_SHININESS */ - { 28718, 0x00001402 }, /* GL_SHORT */ - { 28727, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 28743, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 28763, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 28782, 0x00001D01 }, /* GL_SMOOTH */ - { 28792, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 28825, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 28852, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 28885, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 28912, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 28929, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 28950, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 28971, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 28986, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 29005, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 29024, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 29041, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 29062, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 29083, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 29098, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 29117, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 29136, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 29153, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 29174, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 29195, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 29210, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 29229, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 29248, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 29268, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 29286, 0x00001202 }, /* GL_SPECULAR */ - { 29298, 0x00002402 }, /* GL_SPHERE_MAP */ - { 29312, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 29327, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 29345, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 29362, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 29376, 0x00008580 }, /* GL_SRC0_RGB */ - { 29388, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 29402, 0x00008581 }, /* GL_SRC1_RGB */ - { 29414, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 29428, 0x00008582 }, /* GL_SRC2_RGB */ - { 29440, 0x00000302 }, /* GL_SRC_ALPHA */ - { 29453, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 29475, 0x00000300 }, /* GL_SRC_COLOR */ - { 29488, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 29506, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 29525, 0x000088E6 }, /* GL_STATIC_COPY */ - { 29540, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 29559, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 29574, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 29593, 0x000088E5 }, /* GL_STATIC_READ */ - { 29608, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 29627, 0x00001802 }, /* GL_STENCIL */ - { 29638, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 29664, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 29685, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 29710, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 29731, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 29756, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 29788, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 29824, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 29856, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 29892, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 29912, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 29939, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 29965, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 29981, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 30003, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 30026, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 30042, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 30058, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 30075, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 30098, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 30120, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 30142, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 30164, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 30185, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 30212, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 30239, 0x00000B97 }, /* GL_STENCIL_REF */ - { 30254, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 30270, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 30299, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 30321, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 30342, 0x00000C33 }, /* GL_STEREO */ - { 30352, 0x000088E2 }, /* GL_STREAM_COPY */ - { 30367, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 30386, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 30401, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 30420, 0x000088E1 }, /* GL_STREAM_READ */ - { 30435, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 30454, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 30471, 0x000084E7 }, /* GL_SUBTRACT */ - { 30483, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 30499, 0x00002001 }, /* GL_T */ - { 30504, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 30519, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 30538, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 30554, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 30569, 0x00002A27 }, /* GL_T2F_V3F */ - { 30580, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 30599, 0x00002A28 }, /* GL_T4F_V4F */ - { 30610, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 30633, 0x00001702 }, /* GL_TEXTURE */ - { 30644, 0x000084C0 }, /* GL_TEXTURE0 */ - { 30656, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 30672, 0x000084C1 }, /* GL_TEXTURE1 */ - { 30684, 0x000084CA }, /* GL_TEXTURE10 */ - { 30697, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 30714, 0x000084CB }, /* GL_TEXTURE11 */ - { 30727, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 30744, 0x000084CC }, /* GL_TEXTURE12 */ - { 30757, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 30774, 0x000084CD }, /* GL_TEXTURE13 */ - { 30787, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 30804, 0x000084CE }, /* GL_TEXTURE14 */ - { 30817, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 30834, 0x000084CF }, /* GL_TEXTURE15 */ - { 30847, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 30864, 0x000084D0 }, /* GL_TEXTURE16 */ - { 30877, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 30894, 0x000084D1 }, /* GL_TEXTURE17 */ - { 30907, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 30924, 0x000084D2 }, /* GL_TEXTURE18 */ - { 30937, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 30954, 0x000084D3 }, /* GL_TEXTURE19 */ - { 30967, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 30984, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 31000, 0x000084C2 }, /* GL_TEXTURE2 */ - { 31012, 0x000084D4 }, /* GL_TEXTURE20 */ - { 31025, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 31042, 0x000084D5 }, /* GL_TEXTURE21 */ - { 31055, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 31072, 0x000084D6 }, /* GL_TEXTURE22 */ - { 31085, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 31102, 0x000084D7 }, /* GL_TEXTURE23 */ - { 31115, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 31132, 0x000084D8 }, /* GL_TEXTURE24 */ - { 31145, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 31162, 0x000084D9 }, /* GL_TEXTURE25 */ - { 31175, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 31192, 0x000084DA }, /* GL_TEXTURE26 */ - { 31205, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 31222, 0x000084DB }, /* GL_TEXTURE27 */ - { 31235, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 31252, 0x000084DC }, /* GL_TEXTURE28 */ - { 31265, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 31282, 0x000084DD }, /* GL_TEXTURE29 */ - { 31295, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 31312, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 31328, 0x000084C3 }, /* GL_TEXTURE3 */ - { 31340, 0x000084DE }, /* GL_TEXTURE30 */ - { 31353, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 31370, 0x000084DF }, /* GL_TEXTURE31 */ - { 31383, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 31400, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 31416, 0x000084C4 }, /* GL_TEXTURE4 */ - { 31428, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 31444, 0x000084C5 }, /* GL_TEXTURE5 */ - { 31456, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 31472, 0x000084C6 }, /* GL_TEXTURE6 */ - { 31484, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 31500, 0x000084C7 }, /* GL_TEXTURE7 */ - { 31512, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 31528, 0x000084C8 }, /* GL_TEXTURE8 */ - { 31540, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 31556, 0x000084C9 }, /* GL_TEXTURE9 */ - { 31568, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 31584, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 31598, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 31622, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 31636, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 31660, 0x0000806F }, /* GL_TEXTURE_3D */ - { 31674, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 31696, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 31722, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 31744, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 31766, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 31798, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 31820, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 31852, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 31874, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 31902, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 31934, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 31967, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 31999, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 32014, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 32035, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 32060, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 32078, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 32102, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 32133, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 32163, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 32193, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 32228, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 32259, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 32297, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 32324, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 32356, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 32390, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 32414, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 32442, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 32466, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 32494, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 32527, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 32551, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 32573, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 32595, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 32621, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 32655, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 32688, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 32725, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 32753, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 32785, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 32808, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 32846, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 32888, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 32919, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 32947, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 32977, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 33005, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 33025, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 33049, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 33080, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 33115, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 33146, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 33181, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 33212, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 33247, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 33278, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 33313, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 33344, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 33379, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 33410, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 33445, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 33462, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 33484, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 33510, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 33525, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 33546, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 33566, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 33592, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 33612, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 33629, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 33646, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 33663, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 33680, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 33705, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 33727, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 33753, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 33771, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 33797, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 33823, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 33853, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 33880, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 33905, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 33925, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 33949, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 33976, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 34003, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 34030, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 34056, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 34086, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 34108, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 34126, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 34156, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 34184, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 34212, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 34240, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 34261, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 34280, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 34302, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 34321, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 34341, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 34366, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 34390, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 34410, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 34434, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 34454, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 34477, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 34502, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 34536, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 34553, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 34571, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 34589, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 34607, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 34627, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 34646, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 34675, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 34692, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 34718, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 34748, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 34780, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 34810, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 34844, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 34860, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 34891, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 34926, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 34954, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 34986, 0x00000004 }, /* GL_TRIANGLES */ - { 34999, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 35015, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 35036, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 35054, 0x00000001 }, /* GL_TRUE */ - { 35062, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 35082, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 35105, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 35125, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 35146, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 35168, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 35190, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 35210, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 35231, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 35248, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 35275, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 35298, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 35314, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 35341, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 35365, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 35396, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 35420, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 35448, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 35466, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 35496, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 35522, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 35552, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 35578, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 35602, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 35630, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 35658, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 35685, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 35717, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 35748, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 35762, 0x00002A20 }, /* GL_V2F */ - { 35769, 0x00002A21 }, /* GL_V3F */ - { 35776, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 35795, 0x00001F00 }, /* GL_VENDOR */ - { 35805, 0x00001F02 }, /* GL_VERSION */ - { 35816, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 35832, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 35862, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 35893, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 35928, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 35952, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 35973, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 35996, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 36017, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 36044, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 36072, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 36100, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 36128, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 36156, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 36184, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 36212, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 36239, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 36266, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 36293, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 36320, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 36347, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 36374, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 36401, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 36428, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 36455, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 36493, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 36535, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 36566, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 36601, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 36635, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 36673, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 36704, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 36739, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 36767, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 36799, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 36829, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 36863, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 36891, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 36923, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 36943, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 36965, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 36994, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 37015, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 37044, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 37077, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 37109, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 37136, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 37167, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 37197, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 37214, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 37235, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 37262, 0x00000BA2 }, /* GL_VIEWPORT */ - { 37274, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 37290, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 37310, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 37341, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 37376, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 37404, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 37429, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 37456, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 37481, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 37505, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 37524, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 37538, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 37556, 0x00001506 }, /* GL_XOR */ - { 37563, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 37582, 0x00008757 }, /* GL_YCBCR_MESA */ - { 37596, 0x00000000 }, /* GL_ZERO */ - { 37604, 0x00000D16 }, /* GL_ZOOM_X */ - { 37614, 0x00000D17 }, /* GL_ZOOM_Y */ + { 2476, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */ + { 2497, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ + { 2522, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */ + { 2543, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */ + { 2565, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ + { 2591, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */ + { 2613, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ + { 2639, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */ + { 2661, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ + { 2687, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */ + { 2709, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ + { 2735, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */ + { 2757, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ + { 2783, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */ + { 2805, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ + { 2831, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ + { 2856, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */ + { 2877, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ + { 2902, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */ + { 2923, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ + { 2948, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */ + { 2969, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ + { 2994, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */ + { 3015, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ + { 3040, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */ + { 3061, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ + { 3086, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */ + { 3107, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ + { 3132, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */ + { 3153, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ + { 3178, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */ + { 3199, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ + { 3224, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ + { 3244, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ + { 3265, 0x00001900 }, /* GL_COLOR_INDEX */ + { 3280, 0x00001603 }, /* GL_COLOR_INDEXES */ + { 3297, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ + { 3315, 0x00000B57 }, /* GL_COLOR_MATERIAL */ + { 3333, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ + { 3356, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ + { 3384, 0x000080B1 }, /* GL_COLOR_MATRIX */ + { 3400, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ + { 3420, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ + { 3448, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 3480, 0x00008458 }, /* GL_COLOR_SUM */ + { 3493, 0x00008458 }, /* GL_COLOR_SUM_ARB */ + { 3510, 0x000080D0 }, /* GL_COLOR_TABLE */ + { 3525, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ + { 3551, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ + { 3581, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ + { 3611, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ + { 3631, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ + { 3655, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ + { 3680, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ + { 3709, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ + { 3738, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ + { 3760, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ + { 3786, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ + { 3812, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ + { 3838, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ + { 3868, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ + { 3898, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + { 3928, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ + { 3962, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ + { 3996, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + { 4026, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ + { 4060, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ + { 4094, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ + { 4118, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ + { 4146, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ + { 4174, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ + { 4195, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ + { 4220, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ + { 4241, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ + { 4266, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ + { 4291, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ + { 4310, 0x00008570 }, /* GL_COMBINE */ + { 4321, 0x00008503 }, /* GL_COMBINE4 */ + { 4333, 0x00008572 }, /* GL_COMBINE_ALPHA */ + { 4350, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ + { 4371, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ + { 4392, 0x00008570 }, /* GL_COMBINE_ARB */ + { 4407, 0x00008570 }, /* GL_COMBINE_EXT */ + { 4422, 0x00008571 }, /* GL_COMBINE_RGB */ + { 4437, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ + { 4456, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ + { 4475, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ + { 4511, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ + { 4535, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ + { 4563, 0x00001300 }, /* GL_COMPILE */ + { 4574, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ + { 4597, 0x00008B81 }, /* GL_COMPILE_STATUS */ + { 4615, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ + { 4635, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ + { 4659, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ + { 4683, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ + { 4711, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ + { 4735, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + { 4765, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ + { 4799, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ + { 4827, 0x000084ED }, /* GL_COMPRESSED_RGB */ + { 4845, 0x000084EE }, /* GL_COMPRESSED_RGBA */ + { 4864, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ + { 4887, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + { 4916, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + { 4949, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + { 4982, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + { 5015, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ + { 5037, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + { 5065, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + { 5097, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ + { 5127, 0x00008576 }, /* GL_CONSTANT */ + { 5139, 0x00008003 }, /* GL_CONSTANT_ALPHA */ + { 5157, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ + { 5179, 0x00008576 }, /* GL_CONSTANT_ARB */ + { 5195, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ + { 5219, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ + { 5241, 0x00008001 }, /* GL_CONSTANT_COLOR */ + { 5259, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ + { 5281, 0x00008576 }, /* GL_CONSTANT_EXT */ + { 5297, 0x00008010 }, /* GL_CONVOLUTION_1D */ + { 5315, 0x00008011 }, /* GL_CONVOLUTION_2D */ + { 5333, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ + { 5361, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ + { 5392, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ + { 5419, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ + { 5450, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ + { 5477, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ + { 5508, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ + { 5536, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ + { 5568, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ + { 5590, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ + { 5616, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ + { 5638, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ + { 5664, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ + { 5685, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ + { 5710, 0x00008862 }, /* GL_COORD_REPLACE */ + { 5727, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ + { 5748, 0x00008862 }, /* GL_COORD_REPLACE_NV */ + { 5768, 0x00001503 }, /* GL_COPY */ + { 5776, 0x0000150C }, /* GL_COPY_INVERTED */ + { 5793, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ + { 5813, 0x00000B44 }, /* GL_CULL_FACE */ + { 5826, 0x00000B45 }, /* GL_CULL_FACE_MODE */ + { 5844, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ + { 5863, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + { 5895, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + { 5930, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ + { 5951, 0x00000001 }, /* GL_CURRENT_BIT */ + { 5966, 0x00000B00 }, /* GL_CURRENT_COLOR */ + { 5983, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ + { 6004, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ + { 6030, 0x00000B01 }, /* GL_CURRENT_INDEX */ + { 6047, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ + { 6069, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ + { 6097, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ + { 6118, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + { 6152, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ + { 6185, 0x00000B02 }, /* GL_CURRENT_NORMAL */ + { 6203, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + { 6233, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ + { 6252, 0x00008865 }, /* GL_CURRENT_QUERY */ + { 6269, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ + { 6290, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ + { 6314, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ + { 6341, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ + { 6365, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ + { 6392, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ + { 6425, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + { 6458, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ + { 6485, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ + { 6511, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ + { 6536, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ + { 6565, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ + { 6587, 0x00000900 }, /* GL_CW */ + { 6593, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ + { 6614, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ + { 6635, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ + { 6655, 0x00002101 }, /* GL_DECAL */ + { 6664, 0x00001E03 }, /* GL_DECR */ + { 6672, 0x00008508 }, /* GL_DECR_WRAP */ + { 6685, 0x00008508 }, /* GL_DECR_WRAP_EXT */ + { 6702, 0x00008B80 }, /* GL_DELETE_STATUS */ + { 6719, 0x00001801 }, /* GL_DEPTH */ + { 6728, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ + { 6748, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ + { 6768, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 6792, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 6806, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 6820, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 6840, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 6865, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 6885, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 6903, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 6924, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 6943, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 6964, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 6989, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 7015, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 7036, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 7061, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 7087, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 7108, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 7133, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 7159, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 7173, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 7188, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 7203, 0x000084F9 }, /* GL_DEPTH_STENCIL */ + { 7220, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ + { 7248, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 7268, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 7296, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 7324, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 7338, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 7360, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 7386, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 7405, 0x00001201 }, /* GL_DIFFUSE */ + { 7416, 0x00000BD0 }, /* GL_DITHER */ + { 7426, 0x00000A02 }, /* GL_DOMAIN */ + { 7436, 0x00001100 }, /* GL_DONT_CARE */ + { 7449, 0x000086AE }, /* GL_DOT3_RGB */ + { 7461, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7474, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7491, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 7508, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 7524, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 7540, 0x0000140A }, /* GL_DOUBLE */ + { 7550, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 7566, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 7581, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 7597, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 7617, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 7637, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 7653, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 7670, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 7691, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 7712, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 7729, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 7750, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 7771, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 7788, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 7809, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 7830, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 7847, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 7868, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 7889, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 7906, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 7927, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 7948, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 7965, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 7986, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 8007, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 8027, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 8047, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 8063, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 8083, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 8103, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 8119, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 8139, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 8159, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 8175, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 8195, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 8215, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 8231, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 8251, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 8271, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 8287, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 8307, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 8327, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 8343, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 8363, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 8383, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 8399, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8419, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8439, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8455, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8475, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8495, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ + { 8515, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 8547, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 8571, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 8591, 0x00000304 }, /* GL_DST_ALPHA */ + { 8604, 0x00000306 }, /* GL_DST_COLOR */ + { 8617, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 8633, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 8653, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 8669, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 8689, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 8705, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 8725, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 8738, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 8757, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 8791, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 8829, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 8856, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 8882, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 8906, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 8938, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 8974, 0x00001600 }, /* GL_EMISSION */ + { 8986, 0x00002000 }, /* GL_ENABLE_BIT */ + { 9000, 0x00000202 }, /* GL_EQUAL */ + { 9009, 0x00001509 }, /* GL_EQUIV */ + { 9018, 0x00010000 }, /* GL_EVAL_BIT */ + { 9030, 0x00000800 }, /* GL_EXP */ + { 9037, 0x00000801 }, /* GL_EXP2 */ + { 9045, 0x00001F03 }, /* GL_EXTENSIONS */ + { 9059, 0x00002400 }, /* GL_EYE_LINEAR */ + { 9073, 0x00002502 }, /* GL_EYE_PLANE */ + { 9086, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 9111, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 9128, 0x00000000 }, /* GL_FALSE */ + { 9137, 0x00001101 }, /* GL_FASTEST */ + { 9148, 0x00001C01 }, /* GL_FEEDBACK */ + { 9160, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 9187, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 9211, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 9235, 0x00001B02 }, /* GL_FILL */ + { 9243, 0x00001D00 }, /* GL_FLAT */ + { 9251, 0x00001406 }, /* GL_FLOAT */ + { 9260, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9274, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9292, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9306, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9324, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 9338, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 9356, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 9370, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 9388, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 9402, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 9420, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 9434, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 9452, 0x00000B60 }, /* GL_FOG */ + { 9459, 0x00000080 }, /* GL_FOG_BIT */ + { 9470, 0x00000B66 }, /* GL_FOG_COLOR */ + { 9483, 0x00008451 }, /* GL_FOG_COORD */ + { 9496, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 9514, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 9538, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 9577, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 9620, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 9652, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 9683, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 9712, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 9737, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 9756, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 9790, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 9817, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 9843, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 9867, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 9884, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 9899, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 9923, 0x00000B64 }, /* GL_FOG_END */ + { 9934, 0x00000C54 }, /* GL_FOG_HINT */ + { 9946, 0x00000B61 }, /* GL_FOG_INDEX */ + { 9959, 0x00000B65 }, /* GL_FOG_MODE */ + { 9971, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 9990, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10015, 0x00000B63 }, /* GL_FOG_START */ + { 10028, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10046, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10070, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10089, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10112, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10147, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10162, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10199, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10235, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 10276, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 10317, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 10354, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 10391, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 10429, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 10471, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 10509, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 10551, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 10586, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 10625, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 10674, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 10722, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 10774, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 10814, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 10858, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 10898, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 10942, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 10969, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 10993, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11021, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11044, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11063, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11100, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11141, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11182, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 11224, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 11275, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 11313, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 11358, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 11407, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 11445, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 11487, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 11519, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 11544, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 11571, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 11602, 0x00000404 }, /* GL_FRONT */ + { 11611, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 11629, 0x00000B46 }, /* GL_FRONT_FACE */ + { 11643, 0x00000400 }, /* GL_FRONT_LEFT */ + { 11657, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 11672, 0x00008006 }, /* GL_FUNC_ADD */ + { 11684, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 11700, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 11725, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 11754, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 11771, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 11792, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 11811, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 11835, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 11864, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 11888, 0x00000206 }, /* GL_GEQUAL */ + { 11898, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ + { 11923, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ + { 11951, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + { 11985, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ + { 12007, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + { 12035, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + { 12072, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ + { 12091, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ + { 12110, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ + { 12129, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ + { 12148, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ + { 12167, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ + { 12186, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ + { 12210, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + { 12242, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ + { 12268, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 12302, 0x00008C46 }, /* GL_GL_SLUMINANCE */ + { 12319, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ + { 12337, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ + { 12362, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ + { 12385, 0x00008C40 }, /* GL_GL_SRGB */ + { 12396, 0x00008C41 }, /* GL_GL_SRGB8 */ + { 12408, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ + { 12427, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ + { 12444, 0x00000204 }, /* GL_GREATER */ + { 12455, 0x00001904 }, /* GL_GREEN */ + { 12464, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12478, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12492, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12507, 0x00008000 }, /* GL_HINT_BIT */ + { 12519, 0x00008024 }, /* GL_HISTOGRAM */ + { 12532, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12556, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12584, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12607, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12634, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12651, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12671, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 12695, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 12719, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 12747, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 12775, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 12807, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 12829, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 12855, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 12873, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 12895, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 12914, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 12937, 0x0000862A }, /* GL_IDENTITY_NV */ + { 12952, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 12972, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13012, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13050, 0x00001E02 }, /* GL_INCR */ + { 13058, 0x00008507 }, /* GL_INCR_WRAP */ + { 13071, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13088, 0x00008222 }, /* GL_INDEX */ + { 13097, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13112, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13142, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13176, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13199, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13221, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13241, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13255, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13276, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13294, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13308, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13324, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13339, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13358, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13377, 0x00001404 }, /* GL_INT */ + { 13384, 0x00008049 }, /* GL_INTENSITY */ + { 13397, 0x0000804C }, /* GL_INTENSITY12 */ + { 13412, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13431, 0x0000804D }, /* GL_INTENSITY16 */ + { 13446, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13465, 0x0000804A }, /* GL_INTENSITY4 */ + { 13479, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13497, 0x0000804B }, /* GL_INTENSITY8 */ + { 13511, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13529, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13546, 0x00008575 }, /* GL_INTERPOLATE */ + { 13561, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13580, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13599, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13611, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13627, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13639, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13655, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13667, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 13683, 0x00000500 }, /* GL_INVALID_ENUM */ + { 13699, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 13732, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 13769, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 13790, 0x00000501 }, /* GL_INVALID_VALUE */ + { 13807, 0x0000862B }, /* GL_INVERSE_NV */ + { 13821, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 13845, 0x0000150A }, /* GL_INVERT */ + { 13855, 0x00001E00 }, /* GL_KEEP */ + { 13863, 0x00000406 }, /* GL_LEFT */ + { 13871, 0x00000203 }, /* GL_LEQUAL */ + { 13881, 0x00000201 }, /* GL_LESS */ + { 13889, 0x00004000 }, /* GL_LIGHT0 */ + { 13899, 0x00004001 }, /* GL_LIGHT1 */ + { 13909, 0x00004002 }, /* GL_LIGHT2 */ + { 13919, 0x00004003 }, /* GL_LIGHT3 */ + { 13929, 0x00004004 }, /* GL_LIGHT4 */ + { 13939, 0x00004005 }, /* GL_LIGHT5 */ + { 13949, 0x00004006 }, /* GL_LIGHT6 */ + { 13959, 0x00004007 }, /* GL_LIGHT7 */ + { 13969, 0x00000B50 }, /* GL_LIGHTING */ + { 13981, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 13997, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14020, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14049, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14082, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14110, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14134, 0x00001B01 }, /* GL_LINE */ + { 14142, 0x00002601 }, /* GL_LINEAR */ + { 14152, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14174, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14204, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14235, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14259, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14284, 0x00000001 }, /* GL_LINES */ + { 14293, 0x00000004 }, /* GL_LINE_BIT */ + { 14305, 0x00000002 }, /* GL_LINE_LOOP */ + { 14318, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14338, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14353, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14373, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14389, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14413, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14436, 0x00000003 }, /* GL_LINE_STRIP */ + { 14450, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14464, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14478, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14504, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14524, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14539, 0x00000B32 }, /* GL_LIST_BASE */ + { 14552, 0x00020000 }, /* GL_LIST_BIT */ + { 14564, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14578, 0x00000B30 }, /* GL_LIST_MODE */ + { 14591, 0x00000101 }, /* GL_LOAD */ + { 14599, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14611, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 14628, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 14642, 0x00001909 }, /* GL_LUMINANCE */ + { 14655, 0x00008041 }, /* GL_LUMINANCE12 */ + { 14670, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 14693, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 14720, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 14742, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 14768, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 14787, 0x00008042 }, /* GL_LUMINANCE16 */ + { 14802, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 14825, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 14852, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 14871, 0x0000803F }, /* GL_LUMINANCE4 */ + { 14885, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 14906, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 14931, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 14949, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 14970, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 14995, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15009, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15030, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15055, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15073, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15092, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15108, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15128, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15150, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15164, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15179, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15203, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15227, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15251, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15275, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15292, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15309, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15337, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15366, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15395, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15424, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15453, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15482, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15511, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15539, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15567, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15595, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15623, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 15651, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 15679, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 15707, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 15735, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 15763, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 15779, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 15799, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 15821, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 15835, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 15850, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 15874, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 15898, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 15922, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 15946, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 15963, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 15980, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16008, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16037, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16066, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16095, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16124, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16153, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16182, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16210, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16238, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16266, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16294, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16322, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16350, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16378, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16406, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16434, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16447, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16462, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16477, 0x00008630 }, /* GL_MATRIX0_NV */ + { 16491, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 16507, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 16523, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 16539, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 16555, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 16571, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 16587, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 16603, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 16619, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 16635, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 16651, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 16666, 0x00008631 }, /* GL_MATRIX1_NV */ + { 16680, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 16696, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 16712, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 16728, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 16744, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 16760, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 16776, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 16792, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 16808, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 16824, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 16840, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 16855, 0x00008632 }, /* GL_MATRIX2_NV */ + { 16869, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 16885, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 16901, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 16916, 0x00008633 }, /* GL_MATRIX3_NV */ + { 16930, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 16945, 0x00008634 }, /* GL_MATRIX4_NV */ + { 16959, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 16974, 0x00008635 }, /* GL_MATRIX5_NV */ + { 16988, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17003, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17017, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17032, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17046, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17061, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17076, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17102, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17136, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17167, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17200, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17231, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17246, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17268, 0x00008008 }, /* GL_MAX */ + { 17275, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17298, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17330, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17356, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17389, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17415, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17449, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17468, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 17497, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 17529, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 17565, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 17601, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 17641, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 17667, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 17697, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 17722, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 17751, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 17780, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 17813, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 17833, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 17857, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 17881, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 17905, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 17930, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 17948, 0x00008008 }, /* GL_MAX_EXT */ + { 17959, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 17994, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18033, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18047, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18067, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18105, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18134, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18158, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18186, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18209, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18246, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18282, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18309, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18338, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18372, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18408, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18435, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 18467, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 18503, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 18532, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 18561, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 18589, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 18627, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 18671, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 18714, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 18748, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 18787, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 18824, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 18862, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 18905, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 18948, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 18978, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19009, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19045, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19081, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19111, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19145, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19178, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19207, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19222, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19242, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19266, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19288, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19314, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19341, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19372, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 19396, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 19430, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 19450, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 19477, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 19498, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 19523, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 19548, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 19583, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 19605, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 19631, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 19653, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 19679, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 19713, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 19751, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 19784, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 19821, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 19845, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 19866, 0x00008007 }, /* GL_MIN */ + { 19873, 0x0000802E }, /* GL_MINMAX */ + { 19883, 0x0000802E }, /* GL_MINMAX_EXT */ + { 19897, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 19914, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 19935, 0x00008030 }, /* GL_MINMAX_SINK */ + { 19950, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 19969, 0x00008007 }, /* GL_MIN_EXT */ + { 19980, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 19999, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20022, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20045, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20065, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20085, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20115, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20143, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20171, 0x00001700 }, /* GL_MODELVIEW */ + { 20184, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20202, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20221, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20240, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20259, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20278, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20297, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20316, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20335, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20354, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20373, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 20392, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 20410, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 20429, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 20448, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 20467, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 20486, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 20505, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 20524, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 20543, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 20562, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 20581, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 20600, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 20618, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 20637, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 20656, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 20674, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 20692, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 20710, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 20728, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 20746, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 20764, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 20782, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 20802, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 20829, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 20854, 0x00002100 }, /* GL_MODULATE */ + { 20866, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 20886, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 20913, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 20938, 0x00000103 }, /* GL_MULT */ + { 20946, 0x0000809D }, /* GL_MULTISAMPLE */ + { 20961, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 20981, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21000, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21019, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21043, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21066, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21096, 0x00002A25 }, /* GL_N3F_V3F */ + { 21107, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21127, 0x0000150E }, /* GL_NAND */ + { 21135, 0x00002600 }, /* GL_NEAREST */ + { 21146, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21177, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21209, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21234, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21260, 0x00000200 }, /* GL_NEVER */ + { 21269, 0x00001102 }, /* GL_NICEST */ + { 21279, 0x00000000 }, /* GL_NONE */ + { 21287, 0x00001505 }, /* GL_NOOP */ + { 21295, 0x00001508 }, /* GL_NOR */ + { 21302, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21315, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21331, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21362, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 21397, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 21421, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 21444, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 21465, 0x00008511 }, /* GL_NORMAL_MAP */ + { 21479, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 21497, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 21514, 0x00000205 }, /* GL_NOTEQUAL */ + { 21526, 0x00000000 }, /* GL_NO_ERROR */ + { 21538, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 21572, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 21610, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 21642, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 21684, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 21714, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 21754, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 21785, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 21814, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 21842, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 21872, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 21889, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 21915, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 21931, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 21966, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 21988, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22007, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22037, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22058, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22086, 0x00000001 }, /* GL_ONE */ + { 22093, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22121, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22153, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22181, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22213, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22236, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22259, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22282, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22305, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22323, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22345, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22367, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 22383, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 22403, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 22423, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 22441, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 22463, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 22485, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 22501, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 22521, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 22541, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 22559, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 22581, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 22603, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 22619, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 22639, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 22659, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 22680, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 22699, 0x00001507 }, /* GL_OR */ + { 22705, 0x00000A01 }, /* GL_ORDER */ + { 22714, 0x0000150D }, /* GL_OR_INVERTED */ + { 22729, 0x0000150B }, /* GL_OR_REVERSE */ + { 22743, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 22760, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 22778, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 22799, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 22819, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 22837, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 22856, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 22876, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 22896, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 22914, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 22933, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 22958, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 22982, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23003, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23025, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23047, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23072, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23096, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23117, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23139, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23161, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23183, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23214, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23234, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23259, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23279, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23304, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23324, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23349, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23369, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 23394, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 23414, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 23439, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 23459, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 23484, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 23504, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 23529, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 23549, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 23574, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 23594, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 23619, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 23639, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 23664, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 23682, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 23715, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 23740, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 23775, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 23802, 0x00001B00 }, /* GL_POINT */ + { 23811, 0x00000000 }, /* GL_POINTS */ + { 23821, 0x00000002 }, /* GL_POINT_BIT */ + { 23834, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 23864, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 23898, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 23932, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 23967, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 23996, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24029, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24062, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24096, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24110, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24136, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24154, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24176, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24198, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24221, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24239, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24261, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 24283, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 24306, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 24326, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 24342, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 24363, 0x00008861 }, /* GL_POINT_SPRITE */ + { 24379, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 24399, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 24428, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 24447, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 24473, 0x00000701 }, /* GL_POINT_TOKEN */ + { 24488, 0x00000009 }, /* GL_POLYGON */ + { 24499, 0x00000008 }, /* GL_POLYGON_BIT */ + { 24514, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 24530, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 24553, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 24578, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 24601, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 24624, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 24648, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 24672, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 24690, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 24713, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 24732, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 24755, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 24772, 0x00001203 }, /* GL_POSITION */ + { 24784, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 24816, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 24852, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 24885, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 24922, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 24953, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 24988, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25020, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25056, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25089, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25121, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25157, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25190, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25227, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25257, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 25291, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 25322, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 25357, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 25388, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 25423, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 25455, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 25491, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 25521, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 25555, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 25586, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 25621, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 25653, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 25684, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 25719, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 25751, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 25787, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 25816, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 25849, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 25879, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 25913, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 25952, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 25985, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26025, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26059, 0x00008578 }, /* GL_PREVIOUS */ + { 26071, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26087, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26103, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26120, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26141, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26162, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26195, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26227, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26250, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 26273, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 26303, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 26332, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 26360, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 26382, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 26410, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 26438, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 26460, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 26481, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 26521, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 26560, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 26590, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 26625, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 26658, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 26692, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 26731, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 26770, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 26792, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 26818, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 26842, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 26865, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 26887, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 26908, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 26929, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 26956, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 26988, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27020, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27055, 0x00001701 }, /* GL_PROJECTION */ + { 27069, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27090, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27116, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27137, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27156, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27179, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27218, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 27256, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 27276, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 27306, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 27330, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 27350, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 27380, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 27404, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 27424, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 27457, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 27483, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 27513, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 27544, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 27574, 0x00002003 }, /* GL_Q */ + { 27579, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 27604, 0x00000007 }, /* GL_QUADS */ + { 27613, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 27630, 0x00000008 }, /* GL_QUAD_STRIP */ + { 27644, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 27666, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 27692, 0x00008866 }, /* GL_QUERY_RESULT */ + { 27708, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 27728, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 27754, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 27784, 0x00002002 }, /* GL_R */ + { 27789, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 27801, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 27834, 0x00000C02 }, /* GL_READ_BUFFER */ + { 27849, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 27869, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 27901, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 27925, 0x000088B8 }, /* GL_READ_ONLY */ + { 27938, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 27955, 0x000088BA }, /* GL_READ_WRITE */ + { 27969, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 27987, 0x00001903 }, /* GL_RED */ + { 27994, 0x00008016 }, /* GL_REDUCE */ + { 28004, 0x00008016 }, /* GL_REDUCE_EXT */ + { 28018, 0x00000D15 }, /* GL_RED_BIAS */ + { 28030, 0x00000D52 }, /* GL_RED_BITS */ + { 28042, 0x00000D14 }, /* GL_RED_SCALE */ + { 28055, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 28073, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 28095, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 28116, 0x00001C00 }, /* GL_RENDER */ + { 28126, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 28142, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 28169, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 28197, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 28223, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 28250, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 28270, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 28297, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 28320, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 28347, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 28379, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 28415, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 28440, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 28464, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 28493, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 28515, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 28541, 0x00001F01 }, /* GL_RENDERER */ + { 28553, 0x00000C40 }, /* GL_RENDER_MODE */ + { 28568, 0x00002901 }, /* GL_REPEAT */ + { 28578, 0x00001E01 }, /* GL_REPLACE */ + { 28589, 0x00008062 }, /* GL_REPLACE_EXT */ + { 28604, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 28627, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 28645, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 28667, 0x00000102 }, /* GL_RETURN */ + { 28677, 0x00001907 }, /* GL_RGB */ + { 28684, 0x00008052 }, /* GL_RGB10 */ + { 28693, 0x00008059 }, /* GL_RGB10_A2 */ + { 28705, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 28721, 0x00008052 }, /* GL_RGB10_EXT */ + { 28734, 0x00008053 }, /* GL_RGB12 */ + { 28743, 0x00008053 }, /* GL_RGB12_EXT */ + { 28756, 0x00008054 }, /* GL_RGB16 */ + { 28765, 0x00008054 }, /* GL_RGB16_EXT */ + { 28778, 0x0000804E }, /* GL_RGB2_EXT */ + { 28790, 0x0000804F }, /* GL_RGB4 */ + { 28798, 0x0000804F }, /* GL_RGB4_EXT */ + { 28810, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 28823, 0x00008050 }, /* GL_RGB5 */ + { 28831, 0x00008057 }, /* GL_RGB5_A1 */ + { 28842, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 28857, 0x00008050 }, /* GL_RGB5_EXT */ + { 28869, 0x00008051 }, /* GL_RGB8 */ + { 28877, 0x00008051 }, /* GL_RGB8_EXT */ + { 28889, 0x00001908 }, /* GL_RGBA */ + { 28897, 0x0000805A }, /* GL_RGBA12 */ + { 28907, 0x0000805A }, /* GL_RGBA12_EXT */ + { 28921, 0x0000805B }, /* GL_RGBA16 */ + { 28931, 0x0000805B }, /* GL_RGBA16_EXT */ + { 28945, 0x00008055 }, /* GL_RGBA2 */ + { 28954, 0x00008055 }, /* GL_RGBA2_EXT */ + { 28967, 0x00008056 }, /* GL_RGBA4 */ + { 28976, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 28995, 0x00008056 }, /* GL_RGBA4_EXT */ + { 29008, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 29022, 0x00008058 }, /* GL_RGBA8 */ + { 29031, 0x00008058 }, /* GL_RGBA8_EXT */ + { 29044, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 29062, 0x00000C31 }, /* GL_RGBA_MODE */ + { 29075, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 29088, 0x000083A0 }, /* GL_RGB_S3TC */ + { 29100, 0x00008573 }, /* GL_RGB_SCALE */ + { 29113, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 29130, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 29147, 0x00000407 }, /* GL_RIGHT */ + { 29156, 0x00002000 }, /* GL_S */ + { 29161, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 29175, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 29196, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 29210, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 29231, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 29245, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 29261, 0x000080A9 }, /* GL_SAMPLES */ + { 29272, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 29288, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 29303, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 29321, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 29343, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 29371, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 29403, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 29426, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 29453, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 29471, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 29494, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 29516, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 29535, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 29558, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 29584, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 29614, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 29639, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 29668, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 29683, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 29698, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 29714, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 29739, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 29779, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 29823, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 29856, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 29886, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 29918, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 29948, 0x00001C02 }, /* GL_SELECT */ + { 29958, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 29986, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 30011, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 30027, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 30054, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 30085, 0x0000150F }, /* GL_SET */ + { 30092, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 30113, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 30137, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 30152, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 30167, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 30195, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 30218, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 30248, 0x00001601 }, /* GL_SHININESS */ + { 30261, 0x00001402 }, /* GL_SHORT */ + { 30270, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 30286, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 30306, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 30325, 0x00001D01 }, /* GL_SMOOTH */ + { 30335, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 30368, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 30395, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 30428, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 30455, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 30472, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 30493, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 30514, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 30529, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 30548, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 30567, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 30584, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 30605, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 30626, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 30641, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 30660, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 30679, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 30696, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 30717, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 30738, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 30753, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 30772, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 30791, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 30811, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 30829, 0x00001202 }, /* GL_SPECULAR */ + { 30841, 0x00002402 }, /* GL_SPHERE_MAP */ + { 30855, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 30870, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 30888, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 30905, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 30919, 0x00008580 }, /* GL_SRC0_RGB */ + { 30931, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 30945, 0x00008581 }, /* GL_SRC1_RGB */ + { 30957, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 30971, 0x00008582 }, /* GL_SRC2_RGB */ + { 30983, 0x00000302 }, /* GL_SRC_ALPHA */ + { 30996, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 31018, 0x00000300 }, /* GL_SRC_COLOR */ + { 31031, 0x00008C40 }, /* GL_SRGB */ + { 31039, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 31057, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 31076, 0x000088E6 }, /* GL_STATIC_COPY */ + { 31091, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 31110, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 31125, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 31144, 0x000088E5 }, /* GL_STATIC_READ */ + { 31159, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 31178, 0x00001802 }, /* GL_STENCIL */ + { 31189, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 31211, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 31237, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 31258, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 31283, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 31304, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 31329, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 31361, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 31397, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 31429, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 31465, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 31485, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 31512, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 31538, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 31554, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 31576, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 31599, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 31615, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 31631, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 31648, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 31671, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 31693, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 31715, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 31737, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 31758, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 31785, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 31812, 0x00000B97 }, /* GL_STENCIL_REF */ + { 31827, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 31843, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 31872, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 31894, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 31915, 0x00000C33 }, /* GL_STEREO */ + { 31925, 0x000088E2 }, /* GL_STREAM_COPY */ + { 31940, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 31959, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 31974, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 31993, 0x000088E1 }, /* GL_STREAM_READ */ + { 32008, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 32027, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 32044, 0x000084E7 }, /* GL_SUBTRACT */ + { 32056, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 32072, 0x00002001 }, /* GL_T */ + { 32077, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 32092, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 32111, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 32127, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 32142, 0x00002A27 }, /* GL_T2F_V3F */ + { 32153, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 32172, 0x00002A28 }, /* GL_T4F_V4F */ + { 32183, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 32206, 0x00001702 }, /* GL_TEXTURE */ + { 32217, 0x000084C0 }, /* GL_TEXTURE0 */ + { 32229, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 32245, 0x000084C1 }, /* GL_TEXTURE1 */ + { 32257, 0x000084CA }, /* GL_TEXTURE10 */ + { 32270, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 32287, 0x000084CB }, /* GL_TEXTURE11 */ + { 32300, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 32317, 0x000084CC }, /* GL_TEXTURE12 */ + { 32330, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 32347, 0x000084CD }, /* GL_TEXTURE13 */ + { 32360, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 32377, 0x000084CE }, /* GL_TEXTURE14 */ + { 32390, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 32407, 0x000084CF }, /* GL_TEXTURE15 */ + { 32420, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 32437, 0x000084D0 }, /* GL_TEXTURE16 */ + { 32450, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 32467, 0x000084D1 }, /* GL_TEXTURE17 */ + { 32480, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 32497, 0x000084D2 }, /* GL_TEXTURE18 */ + { 32510, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 32527, 0x000084D3 }, /* GL_TEXTURE19 */ + { 32540, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 32557, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 32573, 0x000084C2 }, /* GL_TEXTURE2 */ + { 32585, 0x000084D4 }, /* GL_TEXTURE20 */ + { 32598, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 32615, 0x000084D5 }, /* GL_TEXTURE21 */ + { 32628, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 32645, 0x000084D6 }, /* GL_TEXTURE22 */ + { 32658, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 32675, 0x000084D7 }, /* GL_TEXTURE23 */ + { 32688, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 32705, 0x000084D8 }, /* GL_TEXTURE24 */ + { 32718, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 32735, 0x000084D9 }, /* GL_TEXTURE25 */ + { 32748, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 32765, 0x000084DA }, /* GL_TEXTURE26 */ + { 32778, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 32795, 0x000084DB }, /* GL_TEXTURE27 */ + { 32808, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 32825, 0x000084DC }, /* GL_TEXTURE28 */ + { 32838, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 32855, 0x000084DD }, /* GL_TEXTURE29 */ + { 32868, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 32885, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 32901, 0x000084C3 }, /* GL_TEXTURE3 */ + { 32913, 0x000084DE }, /* GL_TEXTURE30 */ + { 32926, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 32943, 0x000084DF }, /* GL_TEXTURE31 */ + { 32956, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 32973, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 32989, 0x000084C4 }, /* GL_TEXTURE4 */ + { 33001, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 33017, 0x000084C5 }, /* GL_TEXTURE5 */ + { 33029, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 33045, 0x000084C6 }, /* GL_TEXTURE6 */ + { 33057, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 33073, 0x000084C7 }, /* GL_TEXTURE7 */ + { 33085, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 33101, 0x000084C8 }, /* GL_TEXTURE8 */ + { 33113, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 33129, 0x000084C9 }, /* GL_TEXTURE9 */ + { 33141, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 33157, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 33171, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 33195, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 33209, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 33233, 0x0000806F }, /* GL_TEXTURE_3D */ + { 33247, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 33269, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 33295, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 33317, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 33339, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 33371, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 33393, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 33425, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 33447, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 33475, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 33507, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 33540, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 33572, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 33587, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 33608, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 33633, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 33651, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 33675, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 33706, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 33736, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 33766, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 33801, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 33832, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 33870, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 33897, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 33929, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 33963, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 33987, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 34015, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 34039, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 34067, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 34100, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 34124, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 34146, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 34168, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 34194, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 34228, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 34261, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 34298, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 34326, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 34358, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 34381, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 34419, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 34461, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 34492, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 34520, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 34550, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 34578, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 34598, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 34622, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 34653, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 34688, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 34719, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 34754, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 34785, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 34820, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 34851, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 34886, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 34917, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 34952, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 34983, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 35018, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 35035, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 35057, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 35083, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 35098, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 35119, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 35139, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 35165, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 35185, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 35202, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 35219, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 35236, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 35253, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 35278, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 35300, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 35326, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 35344, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 35370, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 35396, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 35426, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 35453, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 35478, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 35498, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 35522, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 35549, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 35576, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 35603, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 35629, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 35659, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 35681, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 35699, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 35729, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 35757, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 35785, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 35813, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 35834, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 35853, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 35875, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 35894, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 35914, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 35939, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 35963, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 35983, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 36007, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 36027, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 36050, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 36074, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 36099, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 36133, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 36150, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 36168, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 36186, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 36204, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 36224, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 36243, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 36272, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 36289, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 36315, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 36345, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 36377, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 36407, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 36441, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 36457, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 36488, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 36523, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 36551, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 36583, 0x00000004 }, /* GL_TRIANGLES */ + { 36596, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 36612, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 36633, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 36651, 0x00000001 }, /* GL_TRUE */ + { 36659, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 36679, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 36702, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 36722, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 36743, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 36765, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 36787, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 36807, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 36828, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 36845, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 36872, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 36895, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 36911, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 36938, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 36959, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 36983, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 37014, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 37038, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 37066, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 37089, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 37107, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 37137, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 37163, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 37193, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 37219, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 37243, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 37271, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 37299, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 37326, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 37358, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 37389, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 37403, 0x00002A20 }, /* GL_V2F */ + { 37410, 0x00002A21 }, /* GL_V3F */ + { 37417, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 37436, 0x00001F00 }, /* GL_VENDOR */ + { 37446, 0x00001F02 }, /* GL_VERSION */ + { 37457, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 37473, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 37503, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 37534, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 37569, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 37593, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 37614, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 37637, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 37658, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 37685, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 37713, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 37741, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 37769, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 37797, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 37825, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 37853, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 37880, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 37907, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 37934, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 37961, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 37988, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 38015, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 38042, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 38069, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 38096, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 38134, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 38176, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 38207, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 38242, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 38276, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 38314, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 38345, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 38380, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 38408, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 38440, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 38470, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 38504, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 38532, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 38564, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 38584, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 38606, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 38635, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 38656, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 38685, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 38718, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 38750, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 38777, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 38808, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 38838, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 38855, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 38876, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 38903, 0x00000BA2 }, /* GL_VIEWPORT */ + { 38915, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 38931, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 38951, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 38982, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 39017, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 39045, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 39070, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 39097, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 39122, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 39146, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 39165, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 39179, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 39197, 0x00001506 }, /* GL_XOR */ + { 39204, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 39223, 0x00008757 }, /* GL_YCBCR_MESA */ + { 39237, 0x00000000 }, /* GL_ZERO */ + { 39245, 0x00000D16 }, /* GL_ZOOM_X */ + { 39255, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1284] = +static const unsigned reduced_enums[1308] = { - 434, /* GL_FALSE */ - 643, /* GL_LINES */ - 645, /* GL_LINE_LOOP */ - 652, /* GL_LINE_STRIP */ - 1639, /* GL_TRIANGLES */ - 1642, /* GL_TRIANGLE_STRIP */ - 1640, /* GL_TRIANGLE_FAN */ - 1209, /* GL_QUADS */ - 1211, /* GL_QUAD_STRIP */ - 1097, /* GL_POLYGON */ - 1109, /* GL_POLYGON_STIPPLE_BIT */ - 1062, /* GL_PIXEL_MODE_BIT */ - 630, /* GL_LIGHTING_BIT */ - 456, /* GL_FOG_BIT */ + 455, /* GL_FALSE */ + 687, /* GL_LINES */ + 689, /* GL_LINE_LOOP */ + 696, /* GL_LINE_STRIP */ + 1699, /* GL_TRIANGLES */ + 1702, /* GL_TRIANGLE_STRIP */ + 1700, /* GL_TRIANGLE_FAN */ + 1254, /* GL_QUADS */ + 1256, /* GL_QUAD_STRIP */ + 1142, /* GL_POLYGON */ + 1154, /* GL_POLYGON_STIPPLE_BIT */ + 1107, /* GL_PIXEL_MODE_BIT */ + 674, /* GL_LIGHTING_BIT */ + 477, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 662, /* GL_LOAD */ - 1251, /* GL_RETURN */ - 935, /* GL_MULT */ + 706, /* GL_LOAD */ + 1308, /* GL_RETURN */ + 980, /* GL_MULT */ 23, /* GL_ADD */ - 951, /* GL_NEVER */ - 620, /* GL_LESS */ - 424, /* GL_EQUAL */ - 619, /* GL_LEQUAL */ - 545, /* GL_GREATER */ - 966, /* GL_NOTEQUAL */ - 520, /* GL_GEQUAL */ + 996, /* GL_NEVER */ + 664, /* GL_LESS */ + 445, /* GL_EQUAL */ + 663, /* GL_LEQUAL */ + 587, /* GL_GREATER */ + 1011, /* GL_NOTEQUAL */ + 562, /* GL_GEQUAL */ 46, /* GL_ALWAYS */ - 1384, /* GL_SRC_COLOR */ - 995, /* GL_ONE_MINUS_SRC_COLOR */ - 1382, /* GL_SRC_ALPHA */ - 994, /* GL_ONE_MINUS_SRC_ALPHA */ - 405, /* GL_DST_ALPHA */ - 992, /* GL_ONE_MINUS_DST_ALPHA */ - 406, /* GL_DST_COLOR */ - 993, /* GL_ONE_MINUS_DST_COLOR */ - 1383, /* GL_SRC_ALPHA_SATURATE */ - 508, /* GL_FRONT_LEFT */ - 509, /* GL_FRONT_RIGHT */ + 1441, /* GL_SRC_COLOR */ + 1040, /* GL_ONE_MINUS_SRC_COLOR */ + 1439, /* GL_SRC_ALPHA */ + 1039, /* GL_ONE_MINUS_SRC_ALPHA */ + 426, /* GL_DST_ALPHA */ + 1037, /* GL_ONE_MINUS_DST_ALPHA */ + 427, /* GL_DST_COLOR */ + 1038, /* GL_ONE_MINUS_DST_COLOR */ + 1440, /* GL_SRC_ALPHA_SATURATE */ + 550, /* GL_FRONT_LEFT */ + 551, /* GL_FRONT_RIGHT */ 68, /* GL_BACK_LEFT */ 69, /* GL_BACK_RIGHT */ - 505, /* GL_FRONT */ + 547, /* GL_FRONT */ 67, /* GL_BACK */ - 618, /* GL_LEFT */ - 1291, /* GL_RIGHT */ - 506, /* GL_FRONT_AND_BACK */ + 662, /* GL_LEFT */ + 1348, /* GL_RIGHT */ + 548, /* GL_FRONT_AND_BACK */ 62, /* GL_AUX0 */ 63, /* GL_AUX1 */ 64, /* GL_AUX2 */ 65, /* GL_AUX3 */ - 610, /* GL_INVALID_ENUM */ - 613, /* GL_INVALID_VALUE */ - 612, /* GL_INVALID_OPERATION */ - 1385, /* GL_STACK_OVERFLOW */ - 1386, /* GL_STACK_UNDERFLOW */ - 1020, /* GL_OUT_OF_MEMORY */ - 611, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + 653, /* GL_INVALID_ENUM */ + 657, /* GL_INVALID_VALUE */ + 656, /* GL_INVALID_OPERATION */ + 1443, /* GL_STACK_OVERFLOW */ + 1444, /* GL_STACK_UNDERFLOW */ + 1065, /* GL_OUT_OF_MEMORY */ + 654, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1040, /* GL_PASS_THROUGH_TOKEN */ - 1096, /* GL_POINT_TOKEN */ - 653, /* GL_LINE_TOKEN */ - 1110, /* GL_POLYGON_TOKEN */ + 1085, /* GL_PASS_THROUGH_TOKEN */ + 1141, /* GL_POINT_TOKEN */ + 697, /* GL_LINE_TOKEN */ + 1155, /* GL_POLYGON_TOKEN */ 73, /* GL_BITMAP_TOKEN */ - 404, /* GL_DRAW_PIXEL_TOKEN */ - 270, /* GL_COPY_PIXEL_TOKEN */ - 646, /* GL_LINE_RESET_TOKEN */ - 427, /* GL_EXP */ - 428, /* GL_EXP2 */ - 303, /* GL_CW */ + 425, /* GL_DRAW_PIXEL_TOKEN */ + 286, /* GL_COPY_PIXEL_TOKEN */ + 690, /* GL_LINE_RESET_TOKEN */ + 448, /* GL_EXP */ + 449, /* GL_EXP2 */ + 319, /* GL_CW */ 115, /* GL_CCW */ 136, /* GL_COEFF */ - 1017, /* GL_ORDER */ - 343, /* GL_DOMAIN */ - 278, /* GL_CURRENT_COLOR */ - 281, /* GL_CURRENT_INDEX */ - 287, /* GL_CURRENT_NORMAL */ - 299, /* GL_CURRENT_TEXTURE_COORDS */ - 292, /* GL_CURRENT_RASTER_COLOR */ - 294, /* GL_CURRENT_RASTER_INDEX */ - 297, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - 295, /* GL_CURRENT_RASTER_POSITION */ - 296, /* GL_CURRENT_RASTER_POSITION_VALID */ - 293, /* GL_CURRENT_RASTER_DISTANCE */ - 1089, /* GL_POINT_SMOOTH */ - 1078, /* GL_POINT_SIZE */ - 1088, /* GL_POINT_SIZE_RANGE */ - 1079, /* GL_POINT_SIZE_GRANULARITY */ - 647, /* GL_LINE_SMOOTH */ - 654, /* GL_LINE_WIDTH */ - 656, /* GL_LINE_WIDTH_RANGE */ - 655, /* GL_LINE_WIDTH_GRANULARITY */ - 649, /* GL_LINE_STIPPLE */ - 650, /* GL_LINE_STIPPLE_PATTERN */ - 651, /* GL_LINE_STIPPLE_REPEAT */ - 661, /* GL_LIST_MODE */ - 820, /* GL_MAX_LIST_NESTING */ - 658, /* GL_LIST_BASE */ - 660, /* GL_LIST_INDEX */ - 1099, /* GL_POLYGON_MODE */ - 1106, /* GL_POLYGON_SMOOTH */ - 1108, /* GL_POLYGON_STIPPLE */ - 413, /* GL_EDGE_FLAG */ - 271, /* GL_CULL_FACE */ - 272, /* GL_CULL_FACE_MODE */ - 507, /* GL_FRONT_FACE */ - 629, /* GL_LIGHTING */ - 634, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 635, /* GL_LIGHT_MODEL_TWO_SIDE */ - 631, /* GL_LIGHT_MODEL_AMBIENT */ - 1337, /* GL_SHADE_MODEL */ - 167, /* GL_COLOR_MATERIAL_FACE */ - 168, /* GL_COLOR_MATERIAL_PARAMETER */ - 166, /* GL_COLOR_MATERIAL */ - 455, /* GL_FOG */ - 477, /* GL_FOG_INDEX */ - 473, /* GL_FOG_DENSITY */ - 481, /* GL_FOG_START */ - 475, /* GL_FOG_END */ - 478, /* GL_FOG_MODE */ - 457, /* GL_FOG_COLOR */ - 332, /* GL_DEPTH_RANGE */ - 337, /* GL_DEPTH_TEST */ - 340, /* GL_DEPTH_WRITEMASK */ - 320, /* GL_DEPTH_CLEAR_VALUE */ - 331, /* GL_DEPTH_FUNC */ + 1062, /* GL_ORDER */ + 363, /* GL_DOMAIN */ + 294, /* GL_CURRENT_COLOR */ + 297, /* GL_CURRENT_INDEX */ + 303, /* GL_CURRENT_NORMAL */ + 315, /* GL_CURRENT_TEXTURE_COORDS */ + 308, /* GL_CURRENT_RASTER_COLOR */ + 310, /* GL_CURRENT_RASTER_INDEX */ + 313, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + 311, /* GL_CURRENT_RASTER_POSITION */ + 312, /* GL_CURRENT_RASTER_POSITION_VALID */ + 309, /* GL_CURRENT_RASTER_DISTANCE */ + 1134, /* GL_POINT_SMOOTH */ + 1123, /* GL_POINT_SIZE */ + 1133, /* GL_POINT_SIZE_RANGE */ + 1124, /* GL_POINT_SIZE_GRANULARITY */ + 691, /* GL_LINE_SMOOTH */ + 698, /* GL_LINE_WIDTH */ + 700, /* GL_LINE_WIDTH_RANGE */ + 699, /* GL_LINE_WIDTH_GRANULARITY */ + 693, /* GL_LINE_STIPPLE */ + 694, /* GL_LINE_STIPPLE_PATTERN */ + 695, /* GL_LINE_STIPPLE_REPEAT */ + 705, /* GL_LIST_MODE */ + 864, /* GL_MAX_LIST_NESTING */ + 702, /* GL_LIST_BASE */ + 704, /* GL_LIST_INDEX */ + 1144, /* GL_POLYGON_MODE */ + 1151, /* GL_POLYGON_SMOOTH */ + 1153, /* GL_POLYGON_STIPPLE */ + 434, /* GL_EDGE_FLAG */ + 287, /* GL_CULL_FACE */ + 288, /* GL_CULL_FACE_MODE */ + 549, /* GL_FRONT_FACE */ + 673, /* GL_LIGHTING */ + 678, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 679, /* GL_LIGHT_MODEL_TWO_SIDE */ + 675, /* GL_LIGHT_MODEL_AMBIENT */ + 1394, /* GL_SHADE_MODEL */ + 183, /* GL_COLOR_MATERIAL_FACE */ + 184, /* GL_COLOR_MATERIAL_PARAMETER */ + 182, /* GL_COLOR_MATERIAL */ + 476, /* GL_FOG */ + 498, /* GL_FOG_INDEX */ + 494, /* GL_FOG_DENSITY */ + 502, /* GL_FOG_START */ + 496, /* GL_FOG_END */ + 499, /* GL_FOG_MODE */ + 478, /* GL_FOG_COLOR */ + 350, /* GL_DEPTH_RANGE */ + 357, /* GL_DEPTH_TEST */ + 360, /* GL_DEPTH_WRITEMASK */ + 338, /* GL_DEPTH_CLEAR_VALUE */ + 349, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1420, /* GL_STENCIL_TEST */ - 1408, /* GL_STENCIL_CLEAR_VALUE */ - 1410, /* GL_STENCIL_FUNC */ - 1422, /* GL_STENCIL_VALUE_MASK */ - 1409, /* GL_STENCIL_FAIL */ - 1417, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1418, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1419, /* GL_STENCIL_REF */ - 1423, /* GL_STENCIL_WRITEMASK */ - 789, /* GL_MATRIX_MODE */ - 956, /* GL_NORMALIZE */ - 1729, /* GL_VIEWPORT */ - 930, /* GL_MODELVIEW_STACK_DEPTH */ - 1189, /* GL_PROJECTION_STACK_DEPTH */ - 1618, /* GL_TEXTURE_STACK_DEPTH */ - 928, /* GL_MODELVIEW_MATRIX */ - 1188, /* GL_PROJECTION_MATRIX */ - 1603, /* GL_TEXTURE_MATRIX */ + 1479, /* GL_STENCIL_TEST */ + 1467, /* GL_STENCIL_CLEAR_VALUE */ + 1469, /* GL_STENCIL_FUNC */ + 1481, /* GL_STENCIL_VALUE_MASK */ + 1468, /* GL_STENCIL_FAIL */ + 1476, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1477, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1478, /* GL_STENCIL_REF */ + 1482, /* GL_STENCIL_WRITEMASK */ + 833, /* GL_MATRIX_MODE */ + 1001, /* GL_NORMALIZE */ + 1791, /* GL_VIEWPORT */ + 975, /* GL_MODELVIEW_STACK_DEPTH */ + 1234, /* GL_PROJECTION_STACK_DEPTH */ + 1677, /* GL_TEXTURE_STACK_DEPTH */ + 973, /* GL_MODELVIEW_MATRIX */ + 1233, /* GL_PROJECTION_MATRIX */ + 1662, /* GL_TEXTURE_MATRIX */ 60, /* GL_ATTRIB_STACK_DEPTH */ 126, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 342, /* GL_DITHER */ + 362, /* GL_DITHER */ 77, /* GL_BLEND_DST */ 85, /* GL_BLEND_SRC */ 74, /* GL_BLEND */ - 664, /* GL_LOGIC_OP_MODE */ - 584, /* GL_INDEX_LOGIC_OP */ - 165, /* GL_COLOR_LOGIC_OP */ + 708, /* GL_LOGIC_OP_MODE */ + 627, /* GL_INDEX_LOGIC_OP */ + 181, /* GL_COLOR_LOGIC_OP */ 66, /* GL_AUX_BUFFERS */ - 353, /* GL_DRAW_BUFFER */ - 1221, /* GL_READ_BUFFER */ - 1318, /* GL_SCISSOR_BOX */ - 1319, /* GL_SCISSOR_TEST */ - 583, /* GL_INDEX_CLEAR_VALUE */ - 588, /* GL_INDEX_WRITEMASK */ - 162, /* GL_COLOR_CLEAR_VALUE */ - 204, /* GL_COLOR_WRITEMASK */ - 585, /* GL_INDEX_MODE */ - 1285, /* GL_RGBA_MODE */ - 352, /* GL_DOUBLEBUFFER */ - 1424, /* GL_STEREO */ - 1244, /* GL_RENDER_MODE */ - 1041, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1090, /* GL_POINT_SMOOTH_HINT */ - 648, /* GL_LINE_SMOOTH_HINT */ - 1107, /* GL_POLYGON_SMOOTH_HINT */ - 476, /* GL_FOG_HINT */ - 1584, /* GL_TEXTURE_GEN_S */ - 1585, /* GL_TEXTURE_GEN_T */ - 1583, /* GL_TEXTURE_GEN_R */ - 1582, /* GL_TEXTURE_GEN_Q */ - 1054, /* GL_PIXEL_MAP_I_TO_I */ - 1060, /* GL_PIXEL_MAP_S_TO_S */ - 1056, /* GL_PIXEL_MAP_I_TO_R */ - 1052, /* GL_PIXEL_MAP_I_TO_G */ - 1050, /* GL_PIXEL_MAP_I_TO_B */ - 1048, /* GL_PIXEL_MAP_I_TO_A */ - 1058, /* GL_PIXEL_MAP_R_TO_R */ - 1046, /* GL_PIXEL_MAP_G_TO_G */ - 1044, /* GL_PIXEL_MAP_B_TO_B */ - 1042, /* GL_PIXEL_MAP_A_TO_A */ - 1055, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1061, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1057, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1053, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1051, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1049, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1059, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1047, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1045, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1043, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1651, /* GL_UNPACK_SWAP_BYTES */ - 1646, /* GL_UNPACK_LSB_FIRST */ - 1647, /* GL_UNPACK_ROW_LENGTH */ - 1650, /* GL_UNPACK_SKIP_ROWS */ - 1649, /* GL_UNPACK_SKIP_PIXELS */ - 1644, /* GL_UNPACK_ALIGNMENT */ - 1029, /* GL_PACK_SWAP_BYTES */ - 1024, /* GL_PACK_LSB_FIRST */ - 1025, /* GL_PACK_ROW_LENGTH */ - 1028, /* GL_PACK_SKIP_ROWS */ - 1027, /* GL_PACK_SKIP_PIXELS */ - 1021, /* GL_PACK_ALIGNMENT */ - 742, /* GL_MAP_COLOR */ - 743, /* GL_MAP_STENCIL */ - 587, /* GL_INDEX_SHIFT */ - 586, /* GL_INDEX_OFFSET */ - 1233, /* GL_RED_SCALE */ - 1231, /* GL_RED_BIAS */ - 1746, /* GL_ZOOM_X */ - 1747, /* GL_ZOOM_Y */ - 549, /* GL_GREEN_SCALE */ - 547, /* GL_GREEN_BIAS */ + 373, /* GL_DRAW_BUFFER */ + 1266, /* GL_READ_BUFFER */ + 1375, /* GL_SCISSOR_BOX */ + 1376, /* GL_SCISSOR_TEST */ + 626, /* GL_INDEX_CLEAR_VALUE */ + 631, /* GL_INDEX_WRITEMASK */ + 178, /* GL_COLOR_CLEAR_VALUE */ + 220, /* GL_COLOR_WRITEMASK */ + 628, /* GL_INDEX_MODE */ + 1342, /* GL_RGBA_MODE */ + 372, /* GL_DOUBLEBUFFER */ + 1483, /* GL_STEREO */ + 1301, /* GL_RENDER_MODE */ + 1086, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1135, /* GL_POINT_SMOOTH_HINT */ + 692, /* GL_LINE_SMOOTH_HINT */ + 1152, /* GL_POLYGON_SMOOTH_HINT */ + 497, /* GL_FOG_HINT */ + 1643, /* GL_TEXTURE_GEN_S */ + 1644, /* GL_TEXTURE_GEN_T */ + 1642, /* GL_TEXTURE_GEN_R */ + 1641, /* GL_TEXTURE_GEN_Q */ + 1099, /* GL_PIXEL_MAP_I_TO_I */ + 1105, /* GL_PIXEL_MAP_S_TO_S */ + 1101, /* GL_PIXEL_MAP_I_TO_R */ + 1097, /* GL_PIXEL_MAP_I_TO_G */ + 1095, /* GL_PIXEL_MAP_I_TO_B */ + 1093, /* GL_PIXEL_MAP_I_TO_A */ + 1103, /* GL_PIXEL_MAP_R_TO_R */ + 1091, /* GL_PIXEL_MAP_G_TO_G */ + 1089, /* GL_PIXEL_MAP_B_TO_B */ + 1087, /* GL_PIXEL_MAP_A_TO_A */ + 1100, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1106, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1102, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1098, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1096, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1094, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1104, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1092, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1090, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1088, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1711, /* GL_UNPACK_SWAP_BYTES */ + 1706, /* GL_UNPACK_LSB_FIRST */ + 1707, /* GL_UNPACK_ROW_LENGTH */ + 1710, /* GL_UNPACK_SKIP_ROWS */ + 1709, /* GL_UNPACK_SKIP_PIXELS */ + 1704, /* GL_UNPACK_ALIGNMENT */ + 1074, /* GL_PACK_SWAP_BYTES */ + 1069, /* GL_PACK_LSB_FIRST */ + 1070, /* GL_PACK_ROW_LENGTH */ + 1073, /* GL_PACK_SKIP_ROWS */ + 1072, /* GL_PACK_SKIP_PIXELS */ + 1066, /* GL_PACK_ALIGNMENT */ + 786, /* GL_MAP_COLOR */ + 787, /* GL_MAP_STENCIL */ + 630, /* GL_INDEX_SHIFT */ + 629, /* GL_INDEX_OFFSET */ + 1279, /* GL_RED_SCALE */ + 1277, /* GL_RED_BIAS */ + 1808, /* GL_ZOOM_X */ + 1809, /* GL_ZOOM_Y */ + 591, /* GL_GREEN_SCALE */ + 589, /* GL_GREEN_BIAS */ 91, /* GL_BLUE_SCALE */ 89, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 333, /* GL_DEPTH_SCALE */ - 314, /* GL_DEPTH_BIAS */ - 815, /* GL_MAX_EVAL_ORDER */ - 819, /* GL_MAX_LIGHTS */ - 798, /* GL_MAX_CLIP_PLANES */ - 863, /* GL_MAX_TEXTURE_SIZE */ - 825, /* GL_MAX_PIXEL_MAP_TABLE */ - 794, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 822, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 823, /* GL_MAX_NAME_STACK_DEPTH */ - 851, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 864, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 878, /* GL_MAX_VIEWPORT_DIMS */ - 795, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1431, /* GL_SUBPIXEL_BITS */ - 582, /* GL_INDEX_BITS */ - 1232, /* GL_RED_BITS */ - 548, /* GL_GREEN_BITS */ + 351, /* GL_DEPTH_SCALE */ + 332, /* GL_DEPTH_BIAS */ + 859, /* GL_MAX_EVAL_ORDER */ + 863, /* GL_MAX_LIGHTS */ + 842, /* GL_MAX_CLIP_PLANES */ + 908, /* GL_MAX_TEXTURE_SIZE */ + 869, /* GL_MAX_PIXEL_MAP_TABLE */ + 838, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 866, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 867, /* GL_MAX_NAME_STACK_DEPTH */ + 895, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 909, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 923, /* GL_MAX_VIEWPORT_DIMS */ + 839, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1490, /* GL_SUBPIXEL_BITS */ + 625, /* GL_INDEX_BITS */ + 1278, /* GL_RED_BITS */ + 590, /* GL_GREEN_BITS */ 90, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ - 315, /* GL_DEPTH_BITS */ - 1406, /* GL_STENCIL_BITS */ + 333, /* GL_DEPTH_BITS */ + 1465, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 944, /* GL_NAME_STACK_DEPTH */ + 989, /* GL_NAME_STACK_DEPTH */ 61, /* GL_AUTO_NORMAL */ - 688, /* GL_MAP1_COLOR_4 */ - 691, /* GL_MAP1_INDEX */ - 692, /* GL_MAP1_NORMAL */ - 693, /* GL_MAP1_TEXTURE_COORD_1 */ - 694, /* GL_MAP1_TEXTURE_COORD_2 */ - 695, /* GL_MAP1_TEXTURE_COORD_3 */ - 696, /* GL_MAP1_TEXTURE_COORD_4 */ - 697, /* GL_MAP1_VERTEX_3 */ - 698, /* GL_MAP1_VERTEX_4 */ - 715, /* GL_MAP2_COLOR_4 */ - 718, /* GL_MAP2_INDEX */ - 719, /* GL_MAP2_NORMAL */ - 720, /* GL_MAP2_TEXTURE_COORD_1 */ - 721, /* GL_MAP2_TEXTURE_COORD_2 */ - 722, /* GL_MAP2_TEXTURE_COORD_3 */ - 723, /* GL_MAP2_TEXTURE_COORD_4 */ - 724, /* GL_MAP2_VERTEX_3 */ - 725, /* GL_MAP2_VERTEX_4 */ - 689, /* GL_MAP1_GRID_DOMAIN */ - 690, /* GL_MAP1_GRID_SEGMENTS */ - 716, /* GL_MAP2_GRID_DOMAIN */ - 717, /* GL_MAP2_GRID_SEGMENTS */ - 1508, /* GL_TEXTURE_1D */ - 1510, /* GL_TEXTURE_2D */ - 437, /* GL_FEEDBACK_BUFFER_POINTER */ - 438, /* GL_FEEDBACK_BUFFER_SIZE */ - 439, /* GL_FEEDBACK_BUFFER_TYPE */ - 1328, /* GL_SELECTION_BUFFER_POINTER */ - 1329, /* GL_SELECTION_BUFFER_SIZE */ - 1621, /* GL_TEXTURE_WIDTH */ - 1589, /* GL_TEXTURE_HEIGHT */ - 1545, /* GL_TEXTURE_COMPONENTS */ - 1529, /* GL_TEXTURE_BORDER_COLOR */ - 1528, /* GL_TEXTURE_BORDER */ - 344, /* GL_DONT_CARE */ - 435, /* GL_FASTEST */ - 952, /* GL_NICEST */ + 732, /* GL_MAP1_COLOR_4 */ + 735, /* GL_MAP1_INDEX */ + 736, /* GL_MAP1_NORMAL */ + 737, /* GL_MAP1_TEXTURE_COORD_1 */ + 738, /* GL_MAP1_TEXTURE_COORD_2 */ + 739, /* GL_MAP1_TEXTURE_COORD_3 */ + 740, /* GL_MAP1_TEXTURE_COORD_4 */ + 741, /* GL_MAP1_VERTEX_3 */ + 742, /* GL_MAP1_VERTEX_4 */ + 759, /* GL_MAP2_COLOR_4 */ + 762, /* GL_MAP2_INDEX */ + 763, /* GL_MAP2_NORMAL */ + 764, /* GL_MAP2_TEXTURE_COORD_1 */ + 765, /* GL_MAP2_TEXTURE_COORD_2 */ + 766, /* GL_MAP2_TEXTURE_COORD_3 */ + 767, /* GL_MAP2_TEXTURE_COORD_4 */ + 768, /* GL_MAP2_VERTEX_3 */ + 769, /* GL_MAP2_VERTEX_4 */ + 733, /* GL_MAP1_GRID_DOMAIN */ + 734, /* GL_MAP1_GRID_SEGMENTS */ + 760, /* GL_MAP2_GRID_DOMAIN */ + 761, /* GL_MAP2_GRID_SEGMENTS */ + 1567, /* GL_TEXTURE_1D */ + 1569, /* GL_TEXTURE_2D */ + 458, /* GL_FEEDBACK_BUFFER_POINTER */ + 459, /* GL_FEEDBACK_BUFFER_SIZE */ + 460, /* GL_FEEDBACK_BUFFER_TYPE */ + 1385, /* GL_SELECTION_BUFFER_POINTER */ + 1386, /* GL_SELECTION_BUFFER_SIZE */ + 1681, /* GL_TEXTURE_WIDTH */ + 1648, /* GL_TEXTURE_HEIGHT */ + 1604, /* GL_TEXTURE_COMPONENTS */ + 1588, /* GL_TEXTURE_BORDER_COLOR */ + 1587, /* GL_TEXTURE_BORDER */ + 364, /* GL_DONT_CARE */ + 456, /* GL_FASTEST */ + 997, /* GL_NICEST */ 47, /* GL_AMBIENT */ - 341, /* GL_DIFFUSE */ - 1371, /* GL_SPECULAR */ - 1111, /* GL_POSITION */ - 1374, /* GL_SPOT_DIRECTION */ - 1375, /* GL_SPOT_EXPONENT */ - 1373, /* GL_SPOT_CUTOFF */ - 244, /* GL_CONSTANT_ATTENUATION */ - 638, /* GL_LINEAR_ATTENUATION */ - 1208, /* GL_QUADRATIC_ATTENUATION */ - 218, /* GL_COMPILE */ - 219, /* GL_COMPILE_AND_EXECUTE */ + 361, /* GL_DIFFUSE */ + 1428, /* GL_SPECULAR */ + 1156, /* GL_POSITION */ + 1431, /* GL_SPOT_DIRECTION */ + 1432, /* GL_SPOT_EXPONENT */ + 1430, /* GL_SPOT_CUTOFF */ + 260, /* GL_CONSTANT_ATTENUATION */ + 682, /* GL_LINEAR_ATTENUATION */ + 1253, /* GL_QUADRATIC_ATTENUATION */ + 234, /* GL_COMPILE */ + 235, /* GL_COMPILE_AND_EXECUTE */ 110, /* GL_BYTE */ - 1652, /* GL_UNSIGNED_BYTE */ - 1342, /* GL_SHORT */ - 1661, /* GL_UNSIGNED_SHORT */ - 590, /* GL_INT */ - 1655, /* GL_UNSIGNED_INT */ - 442, /* GL_FLOAT */ + 1712, /* GL_UNSIGNED_BYTE */ + 1399, /* GL_SHORT */ + 1723, /* GL_UNSIGNED_SHORT */ + 633, /* GL_INT */ + 1715, /* GL_UNSIGNED_INT */ + 463, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 351, /* GL_DOUBLE */ + 371, /* GL_DOUBLE */ 122, /* GL_CLEAR */ 49, /* GL_AND */ 51, /* GL_AND_REVERSE */ - 268, /* GL_COPY */ + 284, /* GL_COPY */ 50, /* GL_AND_INVERTED */ - 954, /* GL_NOOP */ - 1742, /* GL_XOR */ - 1016, /* GL_OR */ - 955, /* GL_NOR */ - 425, /* GL_EQUIV */ - 616, /* GL_INVERT */ - 1019, /* GL_OR_REVERSE */ - 269, /* GL_COPY_INVERTED */ - 1018, /* GL_OR_INVERTED */ - 945, /* GL_NAND */ - 1333, /* GL_SET */ - 422, /* GL_EMISSION */ - 1341, /* GL_SHININESS */ + 999, /* GL_NOOP */ + 1804, /* GL_XOR */ + 1061, /* GL_OR */ + 1000, /* GL_NOR */ + 446, /* GL_EQUIV */ + 660, /* GL_INVERT */ + 1064, /* GL_OR_REVERSE */ + 285, /* GL_COPY_INVERTED */ + 1063, /* GL_OR_INVERTED */ + 990, /* GL_NAND */ + 1390, /* GL_SET */ + 443, /* GL_EMISSION */ + 1398, /* GL_SHININESS */ 48, /* GL_AMBIENT_AND_DIFFUSE */ - 164, /* GL_COLOR_INDEXES */ - 895, /* GL_MODELVIEW */ - 1187, /* GL_PROJECTION */ - 1443, /* GL_TEXTURE */ + 180, /* GL_COLOR_INDEXES */ + 940, /* GL_MODELVIEW */ + 1232, /* GL_PROJECTION */ + 1502, /* GL_TEXTURE */ 137, /* GL_COLOR */ - 312, /* GL_DEPTH */ - 1393, /* GL_STENCIL */ - 163, /* GL_COLOR_INDEX */ - 1411, /* GL_STENCIL_INDEX */ - 321, /* GL_DEPTH_COMPONENT */ - 1228, /* GL_RED */ - 546, /* GL_GREEN */ + 328, /* GL_DEPTH */ + 1451, /* GL_STENCIL */ + 179, /* GL_COLOR_INDEX */ + 1470, /* GL_STENCIL_INDEX */ + 339, /* GL_DEPTH_COMPONENT */ + 1274, /* GL_RED */ + 588, /* GL_GREEN */ 88, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1252, /* GL_RGB */ - 1271, /* GL_RGBA */ - 666, /* GL_LUMINANCE */ - 687, /* GL_LUMINANCE_ALPHA */ + 1309, /* GL_RGB */ + 1328, /* GL_RGBA */ + 710, /* GL_LUMINANCE */ + 731, /* GL_LUMINANCE_ALPHA */ 72, /* GL_BITMAP */ - 1067, /* GL_POINT */ - 636, /* GL_LINE */ - 440, /* GL_FILL */ - 1237, /* GL_RENDER */ - 436, /* GL_FEEDBACK */ - 1327, /* GL_SELECT */ - 441, /* GL_FLAT */ - 1346, /* GL_SMOOTH */ - 617, /* GL_KEEP */ - 1246, /* GL_REPLACE */ - 573, /* GL_INCR */ - 308, /* GL_DECR */ - 1676, /* GL_VENDOR */ - 1243, /* GL_RENDERER */ - 1677, /* GL_VERSION */ - 429, /* GL_EXTENSIONS */ - 1292, /* GL_S */ - 1434, /* GL_T */ - 1218, /* GL_R */ - 1207, /* GL_Q */ - 931, /* GL_MODULATE */ - 307, /* GL_DECAL */ - 1579, /* GL_TEXTURE_ENV_MODE */ - 1578, /* GL_TEXTURE_ENV_COLOR */ - 1577, /* GL_TEXTURE_ENV */ - 430, /* GL_EYE_LINEAR */ - 978, /* GL_OBJECT_LINEAR */ - 1372, /* GL_SPHERE_MAP */ - 1581, /* GL_TEXTURE_GEN_MODE */ - 980, /* GL_OBJECT_PLANE */ - 431, /* GL_EYE_PLANE */ - 946, /* GL_NEAREST */ - 637, /* GL_LINEAR */ - 950, /* GL_NEAREST_MIPMAP_NEAREST */ - 642, /* GL_LINEAR_MIPMAP_NEAREST */ - 949, /* GL_NEAREST_MIPMAP_LINEAR */ - 641, /* GL_LINEAR_MIPMAP_LINEAR */ - 1602, /* GL_TEXTURE_MAG_FILTER */ - 1610, /* GL_TEXTURE_MIN_FILTER */ - 1623, /* GL_TEXTURE_WRAP_S */ - 1624, /* GL_TEXTURE_WRAP_T */ + 1112, /* GL_POINT */ + 680, /* GL_LINE */ + 461, /* GL_FILL */ + 1283, /* GL_RENDER */ + 457, /* GL_FEEDBACK */ + 1384, /* GL_SELECT */ + 462, /* GL_FLAT */ + 1403, /* GL_SMOOTH */ + 661, /* GL_KEEP */ + 1303, /* GL_REPLACE */ + 615, /* GL_INCR */ + 324, /* GL_DECR */ + 1738, /* GL_VENDOR */ + 1300, /* GL_RENDERER */ + 1739, /* GL_VERSION */ + 450, /* GL_EXTENSIONS */ + 1349, /* GL_S */ + 1493, /* GL_T */ + 1263, /* GL_R */ + 1252, /* GL_Q */ + 976, /* GL_MODULATE */ + 323, /* GL_DECAL */ + 1638, /* GL_TEXTURE_ENV_MODE */ + 1637, /* GL_TEXTURE_ENV_COLOR */ + 1636, /* GL_TEXTURE_ENV */ + 451, /* GL_EYE_LINEAR */ + 1023, /* GL_OBJECT_LINEAR */ + 1429, /* GL_SPHERE_MAP */ + 1640, /* GL_TEXTURE_GEN_MODE */ + 1025, /* GL_OBJECT_PLANE */ + 452, /* GL_EYE_PLANE */ + 991, /* GL_NEAREST */ + 681, /* GL_LINEAR */ + 995, /* GL_NEAREST_MIPMAP_NEAREST */ + 686, /* GL_LINEAR_MIPMAP_NEAREST */ + 994, /* GL_NEAREST_MIPMAP_LINEAR */ + 685, /* GL_LINEAR_MIPMAP_LINEAR */ + 1661, /* GL_TEXTURE_MAG_FILTER */ + 1669, /* GL_TEXTURE_MIN_FILTER */ + 1683, /* GL_TEXTURE_WRAP_S */ + 1684, /* GL_TEXTURE_WRAP_T */ 116, /* GL_CLAMP */ - 1245, /* GL_REPEAT */ - 1105, /* GL_POLYGON_OFFSET_UNITS */ - 1104, /* GL_POLYGON_OFFSET_POINT */ - 1103, /* GL_POLYGON_OFFSET_LINE */ - 1219, /* GL_R3_G3_B2 */ - 1673, /* GL_V2F */ - 1674, /* GL_V3F */ + 1302, /* GL_REPEAT */ + 1150, /* GL_POLYGON_OFFSET_UNITS */ + 1149, /* GL_POLYGON_OFFSET_POINT */ + 1148, /* GL_POLYGON_OFFSET_LINE */ + 1264, /* GL_R3_G3_B2 */ + 1735, /* GL_V2F */ + 1736, /* GL_V3F */ 113, /* GL_C4UB_V2F */ 114, /* GL_C4UB_V3F */ 111, /* GL_C3F_V3F */ - 943, /* GL_N3F_V3F */ + 988, /* GL_N3F_V3F */ 112, /* GL_C4F_N3F_V3F */ - 1439, /* GL_T2F_V3F */ - 1441, /* GL_T4F_V4F */ - 1437, /* GL_T2F_C4UB_V3F */ - 1435, /* GL_T2F_C3F_V3F */ - 1438, /* GL_T2F_N3F_V3F */ - 1436, /* GL_T2F_C4F_N3F_V3F */ - 1440, /* GL_T4F_C4F_N3F_V4F */ + 1498, /* GL_T2F_V3F */ + 1500, /* GL_T4F_V4F */ + 1496, /* GL_T2F_C4UB_V3F */ + 1494, /* GL_T2F_C3F_V3F */ + 1497, /* GL_T2F_N3F_V3F */ + 1495, /* GL_T2F_C4F_N3F_V3F */ + 1499, /* GL_T4F_C4F_N3F_V4F */ 129, /* GL_CLIP_PLANE0 */ 130, /* GL_CLIP_PLANE1 */ 131, /* GL_CLIP_PLANE2 */ 132, /* GL_CLIP_PLANE3 */ 133, /* GL_CLIP_PLANE4 */ 134, /* GL_CLIP_PLANE5 */ - 621, /* GL_LIGHT0 */ - 622, /* GL_LIGHT1 */ - 623, /* GL_LIGHT2 */ - 624, /* GL_LIGHT3 */ - 625, /* GL_LIGHT4 */ - 626, /* GL_LIGHT5 */ - 627, /* GL_LIGHT6 */ - 628, /* GL_LIGHT7 */ - 550, /* GL_HINT_BIT */ - 246, /* GL_CONSTANT_COLOR */ - 990, /* GL_ONE_MINUS_CONSTANT_COLOR */ - 241, /* GL_CONSTANT_ALPHA */ - 988, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 665, /* GL_LIGHT0 */ + 666, /* GL_LIGHT1 */ + 667, /* GL_LIGHT2 */ + 668, /* GL_LIGHT3 */ + 669, /* GL_LIGHT4 */ + 670, /* GL_LIGHT5 */ + 671, /* GL_LIGHT6 */ + 672, /* GL_LIGHT7 */ + 592, /* GL_HINT_BIT */ + 262, /* GL_CONSTANT_COLOR */ + 1035, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 257, /* GL_CONSTANT_ALPHA */ + 1033, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 75, /* GL_BLEND_COLOR */ - 510, /* GL_FUNC_ADD */ - 879, /* GL_MIN */ - 791, /* GL_MAX */ + 552, /* GL_FUNC_ADD */ + 924, /* GL_MIN */ + 835, /* GL_MAX */ 80, /* GL_BLEND_EQUATION */ - 514, /* GL_FUNC_SUBTRACT */ - 512, /* GL_FUNC_REVERSE_SUBTRACT */ - 249, /* GL_CONVOLUTION_1D */ - 250, /* GL_CONVOLUTION_2D */ - 1330, /* GL_SEPARABLE_2D */ - 253, /* GL_CONVOLUTION_BORDER_MODE */ - 257, /* GL_CONVOLUTION_FILTER_SCALE */ - 255, /* GL_CONVOLUTION_FILTER_BIAS */ - 1229, /* GL_REDUCE */ - 259, /* GL_CONVOLUTION_FORMAT */ - 263, /* GL_CONVOLUTION_WIDTH */ - 261, /* GL_CONVOLUTION_HEIGHT */ - 806, /* GL_MAX_CONVOLUTION_WIDTH */ - 804, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1144, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1140, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1135, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1131, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1142, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1138, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1133, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1129, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 551, /* GL_HISTOGRAM */ - 1191, /* GL_PROXY_HISTOGRAM */ - 567, /* GL_HISTOGRAM_WIDTH */ - 557, /* GL_HISTOGRAM_FORMAT */ - 563, /* GL_HISTOGRAM_RED_SIZE */ - 559, /* GL_HISTOGRAM_GREEN_SIZE */ - 554, /* GL_HISTOGRAM_BLUE_SIZE */ - 552, /* GL_HISTOGRAM_ALPHA_SIZE */ - 561, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 565, /* GL_HISTOGRAM_SINK */ - 880, /* GL_MINMAX */ - 882, /* GL_MINMAX_FORMAT */ - 884, /* GL_MINMAX_SINK */ - 1442, /* GL_TABLE_TOO_LARGE_EXT */ - 1654, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1663, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1665, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1659, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1656, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1102, /* GL_POLYGON_OFFSET_FILL */ - 1101, /* GL_POLYGON_OFFSET_FACTOR */ - 1100, /* GL_POLYGON_OFFSET_BIAS */ - 1249, /* GL_RESCALE_NORMAL */ + 556, /* GL_FUNC_SUBTRACT */ + 554, /* GL_FUNC_REVERSE_SUBTRACT */ + 265, /* GL_CONVOLUTION_1D */ + 266, /* GL_CONVOLUTION_2D */ + 1387, /* GL_SEPARABLE_2D */ + 269, /* GL_CONVOLUTION_BORDER_MODE */ + 273, /* GL_CONVOLUTION_FILTER_SCALE */ + 271, /* GL_CONVOLUTION_FILTER_BIAS */ + 1275, /* GL_REDUCE */ + 275, /* GL_CONVOLUTION_FORMAT */ + 279, /* GL_CONVOLUTION_WIDTH */ + 277, /* GL_CONVOLUTION_HEIGHT */ + 850, /* GL_MAX_CONVOLUTION_WIDTH */ + 848, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1189, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1185, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1180, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1176, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1187, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1183, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1178, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1174, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 593, /* GL_HISTOGRAM */ + 1236, /* GL_PROXY_HISTOGRAM */ + 609, /* GL_HISTOGRAM_WIDTH */ + 599, /* GL_HISTOGRAM_FORMAT */ + 605, /* GL_HISTOGRAM_RED_SIZE */ + 601, /* GL_HISTOGRAM_GREEN_SIZE */ + 596, /* GL_HISTOGRAM_BLUE_SIZE */ + 594, /* GL_HISTOGRAM_ALPHA_SIZE */ + 603, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 607, /* GL_HISTOGRAM_SINK */ + 925, /* GL_MINMAX */ + 927, /* GL_MINMAX_FORMAT */ + 929, /* GL_MINMAX_SINK */ + 1501, /* GL_TABLE_TOO_LARGE_EXT */ + 1714, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1725, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1727, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1720, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1716, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1147, /* GL_POLYGON_OFFSET_FILL */ + 1146, /* GL_POLYGON_OFFSET_FACTOR */ + 1145, /* GL_POLYGON_OFFSET_BIAS */ + 1306, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 677, /* GL_LUMINANCE4 */ - 683, /* GL_LUMINANCE8 */ - 667, /* GL_LUMINANCE12 */ - 673, /* GL_LUMINANCE16 */ - 678, /* GL_LUMINANCE4_ALPHA4 */ - 681, /* GL_LUMINANCE6_ALPHA2 */ - 684, /* GL_LUMINANCE8_ALPHA8 */ - 670, /* GL_LUMINANCE12_ALPHA4 */ - 668, /* GL_LUMINANCE12_ALPHA12 */ - 674, /* GL_LUMINANCE16_ALPHA16 */ - 591, /* GL_INTENSITY */ - 596, /* GL_INTENSITY4 */ - 598, /* GL_INTENSITY8 */ - 592, /* GL_INTENSITY12 */ - 594, /* GL_INTENSITY16 */ - 1261, /* GL_RGB2_EXT */ - 1262, /* GL_RGB4 */ - 1265, /* GL_RGB5 */ - 1269, /* GL_RGB8 */ - 1253, /* GL_RGB10 */ - 1257, /* GL_RGB12 */ - 1259, /* GL_RGB16 */ - 1276, /* GL_RGBA2 */ - 1278, /* GL_RGBA4 */ - 1266, /* GL_RGB5_A1 */ - 1282, /* GL_RGBA8 */ - 1254, /* GL_RGB10_A2 */ - 1272, /* GL_RGBA12 */ - 1274, /* GL_RGBA16 */ - 1615, /* GL_TEXTURE_RED_SIZE */ - 1587, /* GL_TEXTURE_GREEN_SIZE */ - 1526, /* GL_TEXTURE_BLUE_SIZE */ - 1513, /* GL_TEXTURE_ALPHA_SIZE */ - 1600, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1591, /* GL_TEXTURE_INTENSITY_SIZE */ - 1247, /* GL_REPLACE_EXT */ - 1195, /* GL_PROXY_TEXTURE_1D */ - 1198, /* GL_PROXY_TEXTURE_2D */ - 1619, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1612, /* GL_TEXTURE_PRIORITY */ - 1617, /* GL_TEXTURE_RESIDENT */ - 1516, /* GL_TEXTURE_BINDING_1D */ - 1518, /* GL_TEXTURE_BINDING_2D */ - 1520, /* GL_TEXTURE_BINDING_3D */ - 1026, /* GL_PACK_SKIP_IMAGES */ - 1022, /* GL_PACK_IMAGE_HEIGHT */ - 1648, /* GL_UNPACK_SKIP_IMAGES */ - 1645, /* GL_UNPACK_IMAGE_HEIGHT */ - 1512, /* GL_TEXTURE_3D */ - 1201, /* GL_PROXY_TEXTURE_3D */ - 1574, /* GL_TEXTURE_DEPTH */ - 1622, /* GL_TEXTURE_WRAP_R */ - 792, /* GL_MAX_3D_TEXTURE_SIZE */ - 1678, /* GL_VERTEX_ARRAY */ - 957, /* GL_NORMAL_ARRAY */ + 721, /* GL_LUMINANCE4 */ + 727, /* GL_LUMINANCE8 */ + 711, /* GL_LUMINANCE12 */ + 717, /* GL_LUMINANCE16 */ + 722, /* GL_LUMINANCE4_ALPHA4 */ + 725, /* GL_LUMINANCE6_ALPHA2 */ + 728, /* GL_LUMINANCE8_ALPHA8 */ + 714, /* GL_LUMINANCE12_ALPHA4 */ + 712, /* GL_LUMINANCE12_ALPHA12 */ + 718, /* GL_LUMINANCE16_ALPHA16 */ + 634, /* GL_INTENSITY */ + 639, /* GL_INTENSITY4 */ + 641, /* GL_INTENSITY8 */ + 635, /* GL_INTENSITY12 */ + 637, /* GL_INTENSITY16 */ + 1318, /* GL_RGB2_EXT */ + 1319, /* GL_RGB4 */ + 1322, /* GL_RGB5 */ + 1326, /* GL_RGB8 */ + 1310, /* GL_RGB10 */ + 1314, /* GL_RGB12 */ + 1316, /* GL_RGB16 */ + 1333, /* GL_RGBA2 */ + 1335, /* GL_RGBA4 */ + 1323, /* GL_RGB5_A1 */ + 1339, /* GL_RGBA8 */ + 1311, /* GL_RGB10_A2 */ + 1329, /* GL_RGBA12 */ + 1331, /* GL_RGBA16 */ + 1674, /* GL_TEXTURE_RED_SIZE */ + 1646, /* GL_TEXTURE_GREEN_SIZE */ + 1585, /* GL_TEXTURE_BLUE_SIZE */ + 1572, /* GL_TEXTURE_ALPHA_SIZE */ + 1659, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1650, /* GL_TEXTURE_INTENSITY_SIZE */ + 1304, /* GL_REPLACE_EXT */ + 1240, /* GL_PROXY_TEXTURE_1D */ + 1243, /* GL_PROXY_TEXTURE_2D */ + 1679, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1671, /* GL_TEXTURE_PRIORITY */ + 1676, /* GL_TEXTURE_RESIDENT */ + 1575, /* GL_TEXTURE_BINDING_1D */ + 1577, /* GL_TEXTURE_BINDING_2D */ + 1579, /* GL_TEXTURE_BINDING_3D */ + 1071, /* GL_PACK_SKIP_IMAGES */ + 1067, /* GL_PACK_IMAGE_HEIGHT */ + 1708, /* GL_UNPACK_SKIP_IMAGES */ + 1705, /* GL_UNPACK_IMAGE_HEIGHT */ + 1571, /* GL_TEXTURE_3D */ + 1246, /* GL_PROXY_TEXTURE_3D */ + 1633, /* GL_TEXTURE_DEPTH */ + 1682, /* GL_TEXTURE_WRAP_R */ + 836, /* GL_MAX_3D_TEXTURE_SIZE */ + 1740, /* GL_VERTEX_ARRAY */ + 1002, /* GL_NORMAL_ARRAY */ 138, /* GL_COLOR_ARRAY */ - 576, /* GL_INDEX_ARRAY */ - 1553, /* GL_TEXTURE_COORD_ARRAY */ - 414, /* GL_EDGE_FLAG_ARRAY */ - 1683, /* GL_VERTEX_ARRAY_SIZE */ - 1685, /* GL_VERTEX_ARRAY_TYPE */ - 1684, /* GL_VERTEX_ARRAY_STRIDE */ - 962, /* GL_NORMAL_ARRAY_TYPE */ - 961, /* GL_NORMAL_ARRAY_STRIDE */ + 619, /* GL_INDEX_ARRAY */ + 1612, /* GL_TEXTURE_COORD_ARRAY */ + 435, /* GL_EDGE_FLAG_ARRAY */ + 1745, /* GL_VERTEX_ARRAY_SIZE */ + 1747, /* GL_VERTEX_ARRAY_TYPE */ + 1746, /* GL_VERTEX_ARRAY_STRIDE */ + 1007, /* GL_NORMAL_ARRAY_TYPE */ + 1006, /* GL_NORMAL_ARRAY_STRIDE */ 142, /* GL_COLOR_ARRAY_SIZE */ 144, /* GL_COLOR_ARRAY_TYPE */ 143, /* GL_COLOR_ARRAY_STRIDE */ - 581, /* GL_INDEX_ARRAY_TYPE */ - 580, /* GL_INDEX_ARRAY_STRIDE */ - 1557, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1559, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1558, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 418, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1682, /* GL_VERTEX_ARRAY_POINTER */ - 960, /* GL_NORMAL_ARRAY_POINTER */ + 624, /* GL_INDEX_ARRAY_TYPE */ + 623, /* GL_INDEX_ARRAY_STRIDE */ + 1616, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1618, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1617, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 439, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1744, /* GL_VERTEX_ARRAY_POINTER */ + 1005, /* GL_NORMAL_ARRAY_POINTER */ 141, /* GL_COLOR_ARRAY_POINTER */ - 579, /* GL_INDEX_ARRAY_POINTER */ - 1556, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 417, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 936, /* GL_MULTISAMPLE */ - 1304, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1306, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1311, /* GL_SAMPLE_COVERAGE */ - 1308, /* GL_SAMPLE_BUFFERS */ - 1299, /* GL_SAMPLES */ - 1315, /* GL_SAMPLE_COVERAGE_VALUE */ - 1313, /* GL_SAMPLE_COVERAGE_INVERT */ - 169, /* GL_COLOR_MATRIX */ - 171, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 800, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1127, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1123, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1118, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1114, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1125, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1121, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1116, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1112, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1536, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1202, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1538, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 622, /* GL_INDEX_ARRAY_POINTER */ + 1615, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 438, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 981, /* GL_MULTISAMPLE */ + 1361, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1363, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1368, /* GL_SAMPLE_COVERAGE */ + 1365, /* GL_SAMPLE_BUFFERS */ + 1356, /* GL_SAMPLES */ + 1372, /* GL_SAMPLE_COVERAGE_VALUE */ + 1370, /* GL_SAMPLE_COVERAGE_INVERT */ + 185, /* GL_COLOR_MATRIX */ + 187, /* GL_COLOR_MATRIX_STACK_DEPTH */ + 844, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1172, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1168, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1163, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1159, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1170, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1166, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1161, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1157, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1595, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1247, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1597, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 79, /* GL_BLEND_DST_RGB */ 87, /* GL_BLEND_SRC_RGB */ 78, /* GL_BLEND_DST_ALPHA */ 86, /* GL_BLEND_SRC_ALPHA */ - 175, /* GL_COLOR_TABLE */ - 1137, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1120, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1190, /* GL_PROXY_COLOR_TABLE */ - 1194, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1193, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - 199, /* GL_COLOR_TABLE_SCALE */ - 179, /* GL_COLOR_TABLE_BIAS */ - 184, /* GL_COLOR_TABLE_FORMAT */ - 201, /* GL_COLOR_TABLE_WIDTH */ - 196, /* GL_COLOR_TABLE_RED_SIZE */ - 187, /* GL_COLOR_TABLE_GREEN_SIZE */ - 181, /* GL_COLOR_TABLE_BLUE_SIZE */ - 176, /* GL_COLOR_TABLE_ALPHA_SIZE */ - 193, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - 190, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + 191, /* GL_COLOR_TABLE */ + 1182, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1165, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1235, /* GL_PROXY_COLOR_TABLE */ + 1239, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1238, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 215, /* GL_COLOR_TABLE_SCALE */ + 195, /* GL_COLOR_TABLE_BIAS */ + 200, /* GL_COLOR_TABLE_FORMAT */ + 217, /* GL_COLOR_TABLE_WIDTH */ + 212, /* GL_COLOR_TABLE_RED_SIZE */ + 203, /* GL_COLOR_TABLE_GREEN_SIZE */ + 197, /* GL_COLOR_TABLE_BLUE_SIZE */ + 192, /* GL_COLOR_TABLE_ALPHA_SIZE */ + 209, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + 206, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 70, /* GL_BGR */ 71, /* GL_BGRA */ - 814, /* GL_MAX_ELEMENTS_VERTICES */ - 813, /* GL_MAX_ELEMENTS_INDICES */ - 1590, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 858, /* GL_MAX_ELEMENTS_VERTICES */ + 857, /* GL_MAX_ELEMENTS_INDICES */ + 1649, /* GL_TEXTURE_INDEX_SIZE_EXT */ 135, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1084, /* GL_POINT_SIZE_MIN */ - 1080, /* GL_POINT_SIZE_MAX */ - 1074, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1070, /* GL_POINT_DISTANCE_ATTENUATION */ + 1129, /* GL_POINT_SIZE_MIN */ + 1125, /* GL_POINT_SIZE_MAX */ + 1119, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1115, /* GL_POINT_DISTANCE_ATTENUATION */ 117, /* GL_CLAMP_TO_BORDER */ 120, /* GL_CLAMP_TO_EDGE */ - 1611, /* GL_TEXTURE_MIN_LOD */ - 1609, /* GL_TEXTURE_MAX_LOD */ - 1515, /* GL_TEXTURE_BASE_LEVEL */ - 1608, /* GL_TEXTURE_MAX_LEVEL */ - 570, /* GL_IGNORE_BORDER_HP */ - 245, /* GL_CONSTANT_BORDER_HP */ - 1248, /* GL_REPLICATE_BORDER_HP */ - 251, /* GL_CONVOLUTION_BORDER_COLOR */ - 985, /* GL_OCCLUSION_TEST_HP */ - 986, /* GL_OCCLUSION_TEST_RESULT_HP */ - 639, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1530, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1532, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1534, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1535, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1533, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1531, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 796, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 797, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1147, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1149, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1146, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1148, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1598, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1599, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1597, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 516, /* GL_GENERATE_MIPMAP */ - 517, /* GL_GENERATE_MIPMAP_HINT */ - 479, /* GL_FOG_OFFSET_SGIX */ - 480, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1544, /* GL_TEXTURE_COMPARE_SGIX */ - 1543, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1594, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1586, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 322, /* GL_DEPTH_COMPONENT16 */ - 325, /* GL_DEPTH_COMPONENT24 */ - 328, /* GL_DEPTH_COMPONENT32 */ - 273, /* GL_CULL_VERTEX_EXT */ - 275, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - 274, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1739, /* GL_WRAP_BORDER_SUN */ - 1537, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 632, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1343, /* GL_SINGLE_COLOR */ - 1331, /* GL_SEPARATE_SPECULAR_COLOR */ - 1340, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 1653, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1666, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1667, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1664, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1662, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1660, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1658, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1606, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1607, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1605, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 887, /* GL_MIRRORED_REPEAT */ - 1287, /* GL_RGB_S3TC */ - 1264, /* GL_RGB4_S3TC */ - 1286, /* GL_RGBA_S3TC */ - 1281, /* GL_RGBA4_S3TC */ - 1284, /* GL_RGBA_DXT5_S3TC */ - 1279, /* GL_RGBA4_DXT5_S3TC */ - 238, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - 233, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - 234, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - 235, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 948, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 947, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 640, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 466, /* GL_FOG_COORDINATE_SOURCE */ - 458, /* GL_FOG_COORD */ - 482, /* GL_FRAGMENT_DEPTH */ - 279, /* GL_CURRENT_FOG_COORD */ - 465, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 464, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 463, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 460, /* GL_FOG_COORDINATE_ARRAY */ - 173, /* GL_COLOR_SUM */ - 298, /* GL_CURRENT_SECONDARY_COLOR */ - 1324, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1326, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1325, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1323, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1320, /* GL_SECONDARY_COLOR_ARRAY */ - 526, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + 1670, /* GL_TEXTURE_MIN_LOD */ + 1668, /* GL_TEXTURE_MAX_LOD */ + 1574, /* GL_TEXTURE_BASE_LEVEL */ + 1667, /* GL_TEXTURE_MAX_LEVEL */ + 612, /* GL_IGNORE_BORDER_HP */ + 261, /* GL_CONSTANT_BORDER_HP */ + 1305, /* GL_REPLICATE_BORDER_HP */ + 267, /* GL_CONVOLUTION_BORDER_COLOR */ + 1030, /* GL_OCCLUSION_TEST_HP */ + 1031, /* GL_OCCLUSION_TEST_RESULT_HP */ + 683, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1589, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1591, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1593, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1594, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1592, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1590, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 840, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 841, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1192, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1194, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1191, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1193, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1657, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1658, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1656, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 558, /* GL_GENERATE_MIPMAP */ + 559, /* GL_GENERATE_MIPMAP_HINT */ + 500, /* GL_FOG_OFFSET_SGIX */ + 501, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1603, /* GL_TEXTURE_COMPARE_SGIX */ + 1602, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1653, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1645, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 340, /* GL_DEPTH_COMPONENT16 */ + 343, /* GL_DEPTH_COMPONENT24 */ + 346, /* GL_DEPTH_COMPONENT32 */ + 289, /* GL_CULL_VERTEX_EXT */ + 291, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + 290, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + 1801, /* GL_WRAP_BORDER_SUN */ + 1596, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 676, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1400, /* GL_SINGLE_COLOR */ + 1388, /* GL_SEPARATE_SPECULAR_COLOR */ + 1397, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 511, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 512, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 519, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 514, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 510, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 509, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 513, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 520, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 531, /* GL_FRAMEBUFFER_DEFAULT */ + 544, /* GL_FRAMEBUFFER_UNDEFINED */ + 353, /* GL_DEPTH_STENCIL_ATTACHMENT */ + 618, /* GL_INDEX */ + 1713, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1728, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1729, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1726, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1724, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1721, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1719, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1665, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1666, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1664, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 932, /* GL_MIRRORED_REPEAT */ + 1344, /* GL_RGB_S3TC */ + 1321, /* GL_RGB4_S3TC */ + 1343, /* GL_RGBA_S3TC */ + 1338, /* GL_RGBA4_S3TC */ + 1341, /* GL_RGBA_DXT5_S3TC */ + 1336, /* GL_RGBA4_DXT5_S3TC */ + 254, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + 249, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + 250, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + 251, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + 993, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 992, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 684, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 487, /* GL_FOG_COORDINATE_SOURCE */ + 479, /* GL_FOG_COORD */ + 503, /* GL_FRAGMENT_DEPTH */ + 295, /* GL_CURRENT_FOG_COORD */ + 486, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 485, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 484, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 481, /* GL_FOG_COORDINATE_ARRAY */ + 189, /* GL_COLOR_SUM */ + 314, /* GL_CURRENT_SECONDARY_COLOR */ + 1381, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1383, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1382, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1380, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1377, /* GL_SECONDARY_COLOR_ARRAY */ + 568, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1444, /* GL_TEXTURE0 */ - 1446, /* GL_TEXTURE1 */ - 1468, /* GL_TEXTURE2 */ - 1490, /* GL_TEXTURE3 */ - 1496, /* GL_TEXTURE4 */ - 1498, /* GL_TEXTURE5 */ - 1500, /* GL_TEXTURE6 */ - 1502, /* GL_TEXTURE7 */ - 1504, /* GL_TEXTURE8 */ - 1506, /* GL_TEXTURE9 */ - 1447, /* GL_TEXTURE10 */ - 1449, /* GL_TEXTURE11 */ - 1451, /* GL_TEXTURE12 */ - 1453, /* GL_TEXTURE13 */ - 1455, /* GL_TEXTURE14 */ - 1457, /* GL_TEXTURE15 */ - 1459, /* GL_TEXTURE16 */ - 1461, /* GL_TEXTURE17 */ - 1463, /* GL_TEXTURE18 */ - 1465, /* GL_TEXTURE19 */ - 1469, /* GL_TEXTURE20 */ - 1471, /* GL_TEXTURE21 */ - 1473, /* GL_TEXTURE22 */ - 1475, /* GL_TEXTURE23 */ - 1477, /* GL_TEXTURE24 */ - 1479, /* GL_TEXTURE25 */ - 1481, /* GL_TEXTURE26 */ - 1483, /* GL_TEXTURE27 */ - 1485, /* GL_TEXTURE28 */ - 1487, /* GL_TEXTURE29 */ - 1491, /* GL_TEXTURE30 */ - 1493, /* GL_TEXTURE31 */ + 1503, /* GL_TEXTURE0 */ + 1505, /* GL_TEXTURE1 */ + 1527, /* GL_TEXTURE2 */ + 1549, /* GL_TEXTURE3 */ + 1555, /* GL_TEXTURE4 */ + 1557, /* GL_TEXTURE5 */ + 1559, /* GL_TEXTURE6 */ + 1561, /* GL_TEXTURE7 */ + 1563, /* GL_TEXTURE8 */ + 1565, /* GL_TEXTURE9 */ + 1506, /* GL_TEXTURE10 */ + 1508, /* GL_TEXTURE11 */ + 1510, /* GL_TEXTURE12 */ + 1512, /* GL_TEXTURE13 */ + 1514, /* GL_TEXTURE14 */ + 1516, /* GL_TEXTURE15 */ + 1518, /* GL_TEXTURE16 */ + 1520, /* GL_TEXTURE17 */ + 1522, /* GL_TEXTURE18 */ + 1524, /* GL_TEXTURE19 */ + 1528, /* GL_TEXTURE20 */ + 1530, /* GL_TEXTURE21 */ + 1532, /* GL_TEXTURE22 */ + 1534, /* GL_TEXTURE23 */ + 1536, /* GL_TEXTURE24 */ + 1538, /* GL_TEXTURE25 */ + 1540, /* GL_TEXTURE26 */ + 1542, /* GL_TEXTURE27 */ + 1544, /* GL_TEXTURE28 */ + 1546, /* GL_TEXTURE29 */ + 1550, /* GL_TEXTURE30 */ + 1552, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ 123, /* GL_CLIENT_ACTIVE_TEXTURE */ - 865, /* GL_MAX_TEXTURE_UNITS */ - 1632, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1635, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1637, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1629, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1432, /* GL_SUBTRACT */ - 854, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - 221, /* GL_COMPRESSED_ALPHA */ - 225, /* GL_COMPRESSED_LUMINANCE */ - 226, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - 223, /* GL_COMPRESSED_INTENSITY */ - 229, /* GL_COMPRESSED_RGB */ - 230, /* GL_COMPRESSED_RGBA */ - 1551, /* GL_TEXTURE_COMPRESSION_HINT */ - 1613, /* GL_TEXTURE_RECTANGLE_ARB */ - 1523, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1205, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 852, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 334, /* GL_DEPTH_STENCIL_NV */ - 1657, /* GL_UNSIGNED_INT_24_8_NV */ - 861, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1604, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 862, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1580, /* GL_TEXTURE_FILTER_CONTROL */ - 1595, /* GL_TEXTURE_LOD_BIAS */ - 206, /* GL_COMBINE4 */ - 855, /* GL_MAX_SHININESS_NV */ - 856, /* GL_MAX_SPOT_EXPONENT_NV */ - 574, /* GL_INCR_WRAP */ - 309, /* GL_DECR_WRAP */ - 907, /* GL_MODELVIEW1_ARB */ - 963, /* GL_NORMAL_MAP */ - 1234, /* GL_REFLECTION_MAP */ - 1560, /* GL_TEXTURE_CUBE_MAP */ - 1521, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1568, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1562, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1570, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1564, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1572, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1566, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1203, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 808, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 942, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 474, /* GL_FOG_DISTANCE_MODE_NV */ - 433, /* GL_EYE_RADIAL_NV */ - 432, /* GL_EYE_PLANE_ABSOLUTE_NV */ - 205, /* GL_COMBINE */ - 212, /* GL_COMBINE_RGB */ - 207, /* GL_COMBINE_ALPHA */ - 1288, /* GL_RGB_SCALE */ + 910, /* GL_MAX_TEXTURE_UNITS */ + 1692, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1695, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1697, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1689, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1491, /* GL_SUBTRACT */ + 898, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 237, /* GL_COMPRESSED_ALPHA */ + 241, /* GL_COMPRESSED_LUMINANCE */ + 242, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + 239, /* GL_COMPRESSED_INTENSITY */ + 245, /* GL_COMPRESSED_RGB */ + 246, /* GL_COMPRESSED_RGBA */ + 1610, /* GL_TEXTURE_COMPRESSION_HINT */ + 1672, /* GL_TEXTURE_RECTANGLE_ARB */ + 1582, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1250, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 896, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 352, /* GL_DEPTH_STENCIL */ + 1717, /* GL_UNSIGNED_INT_24_8 */ + 906, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1663, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 907, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1639, /* GL_TEXTURE_FILTER_CONTROL */ + 1654, /* GL_TEXTURE_LOD_BIAS */ + 222, /* GL_COMBINE4 */ + 900, /* GL_MAX_SHININESS_NV */ + 901, /* GL_MAX_SPOT_EXPONENT_NV */ + 616, /* GL_INCR_WRAP */ + 325, /* GL_DECR_WRAP */ + 952, /* GL_MODELVIEW1_ARB */ + 1008, /* GL_NORMAL_MAP */ + 1280, /* GL_REFLECTION_MAP */ + 1619, /* GL_TEXTURE_CUBE_MAP */ + 1580, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1627, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1621, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1629, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1623, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1631, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1625, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1248, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 852, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 987, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 495, /* GL_FOG_DISTANCE_MODE_NV */ + 454, /* GL_EYE_RADIAL_NV */ + 453, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 221, /* GL_COMBINE */ + 228, /* GL_COMBINE_RGB */ + 223, /* GL_COMBINE_ALPHA */ + 1345, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 601, /* GL_INTERPOLATE */ - 240, /* GL_CONSTANT */ - 1153, /* GL_PRIMARY_COLOR */ - 1150, /* GL_PREVIOUS */ - 1354, /* GL_SOURCE0_RGB */ - 1360, /* GL_SOURCE1_RGB */ - 1366, /* GL_SOURCE2_RGB */ - 1370, /* GL_SOURCE3_RGB_NV */ - 1351, /* GL_SOURCE0_ALPHA */ - 1357, /* GL_SOURCE1_ALPHA */ - 1363, /* GL_SOURCE2_ALPHA */ - 1369, /* GL_SOURCE3_ALPHA_NV */ - 999, /* GL_OPERAND0_RGB */ - 1005, /* GL_OPERAND1_RGB */ - 1011, /* GL_OPERAND2_RGB */ - 1015, /* GL_OPERAND3_RGB_NV */ - 996, /* GL_OPERAND0_ALPHA */ - 1002, /* GL_OPERAND1_ALPHA */ - 1008, /* GL_OPERAND2_ALPHA */ - 1014, /* GL_OPERAND3_ALPHA_NV */ - 1679, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - 1743, /* GL_YCBCR_422_APPLE */ - 1668, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1670, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1345, /* GL_SLICE_ACCUM_SUN */ - 1210, /* GL_QUAD_MESH_SUN */ - 1641, /* GL_TRIANGLE_MESH_SUN */ - 1717, /* GL_VERTEX_PROGRAM_ARB */ - 1728, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1704, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1710, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1712, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1714, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - 300, /* GL_CURRENT_VERTEX_ATTRIB */ - 1166, /* GL_PROGRAM_LENGTH_ARB */ - 1180, /* GL_PROGRAM_STRING_ARB */ - 929, /* GL_MODELVIEW_PROJECTION_NV */ - 569, /* GL_IDENTITY_NV */ - 614, /* GL_INVERSE_NV */ - 1634, /* GL_TRANSPOSE_NV */ - 615, /* GL_INVERSE_TRANSPOSE_NV */ - 838, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 837, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 745, /* GL_MATRIX0_NV */ - 757, /* GL_MATRIX1_NV */ - 769, /* GL_MATRIX2_NV */ - 773, /* GL_MATRIX3_NV */ - 775, /* GL_MATRIX4_NV */ - 777, /* GL_MATRIX5_NV */ - 779, /* GL_MATRIX6_NV */ - 781, /* GL_MATRIX7_NV */ - 285, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - 282, /* GL_CURRENT_MATRIX_ARB */ - 1720, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1723, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1178, /* GL_PROGRAM_PARAMETER_NV */ - 1708, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1182, /* GL_PROGRAM_TARGET_NV */ - 1179, /* GL_PROGRAM_RESIDENT_NV */ - 1626, /* GL_TRACK_MATRIX_NV */ - 1627, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1718, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1160, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 319, /* GL_DEPTH_CLAMP_NV */ - 1686, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1693, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1694, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1695, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1696, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1697, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1698, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1699, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1700, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1701, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1687, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1688, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1689, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1690, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1691, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1692, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 699, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 706, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 707, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 708, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 709, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 710, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 711, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 712, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 713, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 714, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 700, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 701, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 702, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 703, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 704, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 705, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 726, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 733, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 734, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 735, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 736, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 737, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 738, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1159, /* GL_PROGRAM_BINDING_ARB */ - 740, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 741, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 727, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 728, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 729, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 730, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 731, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 732, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1549, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1546, /* GL_TEXTURE_COMPRESSED */ - 968, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - 239, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 877, /* GL_MAX_VERTEX_UNITS_ARB */ + 644, /* GL_INTERPOLATE */ + 256, /* GL_CONSTANT */ + 1198, /* GL_PRIMARY_COLOR */ + 1195, /* GL_PREVIOUS */ + 1411, /* GL_SOURCE0_RGB */ + 1417, /* GL_SOURCE1_RGB */ + 1423, /* GL_SOURCE2_RGB */ + 1427, /* GL_SOURCE3_RGB_NV */ + 1408, /* GL_SOURCE0_ALPHA */ + 1414, /* GL_SOURCE1_ALPHA */ + 1420, /* GL_SOURCE2_ALPHA */ + 1426, /* GL_SOURCE3_ALPHA_NV */ + 1044, /* GL_OPERAND0_RGB */ + 1050, /* GL_OPERAND1_RGB */ + 1056, /* GL_OPERAND2_RGB */ + 1060, /* GL_OPERAND3_RGB_NV */ + 1041, /* GL_OPERAND0_ALPHA */ + 1047, /* GL_OPERAND1_ALPHA */ + 1053, /* GL_OPERAND2_ALPHA */ + 1059, /* GL_OPERAND3_ALPHA_NV */ + 1741, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + 1805, /* GL_YCBCR_422_APPLE */ + 1730, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1732, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1402, /* GL_SLICE_ACCUM_SUN */ + 1255, /* GL_QUAD_MESH_SUN */ + 1701, /* GL_TRIANGLE_MESH_SUN */ + 1779, /* GL_VERTEX_PROGRAM_ARB */ + 1790, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1766, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1772, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1774, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1776, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 316, /* GL_CURRENT_VERTEX_ATTRIB */ + 1211, /* GL_PROGRAM_LENGTH_ARB */ + 1225, /* GL_PROGRAM_STRING_ARB */ + 974, /* GL_MODELVIEW_PROJECTION_NV */ + 611, /* GL_IDENTITY_NV */ + 658, /* GL_INVERSE_NV */ + 1694, /* GL_TRANSPOSE_NV */ + 659, /* GL_INVERSE_TRANSPOSE_NV */ + 882, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 881, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 789, /* GL_MATRIX0_NV */ + 801, /* GL_MATRIX1_NV */ + 813, /* GL_MATRIX2_NV */ + 817, /* GL_MATRIX3_NV */ + 819, /* GL_MATRIX4_NV */ + 821, /* GL_MATRIX5_NV */ + 823, /* GL_MATRIX6_NV */ + 825, /* GL_MATRIX7_NV */ + 301, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + 298, /* GL_CURRENT_MATRIX_ARB */ + 1782, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1785, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1223, /* GL_PROGRAM_PARAMETER_NV */ + 1770, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1227, /* GL_PROGRAM_TARGET_NV */ + 1224, /* GL_PROGRAM_RESIDENT_NV */ + 1686, /* GL_TRACK_MATRIX_NV */ + 1687, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1780, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1205, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 337, /* GL_DEPTH_CLAMP_NV */ + 1748, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1755, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1756, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1757, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1758, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1759, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1760, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1761, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1762, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1763, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1749, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1750, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1751, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1752, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1753, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1754, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 743, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 750, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 751, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 752, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 753, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 754, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 755, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 756, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 757, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 758, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 744, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 745, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 746, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 747, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 748, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 749, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 770, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 777, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 778, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 779, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 780, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 781, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 782, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1204, /* GL_PROGRAM_BINDING_ARB */ + 784, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 785, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 771, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 772, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 773, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 774, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 775, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 776, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1608, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1605, /* GL_TEXTURE_COMPRESSED */ + 1013, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 255, /* GL_COMPRESSED_TEXTURE_FORMATS */ + 922, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1738, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1716, /* GL_VERTEX_BLEND_ARB */ - 302, /* GL_CURRENT_WEIGHT_ARB */ - 1737, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1736, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1735, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1734, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1731, /* GL_WEIGHT_ARRAY_ARB */ - 345, /* GL_DOT3_RGB */ - 346, /* GL_DOT3_RGBA */ - 237, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - 232, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 937, /* GL_MULTISAMPLE_3DFX */ - 1309, /* GL_SAMPLE_BUFFERS_3DFX */ - 1300, /* GL_SAMPLES_3DFX */ - 918, /* GL_MODELVIEW2_ARB */ - 921, /* GL_MODELVIEW3_ARB */ - 922, /* GL_MODELVIEW4_ARB */ - 923, /* GL_MODELVIEW5_ARB */ - 924, /* GL_MODELVIEW6_ARB */ - 925, /* GL_MODELVIEW7_ARB */ - 926, /* GL_MODELVIEW8_ARB */ - 927, /* GL_MODELVIEW9_ARB */ - 897, /* GL_MODELVIEW10_ARB */ - 898, /* GL_MODELVIEW11_ARB */ - 899, /* GL_MODELVIEW12_ARB */ - 900, /* GL_MODELVIEW13_ARB */ - 901, /* GL_MODELVIEW14_ARB */ - 902, /* GL_MODELVIEW15_ARB */ - 903, /* GL_MODELVIEW16_ARB */ - 904, /* GL_MODELVIEW17_ARB */ - 905, /* GL_MODELVIEW18_ARB */ - 906, /* GL_MODELVIEW19_ARB */ - 908, /* GL_MODELVIEW20_ARB */ - 909, /* GL_MODELVIEW21_ARB */ - 910, /* GL_MODELVIEW22_ARB */ - 911, /* GL_MODELVIEW23_ARB */ - 912, /* GL_MODELVIEW24_ARB */ - 913, /* GL_MODELVIEW25_ARB */ - 914, /* GL_MODELVIEW26_ARB */ - 915, /* GL_MODELVIEW27_ARB */ - 916, /* GL_MODELVIEW28_ARB */ - 917, /* GL_MODELVIEW29_ARB */ - 919, /* GL_MODELVIEW30_ARB */ - 920, /* GL_MODELVIEW31_ARB */ - 350, /* GL_DOT3_RGB_EXT */ - 348, /* GL_DOT3_RGBA_EXT */ - 891, /* GL_MIRROR_CLAMP_EXT */ - 894, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 932, /* GL_MODULATE_ADD_ATI */ - 933, /* GL_MODULATE_SIGNED_ADD_ATI */ - 934, /* GL_MODULATE_SUBTRACT_ATI */ - 1744, /* GL_YCBCR_MESA */ - 1023, /* GL_PACK_INVERT_MESA */ - 305, /* GL_DEBUG_OBJECT_MESA */ - 306, /* GL_DEBUG_PRINT_MESA */ - 304, /* GL_DEBUG_ASSERT_MESA */ + 1800, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1778, /* GL_VERTEX_BLEND_ARB */ + 318, /* GL_CURRENT_WEIGHT_ARB */ + 1799, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1798, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1797, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1796, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1793, /* GL_WEIGHT_ARRAY_ARB */ + 365, /* GL_DOT3_RGB */ + 366, /* GL_DOT3_RGBA */ + 253, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + 248, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + 982, /* GL_MULTISAMPLE_3DFX */ + 1366, /* GL_SAMPLE_BUFFERS_3DFX */ + 1357, /* GL_SAMPLES_3DFX */ + 963, /* GL_MODELVIEW2_ARB */ + 966, /* GL_MODELVIEW3_ARB */ + 967, /* GL_MODELVIEW4_ARB */ + 968, /* GL_MODELVIEW5_ARB */ + 969, /* GL_MODELVIEW6_ARB */ + 970, /* GL_MODELVIEW7_ARB */ + 971, /* GL_MODELVIEW8_ARB */ + 972, /* GL_MODELVIEW9_ARB */ + 942, /* GL_MODELVIEW10_ARB */ + 943, /* GL_MODELVIEW11_ARB */ + 944, /* GL_MODELVIEW12_ARB */ + 945, /* GL_MODELVIEW13_ARB */ + 946, /* GL_MODELVIEW14_ARB */ + 947, /* GL_MODELVIEW15_ARB */ + 948, /* GL_MODELVIEW16_ARB */ + 949, /* GL_MODELVIEW17_ARB */ + 950, /* GL_MODELVIEW18_ARB */ + 951, /* GL_MODELVIEW19_ARB */ + 953, /* GL_MODELVIEW20_ARB */ + 954, /* GL_MODELVIEW21_ARB */ + 955, /* GL_MODELVIEW22_ARB */ + 956, /* GL_MODELVIEW23_ARB */ + 957, /* GL_MODELVIEW24_ARB */ + 958, /* GL_MODELVIEW25_ARB */ + 959, /* GL_MODELVIEW26_ARB */ + 960, /* GL_MODELVIEW27_ARB */ + 961, /* GL_MODELVIEW28_ARB */ + 962, /* GL_MODELVIEW29_ARB */ + 964, /* GL_MODELVIEW30_ARB */ + 965, /* GL_MODELVIEW31_ARB */ + 370, /* GL_DOT3_RGB_EXT */ + 368, /* GL_DOT3_RGBA_EXT */ + 936, /* GL_MIRROR_CLAMP_EXT */ + 939, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 977, /* GL_MODULATE_ADD_ATI */ + 978, /* GL_MODULATE_SIGNED_ADD_ATI */ + 979, /* GL_MODULATE_SUBTRACT_ATI */ + 1806, /* GL_YCBCR_MESA */ + 1068, /* GL_PACK_INVERT_MESA */ + 321, /* GL_DEBUG_OBJECT_MESA */ + 322, /* GL_DEBUG_PRINT_MESA */ + 320, /* GL_DEBUG_ASSERT_MESA */ 106, /* GL_BUFFER_SIZE */ 108, /* GL_BUFFER_USAGE */ - 1397, /* GL_STENCIL_BACK_FUNC */ - 1395, /* GL_STENCIL_BACK_FAIL */ - 1399, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1401, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 483, /* GL_FRAGMENT_PROGRAM_ARB */ - 1157, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1185, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1184, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1169, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1175, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1174, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 827, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 850, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 849, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 840, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 846, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 845, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 810, /* GL_MAX_DRAW_BUFFERS */ - 354, /* GL_DRAW_BUFFER0 */ - 357, /* GL_DRAW_BUFFER1 */ - 378, /* GL_DRAW_BUFFER2 */ - 381, /* GL_DRAW_BUFFER3 */ - 384, /* GL_DRAW_BUFFER4 */ - 387, /* GL_DRAW_BUFFER5 */ - 390, /* GL_DRAW_BUFFER6 */ - 393, /* GL_DRAW_BUFFER7 */ - 396, /* GL_DRAW_BUFFER8 */ - 399, /* GL_DRAW_BUFFER9 */ - 358, /* GL_DRAW_BUFFER10 */ - 361, /* GL_DRAW_BUFFER11 */ - 364, /* GL_DRAW_BUFFER12 */ - 367, /* GL_DRAW_BUFFER13 */ - 370, /* GL_DRAW_BUFFER14 */ - 373, /* GL_DRAW_BUFFER15 */ + 1456, /* GL_STENCIL_BACK_FUNC */ + 1454, /* GL_STENCIL_BACK_FAIL */ + 1458, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1460, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 504, /* GL_FRAGMENT_PROGRAM_ARB */ + 1202, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1230, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1229, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1214, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1220, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1219, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 871, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 894, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 893, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 884, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 890, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 889, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 854, /* GL_MAX_DRAW_BUFFERS */ + 374, /* GL_DRAW_BUFFER0 */ + 377, /* GL_DRAW_BUFFER1 */ + 398, /* GL_DRAW_BUFFER2 */ + 401, /* GL_DRAW_BUFFER3 */ + 404, /* GL_DRAW_BUFFER4 */ + 407, /* GL_DRAW_BUFFER5 */ + 410, /* GL_DRAW_BUFFER6 */ + 413, /* GL_DRAW_BUFFER7 */ + 416, /* GL_DRAW_BUFFER8 */ + 419, /* GL_DRAW_BUFFER9 */ + 378, /* GL_DRAW_BUFFER10 */ + 381, /* GL_DRAW_BUFFER11 */ + 384, /* GL_DRAW_BUFFER12 */ + 387, /* GL_DRAW_BUFFER13 */ + 390, /* GL_DRAW_BUFFER14 */ + 393, /* GL_DRAW_BUFFER15 */ 81, /* GL_BLEND_EQUATION_ALPHA */ - 790, /* GL_MATRIX_PALETTE_ARB */ - 821, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 824, /* GL_MAX_PALETTE_MATRICES_ARB */ - 288, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 784, /* GL_MATRIX_INDEX_ARRAY_ARB */ - 283, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 786, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 788, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 787, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 785, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1575, /* GL_TEXTURE_DEPTH_SIZE */ - 338, /* GL_DEPTH_TEXTURE_MODE */ - 1541, /* GL_TEXTURE_COMPARE_MODE */ - 1539, /* GL_TEXTURE_COMPARE_FUNC */ - 216, /* GL_COMPARE_R_TO_TEXTURE */ - 1091, /* GL_POINT_SPRITE */ - 265, /* GL_COORD_REPLACE */ - 1095, /* GL_POINT_SPRITE_R_MODE_NV */ - 1212, /* GL_QUERY_COUNTER_BITS */ - 290, /* GL_CURRENT_QUERY */ - 1214, /* GL_QUERY_RESULT */ - 1216, /* GL_QUERY_RESULT_AVAILABLE */ - 871, /* GL_MAX_VERTEX_ATTRIBS */ - 1706, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 336, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 335, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 857, /* GL_MAX_TEXTURE_COORDS */ - 859, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1162, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1164, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1163, /* GL_PROGRAM_FORMAT_ARB */ - 1620, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 317, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 316, /* GL_DEPTH_BOUNDS_EXT */ + 834, /* GL_MATRIX_PALETTE_ARB */ + 865, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 868, /* GL_MAX_PALETTE_MATRICES_ARB */ + 304, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + 828, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 299, /* GL_CURRENT_MATRIX_INDEX_ARB */ + 830, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 832, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 831, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 829, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1634, /* GL_TEXTURE_DEPTH_SIZE */ + 358, /* GL_DEPTH_TEXTURE_MODE */ + 1600, /* GL_TEXTURE_COMPARE_MODE */ + 1598, /* GL_TEXTURE_COMPARE_FUNC */ + 232, /* GL_COMPARE_R_TO_TEXTURE */ + 1136, /* GL_POINT_SPRITE */ + 281, /* GL_COORD_REPLACE */ + 1140, /* GL_POINT_SPRITE_R_MODE_NV */ + 1257, /* GL_QUERY_COUNTER_BITS */ + 306, /* GL_CURRENT_QUERY */ + 1259, /* GL_QUERY_RESULT */ + 1261, /* GL_QUERY_RESULT_AVAILABLE */ + 916, /* GL_MAX_VERTEX_ATTRIBS */ + 1768, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 356, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 355, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 902, /* GL_MAX_TEXTURE_COORDS */ + 904, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1207, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1209, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1208, /* GL_PROGRAM_FORMAT_ARB */ + 1680, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 335, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 334, /* GL_DEPTH_BOUNDS_EXT */ 52, /* GL_ARRAY_BUFFER */ - 419, /* GL_ELEMENT_ARRAY_BUFFER */ + 440, /* GL_ELEMENT_ARRAY_BUFFER */ 53, /* GL_ARRAY_BUFFER_BINDING */ - 420, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1680, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 958, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 441, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1742, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1003, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 139, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 577, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1554, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 415, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1321, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 461, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1732, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1702, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1165, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 833, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1171, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 842, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1183, /* GL_PROGRAM_TEMPORARIES_ARB */ - 848, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1173, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 844, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1177, /* GL_PROGRAM_PARAMETERS_ARB */ - 847, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1172, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 843, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1158, /* GL_PROGRAM_ATTRIBS_ARB */ - 828, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1170, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 841, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1156, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 826, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1168, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 839, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 834, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 830, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1186, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1631, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1224, /* GL_READ_ONLY */ - 1740, /* GL_WRITE_ONLY */ - 1226, /* GL_READ_WRITE */ + 620, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1613, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 436, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1378, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 482, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1794, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1764, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1210, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 877, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1216, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 886, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1228, /* GL_PROGRAM_TEMPORARIES_ARB */ + 892, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1218, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 888, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1222, /* GL_PROGRAM_PARAMETERS_ARB */ + 891, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1217, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 887, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1203, /* GL_PROGRAM_ATTRIBS_ARB */ + 872, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1215, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 885, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1201, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 870, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1213, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 883, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 878, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 874, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1231, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1691, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1270, /* GL_READ_ONLY */ + 1802, /* GL_WRITE_ONLY */ + 1272, /* GL_READ_WRITE */ 100, /* GL_BUFFER_ACCESS */ 102, /* GL_BUFFER_MAPPED */ 104, /* GL_BUFFER_MAP_POINTER */ - 1625, /* GL_TIME_ELAPSED_EXT */ - 744, /* GL_MATRIX0_ARB */ - 756, /* GL_MATRIX1_ARB */ - 768, /* GL_MATRIX2_ARB */ - 772, /* GL_MATRIX3_ARB */ - 774, /* GL_MATRIX4_ARB */ - 776, /* GL_MATRIX5_ARB */ - 778, /* GL_MATRIX6_ARB */ - 780, /* GL_MATRIX7_ARB */ - 782, /* GL_MATRIX8_ARB */ - 783, /* GL_MATRIX9_ARB */ - 746, /* GL_MATRIX10_ARB */ - 747, /* GL_MATRIX11_ARB */ - 748, /* GL_MATRIX12_ARB */ - 749, /* GL_MATRIX13_ARB */ - 750, /* GL_MATRIX14_ARB */ - 751, /* GL_MATRIX15_ARB */ - 752, /* GL_MATRIX16_ARB */ - 753, /* GL_MATRIX17_ARB */ - 754, /* GL_MATRIX18_ARB */ - 755, /* GL_MATRIX19_ARB */ - 758, /* GL_MATRIX20_ARB */ - 759, /* GL_MATRIX21_ARB */ - 760, /* GL_MATRIX22_ARB */ - 761, /* GL_MATRIX23_ARB */ - 762, /* GL_MATRIX24_ARB */ - 763, /* GL_MATRIX25_ARB */ - 764, /* GL_MATRIX26_ARB */ - 765, /* GL_MATRIX27_ARB */ - 766, /* GL_MATRIX28_ARB */ - 767, /* GL_MATRIX29_ARB */ - 770, /* GL_MATRIX30_ARB */ - 771, /* GL_MATRIX31_ARB */ - 1427, /* GL_STREAM_DRAW */ - 1429, /* GL_STREAM_READ */ - 1425, /* GL_STREAM_COPY */ - 1389, /* GL_STATIC_DRAW */ - 1391, /* GL_STATIC_READ */ - 1387, /* GL_STATIC_COPY */ - 409, /* GL_DYNAMIC_DRAW */ - 411, /* GL_DYNAMIC_READ */ - 407, /* GL_DYNAMIC_COPY */ - 533, /* GL_GL_PIXEL_PACK_BUFFER */ - 535, /* GL_GL_PIXEL_UNPACK_BUFFER */ - 534, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - 536, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - 831, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - 829, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 832, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 836, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 835, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 793, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1421, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1685, /* GL_TIME_ELAPSED_EXT */ + 788, /* GL_MATRIX0_ARB */ + 800, /* GL_MATRIX1_ARB */ + 812, /* GL_MATRIX2_ARB */ + 816, /* GL_MATRIX3_ARB */ + 818, /* GL_MATRIX4_ARB */ + 820, /* GL_MATRIX5_ARB */ + 822, /* GL_MATRIX6_ARB */ + 824, /* GL_MATRIX7_ARB */ + 826, /* GL_MATRIX8_ARB */ + 827, /* GL_MATRIX9_ARB */ + 790, /* GL_MATRIX10_ARB */ + 791, /* GL_MATRIX11_ARB */ + 792, /* GL_MATRIX12_ARB */ + 793, /* GL_MATRIX13_ARB */ + 794, /* GL_MATRIX14_ARB */ + 795, /* GL_MATRIX15_ARB */ + 796, /* GL_MATRIX16_ARB */ + 797, /* GL_MATRIX17_ARB */ + 798, /* GL_MATRIX18_ARB */ + 799, /* GL_MATRIX19_ARB */ + 802, /* GL_MATRIX20_ARB */ + 803, /* GL_MATRIX21_ARB */ + 804, /* GL_MATRIX22_ARB */ + 805, /* GL_MATRIX23_ARB */ + 806, /* GL_MATRIX24_ARB */ + 807, /* GL_MATRIX25_ARB */ + 808, /* GL_MATRIX26_ARB */ + 809, /* GL_MATRIX27_ARB */ + 810, /* GL_MATRIX28_ARB */ + 811, /* GL_MATRIX29_ARB */ + 814, /* GL_MATRIX30_ARB */ + 815, /* GL_MATRIX31_ARB */ + 1486, /* GL_STREAM_DRAW */ + 1488, /* GL_STREAM_READ */ + 1484, /* GL_STREAM_COPY */ + 1447, /* GL_STATIC_DRAW */ + 1449, /* GL_STATIC_READ */ + 1445, /* GL_STATIC_COPY */ + 430, /* GL_DYNAMIC_DRAW */ + 432, /* GL_DYNAMIC_READ */ + 428, /* GL_DYNAMIC_COPY */ + 575, /* GL_GL_PIXEL_PACK_BUFFER */ + 577, /* GL_GL_PIXEL_UNPACK_BUFFER */ + 576, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + 578, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + 329, /* GL_DEPTH24_STENCIL8 */ + 1678, /* GL_TEXTURE_STENCIL_SIZE */ + 875, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + 873, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 876, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 880, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 879, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 837, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1480, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 892, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1302, /* GL_SAMPLES_PASSED */ - 484, /* GL_FRAGMENT_SHADER */ - 1726, /* GL_VERTEX_SHADER */ - 1176, /* GL_PROGRAM_OBJECT_ARB */ - 1334, /* GL_SHADER_OBJECT_ARB */ - 817, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 875, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 869, /* GL_MAX_VARYING_FLOATS */ - 873, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 802, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 983, /* GL_OBJECT_TYPE_ARB */ - 1336, /* GL_SHADER_TYPE */ - 449, /* GL_FLOAT_VEC2 */ - 451, /* GL_FLOAT_VEC3 */ - 453, /* GL_FLOAT_VEC4 */ - 604, /* GL_INT_VEC2 */ - 606, /* GL_INT_VEC3 */ - 608, /* GL_INT_VEC4 */ + 937, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1359, /* GL_SAMPLES_PASSED */ + 505, /* GL_FRAGMENT_SHADER */ + 1788, /* GL_VERTEX_SHADER */ + 1221, /* GL_PROGRAM_OBJECT_ARB */ + 1391, /* GL_SHADER_OBJECT_ARB */ + 861, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 920, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 914, /* GL_MAX_VARYING_FLOATS */ + 918, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 846, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1028, /* GL_OBJECT_TYPE_ARB */ + 1393, /* GL_SHADER_TYPE */ + 470, /* GL_FLOAT_VEC2 */ + 472, /* GL_FLOAT_VEC3 */ + 474, /* GL_FLOAT_VEC4 */ + 647, /* GL_INT_VEC2 */ + 649, /* GL_INT_VEC3 */ + 651, /* GL_INT_VEC4 */ 92, /* GL_BOOL */ 94, /* GL_BOOL_VEC2 */ 96, /* GL_BOOL_VEC3 */ 98, /* GL_BOOL_VEC4 */ - 443, /* GL_FLOAT_MAT2 */ - 445, /* GL_FLOAT_MAT3 */ - 447, /* GL_FLOAT_MAT4 */ - 1293, /* GL_SAMPLER_1D */ - 1295, /* GL_SAMPLER_2D */ - 1297, /* GL_SAMPLER_3D */ - 1298, /* GL_SAMPLER_CUBE */ - 1294, /* GL_SAMPLER_1D_SHADOW */ - 1296, /* GL_SAMPLER_2D_SHADOW */ - 527, /* GL_GL_FLOAT_MAT2x3 */ - 528, /* GL_GL_FLOAT_MAT2x4 */ - 529, /* GL_GL_FLOAT_MAT3x2 */ - 530, /* GL_GL_FLOAT_MAT3x4 */ - 531, /* GL_GL_FLOAT_MAT4x2 */ - 532, /* GL_GL_FLOAT_MAT4x3 */ - 311, /* GL_DELETE_STATUS */ - 220, /* GL_COMPILE_STATUS */ - 657, /* GL_LINK_STATUS */ - 1675, /* GL_VALIDATE_STATUS */ - 589, /* GL_INFO_LOG_LENGTH */ + 464, /* GL_FLOAT_MAT2 */ + 466, /* GL_FLOAT_MAT3 */ + 468, /* GL_FLOAT_MAT4 */ + 1350, /* GL_SAMPLER_1D */ + 1352, /* GL_SAMPLER_2D */ + 1354, /* GL_SAMPLER_3D */ + 1355, /* GL_SAMPLER_CUBE */ + 1351, /* GL_SAMPLER_1D_SHADOW */ + 1353, /* GL_SAMPLER_2D_SHADOW */ + 569, /* GL_GL_FLOAT_MAT2x3 */ + 570, /* GL_GL_FLOAT_MAT2x4 */ + 571, /* GL_GL_FLOAT_MAT3x2 */ + 572, /* GL_GL_FLOAT_MAT3x4 */ + 573, /* GL_GL_FLOAT_MAT4x2 */ + 574, /* GL_GL_FLOAT_MAT4x3 */ + 327, /* GL_DELETE_STATUS */ + 236, /* GL_COMPILE_STATUS */ + 701, /* GL_LINK_STATUS */ + 1737, /* GL_VALIDATE_STATUS */ + 632, /* GL_INFO_LOG_LENGTH */ 55, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1335, /* GL_SHADER_SOURCE_LENGTH */ + 1392, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 486, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1338, /* GL_SHADING_LANGUAGE_VERSION */ - 289, /* GL_CURRENT_PROGRAM */ - 1032, /* GL_PALETTE4_RGB8_OES */ - 1034, /* GL_PALETTE4_RGBA8_OES */ - 1030, /* GL_PALETTE4_R5_G6_B5_OES */ - 1033, /* GL_PALETTE4_RGBA4_OES */ - 1031, /* GL_PALETTE4_RGB5_A1_OES */ - 1037, /* GL_PALETTE8_RGB8_OES */ - 1039, /* GL_PALETTE8_RGBA8_OES */ - 1035, /* GL_PALETTE8_R5_G6_B5_OES */ - 1038, /* GL_PALETTE8_RGBA4_OES */ - 1036, /* GL_PALETTE8_RGB5_A1_OES */ - 572, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 571, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1509, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1196, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1511, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1199, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1517, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1519, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 541, /* GL_GL_SRGB */ - 542, /* GL_GL_SRGB8 */ - 544, /* GL_GL_SRGB_ALPHA */ - 543, /* GL_GL_SRGB8_ALPHA8 */ - 540, /* GL_GL_SLUMINANCE_ALPHA */ - 539, /* GL_GL_SLUMINANCE8_ALPHA8 */ - 537, /* GL_GL_SLUMINANCE */ - 538, /* GL_GL_SLUMINANCE8 */ - 524, /* GL_GL_COMPRESSED_SRGB */ - 525, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - 522, /* GL_GL_COMPRESSED_SLUMINANCE */ - 523, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1093, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 665, /* GL_LOWER_LEFT */ - 1672, /* GL_UPPER_LEFT */ - 1403, /* GL_STENCIL_BACK_REF */ - 1404, /* GL_STENCIL_BACK_VALUE_MASK */ - 1405, /* GL_STENCIL_BACK_WRITEMASK */ - 402, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1238, /* GL_RENDERBUFFER_BINDING_EXT */ - 1223, /* GL_READ_FRAMEBUFFER_EXT */ - 403, /* GL_DRAW_FRAMEBUFFER_EXT */ - 1222, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 488, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - 487, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - 490, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - 489, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - 494, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - 496, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - 501, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - 499, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 497, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 500, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 498, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 502, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 504, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - 503, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 799, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - 145, /* GL_COLOR_ATTACHMENT0_EXT */ - 152, /* GL_COLOR_ATTACHMENT1_EXT */ - 153, /* GL_COLOR_ATTACHMENT2_EXT */ - 154, /* GL_COLOR_ATTACHMENT3_EXT */ - 155, /* GL_COLOR_ATTACHMENT4_EXT */ - 156, /* GL_COLOR_ATTACHMENT5_EXT */ - 157, /* GL_COLOR_ATTACHMENT6_EXT */ - 158, /* GL_COLOR_ATTACHMENT7_EXT */ - 159, /* GL_COLOR_ATTACHMENT8_EXT */ - 160, /* GL_COLOR_ATTACHMENT9_EXT */ - 146, /* GL_COLOR_ATTACHMENT10_EXT */ - 147, /* GL_COLOR_ATTACHMENT11_EXT */ - 148, /* GL_COLOR_ATTACHMENT12_EXT */ - 149, /* GL_COLOR_ATTACHMENT13_EXT */ - 150, /* GL_COLOR_ATTACHMENT14_EXT */ - 151, /* GL_COLOR_ATTACHMENT15_EXT */ - 313, /* GL_DEPTH_ATTACHMENT_EXT */ - 1394, /* GL_STENCIL_ATTACHMENT_EXT */ - 495, /* GL_FRAMEBUFFER_EXT */ - 1239, /* GL_RENDERBUFFER_EXT */ - 1242, /* GL_RENDERBUFFER_WIDTH_EXT */ - 1240, /* GL_RENDERBUFFER_HEIGHT_EXT */ - 1241, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - 1416, /* GL_STENCIL_INDEX_EXT */ - 1413, /* GL_STENCIL_INDEX1_EXT */ - 1414, /* GL_STENCIL_INDEX4_EXT */ - 1415, /* GL_STENCIL_INDEX8_EXT */ - 1412, /* GL_STENCIL_INDEX16_EXT */ - 426, /* GL_EVAL_BIT */ - 1220, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 659, /* GL_LIST_BIT */ - 1525, /* GL_TEXTURE_BIT */ - 1317, /* GL_SCISSOR_BIT */ + 507, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1395, /* GL_SHADING_LANGUAGE_VERSION */ + 305, /* GL_CURRENT_PROGRAM */ + 1077, /* GL_PALETTE4_RGB8_OES */ + 1079, /* GL_PALETTE4_RGBA8_OES */ + 1075, /* GL_PALETTE4_R5_G6_B5_OES */ + 1078, /* GL_PALETTE4_RGBA4_OES */ + 1076, /* GL_PALETTE4_RGB5_A1_OES */ + 1082, /* GL_PALETTE8_RGB8_OES */ + 1084, /* GL_PALETTE8_RGBA8_OES */ + 1080, /* GL_PALETTE8_R5_G6_B5_OES */ + 1083, /* GL_PALETTE8_RGBA4_OES */ + 1081, /* GL_PALETTE8_RGB5_A1_OES */ + 614, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 613, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1722, /* GL_UNSIGNED_NORMALIZED */ + 1568, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1241, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1570, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1244, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1576, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1578, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 583, /* GL_GL_SRGB */ + 584, /* GL_GL_SRGB8 */ + 586, /* GL_GL_SRGB_ALPHA */ + 585, /* GL_GL_SRGB8_ALPHA8 */ + 582, /* GL_GL_SLUMINANCE_ALPHA */ + 581, /* GL_GL_SLUMINANCE8_ALPHA8 */ + 579, /* GL_GL_SLUMINANCE */ + 580, /* GL_GL_SLUMINANCE8 */ + 566, /* GL_GL_COMPRESSED_SRGB */ + 567, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + 564, /* GL_GL_COMPRESSED_SLUMINANCE */ + 565, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + 1138, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 709, /* GL_LOWER_LEFT */ + 1734, /* GL_UPPER_LEFT */ + 1462, /* GL_STENCIL_BACK_REF */ + 1463, /* GL_STENCIL_BACK_VALUE_MASK */ + 1464, /* GL_STENCIL_BACK_WRITEMASK */ + 423, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + 1286, /* GL_RENDERBUFFER_BINDING_EXT */ + 1267, /* GL_READ_FRAMEBUFFER */ + 422, /* GL_DRAW_FRAMEBUFFER */ + 1268, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + 1296, /* GL_RENDERBUFFER_SAMPLES */ + 517, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 515, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 526, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 522, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 524, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 529, /* GL_FRAMEBUFFER_COMPLETE */ + 533, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 539, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 537, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 535, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 538, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 536, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + 542, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + 545, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 543, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 843, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 145, /* GL_COLOR_ATTACHMENT0 */ + 147, /* GL_COLOR_ATTACHMENT1 */ + 161, /* GL_COLOR_ATTACHMENT2 */ + 163, /* GL_COLOR_ATTACHMENT3 */ + 165, /* GL_COLOR_ATTACHMENT4 */ + 167, /* GL_COLOR_ATTACHMENT5 */ + 169, /* GL_COLOR_ATTACHMENT6 */ + 171, /* GL_COLOR_ATTACHMENT7 */ + 173, /* GL_COLOR_ATTACHMENT8 */ + 175, /* GL_COLOR_ATTACHMENT9 */ + 148, /* GL_COLOR_ATTACHMENT10 */ + 150, /* GL_COLOR_ATTACHMENT11 */ + 152, /* GL_COLOR_ATTACHMENT12 */ + 154, /* GL_COLOR_ATTACHMENT13 */ + 156, /* GL_COLOR_ATTACHMENT14 */ + 158, /* GL_COLOR_ATTACHMENT15 */ + 330, /* GL_DEPTH_ATTACHMENT */ + 1452, /* GL_STENCIL_ATTACHMENT */ + 508, /* GL_FRAMEBUFFER */ + 1284, /* GL_RENDERBUFFER */ + 1298, /* GL_RENDERBUFFER_WIDTH */ + 1291, /* GL_RENDERBUFFER_HEIGHT */ + 1293, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1475, /* GL_STENCIL_INDEX_EXT */ + 1472, /* GL_STENCIL_INDEX1_EXT */ + 1473, /* GL_STENCIL_INDEX4_EXT */ + 1474, /* GL_STENCIL_INDEX8_EXT */ + 1471, /* GL_STENCIL_INDEX16_EXT */ + 1295, /* GL_RENDERBUFFER_RED_SIZE */ + 1290, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1287, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1285, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1288, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1297, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 541, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 899, /* GL_MAX_SAMPLES */ + 447, /* GL_EVAL_BIT */ + 1265, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 703, /* GL_LIST_BIT */ + 1584, /* GL_TEXTURE_BIT */ + 1374, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 939, /* GL_MULTISAMPLE_BIT */ + 984, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 3d1d55fd76..7d215939b4 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -626,8 +626,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glGetActiveAttribARB ; .type glGetActiveAttribARB,#function .globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function .globl glDrawBuffersARB ; .type glDrawBuffersARB,#function + .globl glRenderbufferStorageMultisample ; .type glRenderbufferStorageMultisample,#function .globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function - .globl gl_dispatch_stub_562 ; .type gl_dispatch_stub_562,#function .globl gl_dispatch_stub_563 ; .type gl_dispatch_stub_563,#function .globl gl_dispatch_stub_564 ; .type gl_dispatch_stub_564,#function .globl gl_dispatch_stub_565 ; .type gl_dispatch_stub_565,#function @@ -635,6 +635,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl gl_dispatch_stub_567 ; .type gl_dispatch_stub_567,#function .globl gl_dispatch_stub_568 ; .type gl_dispatch_stub_568,#function .globl gl_dispatch_stub_569 ; .type gl_dispatch_stub_569,#function + .globl gl_dispatch_stub_570 ; .type gl_dispatch_stub_570,#function .globl glColorPointerEXT ; .type glColorPointerEXT,#function .globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function .globl glIndexPointerEXT ; .type glIndexPointerEXT,#function @@ -645,8 +646,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function .globl glLockArraysEXT ; .type glLockArraysEXT,#function .globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function - .globl gl_dispatch_stub_580 ; .type gl_dispatch_stub_580,#function .globl gl_dispatch_stub_581 ; .type gl_dispatch_stub_581,#function + .globl gl_dispatch_stub_582 ; .type gl_dispatch_stub_582,#function .globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function .globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function .globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function @@ -671,7 +672,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function .globl glFogCoordfEXT ; .type glFogCoordfEXT,#function .globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function - .globl gl_dispatch_stub_606 ; .type gl_dispatch_stub_606,#function + .globl gl_dispatch_stub_607 ; .type gl_dispatch_stub_607,#function .globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function .globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function .globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function @@ -713,7 +714,6 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function .globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function .globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function - .globl gl_dispatch_stub_648 ; .type gl_dispatch_stub_648,#function .globl gl_dispatch_stub_649 ; .type gl_dispatch_stub_649,#function .globl gl_dispatch_stub_650 ; .type gl_dispatch_stub_650,#function .globl gl_dispatch_stub_651 ; .type gl_dispatch_stub_651,#function @@ -722,6 +722,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl gl_dispatch_stub_654 ; .type gl_dispatch_stub_654,#function .globl gl_dispatch_stub_655 ; .type gl_dispatch_stub_655,#function .globl gl_dispatch_stub_656 ; .type gl_dispatch_stub_656,#function + .globl gl_dispatch_stub_657 ; .type gl_dispatch_stub_657,#function .globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function .globl glBindProgramNV ; .type glBindProgramNV,#function .globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function @@ -798,19 +799,19 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function .globl glPointParameteriNV ; .type glPointParameteriNV,#function .globl glPointParameterivNV ; .type glPointParameterivNV,#function - .globl gl_dispatch_stub_733 ; .type gl_dispatch_stub_733,#function .globl gl_dispatch_stub_734 ; .type gl_dispatch_stub_734,#function .globl gl_dispatch_stub_735 ; .type gl_dispatch_stub_735,#function .globl gl_dispatch_stub_736 ; .type gl_dispatch_stub_736,#function .globl gl_dispatch_stub_737 ; .type gl_dispatch_stub_737,#function + .globl gl_dispatch_stub_738 ; .type gl_dispatch_stub_738,#function .globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function .globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function .globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function .globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function .globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function .globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function - .globl gl_dispatch_stub_744 ; .type gl_dispatch_stub_744,#function .globl gl_dispatch_stub_745 ; .type gl_dispatch_stub_745,#function + .globl gl_dispatch_stub_746 ; .type gl_dispatch_stub_746,#function .globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function .globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function .globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function @@ -828,13 +829,13 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function .globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function .globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function - .globl gl_dispatch_stub_763 ; .type gl_dispatch_stub_763,#function + .globl gl_dispatch_stub_764 ; .type gl_dispatch_stub_764,#function .globl glFramebufferTextureLayerEXT ; .type glFramebufferTextureLayerEXT,#function - .globl gl_dispatch_stub_765 ; .type gl_dispatch_stub_765,#function .globl gl_dispatch_stub_766 ; .type gl_dispatch_stub_766,#function .globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function .globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function .globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function + .globl gl_dispatch_stub_770 ; .type gl_dispatch_stub_770,#function .globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function _mesa_sparc_glapi_begin: @@ -1399,8 +1400,8 @@ _mesa_sparc_glapi_begin: GL_STUB(glGetActiveAttribARB, _gloffset_GetActiveAttribARB) GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB) GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB) + GL_STUB(glRenderbufferStorageMultisample, _gloffset_RenderbufferStorageMultisample) GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT) - GL_STUB(gl_dispatch_stub_562, _gloffset__dispatch_stub_562) GL_STUB(gl_dispatch_stub_563, _gloffset__dispatch_stub_563) GL_STUB(gl_dispatch_stub_564, _gloffset__dispatch_stub_564) GL_STUB(gl_dispatch_stub_565, _gloffset__dispatch_stub_565) @@ -1408,6 +1409,7 @@ _mesa_sparc_glapi_begin: GL_STUB(gl_dispatch_stub_567, _gloffset__dispatch_stub_567) GL_STUB(gl_dispatch_stub_568, _gloffset__dispatch_stub_568) GL_STUB(gl_dispatch_stub_569, _gloffset__dispatch_stub_569) + GL_STUB(gl_dispatch_stub_570, _gloffset__dispatch_stub_570) GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT) GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT) GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT) @@ -1418,8 +1420,8 @@ _mesa_sparc_glapi_begin: GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT) GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT) GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT) - GL_STUB(gl_dispatch_stub_580, _gloffset__dispatch_stub_580) GL_STUB(gl_dispatch_stub_581, _gloffset__dispatch_stub_581) + GL_STUB(gl_dispatch_stub_582, _gloffset__dispatch_stub_582) GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT) GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT) GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT) @@ -1444,7 +1446,7 @@ _mesa_sparc_glapi_begin: GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT) GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT) GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT) - GL_STUB(gl_dispatch_stub_606, _gloffset__dispatch_stub_606) + GL_STUB(gl_dispatch_stub_607, _gloffset__dispatch_stub_607) GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT) GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV) GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV) @@ -1486,7 +1488,6 @@ _mesa_sparc_glapi_begin: GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA) GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA) GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA) - GL_STUB(gl_dispatch_stub_648, _gloffset__dispatch_stub_648) GL_STUB(gl_dispatch_stub_649, _gloffset__dispatch_stub_649) GL_STUB(gl_dispatch_stub_650, _gloffset__dispatch_stub_650) GL_STUB(gl_dispatch_stub_651, _gloffset__dispatch_stub_651) @@ -1495,6 +1496,7 @@ _mesa_sparc_glapi_begin: GL_STUB(gl_dispatch_stub_654, _gloffset__dispatch_stub_654) GL_STUB(gl_dispatch_stub_655, _gloffset__dispatch_stub_655) GL_STUB(gl_dispatch_stub_656, _gloffset__dispatch_stub_656) + GL_STUB(gl_dispatch_stub_657, _gloffset__dispatch_stub_657) GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV) GL_STUB(glBindProgramNV, _gloffset_BindProgramNV) GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV) @@ -1571,19 +1573,19 @@ _mesa_sparc_glapi_begin: GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI) GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV) GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV) - GL_STUB(gl_dispatch_stub_733, _gloffset__dispatch_stub_733) GL_STUB(gl_dispatch_stub_734, _gloffset__dispatch_stub_734) GL_STUB(gl_dispatch_stub_735, _gloffset__dispatch_stub_735) GL_STUB(gl_dispatch_stub_736, _gloffset__dispatch_stub_736) GL_STUB(gl_dispatch_stub_737, _gloffset__dispatch_stub_737) + GL_STUB(gl_dispatch_stub_738, _gloffset__dispatch_stub_738) GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV) GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV) GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV) GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV) GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV) GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV) - GL_STUB(gl_dispatch_stub_744, _gloffset__dispatch_stub_744) GL_STUB(gl_dispatch_stub_745, _gloffset__dispatch_stub_745) + GL_STUB(gl_dispatch_stub_746, _gloffset__dispatch_stub_746) GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT) GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT) GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT) @@ -1601,13 +1603,13 @@ _mesa_sparc_glapi_begin: GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT) GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT) GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT) - GL_STUB(gl_dispatch_stub_763, _gloffset__dispatch_stub_763) + GL_STUB(gl_dispatch_stub_764, _gloffset__dispatch_stub_764) GL_STUB(glFramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT) - GL_STUB(gl_dispatch_stub_765, _gloffset__dispatch_stub_765) GL_STUB(gl_dispatch_stub_766, _gloffset__dispatch_stub_766) GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767) GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768) GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769) + GL_STUB(gl_dispatch_stub_770, _gloffset__dispatch_stub_770) .globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function _mesa_sparc_glapi_end: @@ -1866,3 +1868,22 @@ _mesa_sparc_glapi_end: .globl glPointParameteri ; .type glPointParameteri,#function ; glPointParameteri = glPointParameteriNV .globl glPointParameteriv ; .type glPointParameteriv,#function ; glPointParameteriv = glPointParameterivNV .globl glBlendEquationSeparate ; .type glBlendEquationSeparate,#function ; glBlendEquationSeparate = glBlendEquationSeparateEXT + .globl glBindFramebuffer ; .type glBindFramebuffer,#function ; glBindFramebuffer = glBindFramebufferEXT + .globl glBindRenderbuffer ; .type glBindRenderbuffer,#function ; glBindRenderbuffer = glBindRenderbufferEXT + .globl glCheckFramebufferStatus ; .type glCheckFramebufferStatus,#function ; glCheckFramebufferStatus = glCheckFramebufferStatusEXT + .globl glDeleteFramebuffers ; .type glDeleteFramebuffers,#function ; glDeleteFramebuffers = glDeleteFramebuffersEXT + .globl glDeleteRenderbuffers ; .type glDeleteRenderbuffers,#function ; glDeleteRenderbuffers = glDeleteRenderbuffersEXT + .globl glFramebufferRenderbuffer ; .type glFramebufferRenderbuffer,#function ; glFramebufferRenderbuffer = glFramebufferRenderbufferEXT + .globl glFramebufferTexture1D ; .type glFramebufferTexture1D,#function ; glFramebufferTexture1D = glFramebufferTexture1DEXT + .globl glFramebufferTexture2D ; .type glFramebufferTexture2D,#function ; glFramebufferTexture2D = glFramebufferTexture2DEXT + .globl glFramebufferTexture3D ; .type glFramebufferTexture3D,#function ; glFramebufferTexture3D = glFramebufferTexture3DEXT + .globl glGenFramebuffers ; .type glGenFramebuffers,#function ; glGenFramebuffers = glGenFramebuffersEXT + .globl glGenRenderbuffers ; .type glGenRenderbuffers,#function ; glGenRenderbuffers = glGenRenderbuffersEXT + .globl glGenerateMipmap ; .type glGenerateMipmap,#function ; glGenerateMipmap = glGenerateMipmapEXT + .globl glGetFramebufferAttachmentParameteriv ; .type glGetFramebufferAttachmentParameteriv,#function ; glGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameterivEXT + .globl glGetRenderbufferParameteriv ; .type glGetRenderbufferParameteriv,#function ; glGetRenderbufferParameteriv = glGetRenderbufferParameterivEXT + .globl glIsFramebuffer ; .type glIsFramebuffer,#function ; glIsFramebuffer = glIsFramebufferEXT + .globl glIsRenderbuffer ; .type glIsRenderbuffer,#function ; glIsRenderbuffer = glIsRenderbufferEXT + .globl glRenderbufferStorage ; .type glRenderbufferStorage,#function ; glRenderbufferStorage = glRenderbufferStorageEXT + .globl glBlitFramebuffer ; .type glBlitFramebuffer,#function ; glBlitFramebuffer = glBlitFramebufferEXT + .globl glFramebufferTextureLayer ; .type glFramebufferTextureLayer,#function ; glFramebufferTextureLayer = glFramebufferTextureLayerEXT diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index cb34061b36..1eb4358b1c 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -21112,21 +21112,25 @@ GL_PREFIX(DrawBuffersARB): .size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB) .p2align 4,,15 - .globl GL_PREFIX(PolygonOffsetEXT) - .type GL_PREFIX(PolygonOffsetEXT), @function -GL_PREFIX(PolygonOffsetEXT): + .globl GL_PREFIX(RenderbufferStorageMultisample) + .type GL_PREFIX(RenderbufferStorageMultisample), @function +GL_PREFIX(RenderbufferStorageMultisample): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4488(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4488(%rax), %r11 jmp *%r11 #else @@ -21136,35 +21140,38 @@ GL_PREFIX(PolygonOffsetEXT): movq 4488(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4488(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT) + .size GL_PREFIX(RenderbufferStorageMultisample), .-GL_PREFIX(RenderbufferStorageMultisample) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_562) - .type GL_PREFIX(_dispatch_stub_562), @function - HIDDEN(GL_PREFIX(_dispatch_stub_562)) -GL_PREFIX(_dispatch_stub_562): + .globl GL_PREFIX(PolygonOffsetEXT) + .type GL_PREFIX(PolygonOffsetEXT), @function +GL_PREFIX(PolygonOffsetEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4496(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %xmm0, (%rsp) + movq %xmm1, 8(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm1 + movq (%rsp), %xmm0 + addq $24, %rsp movq 4496(%rax), %r11 jmp *%r11 #else @@ -21174,17 +21181,17 @@ GL_PREFIX(_dispatch_stub_562): movq 4496(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %xmm0, (%rsp) + movq %xmm1, 8(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm1 + movq (%rsp), %xmm0 + addq $24, %rsp movq 4496(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_562), .-GL_PREFIX(_dispatch_stub_562) + .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT) .p2align 4,,15 .globl GL_PREFIX(_dispatch_stub_563) @@ -21234,13 +21241,13 @@ GL_PREFIX(_dispatch_stub_564): movq 4512(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rbp + popq %rsi + popq %rdi movq 4512(%rax), %r11 jmp *%r11 #else @@ -21250,13 +21257,13 @@ GL_PREFIX(_dispatch_stub_564): movq 4512(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rbp + popq %rsi + popq %rdi movq 4512(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ @@ -21272,13 +21279,13 @@ GL_PREFIX(_dispatch_stub_565): movq 4520(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 4520(%rax), %r11 jmp *%r11 #else @@ -21288,13 +21295,13 @@ GL_PREFIX(_dispatch_stub_565): movq 4520(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 4520(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ @@ -21425,7 +21432,11 @@ GL_PREFIX(_dispatch_stub_569): jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 4552(%rax), %r11 jmp *%r11 @@ -21437,20 +21448,54 @@ GL_PREFIX(_dispatch_stub_569): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 4552(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(_dispatch_stub_569), .-GL_PREFIX(_dispatch_stub_569) + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_570) + .type GL_PREFIX(_dispatch_stub_570), @function + HIDDEN(GL_PREFIX(_dispatch_stub_570)) +GL_PREFIX(_dispatch_stub_570): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 4560(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + call _x86_64_get_dispatch@PLT + popq %rdi + movq 4560(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 4560(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + call _glapi_get_dispatch + popq %rdi + movq 4560(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_570), .-GL_PREFIX(_dispatch_stub_570) + .p2align 4,,15 .globl GL_PREFIX(ColorPointerEXT) .type GL_PREFIX(ColorPointerEXT), @function GL_PREFIX(ColorPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4560(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21464,13 +21509,13 @@ GL_PREFIX(ColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4560(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4560(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21484,7 +21529,7 @@ GL_PREFIX(ColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4560(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT) @@ -21495,7 +21540,7 @@ GL_PREFIX(ColorPointerEXT): GL_PREFIX(EdgeFlagPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4568(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21505,13 +21550,13 @@ GL_PREFIX(EdgeFlagPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4568(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4568(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21521,7 +21566,7 @@ GL_PREFIX(EdgeFlagPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4568(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT) @@ -21532,7 +21577,7 @@ GL_PREFIX(EdgeFlagPointerEXT): GL_PREFIX(IndexPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4576(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21546,13 +21591,13 @@ GL_PREFIX(IndexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4576(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4576(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21566,7 +21611,7 @@ GL_PREFIX(IndexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4576(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT) @@ -21577,7 +21622,7 @@ GL_PREFIX(IndexPointerEXT): GL_PREFIX(NormalPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4584(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21591,13 +21636,13 @@ GL_PREFIX(NormalPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4584(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4584(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21611,7 +21656,7 @@ GL_PREFIX(NormalPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4584(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT) @@ -21622,7 +21667,7 @@ GL_PREFIX(NormalPointerEXT): GL_PREFIX(TexCoordPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4592(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21636,13 +21681,13 @@ GL_PREFIX(TexCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4592(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4592(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21656,7 +21701,7 @@ GL_PREFIX(TexCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4592(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT) @@ -21667,7 +21712,7 @@ GL_PREFIX(TexCoordPointerEXT): GL_PREFIX(VertexPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4600(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21681,13 +21726,13 @@ GL_PREFIX(VertexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4600(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4600(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21701,7 +21746,7 @@ GL_PREFIX(VertexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4600(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT) @@ -21712,7 +21757,7 @@ GL_PREFIX(VertexPointerEXT): GL_PREFIX(PointParameterfEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4608(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -21722,13 +21767,13 @@ GL_PREFIX(PointParameterfEXT): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4608(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4608(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -21738,7 +21783,7 @@ GL_PREFIX(PointParameterfEXT): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4608(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT) @@ -21749,7 +21794,7 @@ GL_PREFIX(PointParameterfEXT): GL_PREFIX(PointParameterfvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4616(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21759,13 +21804,13 @@ GL_PREFIX(PointParameterfvEXT): popq %rbp popq %rsi popq %rdi - movq 4616(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4616(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21775,7 +21820,7 @@ GL_PREFIX(PointParameterfvEXT): popq %rbp popq %rsi popq %rdi - movq 4616(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT) @@ -21786,7 +21831,7 @@ GL_PREFIX(PointParameterfvEXT): GL_PREFIX(LockArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4624(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21796,13 +21841,13 @@ GL_PREFIX(LockArraysEXT): popq %rbp popq %rsi popq %rdi - movq 4624(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4624(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21812,7 +21857,7 @@ GL_PREFIX(LockArraysEXT): popq %rbp popq %rsi popq %rdi - movq 4624(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT) @@ -21823,37 +21868,37 @@ GL_PREFIX(LockArraysEXT): GL_PREFIX(UnlockArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4632(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4632(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4632(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4632(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_580) - .type GL_PREFIX(_dispatch_stub_580), @function - HIDDEN(GL_PREFIX(_dispatch_stub_580)) -GL_PREFIX(_dispatch_stub_580): + .globl GL_PREFIX(_dispatch_stub_581) + .type GL_PREFIX(_dispatch_stub_581), @function + HIDDEN(GL_PREFIX(_dispatch_stub_581)) +GL_PREFIX(_dispatch_stub_581): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4640(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21863,13 +21908,13 @@ GL_PREFIX(_dispatch_stub_580): popq %rbp popq %rsi popq %rdi - movq 4640(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4640(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21879,19 +21924,19 @@ GL_PREFIX(_dispatch_stub_580): popq %rbp popq %rsi popq %rdi - movq 4640(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_580), .-GL_PREFIX(_dispatch_stub_580) + .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_581) - .type GL_PREFIX(_dispatch_stub_581), @function - HIDDEN(GL_PREFIX(_dispatch_stub_581)) -GL_PREFIX(_dispatch_stub_581): + .globl GL_PREFIX(_dispatch_stub_582) + .type GL_PREFIX(_dispatch_stub_582), @function + HIDDEN(GL_PREFIX(_dispatch_stub_582)) +GL_PREFIX(_dispatch_stub_582): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4648(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21901,13 +21946,13 @@ GL_PREFIX(_dispatch_stub_581): popq %rbp popq %rsi popq %rdi - movq 4648(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4648(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21917,10 +21962,10 @@ GL_PREFIX(_dispatch_stub_581): popq %rbp popq %rsi popq %rdi - movq 4648(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581) + .size GL_PREFIX(_dispatch_stub_582), .-GL_PREFIX(_dispatch_stub_582) .p2align 4,,15 .globl GL_PREFIX(SecondaryColor3bEXT) @@ -21928,7 +21973,7 @@ GL_PREFIX(_dispatch_stub_581): GL_PREFIX(SecondaryColor3bEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4656(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21938,13 +21983,13 @@ GL_PREFIX(SecondaryColor3bEXT): popq %rdx popq %rsi popq %rdi - movq 4656(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4656(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21954,7 +21999,7 @@ GL_PREFIX(SecondaryColor3bEXT): popq %rdx popq %rsi popq %rdi - movq 4656(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT) @@ -21965,25 +22010,25 @@ GL_PREFIX(SecondaryColor3bEXT): GL_PREFIX(SecondaryColor3bvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4664(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4664(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4664(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4664(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT) @@ -21994,7 +22039,7 @@ GL_PREFIX(SecondaryColor3bvEXT): GL_PREFIX(SecondaryColor3dEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4672(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -22006,13 +22051,13 @@ GL_PREFIX(SecondaryColor3dEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4672(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4672(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -22024,7 +22069,7 @@ GL_PREFIX(SecondaryColor3dEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4672(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT) @@ -22035,25 +22080,25 @@ GL_PREFIX(SecondaryColor3dEXT): GL_PREFIX(SecondaryColor3dvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4680(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4680(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4680(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4680(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT) @@ -22064,7 +22109,7 @@ GL_PREFIX(SecondaryColor3dvEXT): GL_PREFIX(SecondaryColor3fEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4688(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -22076,13 +22121,13 @@ GL_PREFIX(SecondaryColor3fEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4688(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4688(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -22094,7 +22139,7 @@ GL_PREFIX(SecondaryColor3fEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4688(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT) @@ -22105,25 +22150,25 @@ GL_PREFIX(SecondaryColor3fEXT): GL_PREFIX(SecondaryColor3fvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4696(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4696(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4696(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4696(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT) @@ -22134,7 +22179,7 @@ GL_PREFIX(SecondaryColor3fvEXT): GL_PREFIX(SecondaryColor3iEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4704(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22144,13 +22189,13 @@ GL_PREFIX(SecondaryColor3iEXT): popq %rdx popq %rsi popq %rdi - movq 4704(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4704(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22160,7 +22205,7 @@ GL_PREFIX(SecondaryColor3iEXT): popq %rdx popq %rsi popq %rdi - movq 4704(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT) @@ -22171,25 +22216,25 @@ GL_PREFIX(SecondaryColor3iEXT): GL_PREFIX(SecondaryColor3ivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4712(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4712(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4712(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4712(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT) @@ -22200,7 +22245,7 @@ GL_PREFIX(SecondaryColor3ivEXT): GL_PREFIX(SecondaryColor3sEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4720(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22210,13 +22255,13 @@ GL_PREFIX(SecondaryColor3sEXT): popq %rdx popq %rsi popq %rdi - movq 4720(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4720(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22226,7 +22271,7 @@ GL_PREFIX(SecondaryColor3sEXT): popq %rdx popq %rsi popq %rdi - movq 4720(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT) @@ -22237,25 +22282,25 @@ GL_PREFIX(SecondaryColor3sEXT): GL_PREFIX(SecondaryColor3svEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4728(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4728(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4728(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4728(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT) @@ -22266,7 +22311,7 @@ GL_PREFIX(SecondaryColor3svEXT): GL_PREFIX(SecondaryColor3ubEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4736(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22276,13 +22321,13 @@ GL_PREFIX(SecondaryColor3ubEXT): popq %rdx popq %rsi popq %rdi - movq 4736(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4736(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22292,7 +22337,7 @@ GL_PREFIX(SecondaryColor3ubEXT): popq %rdx popq %rsi popq %rdi - movq 4736(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT) @@ -22303,25 +22348,25 @@ GL_PREFIX(SecondaryColor3ubEXT): GL_PREFIX(SecondaryColor3ubvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4744(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4744(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4744(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4744(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT) @@ -22332,7 +22377,7 @@ GL_PREFIX(SecondaryColor3ubvEXT): GL_PREFIX(SecondaryColor3uiEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4752(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22342,13 +22387,13 @@ GL_PREFIX(SecondaryColor3uiEXT): popq %rdx popq %rsi popq %rdi - movq 4752(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4752(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22358,7 +22403,7 @@ GL_PREFIX(SecondaryColor3uiEXT): popq %rdx popq %rsi popq %rdi - movq 4752(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT) @@ -22369,25 +22414,25 @@ GL_PREFIX(SecondaryColor3uiEXT): GL_PREFIX(SecondaryColor3uivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4760(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4760(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4760(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4760(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT) @@ -22398,7 +22443,7 @@ GL_PREFIX(SecondaryColor3uivEXT): GL_PREFIX(SecondaryColor3usEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4768(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22408,13 +22453,13 @@ GL_PREFIX(SecondaryColor3usEXT): popq %rdx popq %rsi popq %rdi - movq 4768(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4768(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22424,7 +22469,7 @@ GL_PREFIX(SecondaryColor3usEXT): popq %rdx popq %rsi popq %rdi - movq 4768(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT) @@ -22435,25 +22480,25 @@ GL_PREFIX(SecondaryColor3usEXT): GL_PREFIX(SecondaryColor3usvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4776(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4776(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4776(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4776(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT) @@ -22464,7 +22509,7 @@ GL_PREFIX(SecondaryColor3usvEXT): GL_PREFIX(SecondaryColorPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4784(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22478,13 +22523,13 @@ GL_PREFIX(SecondaryColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4784(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4784(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22498,7 +22543,7 @@ GL_PREFIX(SecondaryColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4784(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT) @@ -22509,7 +22554,7 @@ GL_PREFIX(SecondaryColorPointerEXT): GL_PREFIX(MultiDrawArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4792(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22523,13 +22568,13 @@ GL_PREFIX(MultiDrawArraysEXT): popq %rdx popq %rsi popq %rdi - movq 4792(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4792(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22543,7 +22588,7 @@ GL_PREFIX(MultiDrawArraysEXT): popq %rdx popq %rsi popq %rdi - movq 4792(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT) @@ -22554,7 +22599,7 @@ GL_PREFIX(MultiDrawArraysEXT): GL_PREFIX(MultiDrawElementsEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4800(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22568,13 +22613,13 @@ GL_PREFIX(MultiDrawElementsEXT): popq %rdx popq %rsi popq %rdi - movq 4800(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4800(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22588,7 +22633,7 @@ GL_PREFIX(MultiDrawElementsEXT): popq %rdx popq %rsi popq %rdi - movq 4800(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT) @@ -22599,7 +22644,7 @@ GL_PREFIX(MultiDrawElementsEXT): GL_PREFIX(FogCoordPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4808(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22609,13 +22654,13 @@ GL_PREFIX(FogCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4808(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4808(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22625,7 +22670,7 @@ GL_PREFIX(FogCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4808(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT) @@ -22636,7 +22681,7 @@ GL_PREFIX(FogCoordPointerEXT): GL_PREFIX(FogCoorddEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4816(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $8, %rsp @@ -22644,13 +22689,13 @@ GL_PREFIX(FogCoorddEXT): call _x86_64_get_dispatch@PLT movq (%rsp), %xmm0 addq $8, %rsp - movq 4816(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4816(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 1: subq $8, %rsp @@ -22658,7 +22703,7 @@ GL_PREFIX(FogCoorddEXT): call _glapi_get_dispatch movq (%rsp), %xmm0 addq $8, %rsp - movq 4816(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT) @@ -22669,25 +22714,25 @@ GL_PREFIX(FogCoorddEXT): GL_PREFIX(FogCoorddvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4824(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4824(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4824(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4824(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT) @@ -22698,7 +22743,7 @@ GL_PREFIX(FogCoorddvEXT): GL_PREFIX(FogCoordfEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4832(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $8, %rsp @@ -22706,13 +22751,13 @@ GL_PREFIX(FogCoordfEXT): call _x86_64_get_dispatch@PLT movq (%rsp), %xmm0 addq $8, %rsp - movq 4832(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4832(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 1: subq $8, %rsp @@ -22720,7 +22765,7 @@ GL_PREFIX(FogCoordfEXT): call _glapi_get_dispatch movq (%rsp), %xmm0 addq $8, %rsp - movq 4832(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT) @@ -22731,58 +22776,58 @@ GL_PREFIX(FogCoordfEXT): GL_PREFIX(FogCoordfvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4840(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4840(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4840(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4840(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_606) - .type GL_PREFIX(_dispatch_stub_606), @function - HIDDEN(GL_PREFIX(_dispatch_stub_606)) -GL_PREFIX(_dispatch_stub_606): + .globl GL_PREFIX(_dispatch_stub_607) + .type GL_PREFIX(_dispatch_stub_607), @function + HIDDEN(GL_PREFIX(_dispatch_stub_607)) +GL_PREFIX(_dispatch_stub_607): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4848(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4848(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4848(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4848(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_606), .-GL_PREFIX(_dispatch_stub_606) + .size GL_PREFIX(_dispatch_stub_607), .-GL_PREFIX(_dispatch_stub_607) .p2align 4,,15 .globl GL_PREFIX(BlendFuncSeparateEXT) @@ -22790,7 +22835,7 @@ GL_PREFIX(_dispatch_stub_606): GL_PREFIX(BlendFuncSeparateEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4856(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22804,13 +22849,13 @@ GL_PREFIX(BlendFuncSeparateEXT): popq %rdx popq %rsi popq %rdi - movq 4856(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4856(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22824,7 +22869,7 @@ GL_PREFIX(BlendFuncSeparateEXT): popq %rdx popq %rsi popq %rdi - movq 4856(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT) @@ -22835,25 +22880,25 @@ GL_PREFIX(BlendFuncSeparateEXT): GL_PREFIX(FlushVertexArrayRangeNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4864(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4864(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4864(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4864(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV) @@ -22864,7 +22909,7 @@ GL_PREFIX(FlushVertexArrayRangeNV): GL_PREFIX(VertexArrayRangeNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4872(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22874,13 +22919,13 @@ GL_PREFIX(VertexArrayRangeNV): popq %rbp popq %rsi popq %rdi - movq 4872(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4872(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22890,7 +22935,7 @@ GL_PREFIX(VertexArrayRangeNV): popq %rbp popq %rsi popq %rdi - movq 4872(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV) @@ -22901,7 +22946,7 @@ GL_PREFIX(VertexArrayRangeNV): GL_PREFIX(CombinerInputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4880(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22919,13 +22964,13 @@ GL_PREFIX(CombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4880(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4880(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22943,7 +22988,7 @@ GL_PREFIX(CombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4880(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV) @@ -22954,7 +22999,7 @@ GL_PREFIX(CombinerInputNV): GL_PREFIX(CombinerOutputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4888(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22972,13 +23017,13 @@ GL_PREFIX(CombinerOutputNV): popq %rdx popq %rsi popq %rdi - movq 4888(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4888(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22996,7 +23041,7 @@ GL_PREFIX(CombinerOutputNV): popq %rdx popq %rsi popq %rdi - movq 4888(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV) @@ -23007,7 +23052,7 @@ GL_PREFIX(CombinerOutputNV): GL_PREFIX(CombinerParameterfNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4896(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23017,13 +23062,13 @@ GL_PREFIX(CombinerParameterfNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4896(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4896(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23033,7 +23078,7 @@ GL_PREFIX(CombinerParameterfNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4896(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV) @@ -23044,7 +23089,7 @@ GL_PREFIX(CombinerParameterfNV): GL_PREFIX(CombinerParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4904(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23054,13 +23099,13 @@ GL_PREFIX(CombinerParameterfvNV): popq %rbp popq %rsi popq %rdi - movq 4904(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4904(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23070,7 +23115,7 @@ GL_PREFIX(CombinerParameterfvNV): popq %rbp popq %rsi popq %rdi - movq 4904(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV) @@ -23081,7 +23126,7 @@ GL_PREFIX(CombinerParameterfvNV): GL_PREFIX(CombinerParameteriNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4912(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23091,13 +23136,13 @@ GL_PREFIX(CombinerParameteriNV): popq %rbp popq %rsi popq %rdi - movq 4912(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4912(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23107,7 +23152,7 @@ GL_PREFIX(CombinerParameteriNV): popq %rbp popq %rsi popq %rdi - movq 4912(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV) @@ -23118,7 +23163,7 @@ GL_PREFIX(CombinerParameteriNV): GL_PREFIX(CombinerParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4920(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23128,13 +23173,13 @@ GL_PREFIX(CombinerParameterivNV): popq %rbp popq %rsi popq %rdi - movq 4920(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4920(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23144,7 +23189,7 @@ GL_PREFIX(CombinerParameterivNV): popq %rbp popq %rsi popq %rdi - movq 4920(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV) @@ -23155,7 +23200,7 @@ GL_PREFIX(CombinerParameterivNV): GL_PREFIX(FinalCombinerInputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4928(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23169,13 +23214,13 @@ GL_PREFIX(FinalCombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4928(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4928(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23189,7 +23234,7 @@ GL_PREFIX(FinalCombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4928(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV) @@ -23200,7 +23245,7 @@ GL_PREFIX(FinalCombinerInputNV): GL_PREFIX(GetCombinerInputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4936(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23214,13 +23259,13 @@ GL_PREFIX(GetCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4936(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4936(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23234,7 +23279,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4936(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV) @@ -23245,7 +23290,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV): GL_PREFIX(GetCombinerInputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4944(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23259,13 +23304,13 @@ GL_PREFIX(GetCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4944(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4944(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23279,7 +23324,7 @@ GL_PREFIX(GetCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4944(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV) @@ -23290,7 +23335,7 @@ GL_PREFIX(GetCombinerInputParameterivNV): GL_PREFIX(GetCombinerOutputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4952(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23304,13 +23349,13 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4952(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4952(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23324,7 +23369,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4952(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV) @@ -23335,7 +23380,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): GL_PREFIX(GetCombinerOutputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4960(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23349,13 +23394,13 @@ GL_PREFIX(GetCombinerOutputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4960(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4960(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23369,7 +23414,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4960(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV) @@ -23380,7 +23425,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV): GL_PREFIX(GetFinalCombinerInputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4968(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23390,13 +23435,13 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4968(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4968(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23406,7 +23451,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4968(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV) @@ -23417,7 +23462,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): GL_PREFIX(GetFinalCombinerInputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4976(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23427,13 +23472,13 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4976(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4976(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23443,7 +23488,7 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4976(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV) @@ -23454,25 +23499,25 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): GL_PREFIX(ResizeBuffersMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4984(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4984(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4984(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4984(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA) @@ -23483,7 +23528,7 @@ GL_PREFIX(ResizeBuffersMESA): GL_PREFIX(WindowPos2dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4992(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23493,13 +23538,13 @@ GL_PREFIX(WindowPos2dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4992(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4992(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23509,7 +23554,7 @@ GL_PREFIX(WindowPos2dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4992(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA) @@ -23520,25 +23565,25 @@ GL_PREFIX(WindowPos2dMESA): GL_PREFIX(WindowPos2dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5000(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5000(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5000(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5000(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA) @@ -23549,7 +23594,7 @@ GL_PREFIX(WindowPos2dvMESA): GL_PREFIX(WindowPos2fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5008(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23559,13 +23604,13 @@ GL_PREFIX(WindowPos2fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5008(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5008(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23575,7 +23620,7 @@ GL_PREFIX(WindowPos2fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5008(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA) @@ -23586,25 +23631,25 @@ GL_PREFIX(WindowPos2fMESA): GL_PREFIX(WindowPos2fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5016(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5016(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5016(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5016(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA) @@ -23615,7 +23660,7 @@ GL_PREFIX(WindowPos2fvMESA): GL_PREFIX(WindowPos2iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5024(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23625,13 +23670,13 @@ GL_PREFIX(WindowPos2iMESA): popq %rbp popq %rsi popq %rdi - movq 5024(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5024(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23641,7 +23686,7 @@ GL_PREFIX(WindowPos2iMESA): popq %rbp popq %rsi popq %rdi - movq 5024(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA) @@ -23652,25 +23697,25 @@ GL_PREFIX(WindowPos2iMESA): GL_PREFIX(WindowPos2ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5032(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5032(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5032(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5032(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA) @@ -23681,7 +23726,7 @@ GL_PREFIX(WindowPos2ivMESA): GL_PREFIX(WindowPos2sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5040(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23691,13 +23736,13 @@ GL_PREFIX(WindowPos2sMESA): popq %rbp popq %rsi popq %rdi - movq 5040(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5040(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23707,7 +23752,7 @@ GL_PREFIX(WindowPos2sMESA): popq %rbp popq %rsi popq %rdi - movq 5040(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA) @@ -23718,25 +23763,25 @@ GL_PREFIX(WindowPos2sMESA): GL_PREFIX(WindowPos2svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5048(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5048(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5048(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5048(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA) @@ -23747,7 +23792,7 @@ GL_PREFIX(WindowPos2svMESA): GL_PREFIX(WindowPos3dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5056(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23759,13 +23804,13 @@ GL_PREFIX(WindowPos3dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5056(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5056(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23777,7 +23822,7 @@ GL_PREFIX(WindowPos3dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5056(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA) @@ -23788,25 +23833,25 @@ GL_PREFIX(WindowPos3dMESA): GL_PREFIX(WindowPos3dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5064(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5064(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5064(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5064(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA) @@ -23817,7 +23862,7 @@ GL_PREFIX(WindowPos3dvMESA): GL_PREFIX(WindowPos3fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5072(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23829,13 +23874,13 @@ GL_PREFIX(WindowPos3fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5072(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5072(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23847,7 +23892,7 @@ GL_PREFIX(WindowPos3fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5072(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA) @@ -23858,25 +23903,25 @@ GL_PREFIX(WindowPos3fMESA): GL_PREFIX(WindowPos3fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5080(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5080(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5080(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5080(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA) @@ -23887,7 +23932,7 @@ GL_PREFIX(WindowPos3fvMESA): GL_PREFIX(WindowPos3iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5088(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23897,13 +23942,13 @@ GL_PREFIX(WindowPos3iMESA): popq %rdx popq %rsi popq %rdi - movq 5088(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5088(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23913,7 +23958,7 @@ GL_PREFIX(WindowPos3iMESA): popq %rdx popq %rsi popq %rdi - movq 5088(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA) @@ -23924,25 +23969,25 @@ GL_PREFIX(WindowPos3iMESA): GL_PREFIX(WindowPos3ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5096(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5096(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5096(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5096(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA) @@ -23953,7 +23998,7 @@ GL_PREFIX(WindowPos3ivMESA): GL_PREFIX(WindowPos3sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5104(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23963,13 +24008,13 @@ GL_PREFIX(WindowPos3sMESA): popq %rdx popq %rsi popq %rdi - movq 5104(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5104(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23979,7 +24024,7 @@ GL_PREFIX(WindowPos3sMESA): popq %rdx popq %rsi popq %rdi - movq 5104(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA) @@ -23990,25 +24035,25 @@ GL_PREFIX(WindowPos3sMESA): GL_PREFIX(WindowPos3svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5112(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5112(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5112(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5112(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA) @@ -24019,7 +24064,7 @@ GL_PREFIX(WindowPos3svMESA): GL_PREFIX(WindowPos4dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5120(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -24033,13 +24078,13 @@ GL_PREFIX(WindowPos4dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5120(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5120(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -24053,7 +24098,7 @@ GL_PREFIX(WindowPos4dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5120(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA) @@ -24064,25 +24109,25 @@ GL_PREFIX(WindowPos4dMESA): GL_PREFIX(WindowPos4dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5128(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5128(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5128(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5128(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA) @@ -24093,7 +24138,7 @@ GL_PREFIX(WindowPos4dvMESA): GL_PREFIX(WindowPos4fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5136(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -24107,13 +24152,13 @@ GL_PREFIX(WindowPos4fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5136(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5136(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -24127,7 +24172,7 @@ GL_PREFIX(WindowPos4fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5136(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA) @@ -24138,25 +24183,25 @@ GL_PREFIX(WindowPos4fMESA): GL_PREFIX(WindowPos4fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5144(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5144(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5144(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5144(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA) @@ -24167,7 +24212,7 @@ GL_PREFIX(WindowPos4fvMESA): GL_PREFIX(WindowPos4iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5152(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24181,13 +24226,13 @@ GL_PREFIX(WindowPos4iMESA): popq %rdx popq %rsi popq %rdi - movq 5152(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5152(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24201,7 +24246,7 @@ GL_PREFIX(WindowPos4iMESA): popq %rdx popq %rsi popq %rdi - movq 5152(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA) @@ -24212,25 +24257,25 @@ GL_PREFIX(WindowPos4iMESA): GL_PREFIX(WindowPos4ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5160(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5160(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5160(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5160(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA) @@ -24241,7 +24286,7 @@ GL_PREFIX(WindowPos4ivMESA): GL_PREFIX(WindowPos4sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5168(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24255,13 +24300,13 @@ GL_PREFIX(WindowPos4sMESA): popq %rdx popq %rsi popq %rdi - movq 5168(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5168(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24275,7 +24320,7 @@ GL_PREFIX(WindowPos4sMESA): popq %rdx popq %rsi popq %rdi - movq 5168(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA) @@ -24284,51 +24329,13 @@ GL_PREFIX(WindowPos4sMESA): .globl GL_PREFIX(WindowPos4svMESA) .type GL_PREFIX(WindowPos4svMESA), @function GL_PREFIX(WindowPos4svMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5176(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5176(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5176(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5176(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_648) - .type GL_PREFIX(_dispatch_stub_648), @function - HIDDEN(GL_PREFIX(_dispatch_stub_648)) -GL_PREFIX(_dispatch_stub_648): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 5184(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 5184(%rax), %r11 jmp *%r11 @@ -24340,20 +24347,12 @@ GL_PREFIX(_dispatch_stub_648): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 5184(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648) + .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA) .p2align 4,,15 .globl GL_PREFIX(_dispatch_stub_649) @@ -24370,11 +24369,7 @@ GL_PREFIX(_dispatch_stub_649): pushq %rdx pushq %rcx pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 popq %r8 popq %rcx popq %rdx @@ -24394,11 +24389,7 @@ GL_PREFIX(_dispatch_stub_649): pushq %rdx pushq %rcx pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 popq %r8 popq %rcx popq %rdx @@ -24421,9 +24412,17 @@ GL_PREFIX(_dispatch_stub_650): #elif defined(PTHREADS) pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 5200(%rax), %r11 @@ -24437,9 +24436,17 @@ GL_PREFIX(_dispatch_stub_650): 1: pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 5200(%rax), %r11 @@ -24458,7 +24465,11 @@ GL_PREFIX(_dispatch_stub_651): jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 5208(%rax), %r11 jmp *%r11 @@ -24470,7 +24481,11 @@ GL_PREFIX(_dispatch_stub_651): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 5208(%rax), %r11 jmp *%r11 @@ -24488,11 +24503,7 @@ GL_PREFIX(_dispatch_stub_652): jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi popq %rdi movq 5216(%rax), %r11 jmp *%r11 @@ -24504,11 +24515,7 @@ GL_PREFIX(_dispatch_stub_652): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rsi popq %rdi movq 5216(%rax), %r11 jmp *%r11 @@ -24527,9 +24534,9 @@ GL_PREFIX(_dispatch_stub_653): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 5224(%rax), %r11 @@ -24543,9 +24550,9 @@ GL_PREFIX(_dispatch_stub_653): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 5224(%rax), %r11 @@ -24564,7 +24571,11 @@ GL_PREFIX(_dispatch_stub_654): jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT + popq %rdx + popq %rsi popq %rdi movq 5232(%rax), %r11 jmp *%r11 @@ -24576,7 +24587,11 @@ GL_PREFIX(_dispatch_stub_654): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch + popq %rdx + popq %rsi popq %rdi movq 5232(%rax), %r11 jmp *%r11 @@ -24594,11 +24609,7 @@ GL_PREFIX(_dispatch_stub_655): jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi popq %rdi movq 5240(%rax), %r11 jmp *%r11 @@ -24610,11 +24621,7 @@ GL_PREFIX(_dispatch_stub_655): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rsi popq %rdi movq 5240(%rax), %r11 jmp *%r11 @@ -24632,7 +24639,11 @@ GL_PREFIX(_dispatch_stub_656): jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 5248(%rax), %r11 jmp *%r11 @@ -24644,20 +24655,54 @@ GL_PREFIX(_dispatch_stub_656): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 5248(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(_dispatch_stub_656), .-GL_PREFIX(_dispatch_stub_656) + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_657) + .type GL_PREFIX(_dispatch_stub_657), @function + HIDDEN(GL_PREFIX(_dispatch_stub_657)) +GL_PREFIX(_dispatch_stub_657): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 5256(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + call _x86_64_get_dispatch@PLT + popq %rdi + movq 5256(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 5256(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + call _glapi_get_dispatch + popq %rdi + movq 5256(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_657), .-GL_PREFIX(_dispatch_stub_657) + .p2align 4,,15 .globl GL_PREFIX(AreProgramsResidentNV) .type GL_PREFIX(AreProgramsResidentNV), @function GL_PREFIX(AreProgramsResidentNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5256(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24667,13 +24712,13 @@ GL_PREFIX(AreProgramsResidentNV): popq %rdx popq %rsi popq %rdi - movq 5256(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5256(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24683,7 +24728,7 @@ GL_PREFIX(AreProgramsResidentNV): popq %rdx popq %rsi popq %rdi - movq 5256(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV) @@ -24694,7 +24739,7 @@ GL_PREFIX(AreProgramsResidentNV): GL_PREFIX(BindProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5264(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24704,13 +24749,13 @@ GL_PREFIX(BindProgramNV): popq %rbp popq %rsi popq %rdi - movq 5264(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5264(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24720,7 +24765,7 @@ GL_PREFIX(BindProgramNV): popq %rbp popq %rsi popq %rdi - movq 5264(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV) @@ -24731,7 +24776,7 @@ GL_PREFIX(BindProgramNV): GL_PREFIX(DeleteProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5272(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24741,13 +24786,13 @@ GL_PREFIX(DeleteProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5272(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5272(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24757,7 +24802,7 @@ GL_PREFIX(DeleteProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5272(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV) @@ -24768,7 +24813,7 @@ GL_PREFIX(DeleteProgramsNV): GL_PREFIX(ExecuteProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5280(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24778,13 +24823,13 @@ GL_PREFIX(ExecuteProgramNV): popq %rdx popq %rsi popq %rdi - movq 5280(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5280(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24794,7 +24839,7 @@ GL_PREFIX(ExecuteProgramNV): popq %rdx popq %rsi popq %rdi - movq 5280(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV) @@ -24805,7 +24850,7 @@ GL_PREFIX(ExecuteProgramNV): GL_PREFIX(GenProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5288(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24815,13 +24860,13 @@ GL_PREFIX(GenProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5288(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5288(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24831,7 +24876,7 @@ GL_PREFIX(GenProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5288(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV) @@ -24842,7 +24887,7 @@ GL_PREFIX(GenProgramsNV): GL_PREFIX(GetProgramParameterdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5296(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24856,13 +24901,13 @@ GL_PREFIX(GetProgramParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5296(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5296(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24876,7 +24921,7 @@ GL_PREFIX(GetProgramParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5296(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV) @@ -24887,7 +24932,7 @@ GL_PREFIX(GetProgramParameterdvNV): GL_PREFIX(GetProgramParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5304(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24901,13 +24946,13 @@ GL_PREFIX(GetProgramParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5304(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5304(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24921,7 +24966,7 @@ GL_PREFIX(GetProgramParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5304(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV) @@ -24932,7 +24977,7 @@ GL_PREFIX(GetProgramParameterfvNV): GL_PREFIX(GetProgramStringNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5312(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24942,13 +24987,13 @@ GL_PREFIX(GetProgramStringNV): popq %rdx popq %rsi popq %rdi - movq 5312(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5312(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24958,7 +25003,7 @@ GL_PREFIX(GetProgramStringNV): popq %rdx popq %rsi popq %rdi - movq 5312(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV) @@ -24969,7 +25014,7 @@ GL_PREFIX(GetProgramStringNV): GL_PREFIX(GetProgramivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5320(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24979,13 +25024,13 @@ GL_PREFIX(GetProgramivNV): popq %rdx popq %rsi popq %rdi - movq 5320(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5320(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24995,7 +25040,7 @@ GL_PREFIX(GetProgramivNV): popq %rdx popq %rsi popq %rdi - movq 5320(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV) @@ -25006,7 +25051,7 @@ GL_PREFIX(GetProgramivNV): GL_PREFIX(GetTrackMatrixivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5328(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25020,13 +25065,13 @@ GL_PREFIX(GetTrackMatrixivNV): popq %rdx popq %rsi popq %rdi - movq 5328(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5328(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25040,7 +25085,7 @@ GL_PREFIX(GetTrackMatrixivNV): popq %rdx popq %rsi popq %rdi - movq 5328(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV) @@ -25051,7 +25096,7 @@ GL_PREFIX(GetTrackMatrixivNV): GL_PREFIX(GetVertexAttribPointervNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5336(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25061,13 +25106,13 @@ GL_PREFIX(GetVertexAttribPointervNV): popq %rdx popq %rsi popq %rdi - movq 5336(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5336(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25077,7 +25122,7 @@ GL_PREFIX(GetVertexAttribPointervNV): popq %rdx popq %rsi popq %rdi - movq 5336(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV) @@ -25088,7 +25133,7 @@ GL_PREFIX(GetVertexAttribPointervNV): GL_PREFIX(GetVertexAttribdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5344(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25098,13 +25143,13 @@ GL_PREFIX(GetVertexAttribdvNV): popq %rdx popq %rsi popq %rdi - movq 5344(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5344(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25114,7 +25159,7 @@ GL_PREFIX(GetVertexAttribdvNV): popq %rdx popq %rsi popq %rdi - movq 5344(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV) @@ -25125,7 +25170,7 @@ GL_PREFIX(GetVertexAttribdvNV): GL_PREFIX(GetVertexAttribfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5352(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25135,13 +25180,13 @@ GL_PREFIX(GetVertexAttribfvNV): popq %rdx popq %rsi popq %rdi - movq 5352(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5352(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25151,7 +25196,7 @@ GL_PREFIX(GetVertexAttribfvNV): popq %rdx popq %rsi popq %rdi - movq 5352(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV) @@ -25162,7 +25207,7 @@ GL_PREFIX(GetVertexAttribfvNV): GL_PREFIX(GetVertexAttribivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5360(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25172,13 +25217,13 @@ GL_PREFIX(GetVertexAttribivNV): popq %rdx popq %rsi popq %rdi - movq 5360(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5360(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25188,7 +25233,7 @@ GL_PREFIX(GetVertexAttribivNV): popq %rdx popq %rsi popq %rdi - movq 5360(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV) @@ -25199,25 +25244,25 @@ GL_PREFIX(GetVertexAttribivNV): GL_PREFIX(IsProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5368(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5368(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5368(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5368(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV) @@ -25228,7 +25273,7 @@ GL_PREFIX(IsProgramNV): GL_PREFIX(LoadProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5376(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25242,13 +25287,13 @@ GL_PREFIX(LoadProgramNV): popq %rdx popq %rsi popq %rdi - movq 5376(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5376(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25262,7 +25307,7 @@ GL_PREFIX(LoadProgramNV): popq %rdx popq %rsi popq %rdi - movq 5376(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV) @@ -25273,7 +25318,7 @@ GL_PREFIX(LoadProgramNV): GL_PREFIX(ProgramParameters4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5384(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25287,13 +25332,13 @@ GL_PREFIX(ProgramParameters4dvNV): popq %rdx popq %rsi popq %rdi - movq 5384(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5384(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25307,7 +25352,7 @@ GL_PREFIX(ProgramParameters4dvNV): popq %rdx popq %rsi popq %rdi - movq 5384(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV) @@ -25318,7 +25363,7 @@ GL_PREFIX(ProgramParameters4dvNV): GL_PREFIX(ProgramParameters4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5392(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25332,13 +25377,13 @@ GL_PREFIX(ProgramParameters4fvNV): popq %rdx popq %rsi popq %rdi - movq 5392(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5392(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25352,7 +25397,7 @@ GL_PREFIX(ProgramParameters4fvNV): popq %rdx popq %rsi popq %rdi - movq 5392(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV) @@ -25363,7 +25408,7 @@ GL_PREFIX(ProgramParameters4fvNV): GL_PREFIX(RequestResidentProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5400(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25373,13 +25418,13 @@ GL_PREFIX(RequestResidentProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5400(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5400(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25389,7 +25434,7 @@ GL_PREFIX(RequestResidentProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5400(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV) @@ -25400,7 +25445,7 @@ GL_PREFIX(RequestResidentProgramsNV): GL_PREFIX(TrackMatrixNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5408(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25414,13 +25459,13 @@ GL_PREFIX(TrackMatrixNV): popq %rdx popq %rsi popq %rdi - movq 5408(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5408(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25434,7 +25479,7 @@ GL_PREFIX(TrackMatrixNV): popq %rdx popq %rsi popq %rdi - movq 5408(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV) @@ -25445,7 +25490,7 @@ GL_PREFIX(TrackMatrixNV): GL_PREFIX(VertexAttrib1dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5416(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25455,13 +25500,13 @@ GL_PREFIX(VertexAttrib1dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5416(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5416(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25471,7 +25516,7 @@ GL_PREFIX(VertexAttrib1dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5416(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV) @@ -25482,7 +25527,7 @@ GL_PREFIX(VertexAttrib1dNV): GL_PREFIX(VertexAttrib1dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5424(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25492,13 +25537,13 @@ GL_PREFIX(VertexAttrib1dvNV): popq %rbp popq %rsi popq %rdi - movq 5424(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5424(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25508,7 +25553,7 @@ GL_PREFIX(VertexAttrib1dvNV): popq %rbp popq %rsi popq %rdi - movq 5424(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV) @@ -25519,7 +25564,7 @@ GL_PREFIX(VertexAttrib1dvNV): GL_PREFIX(VertexAttrib1fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5432(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25529,13 +25574,13 @@ GL_PREFIX(VertexAttrib1fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5432(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5432(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25545,7 +25590,7 @@ GL_PREFIX(VertexAttrib1fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5432(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV) @@ -25556,7 +25601,7 @@ GL_PREFIX(VertexAttrib1fNV): GL_PREFIX(VertexAttrib1fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5440(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25566,13 +25611,13 @@ GL_PREFIX(VertexAttrib1fvNV): popq %rbp popq %rsi popq %rdi - movq 5440(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5440(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25582,7 +25627,7 @@ GL_PREFIX(VertexAttrib1fvNV): popq %rbp popq %rsi popq %rdi - movq 5440(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV) @@ -25593,7 +25638,7 @@ GL_PREFIX(VertexAttrib1fvNV): GL_PREFIX(VertexAttrib1sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5448(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25603,13 +25648,13 @@ GL_PREFIX(VertexAttrib1sNV): popq %rbp popq %rsi popq %rdi - movq 5448(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5448(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25619,7 +25664,7 @@ GL_PREFIX(VertexAttrib1sNV): popq %rbp popq %rsi popq %rdi - movq 5448(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV) @@ -25630,7 +25675,7 @@ GL_PREFIX(VertexAttrib1sNV): GL_PREFIX(VertexAttrib1svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5456(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25640,13 +25685,13 @@ GL_PREFIX(VertexAttrib1svNV): popq %rbp popq %rsi popq %rdi - movq 5456(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5456(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25656,7 +25701,7 @@ GL_PREFIX(VertexAttrib1svNV): popq %rbp popq %rsi popq %rdi - movq 5456(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV) @@ -25667,7 +25712,7 @@ GL_PREFIX(VertexAttrib1svNV): GL_PREFIX(VertexAttrib2dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5464(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25679,13 +25724,13 @@ GL_PREFIX(VertexAttrib2dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5464(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5464(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25697,7 +25742,7 @@ GL_PREFIX(VertexAttrib2dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5464(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV) @@ -25708,7 +25753,7 @@ GL_PREFIX(VertexAttrib2dNV): GL_PREFIX(VertexAttrib2dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5472(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25718,13 +25763,13 @@ GL_PREFIX(VertexAttrib2dvNV): popq %rbp popq %rsi popq %rdi - movq 5472(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5472(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25734,7 +25779,7 @@ GL_PREFIX(VertexAttrib2dvNV): popq %rbp popq %rsi popq %rdi - movq 5472(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV) @@ -25745,7 +25790,7 @@ GL_PREFIX(VertexAttrib2dvNV): GL_PREFIX(VertexAttrib2fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5480(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25757,13 +25802,13 @@ GL_PREFIX(VertexAttrib2fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5480(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5480(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25775,7 +25820,7 @@ GL_PREFIX(VertexAttrib2fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5480(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV) @@ -25786,7 +25831,7 @@ GL_PREFIX(VertexAttrib2fNV): GL_PREFIX(VertexAttrib2fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5488(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25796,13 +25841,13 @@ GL_PREFIX(VertexAttrib2fvNV): popq %rbp popq %rsi popq %rdi - movq 5488(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5488(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25812,7 +25857,7 @@ GL_PREFIX(VertexAttrib2fvNV): popq %rbp popq %rsi popq %rdi - movq 5488(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV) @@ -25823,7 +25868,7 @@ GL_PREFIX(VertexAttrib2fvNV): GL_PREFIX(VertexAttrib2sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5496(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25833,13 +25878,13 @@ GL_PREFIX(VertexAttrib2sNV): popq %rdx popq %rsi popq %rdi - movq 5496(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5496(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25849,7 +25894,7 @@ GL_PREFIX(VertexAttrib2sNV): popq %rdx popq %rsi popq %rdi - movq 5496(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV) @@ -25860,7 +25905,7 @@ GL_PREFIX(VertexAttrib2sNV): GL_PREFIX(VertexAttrib2svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5504(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25870,13 +25915,13 @@ GL_PREFIX(VertexAttrib2svNV): popq %rbp popq %rsi popq %rdi - movq 5504(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5504(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25886,7 +25931,7 @@ GL_PREFIX(VertexAttrib2svNV): popq %rbp popq %rsi popq %rdi - movq 5504(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV) @@ -25897,7 +25942,7 @@ GL_PREFIX(VertexAttrib2svNV): GL_PREFIX(VertexAttrib3dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5512(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -25911,13 +25956,13 @@ GL_PREFIX(VertexAttrib3dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5512(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5512(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -25931,7 +25976,7 @@ GL_PREFIX(VertexAttrib3dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5512(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV) @@ -25942,7 +25987,7 @@ GL_PREFIX(VertexAttrib3dNV): GL_PREFIX(VertexAttrib3dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5520(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25952,13 +25997,13 @@ GL_PREFIX(VertexAttrib3dvNV): popq %rbp popq %rsi popq %rdi - movq 5520(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5520(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25968,7 +26013,7 @@ GL_PREFIX(VertexAttrib3dvNV): popq %rbp popq %rsi popq %rdi - movq 5520(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV) @@ -25979,7 +26024,7 @@ GL_PREFIX(VertexAttrib3dvNV): GL_PREFIX(VertexAttrib3fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5528(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -25993,13 +26038,13 @@ GL_PREFIX(VertexAttrib3fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5528(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5528(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26013,7 +26058,7 @@ GL_PREFIX(VertexAttrib3fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5528(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV) @@ -26024,7 +26069,7 @@ GL_PREFIX(VertexAttrib3fNV): GL_PREFIX(VertexAttrib3fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5536(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26034,13 +26079,13 @@ GL_PREFIX(VertexAttrib3fvNV): popq %rbp popq %rsi popq %rdi - movq 5536(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5536(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26050,7 +26095,7 @@ GL_PREFIX(VertexAttrib3fvNV): popq %rbp popq %rsi popq %rdi - movq 5536(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV) @@ -26061,7 +26106,7 @@ GL_PREFIX(VertexAttrib3fvNV): GL_PREFIX(VertexAttrib3sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5544(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26075,13 +26120,13 @@ GL_PREFIX(VertexAttrib3sNV): popq %rdx popq %rsi popq %rdi - movq 5544(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5544(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26095,7 +26140,7 @@ GL_PREFIX(VertexAttrib3sNV): popq %rdx popq %rsi popq %rdi - movq 5544(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV) @@ -26106,7 +26151,7 @@ GL_PREFIX(VertexAttrib3sNV): GL_PREFIX(VertexAttrib3svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5552(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26116,13 +26161,13 @@ GL_PREFIX(VertexAttrib3svNV): popq %rbp popq %rsi popq %rdi - movq 5552(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5552(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26132,7 +26177,7 @@ GL_PREFIX(VertexAttrib3svNV): popq %rbp popq %rsi popq %rdi - movq 5552(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV) @@ -26143,7 +26188,7 @@ GL_PREFIX(VertexAttrib3svNV): GL_PREFIX(VertexAttrib4dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5560(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26159,13 +26204,13 @@ GL_PREFIX(VertexAttrib4dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5560(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5560(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26181,7 +26226,7 @@ GL_PREFIX(VertexAttrib4dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5560(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV) @@ -26192,7 +26237,7 @@ GL_PREFIX(VertexAttrib4dNV): GL_PREFIX(VertexAttrib4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5568(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26202,13 +26247,13 @@ GL_PREFIX(VertexAttrib4dvNV): popq %rbp popq %rsi popq %rdi - movq 5568(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5568(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26218,7 +26263,7 @@ GL_PREFIX(VertexAttrib4dvNV): popq %rbp popq %rsi popq %rdi - movq 5568(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV) @@ -26229,7 +26274,7 @@ GL_PREFIX(VertexAttrib4dvNV): GL_PREFIX(VertexAttrib4fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5576(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26245,13 +26290,13 @@ GL_PREFIX(VertexAttrib4fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5576(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5576(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26267,7 +26312,7 @@ GL_PREFIX(VertexAttrib4fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5576(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV) @@ -26278,7 +26323,7 @@ GL_PREFIX(VertexAttrib4fNV): GL_PREFIX(VertexAttrib4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5584(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26288,13 +26333,13 @@ GL_PREFIX(VertexAttrib4fvNV): popq %rbp popq %rsi popq %rdi - movq 5584(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5584(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26304,7 +26349,7 @@ GL_PREFIX(VertexAttrib4fvNV): popq %rbp popq %rsi popq %rdi - movq 5584(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV) @@ -26315,7 +26360,7 @@ GL_PREFIX(VertexAttrib4fvNV): GL_PREFIX(VertexAttrib4sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5592(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26329,13 +26374,13 @@ GL_PREFIX(VertexAttrib4sNV): popq %rdx popq %rsi popq %rdi - movq 5592(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5592(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26349,7 +26394,7 @@ GL_PREFIX(VertexAttrib4sNV): popq %rdx popq %rsi popq %rdi - movq 5592(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV) @@ -26360,7 +26405,7 @@ GL_PREFIX(VertexAttrib4sNV): GL_PREFIX(VertexAttrib4svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5600(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26370,13 +26415,13 @@ GL_PREFIX(VertexAttrib4svNV): popq %rbp popq %rsi popq %rdi - movq 5600(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5600(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26386,7 +26431,7 @@ GL_PREFIX(VertexAttrib4svNV): popq %rbp popq %rsi popq %rdi - movq 5600(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV) @@ -26397,7 +26442,7 @@ GL_PREFIX(VertexAttrib4svNV): GL_PREFIX(VertexAttrib4ubNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5608(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26411,13 +26456,13 @@ GL_PREFIX(VertexAttrib4ubNV): popq %rdx popq %rsi popq %rdi - movq 5608(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5608(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26431,7 +26476,7 @@ GL_PREFIX(VertexAttrib4ubNV): popq %rdx popq %rsi popq %rdi - movq 5608(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV) @@ -26442,7 +26487,7 @@ GL_PREFIX(VertexAttrib4ubNV): GL_PREFIX(VertexAttrib4ubvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5616(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26452,13 +26497,13 @@ GL_PREFIX(VertexAttrib4ubvNV): popq %rbp popq %rsi popq %rdi - movq 5616(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5616(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26468,7 +26513,7 @@ GL_PREFIX(VertexAttrib4ubvNV): popq %rbp popq %rsi popq %rdi - movq 5616(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV) @@ -26479,7 +26524,7 @@ GL_PREFIX(VertexAttrib4ubvNV): GL_PREFIX(VertexAttribPointerNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5624(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26493,13 +26538,13 @@ GL_PREFIX(VertexAttribPointerNV): popq %rdx popq %rsi popq %rdi - movq 5624(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5624(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26513,7 +26558,7 @@ GL_PREFIX(VertexAttribPointerNV): popq %rdx popq %rsi popq %rdi - movq 5624(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV) @@ -26524,7 +26569,7 @@ GL_PREFIX(VertexAttribPointerNV): GL_PREFIX(VertexAttribs1dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5632(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26534,13 +26579,13 @@ GL_PREFIX(VertexAttribs1dvNV): popq %rdx popq %rsi popq %rdi - movq 5632(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5632(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26550,7 +26595,7 @@ GL_PREFIX(VertexAttribs1dvNV): popq %rdx popq %rsi popq %rdi - movq 5632(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV) @@ -26561,7 +26606,7 @@ GL_PREFIX(VertexAttribs1dvNV): GL_PREFIX(VertexAttribs1fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5640(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26571,13 +26616,13 @@ GL_PREFIX(VertexAttribs1fvNV): popq %rdx popq %rsi popq %rdi - movq 5640(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5640(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26587,7 +26632,7 @@ GL_PREFIX(VertexAttribs1fvNV): popq %rdx popq %rsi popq %rdi - movq 5640(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV) @@ -26598,7 +26643,7 @@ GL_PREFIX(VertexAttribs1fvNV): GL_PREFIX(VertexAttribs1svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5648(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26608,13 +26653,13 @@ GL_PREFIX(VertexAttribs1svNV): popq %rdx popq %rsi popq %rdi - movq 5648(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5648(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26624,7 +26669,7 @@ GL_PREFIX(VertexAttribs1svNV): popq %rdx popq %rsi popq %rdi - movq 5648(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV) @@ -26635,7 +26680,7 @@ GL_PREFIX(VertexAttribs1svNV): GL_PREFIX(VertexAttribs2dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5656(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26645,13 +26690,13 @@ GL_PREFIX(VertexAttribs2dvNV): popq %rdx popq %rsi popq %rdi - movq 5656(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5656(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26661,7 +26706,7 @@ GL_PREFIX(VertexAttribs2dvNV): popq %rdx popq %rsi popq %rdi - movq 5656(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV) @@ -26672,7 +26717,7 @@ GL_PREFIX(VertexAttribs2dvNV): GL_PREFIX(VertexAttribs2fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5664(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26682,13 +26727,13 @@ GL_PREFIX(VertexAttribs2fvNV): popq %rdx popq %rsi popq %rdi - movq 5664(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5664(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26698,7 +26743,7 @@ GL_PREFIX(VertexAttribs2fvNV): popq %rdx popq %rsi popq %rdi - movq 5664(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV) @@ -26709,7 +26754,7 @@ GL_PREFIX(VertexAttribs2fvNV): GL_PREFIX(VertexAttribs2svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5672(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26719,13 +26764,13 @@ GL_PREFIX(VertexAttribs2svNV): popq %rdx popq %rsi popq %rdi - movq 5672(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5672(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26735,7 +26780,7 @@ GL_PREFIX(VertexAttribs2svNV): popq %rdx popq %rsi popq %rdi - movq 5672(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV) @@ -26746,7 +26791,7 @@ GL_PREFIX(VertexAttribs2svNV): GL_PREFIX(VertexAttribs3dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5680(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26756,13 +26801,13 @@ GL_PREFIX(VertexAttribs3dvNV): popq %rdx popq %rsi popq %rdi - movq 5680(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5680(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26772,7 +26817,7 @@ GL_PREFIX(VertexAttribs3dvNV): popq %rdx popq %rsi popq %rdi - movq 5680(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV) @@ -26783,7 +26828,7 @@ GL_PREFIX(VertexAttribs3dvNV): GL_PREFIX(VertexAttribs3fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5688(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26793,13 +26838,13 @@ GL_PREFIX(VertexAttribs3fvNV): popq %rdx popq %rsi popq %rdi - movq 5688(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5688(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26809,7 +26854,7 @@ GL_PREFIX(VertexAttribs3fvNV): popq %rdx popq %rsi popq %rdi - movq 5688(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV) @@ -26820,7 +26865,7 @@ GL_PREFIX(VertexAttribs3fvNV): GL_PREFIX(VertexAttribs3svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5696(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26830,13 +26875,13 @@ GL_PREFIX(VertexAttribs3svNV): popq %rdx popq %rsi popq %rdi - movq 5696(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5696(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26846,7 +26891,7 @@ GL_PREFIX(VertexAttribs3svNV): popq %rdx popq %rsi popq %rdi - movq 5696(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV) @@ -26857,7 +26902,7 @@ GL_PREFIX(VertexAttribs3svNV): GL_PREFIX(VertexAttribs4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5704(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26867,13 +26912,13 @@ GL_PREFIX(VertexAttribs4dvNV): popq %rdx popq %rsi popq %rdi - movq 5704(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5704(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26883,7 +26928,7 @@ GL_PREFIX(VertexAttribs4dvNV): popq %rdx popq %rsi popq %rdi - movq 5704(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV) @@ -26894,7 +26939,7 @@ GL_PREFIX(VertexAttribs4dvNV): GL_PREFIX(VertexAttribs4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5712(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26904,13 +26949,13 @@ GL_PREFIX(VertexAttribs4fvNV): popq %rdx popq %rsi popq %rdi - movq 5712(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5712(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26920,7 +26965,7 @@ GL_PREFIX(VertexAttribs4fvNV): popq %rdx popq %rsi popq %rdi - movq 5712(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV) @@ -26931,7 +26976,7 @@ GL_PREFIX(VertexAttribs4fvNV): GL_PREFIX(VertexAttribs4svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5720(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26941,13 +26986,13 @@ GL_PREFIX(VertexAttribs4svNV): popq %rdx popq %rsi popq %rdi - movq 5720(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5720(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26957,7 +27002,7 @@ GL_PREFIX(VertexAttribs4svNV): popq %rdx popq %rsi popq %rdi - movq 5720(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV) @@ -26968,7 +27013,7 @@ GL_PREFIX(VertexAttribs4svNV): GL_PREFIX(VertexAttribs4ubvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5728(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26978,13 +27023,13 @@ GL_PREFIX(VertexAttribs4ubvNV): popq %rdx popq %rsi popq %rdi - movq 5728(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5728(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26994,7 +27039,7 @@ GL_PREFIX(VertexAttribs4ubvNV): popq %rdx popq %rsi popq %rdi - movq 5728(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV) @@ -27005,7 +27050,7 @@ GL_PREFIX(VertexAttribs4ubvNV): GL_PREFIX(AlphaFragmentOp1ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5736(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27023,13 +27068,13 @@ GL_PREFIX(AlphaFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5736(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5736(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27047,7 +27092,7 @@ GL_PREFIX(AlphaFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5736(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI) @@ -27058,7 +27103,7 @@ GL_PREFIX(AlphaFragmentOp1ATI): GL_PREFIX(AlphaFragmentOp2ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5744(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27076,13 +27121,13 @@ GL_PREFIX(AlphaFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5744(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5744(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27100,7 +27145,7 @@ GL_PREFIX(AlphaFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5744(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI) @@ -27111,7 +27156,7 @@ GL_PREFIX(AlphaFragmentOp2ATI): GL_PREFIX(AlphaFragmentOp3ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5752(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27129,13 +27174,13 @@ GL_PREFIX(AlphaFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5752(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5752(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27153,7 +27198,7 @@ GL_PREFIX(AlphaFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5752(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI) @@ -27164,25 +27209,25 @@ GL_PREFIX(AlphaFragmentOp3ATI): GL_PREFIX(BeginFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5760(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 5760(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5760(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 5760(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI) @@ -27193,25 +27238,25 @@ GL_PREFIX(BeginFragmentShaderATI): GL_PREFIX(BindFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5768(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5768(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5768(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5768(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI) @@ -27222,7 +27267,7 @@ GL_PREFIX(BindFragmentShaderATI): GL_PREFIX(ColorFragmentOp1ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5776(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27240,13 +27285,13 @@ GL_PREFIX(ColorFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5776(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5776(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27264,7 +27309,7 @@ GL_PREFIX(ColorFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5776(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI) @@ -27275,7 +27320,7 @@ GL_PREFIX(ColorFragmentOp1ATI): GL_PREFIX(ColorFragmentOp2ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5784(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27293,13 +27338,13 @@ GL_PREFIX(ColorFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5784(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5784(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27317,7 +27362,7 @@ GL_PREFIX(ColorFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5784(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI) @@ -27328,7 +27373,7 @@ GL_PREFIX(ColorFragmentOp2ATI): GL_PREFIX(ColorFragmentOp3ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5792(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27346,13 +27391,13 @@ GL_PREFIX(ColorFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5792(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5792(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27370,7 +27415,7 @@ GL_PREFIX(ColorFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5792(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI) @@ -27381,25 +27426,25 @@ GL_PREFIX(ColorFragmentOp3ATI): GL_PREFIX(DeleteFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5800(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5800(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5800(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5800(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI) @@ -27410,25 +27455,25 @@ GL_PREFIX(DeleteFragmentShaderATI): GL_PREFIX(EndFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5808(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 5808(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5808(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 5808(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI) @@ -27439,25 +27484,25 @@ GL_PREFIX(EndFragmentShaderATI): GL_PREFIX(GenFragmentShadersATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5816(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5816(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5816(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5816(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI) @@ -27468,7 +27513,7 @@ GL_PREFIX(GenFragmentShadersATI): GL_PREFIX(PassTexCoordATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5824(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27478,13 +27523,13 @@ GL_PREFIX(PassTexCoordATI): popq %rdx popq %rsi popq %rdi - movq 5824(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5824(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27494,7 +27539,7 @@ GL_PREFIX(PassTexCoordATI): popq %rdx popq %rsi popq %rdi - movq 5824(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI) @@ -27505,7 +27550,7 @@ GL_PREFIX(PassTexCoordATI): GL_PREFIX(SampleMapATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5832(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27515,13 +27560,13 @@ GL_PREFIX(SampleMapATI): popq %rdx popq %rsi popq %rdi - movq 5832(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5832(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27531,7 +27576,7 @@ GL_PREFIX(SampleMapATI): popq %rdx popq %rsi popq %rdi - movq 5832(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI) @@ -27542,7 +27587,7 @@ GL_PREFIX(SampleMapATI): GL_PREFIX(SetFragmentShaderConstantATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5840(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27552,13 +27597,13 @@ GL_PREFIX(SetFragmentShaderConstantATI): popq %rbp popq %rsi popq %rdi - movq 5840(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5840(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27568,7 +27613,7 @@ GL_PREFIX(SetFragmentShaderConstantATI): popq %rbp popq %rsi popq %rdi - movq 5840(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI) @@ -27579,7 +27624,7 @@ GL_PREFIX(SetFragmentShaderConstantATI): GL_PREFIX(PointParameteriNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5848(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27589,13 +27634,13 @@ GL_PREFIX(PointParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5848(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5848(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27605,7 +27650,7 @@ GL_PREFIX(PointParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5848(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV) @@ -27616,7 +27661,7 @@ GL_PREFIX(PointParameteriNV): GL_PREFIX(PointParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5856(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27626,13 +27671,13 @@ GL_PREFIX(PointParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5856(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5856(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27642,40 +27687,10 @@ GL_PREFIX(PointParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5856(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_733) - .type GL_PREFIX(_dispatch_stub_733), @function - HIDDEN(GL_PREFIX(_dispatch_stub_733)) -GL_PREFIX(_dispatch_stub_733): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5864(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5864(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5864(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi movq 5864(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_733), .-GL_PREFIX(_dispatch_stub_733) + .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV) .p2align 4,,15 .globl GL_PREFIX(_dispatch_stub_734) @@ -27718,11 +27733,7 @@ GL_PREFIX(_dispatch_stub_735): jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi popq %rdi movq 5880(%rax), %r11 jmp *%r11 @@ -27734,11 +27745,7 @@ GL_PREFIX(_dispatch_stub_735): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rsi popq %rdi movq 5880(%rax), %r11 jmp *%r11 @@ -27794,7 +27801,11 @@ GL_PREFIX(_dispatch_stub_737): jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 5896(%rax), %r11 jmp *%r11 @@ -27806,20 +27817,54 @@ GL_PREFIX(_dispatch_stub_737): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 5896(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737) + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_738) + .type GL_PREFIX(_dispatch_stub_738), @function + HIDDEN(GL_PREFIX(_dispatch_stub_738)) +GL_PREFIX(_dispatch_stub_738): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 5904(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + call _x86_64_get_dispatch@PLT + popq %rdi + movq 5904(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 5904(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + call _glapi_get_dispatch + popq %rdi + movq 5904(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738) + .p2align 4,,15 .globl GL_PREFIX(GetProgramNamedParameterdvNV) .type GL_PREFIX(GetProgramNamedParameterdvNV), @function GL_PREFIX(GetProgramNamedParameterdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5904(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27833,13 +27878,13 @@ GL_PREFIX(GetProgramNamedParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5904(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5904(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27853,7 +27898,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5904(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV) @@ -27864,7 +27909,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV): GL_PREFIX(GetProgramNamedParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5912(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27878,13 +27923,13 @@ GL_PREFIX(GetProgramNamedParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5912(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5912(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27898,7 +27943,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5912(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV) @@ -27909,7 +27954,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV): GL_PREFIX(ProgramNamedParameter4dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5920(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -27929,13 +27974,13 @@ GL_PREFIX(ProgramNamedParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5920(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5920(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -27955,7 +28000,7 @@ GL_PREFIX(ProgramNamedParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5920(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV) @@ -27966,7 +28011,7 @@ GL_PREFIX(ProgramNamedParameter4dNV): GL_PREFIX(ProgramNamedParameter4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5928(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27980,13 +28025,13 @@ GL_PREFIX(ProgramNamedParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 5928(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5928(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28000,7 +28045,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 5928(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV) @@ -28011,7 +28056,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV): GL_PREFIX(ProgramNamedParameter4fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5936(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -28031,13 +28076,13 @@ GL_PREFIX(ProgramNamedParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5936(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5936(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -28057,7 +28102,7 @@ GL_PREFIX(ProgramNamedParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5936(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV) @@ -28068,7 +28113,7 @@ GL_PREFIX(ProgramNamedParameter4fNV): GL_PREFIX(ProgramNamedParameter4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5944(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28082,13 +28127,13 @@ GL_PREFIX(ProgramNamedParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 5944(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5944(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28102,19 +28147,19 @@ GL_PREFIX(ProgramNamedParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 5944(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_744) - .type GL_PREFIX(_dispatch_stub_744), @function - HIDDEN(GL_PREFIX(_dispatch_stub_744)) -GL_PREFIX(_dispatch_stub_744): + .globl GL_PREFIX(_dispatch_stub_745) + .type GL_PREFIX(_dispatch_stub_745), @function + HIDDEN(GL_PREFIX(_dispatch_stub_745)) +GL_PREFIX(_dispatch_stub_745): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5952(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28124,13 +28169,13 @@ GL_PREFIX(_dispatch_stub_744): popq %rbp popq %rsi popq %rdi - movq 5952(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5952(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28140,19 +28185,19 @@ GL_PREFIX(_dispatch_stub_744): popq %rbp popq %rsi popq %rdi - movq 5952(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_744), .-GL_PREFIX(_dispatch_stub_744) + .size GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_745) - .type GL_PREFIX(_dispatch_stub_745), @function - HIDDEN(GL_PREFIX(_dispatch_stub_745)) -GL_PREFIX(_dispatch_stub_745): + .globl GL_PREFIX(_dispatch_stub_746) + .type GL_PREFIX(_dispatch_stub_746), @function + HIDDEN(GL_PREFIX(_dispatch_stub_746)) +GL_PREFIX(_dispatch_stub_746): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5960(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28162,13 +28207,13 @@ GL_PREFIX(_dispatch_stub_745): popq %rbp popq %rsi popq %rdi - movq 5960(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5960(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28178,10 +28223,10 @@ GL_PREFIX(_dispatch_stub_745): popq %rbp popq %rsi popq %rdi - movq 5960(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745) + .size GL_PREFIX(_dispatch_stub_746), .-GL_PREFIX(_dispatch_stub_746) .p2align 4,,15 .globl GL_PREFIX(BindFramebufferEXT) @@ -28189,7 +28234,7 @@ GL_PREFIX(_dispatch_stub_745): GL_PREFIX(BindFramebufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5968(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28199,13 +28244,13 @@ GL_PREFIX(BindFramebufferEXT): popq %rbp popq %rsi popq %rdi - movq 5968(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5968(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28215,7 +28260,7 @@ GL_PREFIX(BindFramebufferEXT): popq %rbp popq %rsi popq %rdi - movq 5968(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT) @@ -28226,7 +28271,7 @@ GL_PREFIX(BindFramebufferEXT): GL_PREFIX(BindRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5976(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28236,13 +28281,13 @@ GL_PREFIX(BindRenderbufferEXT): popq %rbp popq %rsi popq %rdi - movq 5976(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5976(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28252,7 +28297,7 @@ GL_PREFIX(BindRenderbufferEXT): popq %rbp popq %rsi popq %rdi - movq 5976(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT) @@ -28263,25 +28308,25 @@ GL_PREFIX(BindRenderbufferEXT): GL_PREFIX(CheckFramebufferStatusEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5984(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5984(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5984(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5984(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT) @@ -28292,7 +28337,7 @@ GL_PREFIX(CheckFramebufferStatusEXT): GL_PREFIX(DeleteFramebuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5992(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28302,13 +28347,13 @@ GL_PREFIX(DeleteFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 5992(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5992(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28318,7 +28363,7 @@ GL_PREFIX(DeleteFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 5992(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT) @@ -28329,7 +28374,7 @@ GL_PREFIX(DeleteFramebuffersEXT): GL_PREFIX(DeleteRenderbuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6000(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28339,13 +28384,13 @@ GL_PREFIX(DeleteRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6000(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6000(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28355,7 +28400,7 @@ GL_PREFIX(DeleteRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6000(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT) @@ -28366,7 +28411,7 @@ GL_PREFIX(DeleteRenderbuffersEXT): GL_PREFIX(FramebufferRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6008(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28380,13 +28425,13 @@ GL_PREFIX(FramebufferRenderbufferEXT): popq %rdx popq %rsi popq %rdi - movq 6008(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6008(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28400,7 +28445,7 @@ GL_PREFIX(FramebufferRenderbufferEXT): popq %rdx popq %rsi popq %rdi - movq 6008(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT) @@ -28411,7 +28456,7 @@ GL_PREFIX(FramebufferRenderbufferEXT): GL_PREFIX(FramebufferTexture1DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6016(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28425,13 +28470,13 @@ GL_PREFIX(FramebufferTexture1DEXT): popq %rdx popq %rsi popq %rdi - movq 6016(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6016(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28445,7 +28490,7 @@ GL_PREFIX(FramebufferTexture1DEXT): popq %rdx popq %rsi popq %rdi - movq 6016(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT) @@ -28456,7 +28501,7 @@ GL_PREFIX(FramebufferTexture1DEXT): GL_PREFIX(FramebufferTexture2DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6024(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28470,13 +28515,13 @@ GL_PREFIX(FramebufferTexture2DEXT): popq %rdx popq %rsi popq %rdi - movq 6024(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6024(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28490,7 +28535,7 @@ GL_PREFIX(FramebufferTexture2DEXT): popq %rdx popq %rsi popq %rdi - movq 6024(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT) @@ -28501,7 +28546,7 @@ GL_PREFIX(FramebufferTexture2DEXT): GL_PREFIX(FramebufferTexture3DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6032(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28519,13 +28564,13 @@ GL_PREFIX(FramebufferTexture3DEXT): popq %rdx popq %rsi popq %rdi - movq 6032(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6032(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28543,7 +28588,7 @@ GL_PREFIX(FramebufferTexture3DEXT): popq %rdx popq %rsi popq %rdi - movq 6032(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT) @@ -28554,7 +28599,7 @@ GL_PREFIX(FramebufferTexture3DEXT): GL_PREFIX(GenFramebuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6040(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28564,13 +28609,13 @@ GL_PREFIX(GenFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6040(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6040(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28580,7 +28625,7 @@ GL_PREFIX(GenFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6040(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT) @@ -28591,7 +28636,7 @@ GL_PREFIX(GenFramebuffersEXT): GL_PREFIX(GenRenderbuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6048(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28601,13 +28646,13 @@ GL_PREFIX(GenRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6048(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6048(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28617,7 +28662,7 @@ GL_PREFIX(GenRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6048(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT) @@ -28628,25 +28673,25 @@ GL_PREFIX(GenRenderbuffersEXT): GL_PREFIX(GenerateMipmapEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6056(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6056(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6056(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6056(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT) @@ -28657,7 +28702,7 @@ GL_PREFIX(GenerateMipmapEXT): GL_PREFIX(GetFramebufferAttachmentParameterivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6064(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28671,13 +28716,13 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6064(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6064(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28691,7 +28736,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6064(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT) @@ -28702,7 +28747,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): GL_PREFIX(GetRenderbufferParameterivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6072(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28712,13 +28757,13 @@ GL_PREFIX(GetRenderbufferParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6072(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6072(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28728,7 +28773,7 @@ GL_PREFIX(GetRenderbufferParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6072(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT) @@ -28739,25 +28784,25 @@ GL_PREFIX(GetRenderbufferParameterivEXT): GL_PREFIX(IsFramebufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6080(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6080(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6080(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6080(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT) @@ -28768,25 +28813,25 @@ GL_PREFIX(IsFramebufferEXT): GL_PREFIX(IsRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6088(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6088(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6088(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6088(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT) @@ -28797,7 +28842,7 @@ GL_PREFIX(IsRenderbufferEXT): GL_PREFIX(RenderbufferStorageEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6096(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28811,13 +28856,13 @@ GL_PREFIX(RenderbufferStorageEXT): popq %rdx popq %rsi popq %rdi - movq 6096(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6096(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28831,19 +28876,19 @@ GL_PREFIX(RenderbufferStorageEXT): popq %rdx popq %rsi popq %rdi - movq 6096(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_763) - .type GL_PREFIX(_dispatch_stub_763), @function - HIDDEN(GL_PREFIX(_dispatch_stub_763)) -GL_PREFIX(_dispatch_stub_763): + .globl GL_PREFIX(_dispatch_stub_764) + .type GL_PREFIX(_dispatch_stub_764), @function + HIDDEN(GL_PREFIX(_dispatch_stub_764)) +GL_PREFIX(_dispatch_stub_764): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6104(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28861,13 +28906,13 @@ GL_PREFIX(_dispatch_stub_763): popq %rdx popq %rsi popq %rdi - movq 6104(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6104(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28885,10 +28930,10 @@ GL_PREFIX(_dispatch_stub_763): popq %rdx popq %rsi popq %rdi - movq 6104(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_763), .-GL_PREFIX(_dispatch_stub_763) + .size GL_PREFIX(_dispatch_stub_764), .-GL_PREFIX(_dispatch_stub_764) .p2align 4,,15 .globl GL_PREFIX(FramebufferTextureLayerEXT) @@ -28896,7 +28941,7 @@ GL_PREFIX(_dispatch_stub_763): GL_PREFIX(FramebufferTextureLayerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6112(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28910,13 +28955,13 @@ GL_PREFIX(FramebufferTextureLayerEXT): popq %rdx popq %rsi popq %rdi - movq 6112(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6112(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28930,19 +28975,19 @@ GL_PREFIX(FramebufferTextureLayerEXT): popq %rdx popq %rsi popq %rdi - movq 6112(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_765) - .type GL_PREFIX(_dispatch_stub_765), @function - HIDDEN(GL_PREFIX(_dispatch_stub_765)) -GL_PREFIX(_dispatch_stub_765): + .globl GL_PREFIX(_dispatch_stub_766) + .type GL_PREFIX(_dispatch_stub_766), @function + HIDDEN(GL_PREFIX(_dispatch_stub_766)) +GL_PREFIX(_dispatch_stub_766): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6120(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28956,13 +29001,13 @@ GL_PREFIX(_dispatch_stub_765): popq %rdx popq %rsi popq %rdi - movq 6120(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6120(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28976,19 +29021,19 @@ GL_PREFIX(_dispatch_stub_765): popq %rdx popq %rsi popq %rdi - movq 6120(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_765), .-GL_PREFIX(_dispatch_stub_765) + .size GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_766) - .type GL_PREFIX(_dispatch_stub_766), @function - HIDDEN(GL_PREFIX(_dispatch_stub_766)) -GL_PREFIX(_dispatch_stub_766): + .globl GL_PREFIX(_dispatch_stub_767) + .type GL_PREFIX(_dispatch_stub_767), @function + HIDDEN(GL_PREFIX(_dispatch_stub_767)) +GL_PREFIX(_dispatch_stub_767): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6128(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29002,13 +29047,13 @@ GL_PREFIX(_dispatch_stub_766): popq %rdx popq %rsi popq %rdi - movq 6128(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6128(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29022,19 +29067,19 @@ GL_PREFIX(_dispatch_stub_766): popq %rdx popq %rsi popq %rdi - movq 6128(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766) + .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_767) - .type GL_PREFIX(_dispatch_stub_767), @function - HIDDEN(GL_PREFIX(_dispatch_stub_767)) -GL_PREFIX(_dispatch_stub_767): + .globl GL_PREFIX(_dispatch_stub_768) + .type GL_PREFIX(_dispatch_stub_768), @function + HIDDEN(GL_PREFIX(_dispatch_stub_768)) +GL_PREFIX(_dispatch_stub_768): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6136(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29048,13 +29093,13 @@ GL_PREFIX(_dispatch_stub_767): popq %rdx popq %rsi popq %rdi - movq 6136(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6136(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29068,19 +29113,19 @@ GL_PREFIX(_dispatch_stub_767): popq %rdx popq %rsi popq %rdi - movq 6136(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767) + .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_768) - .type GL_PREFIX(_dispatch_stub_768), @function - HIDDEN(GL_PREFIX(_dispatch_stub_768)) -GL_PREFIX(_dispatch_stub_768): + .globl GL_PREFIX(_dispatch_stub_769) + .type GL_PREFIX(_dispatch_stub_769), @function + HIDDEN(GL_PREFIX(_dispatch_stub_769)) +GL_PREFIX(_dispatch_stub_769): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6144(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29090,13 +29135,13 @@ GL_PREFIX(_dispatch_stub_768): popq %rdx popq %rsi popq %rdi - movq 6144(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6144(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29106,19 +29151,19 @@ GL_PREFIX(_dispatch_stub_768): popq %rdx popq %rsi popq %rdi - movq 6144(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768) + .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_769) - .type GL_PREFIX(_dispatch_stub_769), @function - HIDDEN(GL_PREFIX(_dispatch_stub_769)) -GL_PREFIX(_dispatch_stub_769): + .globl GL_PREFIX(_dispatch_stub_770) + .type GL_PREFIX(_dispatch_stub_770), @function + HIDDEN(GL_PREFIX(_dispatch_stub_770)) +GL_PREFIX(_dispatch_stub_770): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6152(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29128,13 +29173,13 @@ GL_PREFIX(_dispatch_stub_769): popq %rdx popq %rsi popq %rdi - movq 6152(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6152(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29144,10 +29189,10 @@ GL_PREFIX(_dispatch_stub_769): popq %rdx popq %rsi popq %rdi - movq 6152(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769) + .size GL_PREFIX(_dispatch_stub_770), .-GL_PREFIX(_dispatch_stub_770) .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement) .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture) @@ -29402,7 +29447,26 @@ GL_PREFIX(_dispatch_stub_769): .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV) .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV) .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV) - .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_745) + .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_746) + .globl GL_PREFIX(BindFramebuffer) ; .set GL_PREFIX(BindFramebuffer), GL_PREFIX(BindFramebufferEXT) + .globl GL_PREFIX(BindRenderbuffer) ; .set GL_PREFIX(BindRenderbuffer), GL_PREFIX(BindRenderbufferEXT) + .globl GL_PREFIX(CheckFramebufferStatus) ; .set GL_PREFIX(CheckFramebufferStatus), GL_PREFIX(CheckFramebufferStatusEXT) + .globl GL_PREFIX(DeleteFramebuffers) ; .set GL_PREFIX(DeleteFramebuffers), GL_PREFIX(DeleteFramebuffersEXT) + .globl GL_PREFIX(DeleteRenderbuffers) ; .set GL_PREFIX(DeleteRenderbuffers), GL_PREFIX(DeleteRenderbuffersEXT) + .globl GL_PREFIX(FramebufferRenderbuffer) ; .set GL_PREFIX(FramebufferRenderbuffer), GL_PREFIX(FramebufferRenderbufferEXT) + .globl GL_PREFIX(FramebufferTexture1D) ; .set GL_PREFIX(FramebufferTexture1D), GL_PREFIX(FramebufferTexture1DEXT) + .globl GL_PREFIX(FramebufferTexture2D) ; .set GL_PREFIX(FramebufferTexture2D), GL_PREFIX(FramebufferTexture2DEXT) + .globl GL_PREFIX(FramebufferTexture3D) ; .set GL_PREFIX(FramebufferTexture3D), GL_PREFIX(FramebufferTexture3DEXT) + .globl GL_PREFIX(GenFramebuffers) ; .set GL_PREFIX(GenFramebuffers), GL_PREFIX(GenFramebuffersEXT) + .globl GL_PREFIX(GenRenderbuffers) ; .set GL_PREFIX(GenRenderbuffers), GL_PREFIX(GenRenderbuffersEXT) + .globl GL_PREFIX(GenerateMipmap) ; .set GL_PREFIX(GenerateMipmap), GL_PREFIX(GenerateMipmapEXT) + .globl GL_PREFIX(GetFramebufferAttachmentParameteriv) ; .set GL_PREFIX(GetFramebufferAttachmentParameteriv), GL_PREFIX(GetFramebufferAttachmentParameterivEXT) + .globl GL_PREFIX(GetRenderbufferParameteriv) ; .set GL_PREFIX(GetRenderbufferParameteriv), GL_PREFIX(GetRenderbufferParameterivEXT) + .globl GL_PREFIX(IsFramebuffer) ; .set GL_PREFIX(IsFramebuffer), GL_PREFIX(IsFramebufferEXT) + .globl GL_PREFIX(IsRenderbuffer) ; .set GL_PREFIX(IsRenderbuffer), GL_PREFIX(IsRenderbufferEXT) + .globl GL_PREFIX(RenderbufferStorage) ; .set GL_PREFIX(RenderbufferStorage), GL_PREFIX(RenderbufferStorageEXT) + .globl GL_PREFIX(BlitFramebuffer) ; .set GL_PREFIX(BlitFramebuffer), GL_PREFIX(_dispatch_stub_764) + .globl GL_PREFIX(FramebufferTextureLayer) ; .set GL_PREFIX(FramebufferTextureLayer), GL_PREFIX(FramebufferTextureLayerEXT) #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 b99c2b6520..2e05a74ac6 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -712,23 +712,24 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(GetActiveAttribARB, _gloffset_GetActiveAttribARB, GetActiveAttribARB@28) GL_STUB(GetAttribLocationARB, _gloffset_GetAttribLocationARB, GetAttribLocationARB@8) GL_STUB(DrawBuffersARB, _gloffset_DrawBuffersARB, DrawBuffersARB@8) + GL_STUB(RenderbufferStorageMultisample, _gloffset_RenderbufferStorageMultisample, RenderbufferStorageMultisample@20) GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8) - GL_STUB(_dispatch_stub_562, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_562@8) - HIDDEN(GL_PREFIX(_dispatch_stub_562, _dispatch_stub_562@8)) - GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_563@8) + GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_563@8) HIDDEN(GL_PREFIX(_dispatch_stub_563, _dispatch_stub_563@8)) - GL_STUB(_dispatch_stub_564, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_564@8) + GL_STUB(_dispatch_stub_564, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_564@8) HIDDEN(GL_PREFIX(_dispatch_stub_564, _dispatch_stub_564@8)) - GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_565@8) + GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_565@8) HIDDEN(GL_PREFIX(_dispatch_stub_565, _dispatch_stub_565@8)) - GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_566@8) + GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_566@8) HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@8)) - GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_567@8) + GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_567@8) HIDDEN(GL_PREFIX(_dispatch_stub_567, _dispatch_stub_567@8)) - GL_STUB(_dispatch_stub_568, _gloffset_SampleMaskSGIS, _dispatch_stub_568@8) + GL_STUB(_dispatch_stub_568, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_568@8) HIDDEN(GL_PREFIX(_dispatch_stub_568, _dispatch_stub_568@8)) - GL_STUB(_dispatch_stub_569, _gloffset_SamplePatternSGIS, _dispatch_stub_569@4) - HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@4)) + GL_STUB(_dispatch_stub_569, _gloffset_SampleMaskSGIS, _dispatch_stub_569@8) + HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@8)) + GL_STUB(_dispatch_stub_570, _gloffset_SamplePatternSGIS, _dispatch_stub_570@4) + HIDDEN(GL_PREFIX(_dispatch_stub_570, _dispatch_stub_570@4)) GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20) GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12) GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16) @@ -739,10 +740,10 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8) GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8) GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0) - GL_STUB(_dispatch_stub_580, _gloffset_CullParameterdvEXT, _dispatch_stub_580@8) - HIDDEN(GL_PREFIX(_dispatch_stub_580, _dispatch_stub_580@8)) - GL_STUB(_dispatch_stub_581, _gloffset_CullParameterfvEXT, _dispatch_stub_581@8) + GL_STUB(_dispatch_stub_581, _gloffset_CullParameterdvEXT, _dispatch_stub_581@8) HIDDEN(GL_PREFIX(_dispatch_stub_581, _dispatch_stub_581@8)) + GL_STUB(_dispatch_stub_582, _gloffset_CullParameterfvEXT, _dispatch_stub_582@8) + HIDDEN(GL_PREFIX(_dispatch_stub_582, _dispatch_stub_582@8)) GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12) GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4) GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24) @@ -767,8 +768,8 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4) GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4) GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4) - GL_STUB(_dispatch_stub_606, _gloffset_PixelTexGenSGIX, _dispatch_stub_606@4) - HIDDEN(GL_PREFIX(_dispatch_stub_606, _dispatch_stub_606@4)) + GL_STUB(_dispatch_stub_607, _gloffset_PixelTexGenSGIX, _dispatch_stub_607@4) + HIDDEN(GL_PREFIX(_dispatch_stub_607, _dispatch_stub_607@4)) GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0) GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8) @@ -810,24 +811,24 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4) GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16) GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4) - GL_STUB(_dispatch_stub_648, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_648@20) - HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@20)) - GL_STUB(_dispatch_stub_649, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_649@24) - HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@24)) - GL_STUB(_dispatch_stub_650, _gloffset_DeleteFencesNV, _dispatch_stub_650@8) - HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@8)) - GL_STUB(_dispatch_stub_651, _gloffset_FinishFenceNV, _dispatch_stub_651@4) - HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@4)) - GL_STUB(_dispatch_stub_652, _gloffset_GenFencesNV, _dispatch_stub_652@8) - HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@8)) - GL_STUB(_dispatch_stub_653, _gloffset_GetFenceivNV, _dispatch_stub_653@12) - HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@12)) - GL_STUB(_dispatch_stub_654, _gloffset_IsFenceNV, _dispatch_stub_654@4) - HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@4)) - GL_STUB(_dispatch_stub_655, _gloffset_SetFenceNV, _dispatch_stub_655@8) - HIDDEN(GL_PREFIX(_dispatch_stub_655, _dispatch_stub_655@8)) - GL_STUB(_dispatch_stub_656, _gloffset_TestFenceNV, _dispatch_stub_656@4) - HIDDEN(GL_PREFIX(_dispatch_stub_656, _dispatch_stub_656@4)) + GL_STUB(_dispatch_stub_649, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_649@20) + HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@20)) + GL_STUB(_dispatch_stub_650, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_650@24) + HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@24)) + GL_STUB(_dispatch_stub_651, _gloffset_DeleteFencesNV, _dispatch_stub_651@8) + HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@8)) + GL_STUB(_dispatch_stub_652, _gloffset_FinishFenceNV, _dispatch_stub_652@4) + HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@4)) + GL_STUB(_dispatch_stub_653, _gloffset_GenFencesNV, _dispatch_stub_653@8) + HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@8)) + GL_STUB(_dispatch_stub_654, _gloffset_GetFenceivNV, _dispatch_stub_654@12) + HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@12)) + GL_STUB(_dispatch_stub_655, _gloffset_IsFenceNV, _dispatch_stub_655@4) + HIDDEN(GL_PREFIX(_dispatch_stub_655, _dispatch_stub_655@4)) + GL_STUB(_dispatch_stub_656, _gloffset_SetFenceNV, _dispatch_stub_656@8) + HIDDEN(GL_PREFIX(_dispatch_stub_656, _dispatch_stub_656@8)) + GL_STUB(_dispatch_stub_657, _gloffset_TestFenceNV, _dispatch_stub_657@4) + HIDDEN(GL_PREFIX(_dispatch_stub_657, _dispatch_stub_657@4)) GL_STUB(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12) GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8) GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8) @@ -904,26 +905,26 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8) GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8) GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8) - GL_STUB(_dispatch_stub_733, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_733@4) - HIDDEN(GL_PREFIX(_dispatch_stub_733, _dispatch_stub_733@4)) - GL_STUB(_dispatch_stub_734, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_734@4) + GL_STUB(_dispatch_stub_734, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_734@4) HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4)) - GL_STUB(_dispatch_stub_735, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_735@8) - HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@8)) - GL_STUB(_dispatch_stub_736, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_736@8) + GL_STUB(_dispatch_stub_735, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_735@4) + HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@4)) + GL_STUB(_dispatch_stub_736, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_736@8) HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8)) - GL_STUB(_dispatch_stub_737, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_737@4) - HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4)) + GL_STUB(_dispatch_stub_737, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_737@8) + HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@8)) + GL_STUB(_dispatch_stub_738, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_738@4) + HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4)) GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16) GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16) GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44) GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16) GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28) GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16) - GL_STUB(_dispatch_stub_744, _gloffset_DepthBoundsEXT, _dispatch_stub_744@16) - HIDDEN(GL_PREFIX(_dispatch_stub_744, _dispatch_stub_744@16)) - GL_STUB(_dispatch_stub_745, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_745@8) - HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@8)) + GL_STUB(_dispatch_stub_745, _gloffset_DepthBoundsEXT, _dispatch_stub_745@16) + HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@16)) + GL_STUB(_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_746@8) + HIDDEN(GL_PREFIX(_dispatch_stub_746, _dispatch_stub_746@8)) GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8) GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8) GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4) @@ -941,19 +942,19 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4) GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4) GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16) - GL_STUB(_dispatch_stub_763, _gloffset_BlitFramebufferEXT, _dispatch_stub_763@40) - HIDDEN(GL_PREFIX(_dispatch_stub_763, _dispatch_stub_763@40)) + GL_STUB(_dispatch_stub_764, _gloffset_BlitFramebufferEXT, _dispatch_stub_764@40) + HIDDEN(GL_PREFIX(_dispatch_stub_764, _dispatch_stub_764@40)) GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) - GL_STUB(_dispatch_stub_765, _gloffset_StencilFuncSeparateATI, _dispatch_stub_765@16) - HIDDEN(GL_PREFIX(_dispatch_stub_765, _dispatch_stub_765@16)) - GL_STUB(_dispatch_stub_766, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_766@16) + GL_STUB(_dispatch_stub_766, _gloffset_StencilFuncSeparateATI, _dispatch_stub_766@16) HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@16)) - GL_STUB(_dispatch_stub_767, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_767@16) + GL_STUB(_dispatch_stub_767, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_767@16) HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16)) - GL_STUB(_dispatch_stub_768, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_768@12) - HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@12)) - GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_769@12) + GL_STUB(_dispatch_stub_768, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_768@16) + HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16)) + GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_769@12) HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@12)) + GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_770@12) + HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12)) GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4) GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8) GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12) @@ -1269,6 +1270,24 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(IsProgramARB, _gloffset_IsProgramNV, IsProgramARB@4, IsProgramNV, IsProgramNV@4) GL_STUB_ALIAS(PointParameteri, _gloffset_PointParameteriNV, PointParameteri@8, PointParameteriNV, PointParameteriNV@8) GL_STUB_ALIAS(PointParameteriv, _gloffset_PointParameterivNV, PointParameteriv@8, PointParameterivNV, PointParameterivNV@8) + GL_STUB_ALIAS(BindFramebuffer, _gloffset_BindFramebufferEXT, BindFramebuffer@8, BindFramebufferEXT, BindFramebufferEXT@8) + GL_STUB_ALIAS(BindRenderbuffer, _gloffset_BindRenderbufferEXT, BindRenderbuffer@8, BindRenderbufferEXT, BindRenderbufferEXT@8) + GL_STUB_ALIAS(CheckFramebufferStatus, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatus@4, CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4) + GL_STUB_ALIAS(DeleteFramebuffers, _gloffset_DeleteFramebuffersEXT, DeleteFramebuffers@8, DeleteFramebuffersEXT, DeleteFramebuffersEXT@8) + GL_STUB_ALIAS(DeleteRenderbuffers, _gloffset_DeleteRenderbuffersEXT, DeleteRenderbuffers@8, DeleteRenderbuffersEXT, DeleteRenderbuffersEXT@8) + GL_STUB_ALIAS(FramebufferRenderbuffer, _gloffset_FramebufferRenderbufferEXT, FramebufferRenderbuffer@16, FramebufferRenderbufferEXT, FramebufferRenderbufferEXT@16) + GL_STUB_ALIAS(FramebufferTexture1D, _gloffset_FramebufferTexture1DEXT, FramebufferTexture1D@20, FramebufferTexture1DEXT, FramebufferTexture1DEXT@20) + GL_STUB_ALIAS(FramebufferTexture2D, _gloffset_FramebufferTexture2DEXT, FramebufferTexture2D@20, FramebufferTexture2DEXT, FramebufferTexture2DEXT@20) + GL_STUB_ALIAS(FramebufferTexture3D, _gloffset_FramebufferTexture3DEXT, FramebufferTexture3D@24, FramebufferTexture3DEXT, FramebufferTexture3DEXT@24) + GL_STUB_ALIAS(GenFramebuffers, _gloffset_GenFramebuffersEXT, GenFramebuffers@8, GenFramebuffersEXT, GenFramebuffersEXT@8) + GL_STUB_ALIAS(GenRenderbuffers, _gloffset_GenRenderbuffersEXT, GenRenderbuffers@8, GenRenderbuffersEXT, GenRenderbuffersEXT@8) + GL_STUB_ALIAS(GenerateMipmap, _gloffset_GenerateMipmapEXT, GenerateMipmap@4, GenerateMipmapEXT, GenerateMipmapEXT@4) + GL_STUB_ALIAS(GetFramebufferAttachmentParameteriv, _gloffset_GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameteriv@16, GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16) + GL_STUB_ALIAS(GetRenderbufferParameteriv, _gloffset_GetRenderbufferParameterivEXT, GetRenderbufferParameteriv@12, GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12) + GL_STUB_ALIAS(IsFramebuffer, _gloffset_IsFramebufferEXT, IsFramebuffer@4, IsFramebufferEXT, IsFramebufferEXT@4) + 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) GLOBL GLNAME(gl_dispatch_functions_end) HIDDEN(GLNAME(gl_dispatch_functions_end)) -- cgit v1.2.3 From 7d98f5ab6e207586dcac4b165221ea9852fcf035 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:04:11 -0700 Subject: mesa: initial extension bits for GL_ARB_framebuffer_object --- src/mesa/main/extensions.c | 1 + src/mesa/main/mfeatures.h | 1 + src/mesa/main/mtypes.h | 1 + 3 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 9522f04ae5..0cad9887a2 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -49,6 +49,7 @@ static const struct { { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, + { OFF, "GL_ARB_framebuffer_object", F(ARB_framebuffer_object) }, { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, { OFF, "GL_ARB_imaging", F(ARB_imaging) }, { OFF, "GL_ARB_multisample", F(ARB_multisample) }, diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 3819da3d68..8fb32dd7e9 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -60,6 +60,7 @@ #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_vertex_buffer_object _HAVE_FULL_GL #define FEATURE_ARB_vertex_program _HAVE_FULL_GL #define FEATURE_ARB_vertex_shader _HAVE_FULL_GL diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 2014745a7a..faa9cbd624 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2531,6 +2531,7 @@ struct gl_extensions GLboolean ARB_fragment_program; GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; + GLboolean ARB_framebuffer_object; GLboolean ARB_half_float_pixel; GLboolean ARB_imaging; GLboolean ARB_multisample; -- cgit v1.2.3 From 989edea40913de9347908488db8978eb2efaba63 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:05:13 -0700 Subject: mesa: for ARB_fbo, lift restriction that all FBO attachments are same size and color format --- src/mesa/main/fbobject.c | 68 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 876d691c65..faf3763b71 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -3,6 +3,7 @@ * Version: 7.1 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 1999-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"), @@ -24,6 +25,8 @@ /* + * GL_EXT/ARB_framebuffer_object extensions + * * Authors: * Brian Paul */ @@ -34,6 +37,7 @@ #include "fbobject.h" #include "framebuffer.h" #include "hash.h" +#include "macros.h" #include "mipmap.h" #include "renderbuffer.h" #include "state.h" @@ -416,9 +420,9 @@ fbo_incomplete(const char *msg, int index) void _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) { - GLuint numImages, width = 0, height = 0; - GLenum intFormat = GL_NONE; - GLuint w = 0, h = 0; + GLuint numImages; + GLenum intFormat = GL_NONE; /* color buffers' internal format */ + GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0; GLint i; GLuint j; @@ -428,11 +432,17 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) fb->Width = 0; fb->Height = 0; - /* Start at -2 to more easily loop over all attachment points */ + /* Start at -2 to more easily loop over all attachment points. + * -2: depth buffer + * -1: stencil buffer + * >=0: color buffer + */ for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { struct gl_renderbuffer_attachment *att; GLenum f; + /* check for attachment completeness + */ if (i == -2) { att = &fb->Attachment[BUFFER_DEPTH]; test_attachment_completeness(ctx, GL_DEPTH, att); @@ -461,11 +471,15 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) } } + /* get width, height, format of the renderbuffer/texture + */ if (att->Type == GL_TEXTURE) { const struct gl_texture_image *texImg = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; - w = texImg->Width; - h = texImg->Height; + minWidth = MIN2(minWidth, texImg->Width); + maxWidth = MAX2(maxWidth, texImg->Width); + minHeight = MIN2(minHeight, texImg->Height); + maxHeight = MAX2(maxHeight, texImg->Height); f = texImg->_BaseFormat; numImages++; if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT @@ -476,8 +490,10 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) } } else if (att->Type == GL_RENDERBUFFER_EXT) { - w = att->Renderbuffer->Width; - h = att->Renderbuffer->Height; + minWidth = MIN2(minWidth, att->Renderbuffer->Width); + maxWidth = MAX2(minWidth, att->Renderbuffer->Width); + minHeight = MIN2(minHeight, att->Renderbuffer->Height); + maxHeight = MAX2(minHeight, att->Renderbuffer->Height); f = att->Renderbuffer->InternalFormat; numImages++; } @@ -486,24 +502,27 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) continue; } + /* Error-check width, height, format + */ if (numImages == 1) { - /* set required width, height and format */ - width = w; - height = h; + /* save format */ if (i >= 0) intFormat = f; } else { - /* check that width, height, format are same */ - if (w != width || h != height) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; - fbo_incomplete("width or height mismatch", -1); - return; - } - if (intFormat != GL_NONE && f != intFormat) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; - fbo_incomplete("format mismatch", -1); - return; + if (!ctx->Extensions.ARB_framebuffer_object) { + /* check that width, height, format are same */ + if (minWidth != maxWidth || minHeight != maxHeight) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; + fbo_incomplete("width or height mismatch", -1); + return; + } + /* check that all color buffer have same format */ + if (intFormat != GL_NONE && f != intFormat) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; + fbo_incomplete("format mismatch", -1); + return; + } } } } @@ -544,10 +563,13 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) /* * If we get here, the framebuffer is complete! + * Note that if ARB_framebuffer_object is supported and the attached + * renderbuffers/textures are different sizes, the framebuffer width/height + * will be set to the smallest width/height. */ fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; - fb->Width = w; - fb->Height = h; + fb->Width = minWidth; + fb->Height = minHeight; } -- cgit v1.2.3 From 06f3b2e6799ebd66a813ce9345c2ca6bbd0abe7d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:06:17 -0700 Subject: mesa: additional FBO/RB id error checking for ARB_fbo It's illegal to bind a FBO/RB id that didn't come from glGenRender/Framebuffer(). --- src/mesa/main/fbobject.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index faf3763b71..f904937078 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -616,6 +616,11 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) newRb = NULL; } if (!newRb) { + if (ctx->Extensions.ARB_framebuffer_object) { + /* All RB IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); + return; + } /* create new renderbuffer object */ newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer); if (!newRb) { @@ -1018,6 +1023,11 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) newFb = NULL; } if (!newFb) { + if (ctx->Extensions.ARB_framebuffer_object) { + /* All FBO IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); + return; + } /* create new framebuffer object */ newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); if (!newFb) { -- cgit v1.2.3 From d9a2cf92468f318e4cd7f1cfdbb3faf53545ecad Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:07:10 -0700 Subject: mesa: add new ColorEncoding and ComponentType to gl_renderbuffer --- src/mesa/main/mtypes.h | 6 +++++- src/mesa/main/renderbuffer.c | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index faa9cbd624..0cd88e7b3a 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2260,7 +2260,9 @@ struct gl_renderbuffer GLenum _ActualFormat; /**< The driver-chosen format */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or GL_STENCIL_INDEX. */ - GLenum DataType; /**< Type of values passed to the Get/Put functions */ + 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; @@ -2268,6 +2270,8 @@ struct gl_renderbuffer GLubyte IndexBits; GLubyte DepthBits; GLubyte StencilBits; + + GLenum DataType; /**< Type of values passed to the Get/Put functions */ GLvoid *Data; /**< This may not be used by some kinds of RBs */ /* Used to wrap one renderbuffer around another: */ diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 6f1d7c3960..6047ebac4a 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1487,11 +1487,16 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) rb->InternalFormat = GL_NONE; rb->_ActualFormat = GL_NONE; rb->_BaseFormat = GL_NONE; - rb->DataType = 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->DataType = GL_NONE; rb->Data = NULL; /* Point back to ourself so that we don't have to check for Wrapped==NULL -- cgit v1.2.3 From 1bc59bf4f85d1649e6c273cca82785965ea94ac9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:07:34 -0700 Subject: mesa: add new ARB_fbo queries, fix some error tests --- src/mesa/main/fbobject.c | 107 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 97 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index f904937078..5bb9015efe 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -441,6 +441,11 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) struct gl_renderbuffer_attachment *att; GLenum f; + /* + * XXX for ARB_fbo, only check color buffers that are named by + * GL_READ_BUFFER and GL_DRAW_BUFFERi. + */ + /* check for attachment completeness */ if (i == -2) { @@ -615,12 +620,13 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) /* ID was reserved, but no real renderbuffer object made yet */ newRb = NULL; } + else if (!newRb && ctx->Extensions.ARB_framebuffer_object) { + /* All RB IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); + return; + } + if (!newRb) { - if (ctx->Extensions.ARB_framebuffer_object) { - /* All RB IDs must be Gen'd */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); - return; - } /* create new renderbuffer object */ newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer); if (!newRb) { @@ -973,6 +979,13 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) GLboolean bindReadBuf, bindDrawBuf; GET_CURRENT_CONTEXT(ctx); +#ifdef DEBUG + if (ctx->Extensions.ARB_framebuffer_object) { + ASSERT(ctx->Extensions.EXT_framebuffer_object); + ASSERT(ctx->Extensions.EXT_framebuffer_blit); + } +#endif + ASSERT_OUTSIDE_BEGIN_END(ctx); if (!ctx->Extensions.EXT_framebuffer_object) { @@ -1022,12 +1035,13 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) /* ID was reserved, but no real framebuffer object made yet */ newFb = NULL; } + else if (!newFb && ctx->Extensions.ARB_framebuffer_object) { + /* All FBO IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); + return; + } + if (!newFb) { - if (ctx->Extensions.ARB_framebuffer_object) { - /* All FBO IDs must be Gen'd */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); - return; - } /* create new framebuffer object */ newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); if (!newFb) { @@ -1573,6 +1587,79 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, "glGetFramebufferAttachmentParameterivEXT(pname)"); } return; + case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->ColorEncoding; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + return; + } + else { + *params = att->Renderbuffer->ComponentType; + } + 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: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->DepthBits; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->StencilBits; + } + return; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFramebufferAttachmentParameterivEXT(pname)"); -- cgit v1.2.3 From 3528f69ce4ba9098ff4d372d7d411b24cf161d61 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:13:18 -0700 Subject: mesa: added ctx->Driver.ValidateFramebuffer() callback Called from the _mesa_test_framebuffer_completeness() function to give the driver the chance to make a framebuffer as incomplete if it doesn't meet some specific hardware restriction. --- src/mesa/main/dd.h | 2 ++ src/mesa/main/fbobject.c | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index ddb38030bf..989791f39f 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -808,6 +808,8 @@ struct dd_function_table { struct gl_renderbuffer_attachment *att); void (*FinishRenderTexture)(GLcontext *ctx, struct gl_renderbuffer_attachment *att); + void (*ValidateFramebuffer)(GLcontext *ctx, + struct gl_framebuffer *fb); /*@}*/ #endif #if FEATURE_EXT_framebuffer_blit diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 5bb9015efe..ad4965550a 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -414,6 +414,8 @@ fbo_incomplete(const char *msg, int index) /** * Test if the given framebuffer object is complete and update its * Status field with the results. + * Calls the ctx->Driver.ValidateFramebuffer() function to allow the + * driver to make hardware-specific validation/completeness checks. * Also update the framebuffer's Width and Height fields if the * framebuffer is complete. */ @@ -566,15 +568,23 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) return; } - /* - * If we get here, the framebuffer is complete! - * Note that if ARB_framebuffer_object is supported and the attached - * renderbuffers/textures are different sizes, the framebuffer width/height - * will be set to the smallest width/height. - */ + /* Provisionally set status = COMPLETE ... */ fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; - fb->Width = minWidth; - fb->Height = minHeight; + + /* ... but the driver may say the FB is incomplete: */ + if (ctx->Driver.ValidateFramebuffer) { + ctx->Driver.ValidateFramebuffer(ctx, fb); + } + + if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) { + /* + * Note that if ARB_framebuffer_object is supported and the attached + * renderbuffers/textures are different sizes, the framebuffer + * width/height will be set to the smallest width/height. + */ + fb->Width = minWidth; + fb->Height = minHeight; + } } -- cgit v1.2.3 From 283edbe31177522d006ab37ebaf33a6e31f0a34e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:14:45 -0700 Subject: mesa: update update_framebuffer_size() for ARB_fbo and mixed renderbuffer sizes --- src/mesa/main/framebuffer.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index af78363ad3..10d05243fe 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 "macros.h" #include "mtypes.h" #include "fbobject.h" #include "framebuffer.h" @@ -418,14 +419,14 @@ _mesa_ResizeBuffersMESA( void ) /** * Examine all the framebuffer's renderbuffers to update the Width/Height * fields of the framebuffer. If we have renderbuffers with different - * sizes, set the framebuffer's width and height to zero. + * sizes, set the framebuffer's width and height to the min size. * Note: this is only intended for user-created framebuffers, not * window-system framebuffes. */ static void -update_framebuffer_size(struct gl_framebuffer *fb) +update_framebuffer_size(GLcontext *ctx, struct gl_framebuffer *fb) { - GLboolean haveSize = GL_FALSE; + GLuint minWidth = ~0, minHeight = ~0; GLuint i; /* user-created framebuffers only */ @@ -435,21 +436,19 @@ update_framebuffer_size(struct gl_framebuffer *fb) struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; const struct gl_renderbuffer *rb = att->Renderbuffer; if (rb) { - if (haveSize) { - if (rb->Width != fb->Width && rb->Height != fb->Height) { - /* size mismatch! */ - fb->Width = 0; - fb->Height = 0; - return; - } - } - else { - fb->Width = rb->Width; - fb->Height = rb->Height; - haveSize = GL_TRUE; - } + minWidth = MIN2(minWidth, rb->Width); + minHeight = MIN2(minHeight, rb->Height); } } + + if (minWidth != ~0) { + fb->Width = minWidth; + fb->Height = minHeight; + } + else { + fb->Width = 0; + fb->Height = 0; + } } @@ -469,7 +468,7 @@ _mesa_update_draw_buffer_bounds(GLcontext *ctx) if (buffer->Name) { /* user-created framebuffer size depends on the renderbuffers */ - update_framebuffer_size(buffer); + update_framebuffer_size(ctx, buffer); } buffer->_Xmin = 0; -- cgit v1.2.3 From 1f32c410dd06d73e2ad007a6ce755437884e92c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 19 Jan 2009 17:34:19 -0700 Subject: mesa: call fbo_incomplete() if driver marks FBO as incomplete (debug only) --- src/mesa/main/fbobject.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index ad4965550a..cdfa291e10 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -574,6 +574,9 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) /* ... but the driver may say the FB is incomplete: */ if (ctx->Driver.ValidateFramebuffer) { ctx->Driver.ValidateFramebuffer(ctx, fb); + if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + fbo_incomplete("driver marked FBO as incomplete", -1); + } } if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) { -- cgit v1.2.3 From 777a2efc7768de659fbc2e9a7541c9cbb3fc1d8b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:17:42 -0700 Subject: mesa: stub for _mesa_RenderbufferStorageMultisample() --- src/mesa/main/api_exec.c | 7 +++++++ src/mesa/main/fbobject.c | 15 ++++++++++++++- src/mesa/main/fbobject.h | 5 +++++ 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index bae3bf11cb..f8ee0d59dd 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -880,5 +880,12 @@ _mesa_init_exec_table(struct _glapi_table *exec) /* GL_ATI_separate_stencil */ SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI); + +#if FEATURE_ARB_framebuffer_object + /* The ARB_fbo functions are the union of + * GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array + */ + SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample); +#endif } diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index cdfa291e10..dbd9c130d0 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -571,7 +571,10 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) /* Provisionally set status = COMPLETE ... */ fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; - /* ... but the driver may say the FB is incomplete: */ + /* ... but the driver may say the FB is incomplete. + * Drivers will most likely set the status to GL_FRAMEBUFFER_UNSUPPORTED + * if anything. + */ if (ctx->Driver.ValidateFramebuffer) { ctx->Driver.ValidateFramebuffer(ctx, fb); if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { @@ -878,6 +881,16 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, } +void GLAPIENTRY +_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalformat, + GLsizei width, GLsizei height) +{ + +} + + + void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) { diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index b6154719ab..33d16cc5a0 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -83,6 +83,11 @@ extern void GLAPIENTRY _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +void GLAPIENTRY +_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalformat, + GLsizei width, GLsizei height); + extern void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params); -- cgit v1.2.3 From 4fc16fb7e9b72c4535967804c031256637a97197 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 15:17:57 -0700 Subject: mesa: added NumSamples, MaxSamples for ARB_fbo --- src/mesa/main/mtypes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 0cd88e7b3a..f1da638ae6 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2270,6 +2270,7 @@ struct gl_renderbuffer GLubyte IndexBits; GLubyte DepthBits; GLubyte StencilBits; + GLubyte NumSamples; GLenum DataType; /**< Type of values passed to the Get/Put functions */ GLvoid *Data; /**< This may not be used by some kinds of RBs */ @@ -2514,6 +2515,8 @@ struct gl_constants /* GL_ARB_vertex_shader */ GLuint MaxVertexTextureImageUnits; GLuint MaxVarying; /**< Number of float[4] vectors */ + /* GL_ARB_framebuffer_object */ + GLuint MaxSamples; }; -- cgit v1.2.3 From 515c118a7e6dfab39935cb4159824a715b45ed3a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 15:19:45 -0700 Subject: mesa: added GL_MAX_SAMPLES query for GL_ARB_fbo --- src/mesa/main/get.c | 12 ++++++++++++ src/mesa/main/get_gen.py | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 8ce9b0ae69..a5909913c8 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1905,6 +1905,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) CHECK_EXT1(ARB_shader_objects, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0); break; + case GL_MAX_SAMPLES: + CHECK_EXT1(ARB_framebuffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxSamples); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); } @@ -3753,6 +3757,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) CHECK_EXT1(ARB_shader_objects, "GetFloatv"); params[0] = (GLfloat)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0); break; + case GL_MAX_SAMPLES: + CHECK_EXT1(ARB_framebuffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxSamples); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname); } @@ -5601,6 +5609,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) CHECK_EXT1(ARB_shader_objects, "GetIntegerv"); params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0; break; + case GL_MAX_SAMPLES: + CHECK_EXT1(ARB_framebuffer_object, "GetIntegerv"); + params[0] = ctx->Const.MaxSamples; + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); } diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index a191b045d3..4bdbfed0bf 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -1009,7 +1009,11 @@ StateVars = [ # close enough for now. ( "GL_CURRENT_PROGRAM", GLint, ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"], - "", ["ARB_shader_objects"] ) + "", ["ARB_shader_objects"] ), + + # GL_ARB_framebuffer_object + ( "GL_MAX_SAMPLES", GLint, ["ctx->Const.MaxSamples"], "", + ["ARB_framebuffer_object"] ) ] -- cgit v1.2.3 From 5ca24eaf563e55269b3255e12e23a2a87dd47009 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 15:25:14 -0700 Subject: mesa: add ARB_framebuffer_object.xml to API_XML --- src/mesa/glapi/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile index adc53d9249..f524167a47 100644 --- a/src/mesa/glapi/Makefile +++ b/src/mesa/glapi/Makefile @@ -47,6 +47,7 @@ SERVER_OUTPUTS = \ API_XML = gl_API.xml \ EXT_framebuffer_object.xml \ + ARB_framebuffer_object.xml \ APPLE_vertex_array_object.xml COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py -- cgit v1.2.3 From 8fb8855b4d495303aabd11a4475cba3723b14bb2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 15:29:08 -0700 Subject: mesa: init MaxSamples = 0 (no multisampling) --- src/mesa/main/context.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 98c23bbd3a..7d616b2325 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -932,6 +932,9 @@ _mesa_init_constants(GLcontext *ctx) ctx->Const.MaxVarying = MAX_VARYING; #endif + /* GL_ARB_framebuffer_object */ + ctx->Const.MaxSamples = 0; + /* sanity checks */ ASSERT(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits)); -- cgit v1.2.3 From 4f3514e410c7b743a99f509c176f75b2a3182948 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:19:56 -0700 Subject: mesa: refactor glRenderbufferStorage(), glRenderbufferStorageMultisample() code Use a common helper routine for both functions. --- src/mesa/main/fbobject.c | 54 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index dbd9c130d0..6fe6a15fae 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -786,10 +786,21 @@ _mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat) } -void GLAPIENTRY -_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height) +/** sentinal value, see below */ +#define NO_SAMPLES 1000 + + +/** + * Helper function used by _mesa_RenderbufferStorageEXT() and + * _mesa_RenderbufferStorageMultisample(). + * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT(). + */ +static void +renderbuffer_storage(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height, GLsizei samples) { + const char *func = samples == NO_SAMPLES ? + "glRenderbufferStorage" : "RenderbufferStorageMultisample"; struct gl_renderbuffer *rb; GLenum baseFormat; GET_CURRENT_CONTEXT(ctx); @@ -797,31 +808,38 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, ASSERT_OUTSIDE_BEGIN_END(ctx); if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, "glRenderbufferStorageEXT(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func); return; } baseFormat = _mesa_base_fbo_format(ctx, internalFormat); if (baseFormat == 0) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glRenderbufferStorageEXT(internalFormat)"); + _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func); return; } if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(width)"); + _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func); return; } if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(height)"); + _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func); return; } - rb = ctx->CurrentRenderbuffer; + if (samples == NO_SAMPLES) { + /* NumSamples == 0 indicates non-multisampling */ + samples = 0; + } + else if (samples > ctx->Const.MaxSamples) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func); + return; + } + rb = ctx->CurrentRenderbuffer; if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glRenderbufferStorageEXT"); + _mesa_error(ctx, GL_INVALID_OPERATION, func); return; } @@ -843,6 +861,7 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, rb->IndexBits = rb->DepthBits = rb->StencilBits = 0; + rb->NumSamples = samples; /* Now allocate the storage */ ASSERT(rb->AllocStorage); @@ -869,7 +888,8 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, rb->AlphaBits = rb->IndexBits = rb->DepthBits = - rb->StencilBits = 0; + rb->StencilBits = + rb->NumSamples = 0; } /* @@ -881,12 +901,20 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, } +void GLAPIENTRY +_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height) +{ + renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES); +} + + void GLAPIENTRY _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, - GLenum internalformat, + GLenum internalFormat, GLsizei width, GLsizei height) { - + renderbuffer_storage(target, internalFormat, width, height, samples); } -- cgit v1.2.3 From 23524e87339b25be75580a2dd2ea296b1741bffb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 16:53:29 -0700 Subject: mesa: update Visual.samples field in _mesa_update_framebuffer_visual() --- src/mesa/main/framebuffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 10d05243fe..079f457503 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -543,6 +543,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) 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) { -- cgit v1.2.3 From 722d976283f402b1edeb5ed67ad9747d322a262e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 16:58:49 -0700 Subject: mesa: additional FBO error checking for multisample-related things Plus some new comments. --- src/mesa/main/fbobject.c | 122 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 98 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 6fe6a15fae..7ac580af72 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -425,6 +425,7 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) GLuint numImages; GLenum intFormat = GL_NONE; /* color buffers' internal format */ GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0; + GLint numSamples = -1; GLint i; GLuint j; @@ -509,12 +510,14 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) continue; } - /* Error-check width, height, format + /* Error-check width, height, format, samples */ if (numImages == 1) { - /* save format */ - if (i >= 0) + /* save format, num samples */ + if (i >= 0) { intFormat = f; + numSamples = att->Renderbuffer->NumSamples; + } } else { if (!ctx->Extensions.ARB_framebuffer_object) { @@ -531,6 +534,12 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) return; } } + if (att->Renderbuffer && + att->Renderbuffer->NumSamples != numSamples) { + fbo_incomplete("inconsistant number of samples", i); + return; + } + } } @@ -833,6 +842,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, samples = 0; } else if (samples > ctx->Const.MaxSamples) { + /* note: driver may choose to use more samples than what's requested */ _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func); return; } @@ -905,6 +915,10 @@ void GLAPIENTRY _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height) { + /* GL_ARB_fbo says calling this function is equivalent to calling + * glRenderbufferStorageMultisample() with samples=0. We pass in + * a token value here just for error reporting purposes. + */ renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES); } @@ -922,6 +936,7 @@ _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) { + struct gl_renderbuffer *rb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -932,7 +947,8 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) return; } - if (!ctx->CurrentRenderbuffer) { + rb = ctx->CurrentRenderbuffer; + if (!rb) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetRenderbufferParameterivEXT"); return; @@ -942,32 +958,38 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) switch (pname) { case GL_RENDERBUFFER_WIDTH_EXT: - *params = ctx->CurrentRenderbuffer->Width; + *params = rb->Width; return; case GL_RENDERBUFFER_HEIGHT_EXT: - *params = ctx->CurrentRenderbuffer->Height; + *params = rb->Height; return; case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT: - *params = ctx->CurrentRenderbuffer->InternalFormat; + *params = rb->InternalFormat; return; case GL_RENDERBUFFER_RED_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->RedBits; + *params = rb->RedBits; break; case GL_RENDERBUFFER_GREEN_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->GreenBits; + *params = rb->GreenBits; break; case GL_RENDERBUFFER_BLUE_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->BlueBits; + *params = rb->BlueBits; break; case GL_RENDERBUFFER_ALPHA_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->AlphaBits; + *params = rb->AlphaBits; break; case GL_RENDERBUFFER_DEPTH_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->DepthBits; + *params = rb->DepthBits; break; case GL_RENDERBUFFER_STENCIL_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->StencilBits; + *params = rb->StencilBits; break; + case GL_RENDERBUFFER_SAMPLES: + if (ctx->Extensions.ARB_framebuffer_object) { + *params = rb->NumSamples; + break; + } + /* fallthrough */ default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetRenderbufferParameterivEXT(target)"); @@ -1763,11 +1785,22 @@ _mesa_GenerateMipmapEXT(GLenum target) #if FEATURE_EXT_framebuffer_blit +/** + * Blit rectangular region, optionally from one framebuffer to another. + * + * Note, if the src buffer is multisampled and the dest is not, this is + * when the samples must be resolved to a single color. + */ void GLAPIENTRY _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { + const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT | + GL_DEPTH_BUFFER_BIT | + GL_STENCIL_BUFFER_BIT); + const struct gl_framebuffer *readFb, *drawFb; + const struct gl_renderbuffer *colorReadRb, *colorDrawRb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1777,13 +1810,19 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, _mesa_update_state(ctx); } - if (!ctx->ReadBuffer) { - /* XXX */ + readFb = ctx->ReadBuffer; + drawFb = ctx->DrawBuffer; + + if (!readFb || !drawFb) { + /* This will normally never happen but someday we may want to + * support MakeCurrent() with no drawables. + */ + return; } /* check for complete framebuffers */ - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || - ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || + readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, "glBlitFramebufferEXT(incomplete draw/read buffers)"); return; @@ -1794,9 +1833,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, return; } - if (mask & ~(GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT | - GL_STENCIL_BUFFER_BIT)) { + if (mask & ~legalMaskBits) { _mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)"); return; } @@ -1809,9 +1846,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, return; } + /* get color read/draw renderbuffers */ + if (mask & GL_COLOR_BUFFER_BIT) { + colorReadRb = readFb->_ColorReadBuffer; + colorDrawRb = drawFb->_ColorDrawBuffers[0]; + } + else { + colorReadRb = colorDrawRb = NULL; + } + if (mask & GL_STENCIL_BUFFER_BIT) { - struct gl_renderbuffer *readRb = ctx->ReadBuffer->_StencilBuffer; - struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_StencilBuffer; + struct gl_renderbuffer *readRb = readFb->_StencilBuffer; + struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; if (readRb->StencilBits != drawRb->StencilBits) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(stencil buffer size mismatch"); @@ -1820,8 +1866,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, } if (mask & GL_DEPTH_BUFFER_BIT) { - struct gl_renderbuffer *readRb = ctx->ReadBuffer->_DepthBuffer; - struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_DepthBuffer; + struct gl_renderbuffer *readRb = readFb->_DepthBuffer; + struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; if (readRb->DepthBits != drawRb->DepthBits) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(depth buffer size mismatch"); @@ -1829,6 +1875,34 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, } } + if (readFb->Visual.samples > 0 && + drawFb->Visual.samples > 0 && + readFb->Visual.samples != drawFb->Visual.samples) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(mismatched samples"); + return; + } + + /* extra checks for multisample copies... */ + if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) { + /* src and dest region sizes must be the same */ + if (srcX1 - srcX0 != dstX1 - dstX0 || + srcY1 - srcY0 != dstY1 - dstY0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(bad src/dst multisample region sizes"); + return; + } + + /* color formats must match */ + if (colorReadRb && + colorDrawRb && + colorReadRb->_ActualFormat != colorDrawRb->_ActualFormat) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(bad src/dst multisample pixel formats"); + return; + } + } + if (!ctx->Extensions.EXT_framebuffer_blit) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT"); return; -- cgit v1.2.3 From 3059007f0c2e91f4ef207677cdcb6dc42be7ecb2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Jan 2009 11:06:11 -0700 Subject: mesa: add support for GL_DEPTH_STENCIL_ATTACHMENT point. Used to set both the depth and stencil attachment points to one renderbuffer of texture. --- src/mesa/main/fbobject.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 7ac580af72..73f891d532 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -128,6 +128,8 @@ _mesa_lookup_framebuffer(GLcontext *ctx, GLuint id) /** * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding * gl_renderbuffer_attachment object. + * If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to + * the depth buffer attachment point. */ struct gl_renderbuffer_attachment * _mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, @@ -157,6 +159,8 @@ _mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, return NULL; } return &fb->Attachment[BUFFER_COLOR0 + i]; + case GL_DEPTH_STENCIL_ATTACHMENT: + /* fall-through */ case GL_DEPTH_ATTACHMENT_EXT: return &fb->Attachment[BUFFER_DEPTH]; case GL_STENCIL_ATTACHMENT_EXT: @@ -267,6 +271,12 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, ASSERT(att); if (rb) { _mesa_set_renderbuffer_attachment(ctx, att, rb); + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* do stencil attachment here (depth already done above) */ + att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT); + assert(att); + _mesa_set_renderbuffer_attachment(ctx, att, rb); + } } else { _mesa_remove_attachment(ctx, att); @@ -1361,7 +1371,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, } } - if ((level < 0) || (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1377,6 +1386,18 @@ 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_VERTICES(ctx, _NEW_BUFFERS); /* The above doesn't fully flush the drivers in the way that a * glFlush does, but that is required here: @@ -1535,6 +1556,17 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, rb = NULL; } + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* make sure the renderbuffer is a depth/stencil format */ + if (rb->_BaseFormat != GL_DEPTH_STENCIL) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferRenderbufferEXT(renderbuffer" + " is not DEPTH_STENCIL format)"); + return; + } + } + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* The above doesn't fully flush the drivers in the way that a * glFlush does, but that is required here: @@ -1603,6 +1635,19 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, return; } + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* the depth and stencil attachments must point to the same buffer */ + const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt; + depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT); + stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT); + if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL" + " attachments differ)"); + return; + } + } + FLUSH_VERTICES(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 d0f13fa7d70c57e698cce9fbde399e80f7afcf47 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Jan 2009 11:17:45 -0700 Subject: mesa: fix some renderbuffer/framebuffer delete semantics Need to unbind buffers if referenced by the current read/draw pointers when being deleted. --- src/mesa/main/fbobject.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 73f891d532..85e15a6e94 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -683,6 +683,26 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) } +/** + * If the given renderbuffer is anywhere attached to the framebuffer, detach + * the renderbuffer. + * This is used when a renderbuffer object is deleted. + * The spec calls for unbinding. + */ +static void +detach_renderbuffer(GLcontext *ctx, + struct gl_framebuffer *fb, + struct gl_renderbuffer *rb) +{ + GLuint i; + for (i = 0; i < BUFFER_COUNT; i++) { + if (fb->Attachment[i].Renderbuffer == rb) { + _mesa_remove_attachment(ctx, &fb->Attachment[i]); + } + } +} + + void GLAPIENTRY _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) { @@ -704,6 +724,13 @@ _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); } + if (ctx->DrawBuffer->Name) { + detach_renderbuffer(ctx, ctx->DrawBuffer, rb); + } + if (ctx->ReadBuffer->Name && ctx->ReadBuffer != ctx->DrawBuffer) { + detach_renderbuffer(ctx, ctx->ReadBuffer, rb); + } + /* Remove from hash table immediately, to free the ID. * But the object will not be freed until it's no longer * referenced anywhere else. @@ -1201,7 +1228,12 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) if (fb == ctx->DrawBuffer) { /* bind default */ ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); + } + if (fb == ctx->ReadBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); } /* remove from hash table immediately, to free the ID */ -- cgit v1.2.3 From 7296636ad03f58c7b7f673109515c1659a36a899 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Jan 2009 16:28:38 -0700 Subject: mesa: avoid calling _mesa_test_framebuffer_completeness() more than needed When we change a FBO's attachments, set _Status=0. Before using an FBO, check if status != GL_FRAMEBUFFER_COMPLETE. Also, fix missing GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE status. --- src/mesa/main/fbobject.c | 32 ++++++++++++++++++++++++++++++-- src/mesa/main/framebuffer.c | 6 ++++-- 2 files changed, 34 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 85e15a6e94..c16ac0f009 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -125,6 +125,18 @@ _mesa_lookup_framebuffer(GLcontext *ctx, GLuint id) } +/** + * Mark the given framebuffer as invalid. This will force the + * test for framebuffer completeness to be done before the framebuffer + * is used. + */ +static void +invalidate_framebuffer(struct gl_framebuffer *fb) +{ + fb->_Status = 0; /* "indeterminate" */ +} + + /** * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding * gl_renderbuffer_attachment object. @@ -234,6 +246,8 @@ _mesa_set_texture_attachment(GLcontext *ctx, if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { ctx->Driver.RenderTexture(ctx, fb, att); } + + invalidate_framebuffer(fb); } @@ -282,6 +296,8 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, _mesa_remove_attachment(ctx, att); } + invalidate_framebuffer(fb); + _glthread_UNLOCK_MUTEX(fb->Mutex); } @@ -520,13 +536,17 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) continue; } + if (numSamples < 0) { + /* first buffer */ + numSamples = att->Renderbuffer->NumSamples; + } + /* Error-check width, height, format, samples */ if (numImages == 1) { /* save format, num samples */ if (i >= 0) { intFormat = f; - numSamples = att->Renderbuffer->NumSamples; } } else { @@ -546,6 +566,7 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) } if (att->Renderbuffer && att->Renderbuffer->NumSamples != numSamples) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; fbo_incomplete("inconsistant number of samples", i); return; } @@ -700,6 +721,7 @@ detach_renderbuffer(GLcontext *ctx, _mesa_remove_attachment(ctx, &fb->Attachment[i]); } } + invalidate_framebuffer(fb); } @@ -1322,7 +1344,10 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) FLUSH_VERTICES(ctx, _NEW_BUFFERS); - _mesa_test_framebuffer_completeness(ctx, buffer); + if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) { + _mesa_test_framebuffer_completeness(ctx, buffer); + } + return buffer->_Status; } @@ -1445,6 +1470,9 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, else { _mesa_remove_attachment(ctx, att); } + + invalidate_framebuffer(fb); + _glthread_UNLOCK_MUTEX(fb->Mutex); } diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 079f457503..2d7e3b0503 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -793,8 +793,10 @@ update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) /* This is a user-created framebuffer. * Completeness only matters for user-created framebuffers. */ - _mesa_test_framebuffer_completeness(ctx, fb); - _mesa_update_framebuffer_visual(fb); + if (fb->_Status != GL_FRAMEBUFFER_COMPLETE) { + _mesa_test_framebuffer_completeness(ctx, fb); + _mesa_update_framebuffer_visual(fb); + } } /* Strictly speaking, we don't need to update the draw-state -- cgit v1.2.3 From 1b199101ffd50e59372e1ecafaae48f369169292 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 19 Jan 2009 16:14:39 -0700 Subject: mesa: enable ARB_fbo for s/w drivers --- src/mesa/main/extensions.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 0cad9887a2..188e01c8a4 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -190,6 +190,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif #if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; +#endif +#if FEATURE_ARB_framebuffer_object + ctx->Extensions.ARB_framebuffer_object = GL_TRUE; #endif ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_imaging = GL_TRUE; -- cgit v1.2.3 From f8b00806d8263f2ff09f175e0801379c0b9e9b2c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:30:57 -0700 Subject: intel: inline some renderbuffer functions --- src/mesa/drivers/dri/intel/intel_fbo.c | 43 ----------------------- src/mesa/drivers/dri/intel/intel_fbo.h | 64 +++++++++++++++++++++++++++------- 2 files changed, 52 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 7cf12619d6..1cc40f9be2 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -46,49 +46,6 @@ #define FILE_DEBUG_FLAG DEBUG_FBO -#define INTEL_RB_CLASS 0x12345678 - - -/* XXX FBO: move this to intel_context.h (inlined) */ -/** - * Return a gl_renderbuffer ptr casted to intel_renderbuffer. - * NULL will be returned if the rb isn't really an intel_renderbuffer. - * This is determiend by checking the ClassID. - */ -struct intel_renderbuffer * -intel_renderbuffer(struct gl_renderbuffer *rb) -{ - struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb; - if (irb && irb->Base.ClassID == INTEL_RB_CLASS) { - /*_mesa_warning(NULL, "Returning non-intel Rb\n");*/ - return irb; - } - else - return NULL; -} - - -struct intel_renderbuffer * -intel_get_renderbuffer(struct gl_framebuffer *fb, int attIndex) -{ - if (attIndex >= 0) - return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer); - else - return NULL; -} - -struct intel_region * -intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex) -{ - struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex); - - if (irb) - return irb->region; - else - return NULL; -} - - /** * Create a new framebuffer object. diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index b7e9280e8c..d0ba3ac32a 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -75,31 +75,71 @@ struct intel_renderbuffer unsigned long span_cache_offset; }; -extern struct intel_renderbuffer *intel_renderbuffer(struct gl_renderbuffer - *rb); + +/** + * gl_renderbuffer is a base class which we subclass. The Class field + * is used for simple run-time type checking. + */ +#define INTEL_RB_CLASS 0x12345678 + + +/** + * Return a gl_renderbuffer ptr casted to intel_renderbuffer. + * NULL will be returned if the rb isn't really an intel_renderbuffer. + * This is determined by checking the ClassID. + */ +static INLINE struct intel_renderbuffer * +intel_renderbuffer(struct gl_renderbuffer *rb) +{ + struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb; + if (irb && irb->Base.ClassID == INTEL_RB_CLASS) { + /*_mesa_warning(NULL, "Returning non-intel Rb\n");*/ + return irb; + } + else + return NULL; +} + + +/** + * Return a framebuffer's renderbuffer, named by a BUFFER_x index. + */ +static INLINE struct intel_renderbuffer * +intel_get_renderbuffer(struct gl_framebuffer *fb, int attIndex) +{ + if (attIndex >= 0) + return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer); + else + return NULL; +} + extern void intel_renderbuffer_set_region(struct intel_renderbuffer *irb, struct intel_region *region); + extern struct intel_renderbuffer * intel_create_renderbuffer(GLenum intFormat); -extern void intel_fbo_init(struct intel_context *intel); +extern void +intel_fbo_init(struct intel_context *intel); -/* XXX make inline or macro */ -extern struct intel_renderbuffer *intel_get_renderbuffer(struct gl_framebuffer - *fb, - int attIndex); - -extern void intel_flip_renderbuffers(struct intel_framebuffer *intel_fb); +extern void +intel_flip_renderbuffers(struct intel_framebuffer *intel_fb); -/* XXX make inline or macro */ -extern struct intel_region *intel_get_rb_region(struct gl_framebuffer *fb, - GLuint attIndex); +static INLINE struct intel_region * +intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex) +{ + struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex); + if (irb) + return irb->region; + else + return NULL; +} /** -- cgit v1.2.3 From 3c98d3cf32e1828b116173f97dc6d4d4a609951c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 15:30:22 -0700 Subject: intel: plug in stub intel_validate_framebuffer() function --- src/mesa/drivers/dri/intel/intel_fbo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 1cc40f9be2..81cd8dd41d 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -630,6 +630,19 @@ intel_finish_render_texture(GLcontext * ctx, } +/** + * Do additional "completeness" testing of a framebuffer object. + */ +static void +intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) +{ + /* no-op for now. + * Eventually: examine the renderbuffers/textures and make sure it's + * supported by the hw. + */ +} + + /** * Do one-time context initializations related to GL_EXT_framebuffer_object. * Hook in device driver functions. @@ -644,4 +657,5 @@ intel_fbo_init(struct intel_context *intel) intel->ctx.Driver.RenderTexture = intel_render_texture; intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture; intel->ctx.Driver.ResizeBuffers = intel_resize_buffers; + intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer; } -- cgit v1.2.3 From d1eca7f558fa3a20cfe1fe78125d8b7f7751def6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Jan 2009 16:29:10 -0700 Subject: i965: minor reformatting --- src/mesa/drivers/dri/intel/intel_buffers.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 0fd2f16a8f..fab21a3021 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -559,7 +559,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) return; } - /* Do this here, note core Mesa, since this function is called from + /* Do this here, not core Mesa, since this function is called from * many places within the driver. */ if (ctx->NewState & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) { @@ -587,7 +587,8 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) /* writing to 0 */ colorRegions[0] = NULL; intel->constant_cliprect = GL_TRUE; - } else if (fb->_NumColorDrawBuffers > 1) { + } + else if (fb->_NumColorDrawBuffers > 1) { int i; struct intel_renderbuffer *irb; @@ -700,10 +701,12 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) if (ctx->Driver.Enable) { if (ctx->Depth.Test && fb->Visual.depthBits > 0) { ctx->Driver.Enable(ctx, GL_DEPTH_TEST, GL_TRUE); - } else { + } + else { ctx->Driver.Enable(ctx, GL_DEPTH_TEST, GL_FALSE); } - } else { + } + else { ctx->NewState |= _NEW_DEPTH; } @@ -714,7 +717,8 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) if (ctx->Driver.Viewport) { ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y, ctx->Viewport.Width, ctx->Viewport.Height); - } else { + } + else { ctx->NewState |= _NEW_VIEWPORT; } -- cgit v1.2.3 From 71b78149bdb3d0d92b004aed29edcf9ea1a440a8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:32:38 -0700 Subject: i965: disallow separate depth/stencil renderbuffers Take advantage of the GL_FRAMEBUFFER_UNSUPPORTED feature to disallow separate depth and stencil renderbuffers; only allow combined depth/stencil buffers. Next up: remove/simplify a bunch of the depth/stencil renderbuffer code. Also: restore the previously disabled GL_DEPTH_COMPONENT16 case --- src/mesa/drivers/dri/intel/intel_fbo.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 81cd8dd41d..ffe55bf19b 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -168,18 +168,11 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, cpp = 4; break; case GL_DEPTH_COMPONENT16: -#if 0 rb->_ActualFormat = GL_DEPTH_COMPONENT16; rb->DataType = GL_UNSIGNED_SHORT; rb->DepthBits = 16; cpp = 2; break; -#else - /* fall-through. - * 16bpp depth renderbuffer can't be paired with a stencil buffer so - * always used combined depth/stencil format. - */ -#endif case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: @@ -636,10 +629,17 @@ intel_finish_render_texture(GLcontext * ctx, static void intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) { - /* no-op for now. - * Eventually: examine the renderbuffers/textures and make sure it's - * supported by the hw. - */ + const struct intel_renderbuffer *depthRb = + intel_get_renderbuffer(fb, BUFFER_DEPTH); + const struct intel_renderbuffer *stencilRb = + intel_get_renderbuffer(fb, BUFFER_STENCIL); + + if (stencilRb && stencilRb != depthRb) { + /* we only support combined depth/stencil buffers, not separate + * stencil buffers. + */ + fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT; + } } -- cgit v1.2.3 From 3abf67c6b1e1510427fc608983fdeaec88f6077c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 11:15:37 -0700 Subject: intel: remove unneeded call to ctx->Driver.DepthRange() The preceeding call to intel_draw_buffer() does that. --- src/mesa/drivers/dri/intel/intel_fbo.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index ffe55bf19b..e80b9c3fce 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -416,9 +416,6 @@ intel_bind_framebuffer(GLcontext * ctx, GLenum target, { if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) { intel_draw_buffer(ctx, fb); - /* Integer depth range depends on depth buffer bits */ - if (ctx->Driver.DepthRange != NULL) - ctx->Driver.DepthRange(ctx, ctx->Viewport.Near, ctx->Viewport.Far); } else { /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */ -- cgit v1.2.3 From b27057b381fd8e478f4a31cf790f30a4bf1538cf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 11:31:28 -0700 Subject: intel: asst clean-ups, simplifications in intel_draw_buffer() --- src/mesa/drivers/dri/intel/intel_buffers.c | 46 +++++++++++------------------- 1 file changed, 16 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index fab21a3021..9a1ac5ab70 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -627,14 +627,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) } } - /* Update culling direction which changes depending on the - * orientation of the buffer: - */ - if (ctx->Driver.FrontFace) - ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); - else - ctx->NewState |= _NEW_POLYGON; - if (!colorRegions[0]) { FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE); } @@ -666,20 +658,13 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) /*** *** Stencil buffer *** This can only be hardware accelerated if we're using a - *** combined DEPTH_STENCIL buffer (for now anyway). + *** combined DEPTH_STENCIL buffer. ***/ if (fb->_StencilBuffer && fb->_StencilBuffer->Wrapped) { irbStencil = intel_renderbuffer(fb->_StencilBuffer->Wrapped); if (irbStencil && irbStencil->region) { ASSERT(irbStencil->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); - /* need to re-compute stencil hw state */ - if (ctx->Driver.Enable != NULL) - ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); - else - ctx->NewState |= _NEW_STENCIL; - if (!depthRegion) - depthRegion = irbStencil->region; } else { FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_TRUE); @@ -688,30 +673,23 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) else { /* XXX FBO: instead of FALSE, pass ctx->Stencil.Enabled ??? */ FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); - /* need to re-compute stencil hw state */ - if (ctx->Driver.Enable != NULL) - ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); - else - ctx->NewState |= _NEW_STENCIL; } /* - * Update depth test state + * Update depth and stencil test state */ if (ctx->Driver.Enable) { - if (ctx->Depth.Test && fb->Visual.depthBits > 0) { - ctx->Driver.Enable(ctx, GL_DEPTH_TEST, GL_TRUE); - } - else { - ctx->Driver.Enable(ctx, GL_DEPTH_TEST, GL_FALSE); - } + ctx->Driver.Enable(ctx, GL_DEPTH_TEST, + (ctx->Depth.Test && fb->Visual.depthBits > 0)); + ctx->Driver.Enable(ctx, GL_STENCIL_TEST, + (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0)); } else { - ctx->NewState |= _NEW_DEPTH; + ctx->NewState |= (_NEW_DEPTH | _NEW_STENCIL); } intel->vtbl.set_draw_region(intel, colorRegions, depthRegion, - fb->_NumColorDrawBuffers); + fb->_NumColorDrawBuffers); /* update viewport since it depends on window size */ if (ctx->Driver.Viewport) { @@ -733,6 +711,14 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) ctx->Driver.DepthRange(ctx, ctx->Viewport.Near, ctx->Viewport.Far); + + /* Update culling direction which changes depending on the + * orientation of the buffer: + */ + if (ctx->Driver.FrontFace) + ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); + else + ctx->NewState |= _NEW_POLYGON; } -- cgit v1.2.3 From f8a7e497acf17cfdefe401815c7063aaf39d4200 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:34:16 -0700 Subject: intel: remove/disable the "paired depth/stencil" code We only allow combined depth+stencil renderbuffers so the complicated code for splitting and combining separate depth and stencil buffers is no longer needed. --- src/mesa/drivers/dri/i915/Makefile | 3 +-- src/mesa/drivers/dri/i965/Makefile | 1 - src/mesa/drivers/dri/intel/intel_buffers.c | 3 --- src/mesa/drivers/dri/intel/intel_fbo.c | 4 ---- src/mesa/drivers/dri/intel/intel_fbo.h | 3 +-- 5 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 5858e0ee9f..5652f9e4bd 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -50,8 +50,7 @@ DRIVER_SOURCES = \ intel_span.c \ intel_state.c \ intel_tris.c \ - intel_fbo.c \ - intel_depthstencil.c + intel_fbo.c C_SOURCES = \ $(COMMON_SOURCES) \ diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 37a470f2e2..f134d6809a 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -11,7 +11,6 @@ DRIVER_SOURCES = \ intel_buffers.c \ intel_context.c \ intel_decode.c \ - intel_depthstencil.c \ intel_fbo.c \ intel_mipmap_tree.c \ intel_regions.c \ diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 9a1ac5ab70..7465ba7c69 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -577,9 +577,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) return; } - if (fb->Name) - intel_validate_paired_depth_stencil(ctx, fb); - /* * How many color buffers are we drawing into? */ diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index e80b9c3fce..47217f756c 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -69,10 +69,6 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb) ASSERT(irb); - if (irb->PairedStencil || irb->PairedDepth) { - intel_unpair_depth_stencil(ctx, irb); - } - if (irb->span_cache != NULL) _mesa_free(irb->span_cache); diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index d0ba3ac32a..a44989b5fd 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -66,8 +66,7 @@ struct intel_renderbuffer GLuint pfPitch; /* possibly paged flipped pitch */ GLboolean RenderToTexture; /* RTT? */ - GLuint PairedDepth; /**< only used if this is a depth renderbuffer */ - GLuint PairedStencil; /**< only used if this is a stencil renderbuffer */ + GLuint pf_pending; /**< sequence number of pending flip */ GLuint vbl_pending; /**< vblank sequence number of pending flip */ -- cgit v1.2.3 From 6d2e1f6a2cd25107ad9bd88b1decd05fc8000f78 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 15:43:40 -0700 Subject: intel: add GL_EXT_framebuffer blit extension This functionality is required by GL_ARB_framebuffer_object. For now, implement it in terms of glCopyPixels(). This will need to be revisted though. --- src/mesa/drivers/dri/intel/intel_context.c | 6 ++- src/mesa/drivers/dri/intel/intel_fbo.c | 70 ++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index c4a24d7397..3a4e652ae5 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -84,6 +84,7 @@ int INTEL_DEBUG = (0); #define need_GL_EXT_cull_vertex #define need_GL_EXT_fog_coord #define need_GL_EXT_framebuffer_object +#define need_GL_EXT_framebuffer_blit #define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_point_parameters #define need_GL_EXT_secondary_color @@ -421,8 +422,9 @@ static const struct dri_extension arb_oq_extensions[] = { }; static const struct dri_extension ttm_extensions[] = { - { "GL_ARB_pixel_buffer_object", NULL }, - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, + { "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 } }; diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 47217f756c..05847ee5fe 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -27,6 +27,7 @@ #include "main/imports.h" +#include "main/macros.h" #include "main/mtypes.h" #include "main/fbobject.h" #include "main/framebuffer.h" @@ -636,6 +637,74 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) } +/** + * Called from glBlitFramebuffer(). + * For now, we're doing an approximation with glCopyPixels(). + * XXX we need to bypass all the per-fragment operations, except scissor. + */ +static void +intel_blit_framebuffer(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + const GLfloat xZoomSave = ctx->Pixel.ZoomX; + const GLfloat yZoomSave = ctx->Pixel.ZoomY; + GLsizei width, height; + GLfloat xFlip = 1.0F, yFlip = 1.0F; + + if (srcX1 < srcX0) { + GLint tmp = srcX1; + srcX1 = srcX0; + srcX0 = tmp; + xFlip = -1.0F; + } + + if (srcY1 < srcY0) { + GLint tmp = srcY1; + srcY1 = srcY0; + srcY0 = tmp; + yFlip = -1.0F; + } + + width = srcX1 - srcX0; + height = srcY1 - srcY0; + + ctx->Pixel.ZoomX = xFlip * (dstX1 - dstX0) / (srcX1 - srcY0); + ctx->Pixel.ZoomY = yFlip * (dstY1 - dstY0) / (srcY1 - srcY0); + + if (ctx->Pixel.ZoomX < 0.0F) { + dstX0 = MAX2(dstX0, dstX1); + } + else { + dstX0 = MIN2(dstX0, dstX1); + } + + if (ctx->Pixel.ZoomY < 0.0F) { + dstY0 = MAX2(dstY0, dstY1); + } + else { + dstY0 = MIN2(dstY0, dstY1); + } + + if (mask & GL_COLOR_BUFFER_BIT) { + ctx->Driver.CopyPixels(ctx, srcX0, srcY0, width, height, + dstX0, dstY0, GL_COLOR); + } + if (mask & GL_DEPTH_BUFFER_BIT) { + ctx->Driver.CopyPixels(ctx, srcX0, srcY0, width, height, + dstX0, dstY0, GL_DEPTH); + } + if (mask & GL_STENCIL_BUFFER_BIT) { + ctx->Driver.CopyPixels(ctx, srcX0, srcY0, width, height, + dstX0, dstY0, GL_STENCIL); + } + + ctx->Pixel.ZoomX = xZoomSave; + ctx->Pixel.ZoomY = yZoomSave; +} + + /** * Do one-time context initializations related to GL_EXT_framebuffer_object. * Hook in device driver functions. @@ -651,4 +720,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 = intel_blit_framebuffer; } -- cgit v1.2.3 From a7f98f4c7e9e20ec23ded82881360ec307881509 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Jan 2009 11:49:59 -0700 Subject: i965: enable GL_ARB_framebuffer_object --- src/mesa/drivers/dri/intel/intel_context.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 3a4e652ae5..fda880829c 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -68,6 +68,7 @@ int INTEL_DEBUG = (0); #endif +#define need_GL_ARB_framebuffer_object #define need_GL_ARB_multisample #define need_GL_ARB_occlusion_query #define need_GL_ARB_point_parameters @@ -398,6 +399,7 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_fragment_program", NULL }, { "GL_ARB_fragment_program_shadow", NULL }, { "GL_ARB_fragment_shader", NULL }, + { "GL_ARB_framebuffer_object", GL_ARB_framebuffer_object_functions}, { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_point_sprite", NULL }, { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, -- cgit v1.2.3 From af0e6336e9d7dc19d74950ce13b33e1fa1b2081d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Jan 2009 16:02:34 -0700 Subject: i965: whitespace changes and reformatting --- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 36 +++++++++++++------------------- src/mesa/drivers/dri/i965/brw_wm_pass1.c | 25 +++++++++++++--------- src/mesa/drivers/dri/i965/brw_wm_pass2.c | 28 ++++++++++++------------- 3 files changed, 42 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index 205a7160d3..d0c6b82290 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -115,7 +115,7 @@ static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, ref->value = &c->creg[i/16]; ref->insn = 0; ref->prevuse = NULL; - + return ref; } } @@ -142,7 +142,7 @@ static const struct brw_wm_ref *get_const_ref( struct brw_wm_compile *c, */ c->constref[i].constval = *constval; c->constref[i].ref = get_param_ref(c, constval); - + return c->constref[i].ref; } else { @@ -198,7 +198,7 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c, */ ref = get_const_ref(c, &plist->ParameterValues[idx][component]); break; - + case PROGRAM_STATE_VAR: case PROGRAM_UNIFORM: /* These may change from run to run: @@ -229,14 +229,13 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c, - /*********************************************************************** * Straight translation to internal instruction format */ static void pass0_set_dst( struct brw_wm_compile *c, - struct brw_wm_instruction *out, - const struct prog_instruction *inst, + struct brw_wm_instruction *out, + const struct prog_instruction *inst, GLuint writemask ) { const struct prog_dst_register *dst = &inst->DstReg; @@ -245,18 +244,17 @@ static void pass0_set_dst( struct brw_wm_compile *c, for (i = 0; i < 4; i++) { if (writemask & (1<dst[i] = get_value(c); - pass0_set_fpreg_value(c, dst->File, dst->Index, i, out->dst[i]); } } - + out->writemask = writemask; } static void pass0_set_dst_scalar( struct brw_wm_compile *c, - struct brw_wm_instruction *out, - const struct prog_instruction *inst, + struct brw_wm_instruction *out, + const struct prog_instruction *inst, GLuint writemask ) { if (writemask) { @@ -282,7 +280,6 @@ static void pass0_set_dst_scalar( struct brw_wm_compile *c, } - static const struct brw_wm_ref *get_fp_src_reg_ref( struct brw_wm_compile *c, struct prog_src_register src, GLuint i ) @@ -292,14 +289,13 @@ static const struct brw_wm_ref *get_fp_src_reg_ref( struct brw_wm_compile *c, static const GLfloat const_zero = 0.0; static const GLfloat const_one = 1.0; - if (component == SWIZZLE_ZERO) src_ref = get_const_ref(c, &const_zero); else if (component == SWIZZLE_ONE) src_ref = get_const_ref(c, &const_one); else src_ref = pass0_get_reg(c, src.File, src.Index, component); - + return src_ref; } @@ -311,19 +307,19 @@ static struct brw_wm_ref *get_new_ref( struct brw_wm_compile *c, { const struct brw_wm_ref *ref = get_fp_src_reg_ref(c, src, i); struct brw_wm_ref *newref = get_ref(c); - + newref->value = ref->value; newref->hw_reg = ref->hw_reg; - if (insn) { + if (insn) { newref->insn = insn - c->instruction; newref->prevuse = newref->value->lastuse; newref->value->lastuse = newref; } - if (src.NegateBase & (1<hw_reg.negate ^= 1; - + if (src.Abs) { newref->hw_reg.negate = 0; newref->hw_reg.abs = 1; @@ -333,7 +329,6 @@ static struct brw_wm_ref *get_new_ref( struct brw_wm_compile *c, } - static struct brw_wm_instruction *translate_insn( struct brw_wm_compile *c, const struct prog_instruction *inst ) { @@ -418,6 +413,7 @@ static void pass0_init_payload( struct brw_wm_compile *c ) &c->payload.input_interp[i] ); } + /*********************************************************************** * PASS 0 * @@ -440,7 +436,6 @@ void brw_wm_pass0( struct brw_wm_compile *c ) for (insn = 0; insn < c->nr_fp_insns; insn++) { const struct prog_instruction *inst = &c->prog_instructions[insn]; - /* Optimize away moves, otherwise emit translated instruction: */ switch (inst->Opcode) { @@ -453,8 +448,6 @@ void brw_wm_pass0( struct brw_wm_compile *c ) translate_insn(c, inst); } break; - - default: translate_insn(c, inst); break; @@ -465,4 +458,3 @@ void brw_wm_pass0( struct brw_wm_compile *c ) brw_wm_print_program(c, "pass0"); } } - diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass1.c b/src/mesa/drivers/dri/i965/brw_wm_pass1.c index f6f3a38e9e..6eaed8a665 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass1.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass1.c @@ -58,7 +58,8 @@ static void unlink_ref(struct brw_wm_ref *ref) if (ref == value->lastuse) { value->lastuse = ref->prevuse; - } else { + } + else { struct brw_wm_ref *i = value->lastuse; while (i->prevuse != ref) i = i->prevuse; i->prevuse = ref->prevuse; @@ -75,8 +76,9 @@ static void track_arg(struct brw_wm_compile *c, for (i = 0; i < 4; i++) { struct brw_wm_ref *ref = inst->src[arg][i]; if (ref) { - if (readmask & (1<value->contributes_to_output = 1; + } else { unlink_ref(ref); inst->src[arg][i] = NULL; @@ -88,15 +90,21 @@ static void track_arg(struct brw_wm_compile *c, static GLuint get_texcoord_mask( GLuint tex_idx ) { switch (tex_idx) { - case TEXTURE_1D_INDEX: return WRITEMASK_X; - case TEXTURE_2D_INDEX: return WRITEMASK_XY; - case TEXTURE_3D_INDEX: return WRITEMASK_XYZ; - case TEXTURE_CUBE_INDEX: return WRITEMASK_XYZ; - case TEXTURE_RECT_INDEX: return WRITEMASK_XY; + case TEXTURE_1D_INDEX: + return WRITEMASK_X; + case TEXTURE_2D_INDEX: + return WRITEMASK_XY; + case TEXTURE_3D_INDEX: + return WRITEMASK_XYZ; + case TEXTURE_CUBE_INDEX: + return WRITEMASK_XYZ; + case TEXTURE_RECT_INDEX: + return WRITEMASK_XY; default: return 0; } } + /* Step two: Basically this is dead code elimination. * * Iterate backwards over instructions, noting which values @@ -273,6 +281,3 @@ void brw_wm_pass1( struct brw_wm_compile *c ) brw_wm_print_program(c, "pass1"); } } - - - diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass2.c b/src/mesa/drivers/dri/i965/brw_wm_pass2.c index 6fca9ad220..780edbc42e 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass2.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass2.c @@ -84,7 +84,7 @@ 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++) + for (j = 0; j < FRAG_ATTRIB_MAX; j++) { if (inputs & (1<payload.input_interp[index], i++); } + } assert(nr_interp_regs >= 1); @@ -120,7 +121,7 @@ static void update_register_usage(struct brw_wm_compile *c, /* Only search those which can change: */ if (grf->nextuse < thisinsn) { - struct brw_wm_ref *ref = grf->value->lastuse; + const struct brw_wm_ref *ref = grf->value->lastuse; /* Has last use of value been passed? */ @@ -148,7 +149,7 @@ static void spill_value(struct brw_wm_compile *c, /* Allocate a spill slot. Note that allocations start from 0x40 - * the first slot is reserved to mean "undef" in brw_wm_emit.c */ - if (!value->spill_slot) { + if (!value->spill_slot) { c->last_scratch += 0x40; value->spill_slot = c->last_scratch; } @@ -189,7 +190,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c, if (grf[i+j].nextuse < group_nextuse) group_nextuse = grf[i+j].nextuse; } - + if (group_nextuse > furthest) { furthest = group_nextuse; reg = i; @@ -197,7 +198,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c, } assert(furthest != thisinsn); - + /* Any non-empty regs will need to be spilled: */ for (j = 0; j < nr; j++) @@ -243,7 +244,7 @@ static void alloc_contiguous_dest(struct brw_wm_compile *c, static void load_args(struct brw_wm_compile *c, struct brw_wm_instruction *inst) -{ +{ GLuint thisinsn = inst - c->instruction; GLuint i,j; @@ -258,17 +259,17 @@ static void load_args(struct brw_wm_compile *c, * register allocation and mark the ref as requiring a fill. */ GLuint reg = search_contiguous_regs(c, 1, thisinsn); - + c->pass2_grf[reg].value = ref->value; c->pass2_grf[reg].nextuse = thisinsn; - + ref->value->resident = &c->pass2_grf[reg]; /* Note that a fill is required: */ ref->unspill_reg = reg*2; } - + /* Adjust the hw_reg to point at the value's current location: */ assert(ref->value == ref->value->resident->value); @@ -294,7 +295,7 @@ void brw_wm_pass2( struct brw_wm_compile *c ) for (insn = 0; insn < c->nr_insns; insn++) { struct brw_wm_instruction *inst = &c->instruction[insn]; - + /* Update registers' nextuse values: */ update_register_usage(c, insn); @@ -322,11 +323,11 @@ void brw_wm_pass2( struct brw_wm_compile *c ) break; } - if (TEST_DST_SPILLS && inst->opcode != WM_PIXELXY) + if (TEST_DST_SPILLS && inst->opcode != WM_PIXELXY) { for (i = 0; i < 4; i++) if (inst->dst[i]) spill_value(c, inst->dst[i]); - + } } if (INTEL_DEBUG & DEBUG_WM) { @@ -339,6 +340,3 @@ void brw_wm_pass2( struct brw_wm_compile *c ) brw_wm_print_program(c, "pass2/done"); } } - - - -- cgit v1.2.3 From dde7cb962860e72e1bf3175069767358cc5b3f3c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 9 Jan 2009 15:43:17 -0800 Subject: Track two sets of back-face stencil state Track separate back-face stencil state for OpenGL 2.0 / GL_ATI_separate_stencil and GL_EXT_stencil_two_side. This allows all three to be enabled in a driver. One set of state is set via the 2.0 or ATI functions and is used when STENCIL_TEST_TWO_SIDE_EXT is disabled. The other is set by StencilFunc and StencilOp when the active stencil face is set to BACK. The GL_EXT_stencil_two_side spec has more details. http://opengl.org/registry/specs/EXT/stencil_two_side.txt --- src/mesa/drivers/dri/i965/brw_cc.c | 15 ++--- src/mesa/drivers/dri/i965/brw_wm.c | 3 +- src/mesa/drivers/dri/r300/r300_render.c | 16 +++-- src/mesa/drivers/dri/r300/r300_state.c | 40 ++++-------- src/mesa/main/enable.c | 7 ++- src/mesa/main/getstring.c | 11 +++- src/mesa/main/mtypes.h | 30 ++++++--- src/mesa/main/stencil.c | 104 +++++++++++++++++--------------- src/mesa/swrast/s_stencil.c | 6 +- 9 files changed, 128 insertions(+), 104 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index fa8121e02d..abae4b3215 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -84,6 +84,7 @@ static void cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) { struct gl_stencil_attrib *stencil = brw->attribs.Stencil; + const unsigned back = stencil->_BackFace; memset(key, 0, sizeof(*key)); @@ -100,13 +101,13 @@ cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) key->stencil_test_mask[0] = stencil->ValueMask[0]; } if (key->stencil_two_side) { - key->stencil_func[1] = stencil->Function[1]; - key->stencil_fail_op[1] = stencil->FailFunc[1]; - key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[1]; - key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[1]; - key->stencil_ref[1] = stencil->Ref[1]; - key->stencil_write_mask[1] = stencil->WriteMask[1]; - key->stencil_test_mask[1] = stencil->ValueMask[1]; + key->stencil_func[1] = stencil->Function[back]; + key->stencil_fail_op[1] = stencil->FailFunc[back]; + key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[back]; + key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[back]; + key->stencil_ref[1] = stencil->Ref[back]; + key->stencil_write_mask[1] = stencil->WriteMask[back]; + key->stencil_test_mask[1] = stencil->ValueMask[back]; } if (brw->attribs.Color->_LogicOpEnabled) diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index c50b0d2dd9..24149cf8a1 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -189,8 +189,7 @@ static void brw_wm_populate_key( struct brw_context *brw, lookup |= IZ_STENCIL_TEST_ENABLE_BIT; if (brw->attribs.Stencil->WriteMask[0] || - (brw->attribs.Stencil->_TestTwoSide && - brw->attribs.Stencil->WriteMask[1])) + brw->attribs.Stencil->WriteMask[brw->attribs.Stencil->_BackFace]) lookup |= IZ_STENCIL_WRITE_ENABLE_BIT; } diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index f9266e44c1..16ce4a1199 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -347,6 +347,8 @@ static GLboolean r300RunRender(GLcontext * ctx, static int r300Fallback(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); + const unsigned back = ctx->Stencil._BackFace; + /* Do we need to use new-style shaders? * Also is there a better way to do this? */ if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { @@ -371,12 +373,14 @@ static int r300Fallback(GLcontext * ctx) FALLBACK_IF(ctx->RenderMode != GL_RENDER); - FALLBACK_IF(ctx->Stencil._TestTwoSide - && (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] - || ctx->Stencil.ValueMask[0] != - ctx->Stencil.ValueMask[1] - || ctx->Stencil.WriteMask[0] != - ctx->Stencil.WriteMask[1])); + /* If GL_EXT_stencil_two_side is disabled, this fallback check can + * be removed. + */ + FALLBACK_IF(ctx->Stencil.Ref[0] != ctx->Stencil.Ref[back] + || ctx->Stencil.ValueMask[0] != + ctx->Stencil.ValueMask[back] + || ctx->Stencil.WriteMask[0] != + ctx->Stencil.WriteMask[back]); if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) FALLBACK_IF(ctx->Point.PointSprite); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index a63dbac343..d02034f039 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -974,15 +974,9 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, { r300ContextPtr rmesa = R300_CONTEXT(ctx); GLuint refmask = - (((ctx->Stencil. - Ref[0] & 0xff) << R300_STENCILREF_SHIFT) | ((ctx-> - Stencil. - ValueMask - [0] & - 0xff) - << - R300_STENCILMASK_SHIFT)); - + ((ctx->Stencil.Ref[0] & 0xff) << R300_STENCILREF_SHIFT) + | ((ctx->Stencil.ValueMask[0] & 0xff) << R300_STENCILMASK_SHIFT); + const unsigned back = ctx->Stencil._BackFace; GLuint flag; R300_STATECHANGE(rmesa, zs); @@ -1000,8 +994,7 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_S_FRONT_FUNC_SHIFT); - if (ctx->Stencil._TestTwoSide) - flag = translate_func(ctx->Stencil.Function[1]); + flag = translate_func(ctx->Stencil.Function[back]); rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_S_BACK_FUNC_SHIFT); @@ -1026,6 +1019,7 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { r300ContextPtr rmesa = R300_CONTEXT(ctx); + const unsigned back = ctx->Stencil._BackFace; R300_STATECHANGE(rmesa, zs); /* It is easier to mask what's left.. */ @@ -1042,23 +1036,13 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << R300_S_FRONT_ZPASS_OP_SHIFT); - if (ctx->Stencil._TestTwoSide) { - rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= - (translate_stencil_op(ctx->Stencil.FailFunc[1]) << - R300_S_BACK_SFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZFailFunc[1]) << - R300_S_BACK_ZFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZPassFunc[1]) << - R300_S_BACK_ZPASS_OP_SHIFT); - } else { - rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= - (translate_stencil_op(ctx->Stencil.FailFunc[0]) << - R300_S_BACK_SFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << - R300_S_BACK_ZFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << - R300_S_BACK_ZPASS_OP_SHIFT); - } + rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= + (translate_stencil_op(ctx->Stencil.FailFunc[back]) << + R300_S_BACK_SFAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZFailFunc[back]) << + R300_S_BACK_ZFAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZPassFunc[back]) << + R300_S_BACK_ZPASS_OP_SHIFT); } /* ============================================================= diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index dae576ae5a..1c026174b8 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -922,10 +922,13 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.TestTwoSide = state; - if (state) + if (state) { + ctx->Stencil._BackFace = 2; ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; - else + } else { + ctx->Stencil._BackFace = 1; ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL; + } break; #if FEATURE_ARB_fragment_program diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 94bf5de1e8..a9e22d340a 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -82,7 +82,16 @@ compute_version(const GLcontext *ctx) ctx->Extensions.ARB_vertex_shader && ctx->Extensions.ARB_fragment_shader && ctx->Extensions.ARB_texture_non_power_of_two && - ctx->Extensions.EXT_blend_equation_separate); + ctx->Extensions.EXT_blend_equation_separate && + + /* Technically, 2.0 requires the functionality + * of the EXT version. Enable 2.0 if either + * extension is available, and assume that a + * driver that only exposes the ATI extension + * will fallback to software when necessary. + */ + (ctx->Extensions.EXT_stencil_two_side + || ctx->Extensions.ATI_separate_stencil)); const GLboolean ver_2_1 = (ver_2_0 && /*ctx->Extensions.ARB_shading_language_120 &&*/ ctx->Extensions.EXT_pixel_buffer_object && diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f1da638ae6..088d45b156 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1108,20 +1108,34 @@ struct gl_scissor_attrib /** * Stencil attribute group (GL_STENCIL_BUFFER_BIT). + * + * Three sets of stencil data are tracked so that OpenGL 2.0, + * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported + * simultaneously. In each of the stencil state arrays, element 0 corresponds + * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 / + * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the + * GL_EXT_stencil_two_side GL_BACK state. + * + * The derived value \c _BackFace is either 1 or 2 depending on whether or + * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled. + * + * The derived value \c _TestTwoSide is set when the front-face and back-face + * stencil state are different. */ struct gl_stencil_attrib { GLboolean Enabled; /**< Enabled flag */ GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */ - GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 1) */ + GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */ GLboolean _TestTwoSide; - GLenum Function[2]; /**< Stencil function */ - GLenum FailFunc[2]; /**< Fail function */ - GLenum ZPassFunc[2]; /**< Depth buffer pass function */ - GLenum ZFailFunc[2]; /**< Depth buffer fail function */ - GLint Ref[2]; /**< Reference value */ - GLuint ValueMask[2]; /**< Value mask */ - GLuint WriteMask[2]; /**< Write mask */ + GLubyte _BackFace; + GLenum Function[3]; /**< Stencil function */ + GLenum FailFunc[3]; /**< Fail function */ + GLenum ZPassFunc[3]; /**< Depth buffer pass function */ + GLenum ZFailFunc[3]; /**< Depth buffer fail function */ + GLint Ref[3]; /**< Reference value */ + GLuint ValueMask[3]; /**< Value mask */ + GLuint WriteMask[3]; /**< Write mask */ GLuint Clear; /**< Clear value */ }; diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 2a4c38b1f2..b4ea9978d8 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -27,21 +27,6 @@ * \file stencil.c * Stencil operations. * - * Note: There's an incompatibility between GL_EXT_stencil_two_side and - * OpenGL 2.0's two-sided stencil feature. - * - * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the - * front OR back face state (as set by glActiveStencilFaceEXT) is set. - * - * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the - * front AND back state. - * - * So either we advertise the GL_EXT_stencil_two_side extension, or OpenGL - * 2.0, but not both. - * - * Also, note that GL_ATI_separate_stencil is different as well: - * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs. - * glStencilFuncSeparate(GLenum face, GLenum func, ...). */ @@ -198,6 +183,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) { GET_CURRENT_CONTEXT(ctx); const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; + const GLint face = ctx->Stencil.ActiveFace; ASSERT_OUTSIDE_BEGIN_END(ctx); if (!validate_stencil_func(ctx, func)) { @@ -207,9 +193,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ref = CLAMP( ref, 0, stencilMax ); - if (ctx->Extensions.EXT_stencil_two_side) { - /* only set active face state */ - const GLint face = ctx->Stencil.ActiveFace; + if (face != 0) { if (ctx->Stencil.Function[face] == func && ctx->Stencil.ValueMask[face] == mask && ctx->Stencil.Ref[face] == ref) @@ -218,9 +202,12 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ctx->Stencil.Function[face] = func; ctx->Stencil.Ref[face] = ref; ctx->Stencil.ValueMask[face] = mask; - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, face ? GL_BACK : GL_FRONT, - func, ref, mask); + + /* Only propagate the change to the driver if EXT_stencil_two_side + * is enabled. + */ + if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) { + ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask); } } else { @@ -237,7 +224,9 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask; if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT_AND_BACK, + ctx->Driver.StencilFuncSeparate(ctx, + ((ctx->Stencil.TestTwoSide) + ? GL_FRONT : GL_FRONT_AND_BACK), func, ref, mask); } } @@ -259,17 +248,23 @@ void GLAPIENTRY _mesa_StencilMask( GLuint mask ) { GET_CURRENT_CONTEXT(ctx); + const GLint face = ctx->Stencil.ActiveFace; + ASSERT_OUTSIDE_BEGIN_END(ctx); - if (ctx->Extensions.EXT_stencil_two_side) { - /* only set active face state */ - const GLint face = ctx->Stencil.ActiveFace; + if (face != 0) { + /* Only modify the EXT_stencil_two_side back-face state. + */ if (ctx->Stencil.WriteMask[face] == mask) return; FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.WriteMask[face] = mask; - if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, face ? GL_BACK : GL_FRONT, mask); + + /* Only propagate the change to the driver if EXT_stencil_two_side + * is enabled. + */ + if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) { + ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask); } } else { @@ -280,7 +275,10 @@ _mesa_StencilMask( GLuint mask ) FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask; if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT_AND_BACK, mask); + ctx->Driver.StencilMaskSeparate(ctx, + ((ctx->Stencil.TestTwoSide) + ? GL_FRONT : GL_FRONT_AND_BACK), + mask); } } } @@ -304,6 +302,8 @@ void GLAPIENTRY _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) { GET_CURRENT_CONTEXT(ctx); + const GLint face = ctx->Stencil.ActiveFace; + ASSERT_OUTSIDE_BEGIN_END(ctx); if (!validate_stencil_op(ctx, fail)) { @@ -319,9 +319,8 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) return; } - if (ctx->Extensions.EXT_stencil_two_side) { + if (face != 0) { /* only set active face state */ - const GLint face = ctx->Stencil.ActiveFace; if (ctx->Stencil.ZFailFunc[face] == zfail && ctx->Stencil.ZPassFunc[face] == zpass && ctx->Stencil.FailFunc[face] == fail) @@ -330,9 +329,12 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.ZFailFunc[face] = zfail; ctx->Stencil.ZPassFunc[face] = zpass; ctx->Stencil.FailFunc[face] = fail; - if (ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, face ? GL_BACK : GL_FRONT, - fail, zfail, zpass); + + /* Only propagate the change to the driver if EXT_stencil_two_side + * is enabled. + */ + if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) { + ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass); } } else { @@ -349,7 +351,9 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass; ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail; if (ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, GL_FRONT_AND_BACK, + ctx->Driver.StencilOpSeparate(ctx, + ((ctx->Stencil.TestTwoSide) + ? GL_FRONT : GL_FRONT_AND_BACK), fail, zfail, zpass); } } @@ -372,7 +376,7 @@ _mesa_ActiveStencilFaceEXT(GLenum face) if (face == GL_FRONT || face == GL_BACK) { FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 1; + ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)"); @@ -513,19 +517,16 @@ _mesa_StencilMaskSeparate(GLenum face, GLuint mask) void _mesa_update_stencil(GLcontext *ctx) { - if (ctx->Extensions.EXT_stencil_two_side) { - ctx->Stencil._TestTwoSide = ctx->Stencil.TestTwoSide; - } - else { - ctx->Stencil._TestTwoSide = - (ctx->Stencil.Function[0] != ctx->Stencil.Function[1] || - ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[1] || - ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[1] || - ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[1] || - ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] || - ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[1] || - ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[1]); - } + const GLint face = ctx->Stencil._BackFace; + + ctx->Stencil._TestTwoSide = + (ctx->Stencil.Function[0] != ctx->Stencil.Function[face] || + ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] || + ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] || + ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[face] || + ctx->Stencil.Ref[0] != ctx->Stencil.Ref[face] || + ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[face] || + ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[face]); } @@ -544,17 +545,24 @@ _mesa_init_stencil(GLcontext *ctx) ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 1 = GL_BACK */ ctx->Stencil.Function[0] = GL_ALWAYS; ctx->Stencil.Function[1] = GL_ALWAYS; + ctx->Stencil.Function[2] = GL_ALWAYS; ctx->Stencil.FailFunc[0] = GL_KEEP; ctx->Stencil.FailFunc[1] = GL_KEEP; + ctx->Stencil.FailFunc[2] = GL_KEEP; ctx->Stencil.ZPassFunc[0] = GL_KEEP; ctx->Stencil.ZPassFunc[1] = GL_KEEP; + ctx->Stencil.ZPassFunc[2] = GL_KEEP; ctx->Stencil.ZFailFunc[0] = GL_KEEP; ctx->Stencil.ZFailFunc[1] = GL_KEEP; + ctx->Stencil.ZFailFunc[2] = GL_KEEP; ctx->Stencil.Ref[0] = 0; ctx->Stencil.Ref[1] = 0; + ctx->Stencil.Ref[2] = 0; ctx->Stencil.ValueMask[0] = ~0U; ctx->Stencil.ValueMask[1] = ~0U; + ctx->Stencil.ValueMask[2] = ~0U; ctx->Stencil.WriteMask[0] = ~0U; ctx->Stencil.WriteMask[1] = ~0U; + ctx->Stencil.WriteMask[2] = ~0U; ctx->Stencil.Clear = 0; } diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index c925922463..2e84ddec71 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -997,10 +997,12 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) GLboolean _swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span) { + const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace; + if (span->arrayMask & SPAN_XY) - return stencil_and_ztest_pixels(ctx, span, span->facing); + return stencil_and_ztest_pixels(ctx, span, face); else - return stencil_and_ztest_span(ctx, span, span->facing); + return stencil_and_ztest_span(ctx, span, face); } -- cgit v1.2.3 From b5fbdef7ec3deb823ad1db8a7b7a731800082f75 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 9 Jan 2009 15:47:05 -0800 Subject: swrast: Enable GL_EXT_stencil_two_side --- src/mesa/drivers/dri/swrast/swrast.c | 2 ++ src/mesa/main/extensions.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 15b57244dc..4197603871 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -72,6 +72,7 @@ #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_IBM_multimode_draw_arrays #define need_GL_MESA_resize_buffers #define need_GL_NV_vertex_program @@ -103,6 +104,7 @@ const struct dri_extension card_extensions[] = { "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_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions }, { "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 188e01c8a4..738fda34dd 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -262,7 +262,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_secondary_color = GL_TRUE; ctx->Extensions.EXT_shared_texture_palette = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; - ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */ + ctx->Extensions.EXT_stencil_two_side = GL_TRUE; ctx->Extensions.EXT_texture_env_add = GL_TRUE; ctx->Extensions.EXT_texture_env_combine = GL_TRUE; ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; @@ -410,7 +410,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx) #if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; #endif - ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */ + ctx->Extensions.EXT_stencil_two_side = GL_TRUE; #if FEATURE_ARB_vertex_shader ctx->Extensions.ARB_vertex_shader = GL_TRUE; #endif -- cgit v1.2.3 From f7265e7a57bf49285dd226cf1effc75bf0cd54c0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 9 Jan 2009 15:47:34 -0800 Subject: 965: Enable GL_EXT_stencil_two_side --- src/mesa/drivers/dri/intel/intel_context.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index fda880829c..e080594ee4 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -89,6 +89,7 @@ int INTEL_DEBUG = (0); #define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_point_parameters #define need_GL_EXT_secondary_color +#define need_GL_EXT_stencil_two_side #define need_GL_ATI_separate_stencil #define need_GL_NV_point_sprite #define need_GL_NV_vertex_program @@ -413,6 +414,7 @@ static const struct dri_extension brw_extensions[] = { { "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 }, { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, { "GL_ATI_texture_env_combine3", NULL }, -- cgit v1.2.3 From 42c07d1500c0fc948f17f3eb1c3d527aeb428bd0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 9 Jan 2009 16:41:19 -0800 Subject: r300: Enable GL_ATI_separate_stencil in R300 At this point, GL_EXT_stencil_two_side should probably be disabled. It may be worth leaving it enabled because it has GLX protocol while GL_ATI_separate_stencil does not. I'll leave it to one of the r300 maintainers to make the call. --- src/mesa/drivers/dri/r300/r300_context.c | 21 +++++++++++++++++---- src/mesa/drivers/dri/radeon/radeon_screen.c | 5 +++++ 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 37436275e3..dc4cd5731d 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -77,19 +77,21 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. int future_hw_tcl_on = 1; int hw_tcl_on = 1; -#define need_GL_EXT_stencil_two_side +#define need_GL_VERSION_2_0 #define need_GL_ARB_multisample #define need_GL_ARB_point_parameters #define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program +#define need_GL_EXT_blend_equation_separate +#define need_GL_EXT_blend_func_separate #define need_GL_EXT_blend_minmax //#define need_GL_EXT_fog_coord +#define need_GL_EXT_gpu_program_parameters #define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_secondary_color -#define need_GL_EXT_blend_equation_separate -#define need_GL_EXT_blend_func_separate -#define need_GL_EXT_gpu_program_parameters +#define need_GL_EXT_stencil_two_side +#define need_GL_ATI_separate_stencil #define need_GL_NV_vertex_program #include "extension_helper.h" @@ -130,6 +132,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_ATI_separate_stencil", GL_ATI_separate_stencil_functions}, {"GL_ATI_texture_env_combine3", NULL}, {"GL_ATI_texture_mirror_once", NULL}, {"GL_MESA_pack_invert", NULL}, @@ -142,6 +145,16 @@ const struct dri_extension card_extensions[] = { /* *INDENT-ON* */ }; + +/** + * 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[] = { + {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, +}; + + extern struct tnl_pipeline_stage _r300_render_stage; extern const struct tnl_pipeline_stage _r300_tcl_stage; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 5f32dd575e..f5665c4af1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -206,6 +206,8 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 17; +extern const struct dri_extension gl_20_extension[]; + #ifndef RADEON_DEBUG int RADEON_DEBUG = 0; @@ -1140,6 +1142,7 @@ static void radeonDestroyContext(__DRIcontextPrivate * driContextPriv) #endif + /** * This is the driver specific part of the createNewScreen entry point. * @@ -1192,6 +1195,8 @@ radeonInitScreen(__DRIscreenPrivate *psp) driInitSingleExtension( NULL, NV_vp_extension ); driInitSingleExtension( NULL, ATI_fs_extension ); driInitExtensions( NULL, point_extensions, GL_FALSE ); +#elif defined(RADEON_COMMON_FOR_R300) + driInitSingleExtension( NULL, gl_20_extension ); #endif if (!radeonInitDriver(psp)) -- cgit v1.2.3 From f7c1a2dacd1643a19fbf975c21ac3e64b708c8d7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 11:23:12 -0700 Subject: mesa: initial bits for GL_EXT_vertex_array_bgra --- src/mesa/main/extensions.c | 1 + src/mesa/main/mtypes.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 188e01c8a4..bdc382bf9d 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -129,6 +129,7 @@ static const struct { { OFF, "GL_EXT_texture_sRGB", F(EXT_texture_sRGB) }, { OFF, "GL_EXT_timer_query", F(EXT_timer_query) }, { ON, "GL_EXT_vertex_array", F(EXT_vertex_array) }, + { OFF, "GL_EXT_vertex_array_bgra", F(EXT_vertex_array_bgra) }, { OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) }, { OFF, "GL_3DFX_texture_compression_FXT1", F(TDFX_texture_compression_FXT1) }, { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f1da638ae6..5c31f66ed1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1661,6 +1661,7 @@ struct gl_client_array { GLint Size; /**< components per element (1,2,3,4) */ GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */ + GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */ GLsizei Stride; /**< user-specified stride */ GLsizei StrideB; /**< actual stride in bytes */ const GLubyte *Ptr; /**< Points to array data */ @@ -2611,6 +2612,7 @@ struct gl_extensions GLboolean EXT_texture_sRGB; GLboolean EXT_timer_query; GLboolean EXT_vertex_array; + GLboolean EXT_vertex_array_bgra; GLboolean EXT_vertex_array_set; /* vendor extensions */ GLboolean APPLE_client_storage; -- cgit v1.2.3 From 76d27a6a1e94e973e5a0a4a22b80158dfecf9151 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 11:24:31 -0700 Subject: mesa: update glColorPointer, etc for GL_EXT_vertex_array_bgra Add new error checking, set array state appropriately. --- src/mesa/main/varray.c | 86 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 9d9b28b518..106252e460 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -52,11 +52,13 @@ static void update_array(GLcontext *ctx, struct gl_client_array *array, GLbitfield dirtyBit, GLsizei elementSize, - GLint size, GLenum type, + GLint size, GLenum type, GLenum format, GLsizei stride, GLboolean normalized, const GLvoid *ptr) { + ASSERT(format == GL_RGBA || format == GL_BGRA); array->Size = size; array->Type = type; + array->Format = format; array->Stride = stride; array->StrideB = stride ? stride : elementSize; array->Normalized = normalized; @@ -132,7 +134,7 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, - elementSize, size, type, stride, GL_FALSE, ptr); + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.VertexPointer) ctx->Driver.VertexPointer( ctx, size, type, stride, ptr ); @@ -182,7 +184,7 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) } update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, - elementSize, 3, type, stride, GL_TRUE, ptr); + elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr); if (ctx->Driver.NormalPointer) ctx->Driver.NormalPointer( ctx, type, stride, ptr ); @@ -193,12 +195,15 @@ void GLAPIENTRY _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { GLsizei elementSize; + GLenum format; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (size < 3 || size > 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" ); - return; + if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) { + _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(size)"); + return; + } } if (stride < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(stride)" ); @@ -209,6 +214,18 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) _mesa_debug(ctx, "glColorPointer( sz %d type %s stride %d )\n", size, _mesa_lookup_enum_by_nr( type ), stride); + if (size == GL_BGRA) { + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(GL_BGRA/GLubyte)"); + return; + } + format = GL_BGRA; + size = 4; + } + else { + format = GL_RGBA; + } + switch (type) { case GL_BYTE: elementSize = size * sizeof(GLbyte); @@ -245,7 +262,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, - elementSize, size, type, stride, GL_TRUE, ptr); + elementSize, size, type, format, stride, GL_TRUE, ptr); if (ctx->Driver.ColorPointer) ctx->Driver.ColorPointer( ctx, size, type, stride, ptr ); @@ -277,7 +294,7 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, - elementSize, 1, type, stride, GL_FALSE, ptr); + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.FogCoordPointer) ctx->Driver.FogCoordPointer( ctx, type, stride, ptr ); @@ -318,7 +335,7 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, - elementSize, 1, type, stride, GL_FALSE, ptr); + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.IndexPointer) ctx->Driver.IndexPointer( ctx, type, stride, ptr ); @@ -330,12 +347,15 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { GLsizei elementSize; + GLenum format; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (size != 3 && size != 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)" ); - return; + if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) { + _mesa_error(ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)"); + return; + } } if (stride < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(stride)" ); @@ -346,6 +366,18 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, _mesa_debug(ctx, "glSecondaryColorPointer( sz %d type %s stride %d )\n", size, _mesa_lookup_enum_by_nr( type ), stride); + if (size == GL_BGRA) { + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(GL_BGRA/GLubyte)"); + return; + } + format = GL_BGRA; + size = 4; + } + else { + format = GL_RGBA; + } + switch (type) { case GL_BYTE: elementSize = size * sizeof(GLbyte); @@ -377,7 +409,7 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, } update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1, - elementSize, size, type, stride, GL_TRUE, ptr); + elementSize, size, type, format, stride, GL_TRUE, ptr); if (ctx->Driver.SecondaryColorPointer) ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr ); @@ -437,7 +469,7 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], _NEW_ARRAY_TEXCOORD(unit), - elementSize, size, type, stride, GL_FALSE, ptr); + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.TexCoordPointer) ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr ); @@ -456,7 +488,8 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, - sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, stride, GL_FALSE, ptr); + sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA, + stride, GL_FALSE, ptr); if (ctx->Driver.EdgeFlagPointer) ctx->Driver.EdgeFlagPointer( ctx, stride, ptr ); @@ -490,7 +523,7 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->PointSize, _NEW_ARRAY_POINT_SIZE, - elementSize, 1, type, stride, GL_FALSE, ptr); + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -546,7 +579,7 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, stride, normalized, ptr); + elementSize, size, type, GL_RGBA, stride, normalized, ptr); if (ctx->Driver.VertexAttribPointer) ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr ); @@ -561,6 +594,7 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { GLsizei elementSize; + GLenum format; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -570,8 +604,10 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, } if (size < 1 || size > 4) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(size)"); - return; + if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) { + _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(size)"); + return; + } } if (stride < 0) { @@ -579,6 +615,20 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, return; } + if (size == GL_BGRA) { + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glVertexAttribPointerARB(GL_BGRA/type)"); + return; + } + format = GL_BGRA; + size = 4; + normalized = GL_TRUE; + } + else { + format = GL_RGBA; + } + /* check for valid 'type' and compute StrideB right away */ /* NOTE: more types are supported here than in the NV extension */ switch (type) { @@ -618,7 +668,7 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, stride, normalized, ptr); + elementSize, size, type, GL_RGBA, stride, normalized, ptr); if (ctx->Driver.VertexAttribPointer) ctx->Driver.VertexAttribPointer(ctx, index, size, type, stride, ptr); -- cgit v1.2.3 From 9cf594d698839678290f058078f0eaf569a13ff8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 11:25:13 -0700 Subject: mesa: improve array initialization code, and set the new array->Format field. --- src/mesa/main/arrayobj.c | 108 +++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index f3f482f8c8..b04095fd16 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -98,6 +98,28 @@ _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ) } +static void +init_array(GLcontext *ctx, + struct gl_client_array *array, GLint size, GLint type) +{ + array->Size = size; + array->Type = type; + array->Format = GL_RGBA; /* only significant for GL_EXT_vertex_array_bgra */ + array->Stride = 0; + array->StrideB = 0; + array->Ptr = NULL; + array->Enabled = GL_FALSE; + array->Normalized = GL_FALSE; +#if FEATURE_ARB_vertex_buffer_object + /* Vertex array buffers */ + array->BufferObj = ctx->Array.NullBufferObj; +#endif +} + + +/** + * Initialize a gl_array_object's arrays. + */ void _mesa_initialize_array_object( GLcontext *ctx, struct gl_array_object *obj, @@ -107,87 +129,23 @@ _mesa_initialize_array_object( GLcontext *ctx, obj->Name = name; - /* Vertex arrays */ - obj->Vertex.Size = 4; - obj->Vertex.Type = GL_FLOAT; - obj->Vertex.Stride = 0; - obj->Vertex.StrideB = 0; - obj->Vertex.Ptr = NULL; - obj->Vertex.Enabled = GL_FALSE; - obj->Normal.Type = GL_FLOAT; - obj->Normal.Stride = 0; - obj->Normal.StrideB = 0; - obj->Normal.Ptr = NULL; - obj->Normal.Enabled = GL_FALSE; - obj->Color.Size = 4; - obj->Color.Type = GL_FLOAT; - obj->Color.Stride = 0; - obj->Color.StrideB = 0; - obj->Color.Ptr = NULL; - obj->Color.Enabled = GL_FALSE; - obj->SecondaryColor.Size = 4; - obj->SecondaryColor.Type = GL_FLOAT; - obj->SecondaryColor.Stride = 0; - obj->SecondaryColor.StrideB = 0; - obj->SecondaryColor.Ptr = NULL; - obj->SecondaryColor.Enabled = GL_FALSE; - obj->FogCoord.Size = 1; - obj->FogCoord.Type = GL_FLOAT; - obj->FogCoord.Stride = 0; - obj->FogCoord.StrideB = 0; - obj->FogCoord.Ptr = NULL; - obj->FogCoord.Enabled = GL_FALSE; - obj->Index.Type = GL_FLOAT; - obj->Index.Stride = 0; - obj->Index.StrideB = 0; - obj->Index.Ptr = NULL; - obj->Index.Enabled = GL_FALSE; + /* Init the individual arrays */ + init_array(ctx, &obj->Vertex, 4, GL_FLOAT); + init_array(ctx, &obj->Normal, 3, GL_FLOAT); + init_array(ctx, &obj->Color, 4, GL_FLOAT); + init_array(ctx, &obj->SecondaryColor, 4, GL_FLOAT); + init_array(ctx, &obj->FogCoord, 1, GL_FLOAT); + init_array(ctx, &obj->Index, 1, GL_FLOAT); for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - obj->TexCoord[i].Size = 4; - obj->TexCoord[i].Type = GL_FLOAT; - obj->TexCoord[i].Stride = 0; - obj->TexCoord[i].StrideB = 0; - obj->TexCoord[i].Ptr = NULL; - obj->TexCoord[i].Enabled = GL_FALSE; + init_array(ctx, &obj->TexCoord[i], 4, GL_FLOAT); } - obj->EdgeFlag.Stride = 0; - obj->EdgeFlag.StrideB = 0; - obj->EdgeFlag.Ptr = NULL; - obj->EdgeFlag.Enabled = GL_FALSE; + init_array(ctx, &obj->EdgeFlag, 1, GL_BOOL); for (i = 0; i < VERT_ATTRIB_MAX; i++) { - obj->VertexAttrib[i].Size = 4; - obj->VertexAttrib[i].Type = GL_FLOAT; - obj->VertexAttrib[i].Stride = 0; - obj->VertexAttrib[i].StrideB = 0; - obj->VertexAttrib[i].Ptr = NULL; - obj->VertexAttrib[i].Enabled = GL_FALSE; - obj->VertexAttrib[i].Normalized = GL_FALSE; + init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT); } #if FEATURE_point_size_array - obj->PointSize.Type = GL_FLOAT; - obj->PointSize.Stride = 0; - obj->PointSize.StrideB = 0; - obj->PointSize.Ptr = NULL; - obj->PointSize.Enabled = GL_FALSE; - obj->PointSize.BufferObj = ctx->Array.NullBufferObj; -#endif - -#if FEATURE_ARB_vertex_buffer_object - /* Vertex array buffers */ - obj->Vertex.BufferObj = ctx->Array.NullBufferObj; - obj->Normal.BufferObj = ctx->Array.NullBufferObj; - obj->Color.BufferObj = ctx->Array.NullBufferObj; - obj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj; - obj->FogCoord.BufferObj = ctx->Array.NullBufferObj; - obj->Index.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - obj->TexCoord[i].BufferObj = ctx->Array.NullBufferObj; - } - obj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - obj->VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj; - } + init_array(ctx, &obj->PointSize, 1, GL_FLOAT); #endif } -- cgit v1.2.3 From 0791fdff6fe87cf9a29ddf4a716f1881c367c7de Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 11:26:30 -0700 Subject: mesa: update tnl module for GL_EXT_vertex_array_bgra Add special case for GLubyte/GL_BGRA color arrays in _tnl_import_array() --- src/mesa/tnl/t_draw.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index fd647c1f4a..2ec65d5323 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -88,6 +88,29 @@ static void free_space(GLcontext *ctx) } while (0) +/** + * Convert array of BGRA/GLubyte[4] values to RGBA/float[4] + * \param ptr input/ubyte array + * \param fptr output/float array + */ +static void +convert_bgra_to_float(const struct gl_client_array *input, + const GLubyte *ptr, GLfloat *fptr, + GLuint count ) +{ + GLuint i; + assert(input->Normalized); + assert(input->Size == 4); + for (i = 0; i < count; i++) { + const GLubyte *in = (GLubyte *) ptr; /* in is in BGRA order */ + *fptr++ = UBYTE_TO_FLOAT(in[2]); /* red */ + *fptr++ = UBYTE_TO_FLOAT(in[1]); /* green */ + *fptr++ = UBYTE_TO_FLOAT(in[0]); /* blue */ + *fptr++ = UBYTE_TO_FLOAT(in[3]); /* alpha */ + ptr += input->StrideB; + } +} + /* Adjust pointer to point at first requested element, convert to * floating point, populate VB->AttribPtr[]. @@ -112,7 +135,13 @@ static void _tnl_import_array( GLcontext *ctx, CONVERT(GLbyte, BYTE_TO_FLOAT); break; case GL_UNSIGNED_BYTE: - CONVERT(GLubyte, UBYTE_TO_FLOAT); + if (input->Format == GL_BGRA) { + /* See GL_EXT_vertex_array_bgra */ + convert_bgra_to_float(input, ptr, fptr, count); + } + else { + CONVERT(GLubyte, UBYTE_TO_FLOAT); + } break; case GL_SHORT: CONVERT(GLshort, SHORT_TO_FLOAT); -- cgit v1.2.3 From 0bd6d48bcea7de37e027854e9d91c54116fbe90e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 11:26:51 -0700 Subject: mesa: enable GL_EXT_vertex_array_bgra for sw drivers --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index bdc382bf9d..8010823cf5 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -272,6 +272,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; #endif + ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE; ctx->Extensions.MESA_pack_invert = GL_TRUE; #if FEATURE_MESA_program_debug -- cgit v1.2.3 From dab586b0755bffa7c4da0fdc571e0f504f4066c2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 11:27:42 -0700 Subject: i965: enable GL_EXT_vertex_array_bgra Simply a matter of choosing the right surface/vertex format for GLubyte/GL_BGRA arrays. --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 20 ++++++++++++++++++-- src/mesa/drivers/dri/intel/intel_context.c | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 73d6dea01e..f89c0c2ba4 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -156,7 +156,13 @@ static GLuint byte_types_scale[5] = { }; -static GLuint get_surface_type( GLenum type, GLuint size, GLboolean normalized ) +/** + * Given vertex array type/size/format/normalized info, return + * the appopriate hardware surface type. + * Format will be GL_RGBA or possibly GL_BGRA for GLubyte[4] color arrays. + */ +static GLuint get_surface_type( GLenum type, GLuint size, + GLenum format, GLboolean normalized ) { if (INTEL_DEBUG & DEBUG_VERTS) _mesa_printf("type %s size %d normalized %d\n", @@ -171,11 +177,20 @@ static GLuint get_surface_type( GLenum type, GLuint size, GLboolean normalized ) case GL_BYTE: return byte_types_norm[size]; case GL_UNSIGNED_INT: return uint_types_norm[size]; case GL_UNSIGNED_SHORT: return ushort_types_norm[size]; - case GL_UNSIGNED_BYTE: return ubyte_types_norm[size]; + case GL_UNSIGNED_BYTE: + if (format == GL_BGRA) { + /* See GL_EXT_vertex_array_bgra */ + assert(size == 4); + return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + } + else { + return ubyte_types_norm[size]; + } default: assert(0); return 0; } } else { + assert(format == GL_RGBA); /* sanity check */ switch (type) { case GL_DOUBLE: return double_types[size]; case GL_FLOAT: return float_types[size]; @@ -484,6 +499,7 @@ static void brw_emit_vertices(struct brw_context *brw) struct brw_vertex_element *input = enabled[i]; uint32_t format = get_surface_type(input->glarray->Type, input->glarray->Size, + input->glarray->Format, input->glarray->Normalized); uint32_t comp0 = BRW_VE1_COMPONENT_STORE_SRC; uint32_t comp1 = BRW_VE1_COMPONENT_STORE_SRC; diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index fda880829c..a43e6be0d9 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -414,6 +414,7 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions }, { "GL_EXT_shadow_funcs", NULL }, { "GL_EXT_texture_sRGB", NULL }, + { "GL_EXT_vertex_array_bgra", NULL }, { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, { "GL_ATI_texture_env_combine3", NULL }, { NULL, NULL } -- cgit v1.2.3 From 0a40033047373d9c16039cff9e63130478e78e0f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 13:44:12 -0700 Subject: mesa: refactor _mesa_TexEnvfv() code with helper functions --- src/mesa/main/texenv.c | 721 +++++++++++++++++++++++++------------------------ 1 file changed, 373 insertions(+), 348 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index e072cea136..2f38ee8852 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * 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"), @@ -37,6 +38,370 @@ #include "math/m_xform.h" +#define TE_ERROR(errCode, msg, value) \ + _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value)); + + +/** Set texture env mode */ +static void +set_env_mode(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum mode) +{ + GLboolean legal; + + if (texUnit->EnvMode == mode) + return; + + switch (mode) { + case GL_MODULATE: + case GL_BLEND: + case GL_DECAL: + case GL_REPLACE: + legal = GL_TRUE; + break; + case GL_REPLACE_EXT: + mode = GL_REPLACE; /* GL_REPLACE_EXT != GL_REPLACE */ + legal = GL_TRUE; + break; + case GL_ADD: + legal = ctx->Extensions.EXT_texture_env_add; + break; + case GL_COMBINE: + legal = (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine); + break; + case GL_COMBINE4_NV: + legal = ctx->Extensions.NV_texture_env_combine4; + break; + default: + legal = GL_FALSE; + } + + if (legal) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->EnvMode = mode; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + } +} + + +static void +set_env_color(GLcontext *ctx, + struct gl_texture_unit *texUnit, + const GLfloat *color) +{ + GLfloat tmp[4]; + tmp[0] = CLAMP(color[0], 0.0F, 1.0F); + tmp[1] = CLAMP(color[1], 0.0F, 1.0F); + tmp[2] = CLAMP(color[2], 0.0F, 1.0F); + tmp[3] = CLAMP(color[3], 0.0F, 1.0F); + if (TEST_EQ_4V(tmp, texUnit->EnvColor)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->EnvColor, tmp); +} + + +/** Set an RGB or A combiner mode/function */ +static void +set_combiner_mode(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLenum mode) +{ + GLboolean legal; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + switch (mode) { + case GL_REPLACE: + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: + legal = GL_TRUE; + break; + case GL_SUBTRACT: + legal = ctx->Extensions.ARB_texture_env_combine; + break; + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + legal = (ctx->Extensions.EXT_texture_env_dot3 && + pname == GL_COMBINE_RGB); + break; + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + legal = (ctx->Extensions.ARB_texture_env_dot3 && + pname == GL_COMBINE_RGB); + break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + legal =ctx->Extensions.ATI_texture_env_combine3; + break; + default: + legal = GL_FALSE; + } + + if (!legal) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + + switch (pname) { + case GL_COMBINE_RGB: + if (texUnit->Combine.ModeRGB == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ModeRGB = mode; + break; + + case GL_COMBINE_ALPHA: + if (texUnit->Combine.ModeA == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ModeA = mode; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + } +} + + + +/** Set an RGB or A combiner source term */ +static void +set_combiner_source(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLenum param) +{ + GLuint src; + GLboolean alpha, legal; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + /* + * Translate pname to (src, alpha). + */ + switch (pname) { + case GL_SOURCE0_RGB: + src = 0; + alpha = GL_FALSE; + break; + case GL_SOURCE1_RGB: + src = 1; + alpha = GL_FALSE; + break; + case GL_SOURCE2_RGB: + src = 2; + alpha = GL_FALSE; + break; + case GL_SOURCE0_ALPHA: + src = 0; + alpha = GL_TRUE; + break; + case GL_SOURCE1_ALPHA: + src = 1; + alpha = GL_TRUE; + break; + case GL_SOURCE2_ALPHA: + src = 2; + alpha = GL_TRUE; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + + /* + * Error-check param (the source term) + */ + switch (param) { + case GL_TEXTURE: + case GL_CONSTANT: + case GL_PRIMARY_COLOR: + case GL_PREVIOUS: + legal = GL_TRUE; + break; + case GL_TEXTURE0: + case GL_TEXTURE1: + case GL_TEXTURE2: + case GL_TEXTURE3: + case GL_TEXTURE4: + case GL_TEXTURE5: + case GL_TEXTURE6: + case GL_TEXTURE7: + legal = (ctx->Extensions.ARB_texture_env_crossbar && + param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits); + break; + case GL_ZERO: + case GL_ONE: + legal = ctx->Extensions.ATI_texture_env_combine3; + break; + default: + legal = GL_FALSE; + } + + if (!legal) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param); + return; + } + + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + + assert(src < 4); + if (alpha) + texUnit->Combine.SourceA[src] = param; + else + texUnit->Combine.SourceRGB[src] = param; +} + + +/** Set an RGB or A combiner operand term */ +static void +set_combiner_operand(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLenum param) +{ + GLuint op; + GLboolean alpha, legal; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + switch (pname) { + case GL_OPERAND0_RGB: + op = 0; + alpha = GL_FALSE; + break; + case GL_OPERAND1_RGB: + op = 1; + alpha = GL_FALSE; + break; + case GL_OPERAND2_RGB: + if (ctx->Extensions.ARB_texture_env_combine) { + op = 2; + alpha = GL_FALSE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND0_ALPHA: + op = 0; + alpha = GL_TRUE; + break; + case GL_OPERAND1_ALPHA: + op = 1; + alpha = GL_TRUE; + break; + case GL_OPERAND2_ALPHA: + if (ctx->Extensions.ARB_texture_env_combine) { + op = 2; + alpha = GL_TRUE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + + /* + * Error-check param (the source operand) + */ + switch (param) { + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + legal = !alpha; + break; + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + legal = GL_TRUE; + break; + default: + legal = GL_FALSE; + } + + if (!legal) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param); + return; + } + + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + + if (alpha) + texUnit->Combine.OperandA[op] = param; + else + texUnit->Combine.OperandRGB[op] = param; +} + + +static void +set_combiner_scale(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLfloat scale) +{ + GLuint shift; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + if (scale == 1.0F) { + shift = 0; + } + else if (scale == 2.0F) { + shift = 1; + } + else if (scale == 4.0F) { + shift = 2; + } + else { + _mesa_error( ctx, GL_INVALID_VALUE, + "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" ); + return; + } + + switch (pname) { + case GL_RGB_SCALE: + if (texUnit->Combine.ScaleShiftRGB == shift) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ScaleShiftRGB = shift; + break; + case GL_ALPHA_SCALE: + if (texUnit->Combine.ScaleShiftA == shift) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ScaleShiftA = shift; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } +} + + void GLAPIENTRY _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) @@ -55,377 +420,37 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; -#define TE_ERROR(errCode, msg, value) \ - _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value)); - if (target == GL_TEXTURE_ENV) { switch (pname) { case GL_TEXTURE_ENV_MODE: - { - GLenum mode = (GLenum) (GLint) *param; - if (mode == GL_REPLACE_EXT) - mode = GL_REPLACE; - if (texUnit->EnvMode == mode) - return; - if (mode == GL_MODULATE || - mode == GL_BLEND || - mode == GL_DECAL || - mode == GL_REPLACE || - (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) || - (mode == GL_COMBINE && - (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->EnvMode = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - } + set_env_mode(ctx, texUnit, (GLenum) (GLint) param[0]); break; case GL_TEXTURE_ENV_COLOR: - { - GLfloat tmp[4]; - tmp[0] = CLAMP( param[0], 0.0F, 1.0F ); - tmp[1] = CLAMP( param[1], 0.0F, 1.0F ); - tmp[2] = CLAMP( param[2], 0.0F, 1.0F ); - tmp[3] = CLAMP( param[3], 0.0F, 1.0F ); - if (TEST_EQ_4V(tmp, texUnit->EnvColor)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EnvColor, tmp); - } + set_env_color(ctx, texUnit, param); break; case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeRGB == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - if (!ctx->Extensions.EXT_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - if (!ctx->Extensions.ARB_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeRGB = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeA == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeA = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + set_combiner_mode(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_SOURCE0_RGB: case GL_SOURCE1_RGB: case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_RGB; - if (texUnit->Combine.SourceRGB[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceRGB[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; case GL_SOURCE0_ALPHA: case GL_SOURCE1_ALPHA: case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_ALPHA; - if (texUnit->Combine.SourceA[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceA[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + set_combiner_source(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_OPERAND0_RGB: case GL_OPERAND1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - const GLuint s = pname - GL_OPERAND0_RGB; - if (texUnit->Combine.OperandRGB[s] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[s] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; + case GL_OPERAND2_RGB: case GL_OPERAND0_ALPHA: case GL_OPERAND1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND2_RGB: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: /* ARB combine only */ - case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */ - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; case GL_OPERAND2_ALPHA: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + set_combiner_operand(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftRGB == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftRGB = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_ALPHA_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftA == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftA = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + set_combiner_scale(ctx, texUnit, pname, param[0]); break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" ); -- cgit v1.2.3 From 39b4061bb9be540dfb51891e22c505bc235ec8a2 Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Wed, 21 Jan 2009 22:41:26 +0000 Subject: intel: Prevent an "irq is not working" printf when only pipe B is enabled. intelMakeCurrent is called before intelWindowMoved (in fact, it calls it), so calculation of the correct vblank crtc has not happened yet. Fix this by making a function that fixes up a set of vblank flags and call if from both functions. --- src/mesa/drivers/dri/intel/intel_buffers.c | 34 +++++++++++++++++++++++------- src/mesa/drivers/dri/intel/intel_buffers.h | 3 +++ src/mesa/drivers/dri/intel/intel_context.c | 5 +++++ 3 files changed, 34 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 7465ba7c69..08e10c9e0e 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -143,16 +143,13 @@ intel_get_cliprects(struct intel_context *intel, } } -/** - * This will be called whenever the currently bound window is moved/resized. - * XXX: actually, it seems to NOT be called when the window is only moved (BP). +/* + * Correct a drawablePrivate's set of vblank flags WRT the current context. + * When considering multiple crtcs. */ -void -intelWindowMoved(struct intel_context *intel) +GLuint +intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv) { - GLcontext *ctx = &intel->ctx; - __DRIdrawablePrivate *dPriv = intel->driDrawable; - struct intel_framebuffer *intel_fb = dPriv->driverPrivate; if (!intel->intelScreen->driScrnPriv->dri2.enabled && intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { @@ -177,6 +174,27 @@ intelWindowMoved(struct intel_context *intel) flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; } + return flags; + } else { + return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; + } +} + +/** + * This will be called whenever the currently bound window is moved/resized. + * XXX: actually, it seems to NOT be called when the window is only moved (BP). + */ +void +intelWindowMoved(struct intel_context *intel) +{ + GLcontext *ctx = &intel->ctx; + __DRIdrawablePrivate *dPriv = intel->driDrawable; + struct intel_framebuffer *intel_fb = dPriv->driverPrivate; + + if (!intel->intelScreen->driScrnPriv->dri2.enabled && + intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { + GLuint flags = intelFixupVblank(intel, dPriv); + /* Check to see if we changed pipes */ if (flags != dPriv->vblFlags && dPriv->vblFlags && !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) { diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h index 0be1cee091..529e823b4f 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.h +++ b/src/mesa/drivers/dri/intel/intel_buffers.h @@ -47,6 +47,9 @@ extern struct intel_region *intel_drawbuf_region(struct intel_context *intel); extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv); +extern GLuint intelFixupVblank(struct intel_context *intel, + __DRIdrawablePrivate *dPriv); + extern void intelWindowMoved(struct intel_context *intel); extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb); diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index a68e217647..6cfe57cb49 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -865,6 +865,11 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, ? 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; -- cgit v1.2.3 From 0b5266ff648b03b3f2beda9838598abc00c4f7b2 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Wed, 21 Jan 2009 21:57:24 +0000 Subject: intel: fix vblank crtc selection with DRI1 when only one pipe is enabled. On Mobile chipsets, we often enable PipeB instead of PipeA, but the test in here was insufficient, falling back to pipe A if the area intersection returned zero. Therefore, in the case where a window went off to the top of the left of the screen, it would freeze, waiting on the wrong vblank. Fix this mess by checking the sarea for a crtc being zero sized, and in that case always default to the other one. --- src/mesa/drivers/dri/intel/intel_buffers.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 08e10c9e0e..81e718bb3d 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -195,6 +195,14 @@ intelWindowMoved(struct intel_context *intel) intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { GLuint flags = intelFixupVblank(intel, dPriv); + /* Do the stupid test: Is one of them actually disabled? + */ + if (sarea->planeA_w == 0 || sarea->planeA_h == 0) { + flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; + } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) { + flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; + } + /* Check to see if we changed pipes */ if (flags != dPriv->vblFlags && dPriv->vblFlags && !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) { -- cgit v1.2.3 From 216bff5fd4699a694a1d76f91c4ee193c2bbe23a Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 23 Jan 2009 13:13:23 -0800 Subject: intel: move pipe enable sanity check to where it belongs Bah, applied the patches in the wrong order, not Owain's fault... --- src/mesa/drivers/dri/intel/intel_buffers.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 81e718bb3d..3444e2905f 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -166,6 +166,14 @@ intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv) GLint areaB = driIntersectArea( drw_rect, planeB_rect ); GLuint flags = dPriv->vblFlags; + /* Do the stupid test: Is one of them actually disabled? + */ + if (sarea->planeA_w == 0 || sarea->planeA_h == 0) { + flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; + } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) { + flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; + } + /* Update vblank info */ if (areaB > areaA || (areaA == areaB && areaB > 0)) { @@ -195,14 +203,6 @@ intelWindowMoved(struct intel_context *intel) intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { GLuint flags = intelFixupVblank(intel, dPriv); - /* Do the stupid test: Is one of them actually disabled? - */ - if (sarea->planeA_w == 0 || sarea->planeA_h == 0) { - flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; - } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) { - flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; - } - /* Check to see if we changed pipes */ if (flags != dPriv->vblFlags && dPriv->vblFlags && !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) { -- cgit v1.2.3 From ad338c14c2aca87199da7ec1ae08ceb5062a9954 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 14:15:45 -0700 Subject: mesa: consolidate glGetTexEnvi/f() code with new get_texenvi() helper --- src/mesa/main/texenv.c | 339 ++++++++++++++++++------------------------------- 1 file changed, 125 insertions(+), 214 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index 2f38ee8852..d94bd9f313 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -558,6 +558,112 @@ _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) } + +/** + * Helper for glGetTexEnvi/f() + * \return value of queried pname or -1 if error. + */ +static GLint +get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit, + GLenum pname) +{ + switch (pname) { + case GL_TEXTURE_ENV_MODE: + return texUnit->EnvMode; + break; + case GL_COMBINE_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return texUnit->Combine.ModeRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_COMBINE_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return texUnit->Combine.ModeA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned rgb_idx = pname - GL_SOURCE0_RGB; + return texUnit->Combine.SourceRGB[rgb_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; + return texUnit->Combine.SourceA[alpha_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_rgb = pname - GL_OPERAND0_RGB; + return texUnit->Combine.OperandRGB[op_rgb]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; + return texUnit->Combine.OperandA[op_alpha]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_RGB_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return 1 << texUnit->Combine.ScaleShiftRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_ALPHA_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return 1 << texUnit->Combine.ScaleShiftA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + default: + ; + } + + return -1; /* error */ +} + + + void GLAPIENTRY _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) { @@ -576,111 +682,14 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = ENUM_TO_FLOAT(texUnit->EnvMode); - break; - case GL_TEXTURE_ENV_COLOR: - COPY_4FV( params, texUnit->EnvColor ); - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.ModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.ModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned rgb_idx = pname - GL_SOURCE0_RGB; - *params = (GLfloat) texUnit->Combine.SourceRGB[rgb_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; - *params = (GLfloat) texUnit->Combine.SourceA[alpha_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_rgb = pname - GL_OPERAND0_RGB; - *params = (GLfloat) texUnit->Combine.OperandRGB[op_rgb]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; - *params = (GLfloat) texUnit->Combine.OperandA[op_alpha]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftRGB == 0) - *params = 1.0; - else if (texUnit->Combine.ScaleShiftRGB == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftA == 0) - *params = 1.0; - else if (texUnit->Combine.ScaleShiftA == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname=0x%x)", pname); + if (pname == GL_TEXTURE_ENV_COLOR) { + COPY_4FV( params, texUnit->EnvColor ); + } + else { + GLint val = get_texenvi(ctx, texUnit, pname); + if (val >= 0) { + *params = (GLfloat) val; + } } } else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { @@ -737,115 +746,17 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = (GLint) texUnit->EnvMode; - break; - case GL_TEXTURE_ENV_COLOR: - params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); - params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); - params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); - params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.ModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.ModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned rgb_idx = pname - GL_SOURCE0_RGB; - *params = (GLint) texUnit->Combine.SourceRGB[rgb_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; - *params = (GLint) texUnit->Combine.SourceA[alpha_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_rgb = pname - GL_OPERAND0_RGB; - *params = (GLint) texUnit->Combine.OperandRGB[op_rgb]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; - *params = (GLint) texUnit->Combine.OperandA[op_alpha]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftRGB == 0) - *params = 1; - else if (texUnit->Combine.ScaleShiftRGB == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftA == 0) - *params = 1; - else if (texUnit->Combine.ScaleShiftA == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname=0x%x)", - pname); + if (pname == GL_TEXTURE_ENV_COLOR) { + params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); + params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); + params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); + params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); + } + else { + GLint val = get_texenvi(ctx, texUnit, pname); + if (val >= 0) { + *params = val; + } } } else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { -- cgit v1.2.3 From e57e39896049a045751201e912779872026fc741 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 23 Jan 2009 13:18:13 -0800 Subject: intel: fix the mismerge of the vblank pipe enable sanity check Fix the last merge fix, had the blocks ordered incorrectly. --- src/mesa/drivers/dri/intel/intel_buffers.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 3444e2905f..f1a08c5c10 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -166,19 +166,19 @@ intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv) GLint areaB = driIntersectArea( drw_rect, planeB_rect ); GLuint flags = dPriv->vblFlags; - /* Do the stupid test: Is one of them actually disabled? + /* Update vblank info */ - if (sarea->planeA_w == 0 || sarea->planeA_h == 0) { + if (areaB > areaA || (areaA == areaB && areaB > 0)) { flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; - } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) { + } else { flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; } - /* Update vblank info + /* Do the stupid test: Is one of them actually disabled? */ - if (areaB > areaA || (areaA == areaB && areaB > 0)) { + if (sarea->planeA_w == 0 || sarea->planeA_h == 0) { flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; - } else { + } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) { flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; } -- cgit v1.2.3 From ded949ed06e02ef26b1168b101daba04be78155e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 16:40:27 -0700 Subject: mesa: set the new array->Format field in VBO code Should help to solve failed assertion in i965 driver (see bug 19708) --- src/mesa/vbo/vbo_context.c | 3 +++ src/mesa/vbo/vbo_exec_draw.c | 1 + src/mesa/vbo/vbo_save_draw.c | 1 + src/mesa/vbo/vbo_split_copy.c | 1 + 4 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index a73a46b9c8..274d23248f 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -76,6 +76,7 @@ static void init_legacy_currval(GLcontext *ctx) cl->StrideB = 0; cl->Enabled = 1; cl->Type = GL_FLOAT; + cl->Format = GL_RGBA; cl->Ptr = (const void *)ctx->Current.Attrib[i]; cl->BufferObj = ctx->Array.NullBufferObj; } @@ -97,6 +98,7 @@ static void init_generic_currval(GLcontext *ctx) */ cl->Size = 1; cl->Type = GL_FLOAT; + cl->Format = GL_RGBA; cl->Ptr = (const void *)ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + i]; cl->Stride = 0; cl->StrideB = 0; @@ -141,6 +143,7 @@ static void init_mat_currval(GLcontext *ctx) cl->Ptr = (const void *)ctx->Light.Material.Attrib[i]; cl->Type = GL_FLOAT; + cl->Format = GL_RGBA; cl->Stride = 0; cl->StrideB = 0; cl->Enabled = 1; diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 92356ba977..5b2e3550ca 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -204,6 +204,7 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Type = GL_FLOAT; + arrays[attr].Format = GL_RGBA; arrays[attr].Enabled = 1; _mesa_reference_buffer_object(ctx, &arrays[attr].BufferObj, diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index ed82f09958..6fa3f1a7e4 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -150,6 +150,7 @@ static void vbo_bind_vertex_list( GLcontext *ctx, arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat); arrays[attr].Stride = node->vertex_size * sizeof(GLfloat); arrays[attr].Type = GL_FLOAT; + arrays[attr].Format = GL_RGBA; arrays[attr].Enabled = 1; _mesa_reference_buffer_object(ctx, &arrays[attr].BufferObj, diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 685cc0fdf6..5fb66d3318 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -461,6 +461,7 @@ static void replay_init( struct copy_context *copy ) dst->Size = src->Size; dst->Type = src->Type; + dst->Format = GL_RGBA; dst->Stride = copy->vertex_size; dst->StrideB = copy->vertex_size; dst->Ptr = copy->dstbuf + offset; -- cgit v1.2.3 From f5d3027c0a03e26fe90efc067766c996dea05948 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:29:26 -0700 Subject: mesa: initial changes for GL_NV_texture_env_combine4 --- src/mesa/main/extensions.c | 1 + src/mesa/main/mtypes.h | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 43c9d4a788..42de564547 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -155,6 +155,7 @@ static const struct { { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, { 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) }, { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) }, { ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) }, { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 39c988f3c8..b09c5910f8 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1468,23 +1468,20 @@ struct gl_texture_object /** * Texture combine environment state. - * - * \todo - * If GL_NV_texture_env_combine4 is ever supported, the arrays in this - * structure will need to be expanded for 4 elements. + * Up to four combiner sources are possible with GL_NV_texture_env_combine4. */ struct gl_tex_env_combine_state { GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ - GLenum SourceRGB[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum SourceA[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum OperandRGB[3]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */ - GLenum OperandA[3]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */ + GLenum SourceRGB[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ + GLenum SourceA[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ + GLenum OperandRGB[4]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */ + GLenum OperandA[4]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */ GLuint ScaleShiftRGB; /**< 0, 1 or 2 */ GLuint ScaleShiftA; /**< 0, 1 or 2 */ - GLuint _NumArgsRGB; /**< Number of inputs used for the combine mode. */ - GLuint _NumArgsA; /**< Number of inputs used for the combine mode. */ + GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */ + GLuint _NumArgsA; /**< Number of inputs used for the A combiner */ }; @@ -2649,6 +2646,7 @@ struct gl_extensions GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_texgen_reflection; + GLboolean NV_texture_env_combine4; GLboolean NV_texture_rectangle; GLboolean NV_vertex_program; GLboolean NV_vertex_program1_1; -- cgit v1.2.3 From 08fbbdd4dceb8ca7ac15f0ce469f59e13e0ba82b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:30:03 -0700 Subject: mesa: update glTexEnv(), glGetTexEnv() for GL_NV_texture_env_combine4 --- src/mesa/main/texenv.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index d94bd9f313..097923182a 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -206,6 +206,16 @@ set_combiner_source(GLcontext *ctx, src = 2; alpha = GL_FALSE; break; + case GL_SOURCE3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + src = 3; + alpha = GL_FALSE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; case GL_SOURCE0_ALPHA: src = 0; alpha = GL_TRUE; @@ -218,11 +228,23 @@ set_combiner_source(GLcontext *ctx, src = 2; alpha = GL_TRUE; break; + case GL_SOURCE3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + src = 3; + alpha = GL_TRUE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; default: TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; } + assert(src < 4); + /* * Error-check param (the source term) */ @@ -245,6 +267,9 @@ set_combiner_source(GLcontext *ctx, param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits); break; case GL_ZERO: + legal = (ctx->Extensions.ATI_texture_env_combine3 || + ctx->Extensions.NV_texture_env_combine4); + break; case GL_ONE: legal = ctx->Extensions.ATI_texture_env_combine3; break; @@ -259,7 +284,6 @@ set_combiner_source(GLcontext *ctx, FLUSH_VERTICES(ctx, _NEW_TEXTURE); - assert(src < 4); if (alpha) texUnit->Combine.SourceA[src] = param; else @@ -301,6 +325,16 @@ set_combiner_operand(GLcontext *ctx, return; } break; + case GL_OPERAND3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + op = 3; + alpha = GL_FALSE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; case GL_OPERAND0_ALPHA: op = 0; alpha = GL_TRUE; @@ -319,11 +353,23 @@ set_combiner_operand(GLcontext *ctx, return; } break; + case GL_OPERAND3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + op = 3; + alpha = GL_TRUE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; default: TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; } + assert(op < 4); + /* * Error-check param (the source operand) */ @@ -397,7 +443,6 @@ set_combiner_scale(GLcontext *ctx, break; default: TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; } } @@ -435,17 +480,21 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) case GL_SOURCE0_RGB: case GL_SOURCE1_RGB: case GL_SOURCE2_RGB: + case GL_SOURCE3_RGB_NV: case GL_SOURCE0_ALPHA: case GL_SOURCE1_ALPHA: case GL_SOURCE2_ALPHA: + case GL_SOURCE3_ALPHA_NV: set_combiner_source(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_OPERAND0_RGB: case GL_OPERAND1_RGB: case GL_OPERAND2_RGB: + case GL_OPERAND3_RGB_NV: case GL_OPERAND0_ALPHA: case GL_OPERAND1_ALPHA: case GL_OPERAND2_ALPHA: + case GL_OPERAND3_ALPHA_NV: set_combiner_operand(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_RGB_SCALE: @@ -601,6 +650,14 @@ get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; + case GL_SOURCE3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.SourceRGB[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; case GL_SOURCE0_ALPHA: case GL_SOURCE1_ALPHA: case GL_SOURCE2_ALPHA: @@ -613,6 +670,14 @@ get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; + case GL_SOURCE3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.SourceA[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; case GL_OPERAND0_RGB: case GL_OPERAND1_RGB: case GL_OPERAND2_RGB: @@ -625,6 +690,14 @@ get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; + case GL_OPERAND3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.OperandRGB[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; case GL_OPERAND0_ALPHA: case GL_OPERAND1_ALPHA: case GL_OPERAND2_ALPHA: @@ -637,6 +710,14 @@ get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; + case GL_OPERAND3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.OperandA[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; case GL_RGB_SCALE: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { -- cgit v1.2.3 From e082314cab42f43b0438603a282f01920004e6f0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:30:33 -0700 Subject: mesa: update state setup/validation for GL_NV_texture_env_combine4 --- src/mesa/main/texstate.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 9bfb7e0ec2..7cddec0bce 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -53,10 +53,10 @@ */ static const struct gl_tex_env_combine_state default_combine_state = { GL_MODULATE, GL_MODULATE, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA }, - { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, + { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT }, + { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT }, + { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA, GL_SRC_ALPHA }, + { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, 0, 0, 2, 2 }; @@ -551,7 +551,8 @@ update_texture_state( GLcontext *ctx ) if (texUnit->_ReallyEnabled) ctx->Texture._EnabledUnits |= (1 << unit); - if (texUnit->EnvMode == GL_COMBINE) { + if (texUnit->EnvMode == GL_COMBINE || + texUnit->EnvMode == GL_COMBINE4_NV) { texUnit->_CurrentCombine = & texUnit->Combine; } else { @@ -572,9 +573,14 @@ update_texture_state( GLcontext *ctx ) case GL_REPLACE: texUnit->_CurrentCombine->_NumArgsRGB = 1; break; - case GL_MODULATE: case GL_ADD: case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + texUnit->_CurrentCombine->_NumArgsRGB = 4; + else + texUnit->_CurrentCombine->_NumArgsRGB = 2; + break; + case GL_MODULATE: case GL_SUBTRACT: case GL_DOT3_RGB: case GL_DOT3_RGBA: @@ -598,9 +604,14 @@ update_texture_state( GLcontext *ctx ) case GL_REPLACE: texUnit->_CurrentCombine->_NumArgsA = 1; break; - case GL_MODULATE: case GL_ADD: case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + texUnit->_CurrentCombine->_NumArgsA = 4; + else + texUnit->_CurrentCombine->_NumArgsA = 2; + break; + case GL_MODULATE: case GL_SUBTRACT: texUnit->_CurrentCombine->_NumArgsA = 2; break; -- cgit v1.2.3 From 2d508c1d5c53dc475e5262593dd4dac5575a6b08 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:30:54 -0700 Subject: swrast: updates for GL_NV_texture_env_combine4 --- src/mesa/swrast/s_texcombine.c | 131 ++++++++++++++++++++++++++++++++++++----- src/mesa/swrast/s_triangle.c | 3 +- 2 files changed, 117 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 632d650007..df6efad66c 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.5 * - * Copyright (C) 1999-2006 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"), @@ -66,9 +67,9 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, GLchan (*rgba)[4] ) { const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]); - const GLchan (*argRGB [3])[4]; - const GLchan (*argA [3])[4]; - const GLuint RGBshift = textureUnit->_CurrentCombine->ScaleShiftRGB; + const GLchan (*argRGB [4])[4]; + const GLchan (*argA [4])[4]; + const GLint RGBshift = textureUnit->_CurrentCombine->ScaleShiftRGB; const GLuint Ashift = textureUnit->_CurrentCombine->ScaleShiftA; #if CHAN_TYPE == GL_FLOAT const GLchan RGBmult = (GLfloat) (1 << RGBshift); @@ -80,7 +81,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, static const GLchan zero[4] = { 0, 0, 0, 0 }; const GLuint numColorArgs = textureUnit->_CurrentCombine->_NumArgsRGB; const GLuint numAlphaArgs = textureUnit->_CurrentCombine->_NumArgsA; - GLchan ccolor[3][MAX_WIDTH][4]; + GLchan ccolor[4][MAX_WIDTH][4]; GLuint i, j; ASSERT(ctx->Extensions.EXT_texture_env_combine || @@ -98,7 +99,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, */ /* - * Do operand setup for up to 3 operands. Loop over the terms. + * Do operand setup for up to 4 operands. Loop over the terms. */ for (j = 0; j < numColorArgs; j++) { const GLenum srcRGB = textureUnit->_CurrentCombine->SourceRGB[j]; @@ -295,7 +296,36 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } break; case GL_ADD: - { + if (textureUnit->EnvMode == GL_COMBINE4_NV) { + /* (a * b) + (c * d) */ + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; + const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3]; + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] + + arg2[i][RCOMP] * arg3[i][RCOMP]) * RGBmult; + rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] + + arg2[i][GCOMP] * arg3[i][GCOMP]) * RGBmult; + rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] + + arg2[i][BCOMP] * arg3[i][BCOMP]) * RGBmult; +#else + const GLint shift = CHAN_BITS - RGBshift; + GLint r = (PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift) + + (PROD(arg2[i][RCOMP], arg3[i][RCOMP]) >> shift); + GLint g = (PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift) + + (PROD(arg2[i][GCOMP], arg3[i][GCOMP]) >> shift); + GLint b = (PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift) + + (PROD(arg2[i][BCOMP], arg3[i][BCOMP]) >> shift); + rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); + rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); + rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); +#endif + } + } + else { + /* 2-term addition */ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { @@ -315,7 +345,37 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } break; case GL_ADD_SIGNED: - { + if (textureUnit->EnvMode == GL_COMBINE4_NV) { + /* (a * b) + (c * d) - 0.5 */ + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; + const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3]; + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] * + arg2[i][RCOMP] + arg3[i][RCOMP] - 0.5) * RGBmult; + rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] * + arg2[i][GCOMP] + arg3[i][GCOMP] - 0.5) * RGBmult; + rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] * + arg2[i][BCOMP] + arg3[i][BCOMP] - 0.5) * RGBmult; +#else + GLint r = (((PROD(arg0[i][RCOMP], arg1[i][RCOMP]) + + PROD(arg2[i][RCOMP], arg3[i][RCOMP])) >> CHAN_BITS) - half) + << RGBshift; + GLint g = (((PROD(arg0[i][GCOMP], arg1[i][GCOMP]) + + PROD(arg2[i][GCOMP], arg3[i][GCOMP])) >> CHAN_BITS) - half) + << RGBshift; + GLint b = (((PROD(arg0[i][BCOMP], arg1[i][BCOMP]) + + PROD(arg2[i][BCOMP], arg3[i][BCOMP])) >> CHAN_BITS) - half) + << RGBshift; + rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); + rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); + rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); +#endif + } + } + else { const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { @@ -324,9 +384,9 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * RGBmult; rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * RGBmult; #else - GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] -half; - GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] -half; - GLint b = (GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP] -half; + GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] - half; + GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] - half; + GLint b = (GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP] - half; r = (r < 0) ? 0 : r << RGBshift; g = (g < 0) ? 0 : g << RGBshift; b = (b < 0) ? 0 : b << RGBshift; @@ -573,9 +633,28 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } break; case GL_ADD: - { + if (textureUnit->EnvMode == GL_COMBINE4_NV) { + /* (a * b) + (c * d) */ + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; + const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3]; + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] + + arg2[i][ACOMP] * arg3[i][ACOMP]) * Amult; +#else + const GLint shift = CHAN_BITS - Ashift; + GLint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift) + + (PROD(arg2[i][ACOMP], arg3[i][ACOMP]) >> shift); + rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); +#endif + } + } + else { + /* two-term add */ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * Amult; @@ -587,7 +666,27 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } break; case GL_ADD_SIGNED: - { + if (textureUnit->EnvMode == GL_COMBINE4_NV) { + /* (a * b) + (c * d) - 0.5 */ + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; + const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3]; + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] + + arg2[i][ACOMP] * arg3[i][ACOMP] - + 0.5) * Amult; +#else + GLint a = (((PROD(arg0[i][ACOMP], arg1[i][ACOMP]) + + PROD(arg2[i][ACOMP], arg3[i][ACOMP])) >> CHAN_BITS) - half) + << Ashift; + rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); +#endif + } + } + else { + /* a + b - 0.5 */ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; for (i = 0; i < n; i++) { @@ -596,7 +695,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, #else GLint a = (GLint) arg0[i][ACOMP] + (GLint) arg1[i][ACOMP] -half; a = (a < 0) ? 0 : a << Ashift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); + rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); #endif } } diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index a2e8433e27..5d232487f3 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1070,7 +1070,8 @@ _swrast_choose_triangle( GLcontext *ctx ) && minFilter == magFilter && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR && !swrast->_FogEnabled - && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT) { + && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT + && ctx->Texture.Unit[0].EnvMode != GL_COMBINE4_NV) { if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) { if (minFilter == GL_NEAREST && format == MESA_FORMAT_RGB -- cgit v1.2.3 From 6947f85cb5fbc433ba7763530285e470745b009b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:32:09 -0700 Subject: mesa: updated fragment shader codegen for GL_NV_texture_env_combine4 Expand struct fields, increase loops and handle new 4-term ADD modes. Plus, some new assertions to catch switch/default cases that may be incorrect. --- src/mesa/main/texenvprogram.c | 121 +++++++++++++++++++++++++++++++----------- 1 file changed, 90 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 6a57d50193..066f3bd0be 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -2,6 +2,7 @@ * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. + * Copyright 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 @@ -38,6 +39,9 @@ #include "texenvprogram.h" +#define MAX_TERMS 4 + + /* * Note on texture units: * @@ -89,13 +93,13 @@ struct state_key { GLuint ScaleShiftRGB:2; GLuint ScaleShiftA:2; - GLuint NumArgsRGB:2; + GLuint NumArgsRGB:3; GLuint ModeRGB:4; - struct mode_opt OptRGB[3]; + struct mode_opt OptRGB[MAX_TERMS]; - GLuint NumArgsA:2; + GLuint NumArgsA:3; GLuint ModeA:4; - struct mode_opt OptA[3]; + struct mode_opt OptA[MAX_TERMS]; } unit[8]; }; @@ -131,7 +135,9 @@ static GLuint translate_operand( GLenum operand ) case GL_ONE_MINUS_SRC_ALPHA: return OPR_ONE_MINUS_SRC_ALPHA; case GL_ZERO: return OPR_ZERO; case GL_ONE: return OPR_ONE; - default: return OPR_UNKNOWN; + default: + assert(0); + return OPR_UNKNOWN; } } @@ -147,6 +153,7 @@ static GLuint translate_operand( GLenum operand ) #define SRC_CONSTANT 9 #define SRC_PRIMARY_COLOR 10 #define SRC_PREVIOUS 11 +#define SRC_ZERO 12 #define SRC_UNKNOWN 15 static GLuint translate_source( GLenum src ) @@ -164,32 +171,49 @@ static GLuint translate_source( GLenum src ) case GL_CONSTANT: return SRC_CONSTANT; case GL_PRIMARY_COLOR: return SRC_PRIMARY_COLOR; case GL_PREVIOUS: return SRC_PREVIOUS; - default: return SRC_UNKNOWN; + case GL_ZERO: + return SRC_ZERO; + default: + assert(0); + return SRC_UNKNOWN; } } -#define MODE_REPLACE 0 -#define MODE_MODULATE 1 -#define MODE_ADD 2 -#define MODE_ADD_SIGNED 3 -#define MODE_INTERPOLATE 4 -#define MODE_SUBTRACT 5 -#define MODE_DOT3_RGB 6 -#define MODE_DOT3_RGB_EXT 7 -#define MODE_DOT3_RGBA 8 -#define MODE_DOT3_RGBA_EXT 9 -#define MODE_MODULATE_ADD_ATI 10 -#define MODE_MODULATE_SIGNED_ADD_ATI 11 -#define MODE_MODULATE_SUBTRACT_ATI 12 -#define MODE_UNKNOWN 15 - -static GLuint translate_mode( GLenum mode ) +#define MODE_REPLACE 0 /* r = a0 */ +#define MODE_MODULATE 1 /* r = a0 * a1 */ +#define MODE_ADD 2 /* r = a0 + a1 */ +#define MODE_ADD_SIGNED 3 /* r = a0 + a1 - 0.5 */ +#define MODE_INTERPOLATE 4 /* r = a0 * a2 + a1 * (1 - a2) */ +#define MODE_SUBTRACT 5 /* r = a0 - a1 */ +#define MODE_DOT3_RGB 6 /* r = a0 . a1 */ +#define MODE_DOT3_RGB_EXT 7 /* r = a0 . a1 */ +#define MODE_DOT3_RGBA 8 /* r = a0 . a1 */ +#define MODE_DOT3_RGBA_EXT 9 /* r = a0 . a1 */ +#define MODE_MODULATE_ADD_ATI 10 /* r = a0 * a2 + a1 */ +#define MODE_MODULATE_SIGNED_ADD_ATI 11 /* r = a0 * a2 + a1 - 0.5 */ +#define MODE_MODULATE_SUBTRACT_ATI 12 /* r = a0 * a2 - a1 */ +#define MODE_ADD_PRODUCTS 13 /* r = a0 * a1 + a2 * a3 */ +#define MODE_ADD_PRODUCTS_SIGNED 14 /* r = a0 * a1 + a2 * a3 - 0.5 */ +#define MODE_UNKNOWN 15 + +/** + * Translate GL combiner state into a MODE_x value + */ +static GLuint translate_mode( GLenum envMode, GLenum mode ) { switch (mode) { case GL_REPLACE: return MODE_REPLACE; case GL_MODULATE: return MODE_MODULATE; - case GL_ADD: return MODE_ADD; - case GL_ADD_SIGNED: return MODE_ADD_SIGNED; + case GL_ADD: + if (envMode == GL_COMBINE4_NV) + return MODE_ADD_PRODUCTS; + else + return MODE_ADD; + case GL_ADD_SIGNED: + if (envMode == GL_COMBINE4_NV) + return MODE_ADD_PRODUCTS_SIGNED; + else + return MODE_ADD_SIGNED; case GL_INTERPOLATE: return MODE_INTERPOLATE; case GL_SUBTRACT: return MODE_SUBTRACT; case GL_DOT3_RGB: return MODE_DOT3_RGB; @@ -199,7 +223,9 @@ static GLuint translate_mode( GLenum mode ) case GL_MODULATE_ADD_ATI: return MODE_MODULATE_ADD_ATI; case GL_MODULATE_SIGNED_ADD_ATI: return MODE_MODULATE_SIGNED_ADD_ATI; case GL_MODULATE_SUBTRACT_ATI: return MODE_MODULATE_SUBTRACT_ATI; - default: return MODE_UNKNOWN; + default: + assert(0); + return MODE_UNKNOWN; } } @@ -212,7 +238,11 @@ static GLuint translate_tex_src_bit( GLbitfield bit ) case TEXTURE_RECT_BIT: return TEXTURE_RECT_INDEX; case TEXTURE_3D_BIT: return TEXTURE_3D_INDEX; case TEXTURE_CUBE_BIT: return TEXTURE_CUBE_INDEX; - default: return TEXTURE_UNKNOWN_INDEX; + case TEXTURE_1D_ARRAY_BIT: return TEXTURE_1D_ARRAY_INDEX; + case TEXTURE_2D_ARRAY_BIT: return TEXTURE_2D_ARRAY_INDEX; + default: + assert(0); + return TEXTURE_UNKNOWN_INDEX; } } @@ -248,14 +278,14 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) key->unit[i].NumArgsA = texUnit->_CurrentCombine->_NumArgsA; key->unit[i].ModeRGB = - translate_mode(texUnit->_CurrentCombine->ModeRGB); + translate_mode(texUnit->EnvMode, texUnit->_CurrentCombine->ModeRGB); key->unit[i].ModeA = - translate_mode(texUnit->_CurrentCombine->ModeA); + translate_mode(texUnit->EnvMode, texUnit->_CurrentCombine->ModeA); key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB; key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftA; - for (j=0;j<3;j++) { + for (j = 0; j < MAX_TERMS; j++) { key->unit[i].OptRGB[j].Operand = translate_operand(texUnit->_CurrentCombine->OperandRGB[j]); key->unit[i].OptA[j].Operand = @@ -677,12 +707,17 @@ static struct ureg get_source( struct texenv_fragment_program *p, case SRC_PRIMARY_COLOR: return register_input(p, FRAG_ATTRIB_COL0); + case SRC_ZERO: + return get_zero(p); + case SRC_PREVIOUS: - default: if (is_undef(p->src_previous)) return register_input(p, FRAG_ATTRIB_COL0); else return p->src_previous; + + default: + assert(0); } } @@ -723,7 +758,9 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, case OPR_ONE: return get_one(p); case OPR_SRC_COLOR: + return src; default: + assert(0); return src; } } @@ -772,10 +809,12 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, GLuint mode, const struct mode_opt *opt) { - struct ureg src[3]; + struct ureg src[MAX_TERMS]; struct ureg tmp, half; GLuint i; + assert(nr <= MAX_TERMS); + tmp = undef; /* silence warning (bug 5318) */ for (i = 0; i < nr; i++) @@ -851,7 +890,26 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, /* Arg0 * Arg2 - Arg1 */ emit_arith( p, OPCODE_MAD, dest, mask, 0, src[0], src[2], negate(src[1]) ); return dest; + case MODE_ADD_PRODUCTS: + /* Arg0 * Arg1 + Arg2 * Arg3 */ + { + struct ureg tmp0 = get_temp(p); + emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef ); + emit_arith( p, OPCODE_MAD, dest, mask, saturate, src[2], src[3], tmp0 ); + } + return dest; + case MODE_ADD_PRODUCTS_SIGNED: + /* Arg0 * Arg1 + Arg2 * Arg3 - 0.5 */ + { + struct ureg tmp0 = get_temp(p); + half = get_half(p); + emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef ); + emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[2], src[3], tmp0 ); + emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef ); + } + return dest; default: + assert(0); return src[0]; } } @@ -1007,6 +1065,7 @@ static GLboolean load_texenv_source( struct texenv_fragment_program *p, break; default: + /* not a texture src - do nothing */ break; } -- cgit v1.2.3 From d4757cd02aeebe1a3072f35b5134ad5e278e3a6f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:32:32 -0700 Subject: mesa: enable GL_NV_texture_env_combine4 for sw drivers --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 42de564547..0b4cbec648 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -285,6 +285,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.NV_blend_square = GL_TRUE; /*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/ ctx->Extensions.NV_point_sprite = GL_TRUE; + ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; ctx->Extensions.NV_texture_rectangle = GL_TRUE; /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/ #if FEATURE_NV_vertex_program -- cgit v1.2.3 From 96ee3db6f76f25f8dcf36b365f6be93341d90472 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:32:59 -0700 Subject: intel: enable GL_NV_texture_env_combine4 extension --- src/mesa/drivers/dri/intel/intel_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index a68e217647..f733afb291 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -388,6 +388,7 @@ static const struct dri_extension card_extensions[] = { { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, { "GL_NV_point_sprite", GL_NV_point_sprite_functions }, + { "GL_NV_texture_env_combine4", NULL }, { "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 628b52241b13132e2d4065b653befdf81236e651 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2009 17:37:21 -0700 Subject: i965: init array->Format fields (see bug 19708) --- src/mesa/drivers/dri/i965/brw_metaops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c index 41bfa2e256..84d224387e 100644 --- a/src/mesa/drivers/dri/i965/brw_metaops.c +++ b/src/mesa/drivers/dri/i965/brw_metaops.c @@ -446,6 +446,7 @@ static void meta_draw_quad(struct intel_context *intel, attribs[VERT_ATTRIB_POS] = &pos_array; attribs[VERT_ATTRIB_POS]->Ptr = 0; attribs[VERT_ATTRIB_POS]->Type = GL_FLOAT; + attribs[VERT_ATTRIB_POS]->Format = GL_RGBA; attribs[VERT_ATTRIB_POS]->Enabled = 1; attribs[VERT_ATTRIB_POS]->Size = 3; attribs[VERT_ATTRIB_POS]->StrideB = 3 * sizeof(GLfloat); @@ -457,6 +458,7 @@ static void meta_draw_quad(struct intel_context *intel, attribs[VERT_ATTRIB_COLOR0] = &color_array; attribs[VERT_ATTRIB_COLOR0]->Ptr = (const GLubyte *)sizeof(pos); attribs[VERT_ATTRIB_COLOR0]->Type = GL_UNSIGNED_BYTE; + attribs[VERT_ATTRIB_COLOR0]->Format = GL_RGBA; attribs[VERT_ATTRIB_COLOR0]->Enabled = 1; attribs[VERT_ATTRIB_COLOR0]->Size = 4; attribs[VERT_ATTRIB_COLOR0]->StrideB = 0; -- cgit v1.2.3 From 523febe12ea2aa6992ed1161d962615a40a04eb6 Mon Sep 17 00:00:00 2001 From: Robert Ellison Date: Mon, 26 Jan 2009 10:22:34 -0700 Subject: mesa: add missing texture_put_row_rgb() function in texrender.c The wrap_texture() function doesn't set the renderbuffer PutRowRGB() method, which is used to implement DrawPixels(). This fix adds an implementation of this method. --- src/mesa/main/texrender.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'src') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 4ae13a7b9b..49de6f5b8a 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -194,6 +194,59 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } +/** + * Put row of RGB values into a renderbuffer that wraps a texture image. + */ +static void +texture_put_row_rgb(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + const struct texture_renderbuffer *trb + = (const struct texture_renderbuffer *) rb; + const GLint z = trb->Zoffset; + GLuint i; + + y += trb->Yoffset; + + if (rb->DataType == CHAN_TYPE) { + const GLchan *rgb = (const GLchan *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, rgb); + } + rgb += 3; + } + } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + const GLushort *zValues = (const GLushort *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, zValues + i); + } + } + } + else if (rb->DataType == GL_UNSIGNED_INT) { + const GLuint *zValues = (const GLuint *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, zValues + i); + } + } + } + else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { + const GLuint *zValues = (const GLuint *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff)); + trb->Store(trb->TexImage, x + i, y, z, &flt); + } + } + } + else { + _mesa_problem(ctx, "invalid rb->DataType in texture_put_row"); + } +} + static void texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, @@ -380,6 +433,7 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att) trb->Base.GetRow = texture_get_row; trb->Base.GetValues = texture_get_values; trb->Base.PutRow = texture_put_row; + trb->Base.PutRowRGB = texture_put_row_rgb; trb->Base.PutMonoRow = texture_put_mono_row; trb->Base.PutValues = texture_put_values; trb->Base.PutMonoValues = texture_put_mono_values; -- cgit v1.2.3 From 3b23a8e07d59ff6ee766e7d3eb384137279a5250 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 11:38:30 -0700 Subject: i965: scissor rect was inverted when rendering to texture --- src/mesa/drivers/dri/i965/brw_sf_state.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 242b7047a1..af95020756 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -84,10 +84,20 @@ static void upload_sf_vp(struct brw_context *brw) * Note that the hardware's coordinates are inclusive, while Mesa's min is * inclusive but max is exclusive. */ - sfv.scissor.xmin = ctx->DrawBuffer->_Xmin; - sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1; - sfv.scissor.ymin = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax; - sfv.scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1; + if (intel_rendering_to_texture(ctx)) { + /* texmemory: Y=0=bottom */ + sfv.scissor.xmin = ctx->DrawBuffer->_Xmin; + sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1; + sfv.scissor.ymin = ctx->DrawBuffer->_Ymin; + sfv.scissor.ymax = ctx->DrawBuffer->_Ymax - 1; + } + else { + /* memory: Y=0=top */ + sfv.scissor.xmin = ctx->DrawBuffer->_Xmin; + sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1; + sfv.scissor.ymin = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax; + sfv.scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1; + } dri_bo_unreference(brw->sf.vp_bo); brw->sf.vp_bo = brw_cache_data( &brw->cache, BRW_SF_VP, &sfv, NULL, 0 ); -- cgit v1.2.3 From 6fcebbe719eab1f8e292c8dcd6c3e898b0f8d261 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 11:53:06 -0700 Subject: intel: Move swap-related functions from intel_buffers.c to new intel_swapbuffers.c --- src/mesa/drivers/dri/i915/Makefile | 1 + src/mesa/drivers/dri/i915/intel_swapbuffers.c | 1 + src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/intel_swapbuffers.c | 1 + src/mesa/drivers/dri/intel/intel_buffers.c | 210 --------------------- src/mesa/drivers/dri/intel/intel_buffers.h | 7 - src/mesa/drivers/dri/intel/intel_context.c | 1 + src/mesa/drivers/dri/intel/intel_screen.c | 1 + src/mesa/drivers/dri/intel/intel_screen.h | 5 - src/mesa/drivers/dri/intel/intel_swapbuffers.c | 243 +++++++++++++++++++++++++ src/mesa/drivers/dri/intel/intel_swapbuffers.h | 52 ++++++ 11 files changed, 301 insertions(+), 222 deletions(-) create mode 120000 src/mesa/drivers/dri/i915/intel_swapbuffers.c create mode 120000 src/mesa/drivers/dri/i965/intel_swapbuffers.c create mode 100644 src/mesa/drivers/dri/intel/intel_swapbuffers.c create mode 100644 src/mesa/drivers/dri/intel/intel_swapbuffers.h (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 5652f9e4bd..0abf47b830 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -34,6 +34,7 @@ DRIVER_SOURCES = \ intel_pixel_read.c \ intel_buffers.c \ intel_blit.c \ + intel_swapbuffers.c \ i915_tex.c \ i915_texstate.c \ i915_context.c \ diff --git a/src/mesa/drivers/dri/i915/intel_swapbuffers.c b/src/mesa/drivers/dri/i915/intel_swapbuffers.c new file mode 120000 index 0000000000..148d5215aa --- /dev/null +++ b/src/mesa/drivers/dri/i915/intel_swapbuffers.c @@ -0,0 +1 @@ +../intel/intel_swapbuffers.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index f134d6809a..692a285cbe 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -21,6 +21,7 @@ DRIVER_SOURCES = \ intel_pixel_copy.c \ intel_pixel_draw.c \ intel_state.c \ + intel_swapbuffers.c \ intel_tex.c \ intel_tex_copy.c \ intel_tex_format.c \ diff --git a/src/mesa/drivers/dri/i965/intel_swapbuffers.c b/src/mesa/drivers/dri/i965/intel_swapbuffers.c new file mode 120000 index 0000000000..148d5215aa --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_swapbuffers.c @@ -0,0 +1 @@ +../intel/intel_swapbuffers.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index f1a08c5c10..827cb8a2a7 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -30,18 +30,12 @@ #include "intel_blit.h" #include "intel_buffers.h" #include "intel_chipset.h" -#include "intel_depthstencil.h" #include "intel_fbo.h" #include "intel_regions.h" #include "intel_batchbuffer.h" -#include "intel_reg.h" -#include "main/context.h" #include "main/framebuffer.h" #include "swrast/swrast.h" -#include "utils.h" #include "drirenderbuffer.h" -#include "vblank.h" -#include "i915_drm.h" #define FILE_DEBUG_FLAG DEBUG_BLIT @@ -114,7 +108,6 @@ intel_get_cliprects(struct intel_context *intel, int *x_off, int *y_off) { __DRIdrawablePrivate *dPriv = intel->driDrawable; - struct intel_framebuffer *intel_fb = dPriv->driverPrivate; if (intel->constant_cliprect) { /* FBO or DRI2 rendering, which can just use the fb's size. */ @@ -143,130 +136,6 @@ intel_get_cliprects(struct intel_context *intel, } } -/* - * Correct a drawablePrivate's set of vblank flags WRT the current context. - * When considering multiple crtcs. - */ -GLuint -intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv) -{ - - if (!intel->intelScreen->driScrnPriv->dri2.enabled && - intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { - volatile drm_i915_sarea_t *sarea = intel->sarea; - drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w, - .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h }; - drm_clip_rect_t planeA_rect = { .x1 = sarea->planeA_x, .y1 = sarea->planeA_y, - .x2 = sarea->planeA_x + sarea->planeA_w, - .y2 = sarea->planeA_y + sarea->planeA_h }; - drm_clip_rect_t planeB_rect = { .x1 = sarea->planeB_x, .y1 = sarea->planeB_y, - .x2 = sarea->planeB_x + sarea->planeB_w, - .y2 = sarea->planeB_y + sarea->planeB_h }; - GLint areaA = driIntersectArea( drw_rect, planeA_rect ); - GLint areaB = driIntersectArea( drw_rect, planeB_rect ); - GLuint flags = dPriv->vblFlags; - - /* Update vblank info - */ - if (areaB > areaA || (areaA == areaB && areaB > 0)) { - flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; - } else { - flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; - } - - /* Do the stupid test: Is one of them actually disabled? - */ - if (sarea->planeA_w == 0 || sarea->planeA_h == 0) { - flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; - } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) { - flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; - } - - return flags; - } else { - return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; - } -} - -/** - * This will be called whenever the currently bound window is moved/resized. - * XXX: actually, it seems to NOT be called when the window is only moved (BP). - */ -void -intelWindowMoved(struct intel_context *intel) -{ - GLcontext *ctx = &intel->ctx; - __DRIdrawablePrivate *dPriv = intel->driDrawable; - struct intel_framebuffer *intel_fb = dPriv->driverPrivate; - - if (!intel->intelScreen->driScrnPriv->dri2.enabled && - intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { - GLuint flags = intelFixupVblank(intel, dPriv); - - /* Check to see if we changed pipes */ - if (flags != dPriv->vblFlags && dPriv->vblFlags && - !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) { - int64_t count; - drmVBlank vbl; - int i; - - /* - * Deal with page flipping - */ - vbl.request.type = DRM_VBLANK_ABSOLUTE; - - if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) { - vbl.request.type |= DRM_VBLANK_SECONDARY; - } - - for (i = 0; i < 2; i++) { - if (!intel_fb->color_rb[i] || - (intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <= - (1<<23)) - continue; - - vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending; - drmWaitVBlank(intel->driFd, &vbl); - } - - /* - * Update msc_base from old pipe - */ - driDrawableGetMSC32(dPriv->driScreenPriv, dPriv, &count); - dPriv->msc_base = count; - /* - * Then get new vblank_base and vblSeq values - */ - dPriv->vblFlags = flags; - driGetCurrentVBlank(dPriv); - dPriv->vblank_base = dPriv->vblSeq; - - intel_fb->vbl_waited = dPriv->vblSeq; - - for (i = 0; i < 2; i++) { - if (intel_fb->color_rb[i]) - intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited; - } - } - } else { - dPriv->vblFlags &= ~VBLANK_FLAG_SECONDARY; - } - - /* Update Mesa's notion of window size */ - driUpdateFramebufferSize(ctx, dPriv); - intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */ - - /* Update hardware scissor */ - if (ctx->Driver.Scissor != NULL) { - ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height); - } - - /* Re-calculate viewport related state */ - if (ctx->Driver.DepthRange != NULL) - ctx->Driver.DepthRange( ctx, ctx->Viewport.Near, ctx->Viewport.Far ); -} - /* A true meta version of this would be very simple and additionally @@ -482,85 +351,6 @@ intelClear(GLcontext *ctx, GLbitfield mask) } } -void -intelSwapBuffers(__DRIdrawablePrivate * dPriv) -{ - __DRIscreenPrivate *psp = dPriv->driScreenPriv; - - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - GET_CURRENT_CONTEXT(ctx); - struct intel_context *intel; - - if (ctx == NULL) - return; - - intel = intel_context(ctx); - - if (ctx->Visual.doubleBufferMode) { - GLboolean missed_target; - struct intel_framebuffer *intel_fb = dPriv->driverPrivate; - int64_t ust; - - _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ - - /* - * The old swapping ioctl was incredibly racy, just wait for vblank - * and do the swap ourselves. - */ - driWaitForVBlank(dPriv, &missed_target); - - /* - * Update each buffer's vbl_pending so we don't get too out of - * sync - */ - intel_get_renderbuffer(&intel_fb->Base, - BUFFER_BACK_LEFT)->vbl_pending = dPriv->vblSeq; - intel_get_renderbuffer(&intel_fb->Base, - BUFFER_FRONT_LEFT)->vbl_pending = dPriv->vblSeq; - - intelCopyBuffer(dPriv, NULL); - - intel_fb->swap_count++; - (*psp->systemTime->getUST) (&ust); - if (missed_target) { - intel_fb->swap_missed_count++; - intel_fb->swap_missed_ust = ust - intel_fb->swap_ust; - } - - intel_fb->swap_ust = ust; - } - drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE); - - } - else { - /* XXX this shouldn't be an error but we can't handle it for now */ - fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); - } -} - -void -intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h) -{ - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - struct intel_context *intel = - (struct intel_context *) dPriv->driContextPriv->driverPrivate; - GLcontext *ctx = &intel->ctx; - - if (ctx->Visual.doubleBufferMode) { - drm_clip_rect_t rect; - rect.x1 = x + dPriv->x; - rect.y1 = (dPriv->h - y - h) + dPriv->y; - rect.x2 = rect.x1 + w; - rect.y2 = rect.y1 + h; - _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ - intelCopyBuffer(dPriv, &rect); - } - } - else { - /* XXX this shouldn't be an error but we can't handle it for now */ - fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); - } -} /** diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h index 529e823b4f..97ae8bf738 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.h +++ b/src/mesa/drivers/dri/intel/intel_buffers.h @@ -45,13 +45,6 @@ extern struct intel_region *intel_readbuf_region(struct intel_context *intel); extern struct intel_region *intel_drawbuf_region(struct intel_context *intel); -extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv); - -extern GLuint intelFixupVblank(struct intel_context *intel, - __DRIdrawablePrivate *dPriv); - -extern void intelWindowMoved(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_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 87b0417baa..72610b2454 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -59,6 +59,7 @@ #include "intel_fbo.h" #include "intel_decode.h" #include "intel_bufmgr.h" +#include "intel_swapbuffers.h" #include "drirenderbuffer.h" #include "vblank.h" diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 7042c25564..26ab35306d 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -43,6 +43,7 @@ #include "intel_span.h" #include "intel_fbo.h" #include "intel_chipset.h" +#include "intel_swapbuffers.h" #include "i915_drm.h" #include "i830_dri.h" diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h index fcd0d9c28c..230b2c3461 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.h +++ b/src/mesa/drivers/dri/intel/intel_screen.h @@ -105,11 +105,6 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, __DRIdrawablePrivate * driDrawPriv, __DRIdrawablePrivate * driReadPriv); -extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv); - -extern void -intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h); - extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen); #endif diff --git a/src/mesa/drivers/dri/intel/intel_swapbuffers.c b/src/mesa/drivers/dri/intel/intel_swapbuffers.c new file mode 100644 index 0000000000..c135166435 --- /dev/null +++ b/src/mesa/drivers/dri/intel/intel_swapbuffers.c @@ -0,0 +1,243 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "intel_blit.h" +#include "intel_buffers.h" +#include "intel_swapbuffers.h" +#include "intel_fbo.h" +#include "intel_batchbuffer.h" +#include "drirenderbuffer.h" +#include "vblank.h" +#include "i915_drm.h" + + + +/* + * Correct a drawablePrivate's set of vblank flags WRT the current context. + * When considering multiple crtcs. + */ +GLuint +intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv) +{ + + if (!intel->intelScreen->driScrnPriv->dri2.enabled && + intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { + volatile drm_i915_sarea_t *sarea = intel->sarea; + drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w, + .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h }; + drm_clip_rect_t planeA_rect = { .x1 = sarea->planeA_x, .y1 = sarea->planeA_y, + .x2 = sarea->planeA_x + sarea->planeA_w, + .y2 = sarea->planeA_y + sarea->planeA_h }; + drm_clip_rect_t planeB_rect = { .x1 = sarea->planeB_x, .y1 = sarea->planeB_y, + .x2 = sarea->planeB_x + sarea->planeB_w, + .y2 = sarea->planeB_y + sarea->planeB_h }; + GLint areaA = driIntersectArea( drw_rect, planeA_rect ); + GLint areaB = driIntersectArea( drw_rect, planeB_rect ); + GLuint flags = dPriv->vblFlags; + + /* Update vblank info + */ + if (areaB > areaA || (areaA == areaB && areaB > 0)) { + flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; + } else { + flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; + } + + /* Do the stupid test: Is one of them actually disabled? + */ + if (sarea->planeA_w == 0 || sarea->planeA_h == 0) { + flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; + } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) { + flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; + } + + return flags; + } else { + return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; + } +} + + +void +intelSwapBuffers(__DRIdrawablePrivate * dPriv) +{ + __DRIscreenPrivate *psp = dPriv->driScreenPriv; + + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + GET_CURRENT_CONTEXT(ctx); + struct intel_context *intel; + + if (ctx == NULL) + return; + + intel = intel_context(ctx); + + if (ctx->Visual.doubleBufferMode) { + GLboolean missed_target; + struct intel_framebuffer *intel_fb = dPriv->driverPrivate; + int64_t ust; + + _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ + + /* + * The old swapping ioctl was incredibly racy, just wait for vblank + * and do the swap ourselves. + */ + driWaitForVBlank(dPriv, &missed_target); + + /* + * Update each buffer's vbl_pending so we don't get too out of + * sync + */ + intel_get_renderbuffer(&intel_fb->Base, + BUFFER_BACK_LEFT)->vbl_pending = dPriv->vblSeq; + intel_get_renderbuffer(&intel_fb->Base, + BUFFER_FRONT_LEFT)->vbl_pending = dPriv->vblSeq; + + intelCopyBuffer(dPriv, NULL); + + intel_fb->swap_count++; + (*psp->systemTime->getUST) (&ust); + if (missed_target) { + intel_fb->swap_missed_count++; + intel_fb->swap_missed_ust = ust - intel_fb->swap_ust; + } + + intel_fb->swap_ust = ust; + } + drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE); + + } + else { + /* XXX this shouldn't be an error but we can't handle it for now */ + fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); + } +} + +void +intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + struct intel_context *intel = + (struct intel_context *) dPriv->driContextPriv->driverPrivate; + GLcontext *ctx = &intel->ctx; + + if (ctx->Visual.doubleBufferMode) { + drm_clip_rect_t rect; + rect.x1 = x + dPriv->x; + rect.y1 = (dPriv->h - y - h) + dPriv->y; + rect.x2 = rect.x1 + w; + rect.y2 = rect.y1 + h; + _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ + intelCopyBuffer(dPriv, &rect); + } + } + else { + /* XXX this shouldn't be an error but we can't handle it for now */ + fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); + } +} + + +/** + * This will be called whenever the currently bound window is moved/resized. + * XXX: actually, it seems to NOT be called when the window is only moved (BP). + */ +void +intelWindowMoved(struct intel_context *intel) +{ + GLcontext *ctx = &intel->ctx; + __DRIdrawablePrivate *dPriv = intel->driDrawable; + struct intel_framebuffer *intel_fb = dPriv->driverPrivate; + + if (!intel->intelScreen->driScrnPriv->dri2.enabled && + intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { + GLuint flags = intelFixupVblank(intel, dPriv); + + /* Check to see if we changed pipes */ + if (flags != dPriv->vblFlags && dPriv->vblFlags && + !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) { + int64_t count; + drmVBlank vbl; + int i; + + /* + * Deal with page flipping + */ + vbl.request.type = DRM_VBLANK_ABSOLUTE; + + if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + + for (i = 0; i < 2; i++) { + if (!intel_fb->color_rb[i] || + (intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <= + (1<<23)) + continue; + + vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending; + drmWaitVBlank(intel->driFd, &vbl); + } + + /* + * Update msc_base from old pipe + */ + driDrawableGetMSC32(dPriv->driScreenPriv, dPriv, &count); + dPriv->msc_base = count; + /* + * Then get new vblank_base and vblSeq values + */ + dPriv->vblFlags = flags; + driGetCurrentVBlank(dPriv); + dPriv->vblank_base = dPriv->vblSeq; + + intel_fb->vbl_waited = dPriv->vblSeq; + + for (i = 0; i < 2; i++) { + if (intel_fb->color_rb[i]) + intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited; + } + } + } else { + dPriv->vblFlags &= ~VBLANK_FLAG_SECONDARY; + } + + /* Update Mesa's notion of window size */ + driUpdateFramebufferSize(ctx, dPriv); + intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */ + + /* Update hardware scissor */ + if (ctx->Driver.Scissor != NULL) { + ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, + ctx->Scissor.Width, ctx->Scissor.Height); + } + + /* Re-calculate viewport related state */ + if (ctx->Driver.DepthRange != NULL) + ctx->Driver.DepthRange( ctx, ctx->Viewport.Near, ctx->Viewport.Far ); +} diff --git a/src/mesa/drivers/dri/intel/intel_swapbuffers.h b/src/mesa/drivers/dri/intel/intel_swapbuffers.h new file mode 100644 index 0000000000..75bb6242ff --- /dev/null +++ b/src/mesa/drivers/dri/intel/intel_swapbuffers.h @@ -0,0 +1,52 @@ + +/************************************************************************** + * + * Copyright 2006 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 INTEL_SWAPBUFFERS_H +#define INTEL_SWAPBUFFERS_H + +#include "dri_util.h" +#include "drm.h" + +struct intel_context; +struct intel_framebuffer; + + +extern void +intelSwapBuffers(__DRIdrawablePrivate * dPriv); + +extern void +intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h); + +extern GLuint +intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv); + +extern void +intelWindowMoved(struct intel_context *intel); + + +#endif /* INTEL_SWAPBUFFERS_H */ -- cgit v1.2.3 From 4451eb2e7533a41f67ed21d05a8d9ab5efec77e9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:02:25 -0700 Subject: intel: move glClear-related code into new intel_clear.c file --- src/mesa/drivers/dri/i915/Makefile | 1 + src/mesa/drivers/dri/i915/intel_clear.c | 1 + src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/intel_clear.c | 1 + src/mesa/drivers/dri/intel/intel_buffers.c | 222 ------------------------ src/mesa/drivers/dri/intel/intel_clear.c | 260 +++++++++++++++++++++++++++++ src/mesa/drivers/dri/intel/intel_clear.h | 38 +++++ src/mesa/drivers/dri/intel/intel_context.c | 2 + 8 files changed, 304 insertions(+), 222 deletions(-) create mode 120000 src/mesa/drivers/dri/i915/intel_clear.c create mode 120000 src/mesa/drivers/dri/i965/intel_clear.c create mode 100644 src/mesa/drivers/dri/intel/intel_clear.c create mode 100644 src/mesa/drivers/dri/intel/intel_clear.h (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 0abf47b830..25c8c282cd 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -18,6 +18,7 @@ DRIVER_SOURCES = \ intel_regions.c \ intel_buffer_objects.c \ intel_batchbuffer.c \ + intel_clear.c \ intel_mipmap_tree.c \ i915_tex_layout.c \ intel_tex_layout.c \ diff --git a/src/mesa/drivers/dri/i915/intel_clear.c b/src/mesa/drivers/dri/i915/intel_clear.c new file mode 120000 index 0000000000..9a2a742a0d --- /dev/null +++ b/src/mesa/drivers/dri/i915/intel_clear.c @@ -0,0 +1 @@ +../intel/intel_clear.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 692a285cbe..836ca3ca4a 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -9,6 +9,7 @@ DRIVER_SOURCES = \ intel_blit.c \ intel_buffer_objects.c \ intel_buffers.c \ + intel_clear.c \ intel_context.c \ intel_decode.c \ intel_fbo.c \ diff --git a/src/mesa/drivers/dri/i965/intel_clear.c b/src/mesa/drivers/dri/i965/intel_clear.c new file mode 120000 index 0000000000..9a2a742a0d --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_clear.c @@ -0,0 +1 @@ +../intel/intel_clear.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 827cb8a2a7..13555b2e0e 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -25,19 +25,14 @@ * **************************************************************************/ -#include "intel_screen.h" #include "intel_context.h" -#include "intel_blit.h" #include "intel_buffers.h" -#include "intel_chipset.h" #include "intel_fbo.h" #include "intel_regions.h" #include "intel_batchbuffer.h" #include "main/framebuffer.h" -#include "swrast/swrast.h" #include "drirenderbuffer.h" -#define FILE_DEBUG_FLAG DEBUG_BLIT /** * XXX move this into a new dri/common/cliprects.c file. @@ -137,222 +132,6 @@ intel_get_cliprects(struct intel_context *intel, } - -/* A true meta version of this would be very simple and additionally - * machine independent. Maybe we'll get there one day. - */ -static void -intelClearWithTris(struct intel_context *intel, GLbitfield mask) -{ - GLcontext *ctx = &intel->ctx; - struct gl_framebuffer *fb = ctx->DrawBuffer; - GLuint buf; - - intel->vtbl.install_meta_state(intel); - - /* Back and stencil cliprects are the same. Try and do both - * buffers at once: - */ - if (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH)) { - struct intel_region *backRegion = - intel_get_rb_region(fb, BUFFER_BACK_LEFT); - struct intel_region *depthRegion = - intel_get_rb_region(fb, BUFFER_DEPTH); - - intel->vtbl.meta_draw_region(intel, backRegion, depthRegion); - - if (mask & BUFFER_BIT_BACK_LEFT) - intel->vtbl.meta_color_mask(intel, GL_TRUE); - else - intel->vtbl.meta_color_mask(intel, GL_FALSE); - - if (mask & BUFFER_BIT_STENCIL) - intel->vtbl.meta_stencil_replace(intel, - intel->ctx.Stencil.WriteMask[0], - intel->ctx.Stencil.Clear); - else - intel->vtbl.meta_no_stencil_write(intel); - - if (mask & BUFFER_BIT_DEPTH) - intel->vtbl.meta_depth_replace(intel); - else - intel->vtbl.meta_no_depth_write(intel); - - intel->vtbl.meta_draw_quad(intel, - fb->_Xmin, - fb->_Xmax, - fb->_Ymin, - fb->_Ymax, - intel->ctx.Depth.Clear, - intel->ClearColor8888, - 0, 0, 0, 0); /* texcoords */ - - mask &= ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH); - } - - /* clear the remaining (color) renderbuffers */ - for (buf = 0; buf < BUFFER_COUNT && mask; buf++) { - const GLuint bufBit = 1 << buf; - if (mask & bufBit) { - struct intel_renderbuffer *irbColor = - intel_renderbuffer(fb->Attachment[buf].Renderbuffer); - - ASSERT(irbColor); - - intel->vtbl.meta_no_depth_write(intel); - intel->vtbl.meta_no_stencil_write(intel); - intel->vtbl.meta_color_mask(intel, GL_TRUE); - intel->vtbl.meta_draw_region(intel, irbColor->region, NULL); - - intel->vtbl.meta_draw_quad(intel, - fb->_Xmin, - fb->_Xmax, - fb->_Ymin, - fb->_Ymax, - 0, intel->ClearColor8888, - 0, 0, 0, 0); /* texcoords */ - - mask &= ~bufBit; - } - } - - intel->vtbl.leave_meta_state(intel); -} - -static const char *buffer_names[] = { - [BUFFER_FRONT_LEFT] = "front", - [BUFFER_BACK_LEFT] = "back", - [BUFFER_FRONT_RIGHT] = "front right", - [BUFFER_BACK_RIGHT] = "back right", - [BUFFER_AUX0] = "aux0", - [BUFFER_AUX1] = "aux1", - [BUFFER_AUX2] = "aux2", - [BUFFER_AUX3] = "aux3", - [BUFFER_DEPTH] = "depth", - [BUFFER_STENCIL] = "stencil", - [BUFFER_ACCUM] = "accum", - [BUFFER_COLOR0] = "color0", - [BUFFER_COLOR1] = "color1", - [BUFFER_COLOR2] = "color2", - [BUFFER_COLOR3] = "color3", - [BUFFER_COLOR4] = "color4", - [BUFFER_COLOR5] = "color5", - [BUFFER_COLOR6] = "color6", - [BUFFER_COLOR7] = "color7", -}; - -/** - * Called by ctx->Driver.Clear. - */ -static void -intelClear(GLcontext *ctx, GLbitfield mask) -{ - struct intel_context *intel = intel_context(ctx); - const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); - GLbitfield tri_mask = 0; - GLbitfield blit_mask = 0; - GLbitfield swrast_mask = 0; - struct gl_framebuffer *fb = ctx->DrawBuffer; - GLuint i; - - if (0) - fprintf(stderr, "%s\n", __FUNCTION__); - - /* HW color buffers (front, back, aux, generic FBO, etc) */ - if (colorMask == ~0) { - /* clear all R,G,B,A */ - /* XXX FBO: need to check if colorbuffers are software RBOs! */ - blit_mask |= (mask & BUFFER_BITS_COLOR); - } - else { - /* glColorMask in effect */ - tri_mask |= (mask & BUFFER_BITS_COLOR); - } - - /* HW stencil */ - if (mask & BUFFER_BIT_STENCIL) { - const struct intel_region *stencilRegion - = intel_get_rb_region(fb, BUFFER_STENCIL); - if (stencilRegion) { - /* have hw stencil */ - if (IS_965(intel->intelScreen->deviceID) || - (ctx->Stencil.WriteMask[0] & 0xff) != 0xff) { - /* We have to use the 3D engine if we're clearing a partial mask - * of the stencil buffer, or if we're on a 965 which has a tiled - * depth/stencil buffer in a layout we can't blit to. - */ - tri_mask |= BUFFER_BIT_STENCIL; - } - else { - /* clearing all stencil bits, use blitting */ - blit_mask |= BUFFER_BIT_STENCIL; - } - } - } - - /* HW depth */ - if (mask & BUFFER_BIT_DEPTH) { - /* clear depth with whatever method is used for stencil (see above) */ - if (IS_965(intel->intelScreen->deviceID) || - tri_mask & BUFFER_BIT_STENCIL) - tri_mask |= BUFFER_BIT_DEPTH; - else - blit_mask |= BUFFER_BIT_DEPTH; - } - - /* SW fallback clearing */ - swrast_mask = mask & ~tri_mask & ~blit_mask; - - for (i = 0; i < BUFFER_COUNT; i++) { - GLuint bufBit = 1 << i; - if ((blit_mask | tri_mask) & bufBit) { - if (!fb->Attachment[i].Renderbuffer->ClassID) { - blit_mask &= ~bufBit; - tri_mask &= ~bufBit; - swrast_mask |= bufBit; - } - } - } - - if (blit_mask) { - if (INTEL_DEBUG & DEBUG_BLIT) { - DBG("blit clear:"); - for (i = 0; i < BUFFER_COUNT; i++) { - if (blit_mask & (1 << i)) - DBG(" %s", buffer_names[i]); - } - DBG("\n"); - } - intelClearWithBlit(ctx, blit_mask); - } - - if (tri_mask) { - if (INTEL_DEBUG & DEBUG_BLIT) { - DBG("tri clear:"); - for (i = 0; i < BUFFER_COUNT; i++) { - if (tri_mask & (1 << i)) - DBG(" %s", buffer_names[i]); - } - DBG("\n"); - } - intelClearWithTris(intel, tri_mask); - } - - if (swrast_mask) { - if (INTEL_DEBUG & DEBUG_BLIT) { - DBG("swrast clear:"); - for (i = 0; i < BUFFER_COUNT; i++) { - if (swrast_mask & (1 << i)) - DBG(" %s", buffer_names[i]); - } - DBG("\n"); - } - _swrast_Clear(ctx, swrast_mask); - } -} - - - /** * Update the hardware state for drawing into a window or framebuffer object. * @@ -562,7 +341,6 @@ intelReadBuffer(GLcontext * ctx, GLenum mode) void intelInitBufferFuncs(struct dd_function_table *functions) { - functions->Clear = intelClear; functions->DrawBuffer = intelDrawBuffer; functions->ReadBuffer = intelReadBuffer; } diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c new file mode 100644 index 0000000000..921ec2dc33 --- /dev/null +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -0,0 +1,260 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "intel_clear.h" +#include "intel_context.h" +#include "intel_blit.h" +#include "intel_buffers.h" +#include "intel_chipset.h" +#include "intel_fbo.h" +#include "intel_regions.h" +#include "intel_batchbuffer.h" +#include "main/framebuffer.h" +#include "swrast/swrast.h" +#include "drirenderbuffer.h" + +#define FILE_DEBUG_FLAG DEBUG_BLIT + +/* A true meta version of this would be very simple and additionally + * machine independent. Maybe we'll get there one day. + */ +static void +intelClearWithTris(struct intel_context *intel, GLbitfield mask) +{ + GLcontext *ctx = &intel->ctx; + struct gl_framebuffer *fb = ctx->DrawBuffer; + GLuint buf; + + intel->vtbl.install_meta_state(intel); + + /* Back and stencil cliprects are the same. Try and do both + * buffers at once: + */ + if (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH)) { + struct intel_region *backRegion = + intel_get_rb_region(fb, BUFFER_BACK_LEFT); + struct intel_region *depthRegion = + intel_get_rb_region(fb, BUFFER_DEPTH); + + intel->vtbl.meta_draw_region(intel, backRegion, depthRegion); + + if (mask & BUFFER_BIT_BACK_LEFT) + intel->vtbl.meta_color_mask(intel, GL_TRUE); + else + intel->vtbl.meta_color_mask(intel, GL_FALSE); + + if (mask & BUFFER_BIT_STENCIL) + intel->vtbl.meta_stencil_replace(intel, + intel->ctx.Stencil.WriteMask[0], + intel->ctx.Stencil.Clear); + else + intel->vtbl.meta_no_stencil_write(intel); + + if (mask & BUFFER_BIT_DEPTH) + intel->vtbl.meta_depth_replace(intel); + else + intel->vtbl.meta_no_depth_write(intel); + + intel->vtbl.meta_draw_quad(intel, + fb->_Xmin, + fb->_Xmax, + fb->_Ymin, + fb->_Ymax, + intel->ctx.Depth.Clear, + intel->ClearColor8888, + 0, 0, 0, 0); /* texcoords */ + + mask &= ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH); + } + + /* clear the remaining (color) renderbuffers */ + for (buf = 0; buf < BUFFER_COUNT && mask; buf++) { + const GLuint bufBit = 1 << buf; + if (mask & bufBit) { + struct intel_renderbuffer *irbColor = + intel_renderbuffer(fb->Attachment[buf].Renderbuffer); + + ASSERT(irbColor); + + intel->vtbl.meta_no_depth_write(intel); + intel->vtbl.meta_no_stencil_write(intel); + intel->vtbl.meta_color_mask(intel, GL_TRUE); + intel->vtbl.meta_draw_region(intel, irbColor->region, NULL); + + intel->vtbl.meta_draw_quad(intel, + fb->_Xmin, + fb->_Xmax, + fb->_Ymin, + fb->_Ymax, + 0, intel->ClearColor8888, + 0, 0, 0, 0); /* texcoords */ + + mask &= ~bufBit; + } + } + + intel->vtbl.leave_meta_state(intel); +} + +static const char *buffer_names[] = { + [BUFFER_FRONT_LEFT] = "front", + [BUFFER_BACK_LEFT] = "back", + [BUFFER_FRONT_RIGHT] = "front right", + [BUFFER_BACK_RIGHT] = "back right", + [BUFFER_AUX0] = "aux0", + [BUFFER_AUX1] = "aux1", + [BUFFER_AUX2] = "aux2", + [BUFFER_AUX3] = "aux3", + [BUFFER_DEPTH] = "depth", + [BUFFER_STENCIL] = "stencil", + [BUFFER_ACCUM] = "accum", + [BUFFER_COLOR0] = "color0", + [BUFFER_COLOR1] = "color1", + [BUFFER_COLOR2] = "color2", + [BUFFER_COLOR3] = "color3", + [BUFFER_COLOR4] = "color4", + [BUFFER_COLOR5] = "color5", + [BUFFER_COLOR6] = "color6", + [BUFFER_COLOR7] = "color7", +}; + +/** + * Called by ctx->Driver.Clear. + */ +static void +intelClear(GLcontext *ctx, GLbitfield mask) +{ + struct intel_context *intel = intel_context(ctx); + const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); + GLbitfield tri_mask = 0; + GLbitfield blit_mask = 0; + GLbitfield swrast_mask = 0; + struct gl_framebuffer *fb = ctx->DrawBuffer; + GLuint i; + + if (0) + fprintf(stderr, "%s\n", __FUNCTION__); + + /* HW color buffers (front, back, aux, generic FBO, etc) */ + if (colorMask == ~0) { + /* clear all R,G,B,A */ + /* XXX FBO: need to check if colorbuffers are software RBOs! */ + blit_mask |= (mask & BUFFER_BITS_COLOR); + } + else { + /* glColorMask in effect */ + tri_mask |= (mask & BUFFER_BITS_COLOR); + } + + /* HW stencil */ + if (mask & BUFFER_BIT_STENCIL) { + const struct intel_region *stencilRegion + = intel_get_rb_region(fb, BUFFER_STENCIL); + if (stencilRegion) { + /* have hw stencil */ + if (IS_965(intel->intelScreen->deviceID) || + (ctx->Stencil.WriteMask[0] & 0xff) != 0xff) { + /* We have to use the 3D engine if we're clearing a partial mask + * of the stencil buffer, or if we're on a 965 which has a tiled + * depth/stencil buffer in a layout we can't blit to. + */ + tri_mask |= BUFFER_BIT_STENCIL; + } + else { + /* clearing all stencil bits, use blitting */ + blit_mask |= BUFFER_BIT_STENCIL; + } + } + } + + /* HW depth */ + if (mask & BUFFER_BIT_DEPTH) { + /* clear depth with whatever method is used for stencil (see above) */ + if (IS_965(intel->intelScreen->deviceID) || + tri_mask & BUFFER_BIT_STENCIL) + tri_mask |= BUFFER_BIT_DEPTH; + else + blit_mask |= BUFFER_BIT_DEPTH; + } + + /* SW fallback clearing */ + swrast_mask = mask & ~tri_mask & ~blit_mask; + + for (i = 0; i < BUFFER_COUNT; i++) { + GLuint bufBit = 1 << i; + if ((blit_mask | tri_mask) & bufBit) { + if (!fb->Attachment[i].Renderbuffer->ClassID) { + blit_mask &= ~bufBit; + tri_mask &= ~bufBit; + swrast_mask |= bufBit; + } + } + } + + if (blit_mask) { + if (INTEL_DEBUG & DEBUG_BLIT) { + DBG("blit clear:"); + for (i = 0; i < BUFFER_COUNT; i++) { + if (blit_mask & (1 << i)) + DBG(" %s", buffer_names[i]); + } + DBG("\n"); + } + intelClearWithBlit(ctx, blit_mask); + } + + if (tri_mask) { + if (INTEL_DEBUG & DEBUG_BLIT) { + DBG("tri clear:"); + for (i = 0; i < BUFFER_COUNT; i++) { + if (tri_mask & (1 << i)) + DBG(" %s", buffer_names[i]); + } + DBG("\n"); + } + intelClearWithTris(intel, tri_mask); + } + + if (swrast_mask) { + if (INTEL_DEBUG & DEBUG_BLIT) { + DBG("swrast clear:"); + for (i = 0; i < BUFFER_COUNT; i++) { + if (swrast_mask & (1 << i)) + DBG(" %s", buffer_names[i]); + } + DBG("\n"); + } + _swrast_Clear(ctx, swrast_mask); + } +} + + +void +intelInitClearFuncs(struct dd_function_table *functions) +{ + functions->Clear = intelClear; +} diff --git a/src/mesa/drivers/dri/intel/intel_clear.h b/src/mesa/drivers/dri/intel/intel_clear.h new file mode 100644 index 0000000000..7fd6b310a9 --- /dev/null +++ b/src/mesa/drivers/dri/intel/intel_clear.h @@ -0,0 +1,38 @@ + +/************************************************************************** + * + * Copyright 2006 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 INTEL_CLEAR_H +#define INTEL_CLEAR_H + +struct dd_function_table; + +extern void +intelInitClearFuncs(struct dd_function_table *functions); + + +#endif /* INTEL_CLEAR_H */ diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 72610b2454..265cf15e44 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -53,6 +53,7 @@ #include "intel_tex.h" #include "intel_batchbuffer.h" #include "intel_blit.h" +#include "intel_clear.h" #include "intel_pixel.h" #include "intel_regions.h" #include "intel_buffer_objects.h" @@ -565,6 +566,7 @@ intelInitDriverFunctions(struct dd_function_table *functions) intelInitTextureFuncs(functions); intelInitStateFuncs(functions); + intelInitClearFuncs(functions); intelInitBufferFuncs(functions); intelInitPixelFuncs(functions); } -- cgit v1.2.3 From 4006c5e4526a1cdb910500764590e39d32750967 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:22:04 -0700 Subject: intel: move intelInitExtensions() and related code into new intel_extensions.c --- src/mesa/drivers/dri/i915/Makefile | 3 +- src/mesa/drivers/dri/i915/intel_extensions.c | 1 + src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/intel_extensions.c | 1 + src/mesa/drivers/dri/intel/intel_context.c | 154 ++-------------------- src/mesa/drivers/dri/intel/intel_context.h | 1 - src/mesa/drivers/dri/intel/intel_extensions.c | 180 ++++++++++++++++++++++++++ src/mesa/drivers/dri/intel/intel_extensions.h | 36 ++++++ src/mesa/drivers/dri/intel/intel_screen.c | 1 + 9 files changed, 231 insertions(+), 147 deletions(-) create mode 120000 src/mesa/drivers/dri/i915/intel_extensions.c create mode 120000 src/mesa/drivers/dri/i965/intel_extensions.c create mode 100644 src/mesa/drivers/dri/intel/intel_extensions.c create mode 100644 src/mesa/drivers/dri/intel/intel_extensions.h (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 25c8c282cd..954a7e2af1 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -19,8 +19,8 @@ DRIVER_SOURCES = \ intel_buffer_objects.c \ intel_batchbuffer.c \ intel_clear.c \ + intel_extensions.c \ intel_mipmap_tree.c \ - i915_tex_layout.c \ intel_tex_layout.c \ intel_tex_image.c \ intel_tex_subimage.c \ @@ -37,6 +37,7 @@ DRIVER_SOURCES = \ intel_blit.c \ intel_swapbuffers.c \ i915_tex.c \ + i915_tex_layout.c \ i915_texstate.c \ i915_context.c \ i915_debug.c \ diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c new file mode 120000 index 0000000000..a2f3e8cd20 --- /dev/null +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -0,0 +1 @@ +../intel/intel_extensions.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 836ca3ca4a..b7d52e5db5 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -12,6 +12,7 @@ DRIVER_SOURCES = \ intel_clear.c \ intel_context.c \ intel_decode.c \ + intel_extensions.c \ intel_fbo.c \ intel_mipmap_tree.c \ intel_regions.c \ diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c new file mode 120000 index 0000000000..a2f3e8cd20 --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -0,0 +1 @@ +../intel/intel_extensions.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 265cf15e44..404abb7f0a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -28,9 +28,9 @@ #include "main/glheader.h" #include "main/context.h" -#include "main/matrix.h" -#include "main/simple_list.h" #include "main/extensions.h" +//#include "main/matrix.h" +//#include "main/simple_list.h" #include "main/framebuffer.h" #include "main/imports.h" #include "main/points.h" @@ -39,8 +39,8 @@ #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#include "tnl/t_pipeline.h" -#include "tnl/t_vertex.h" +//#include "tnl/t_pipeline.h" +//#include "tnl/t_vertex.h" #include "drivers/common/driverfuncs.h" @@ -52,8 +52,9 @@ #include "intel_buffers.h" #include "intel_tex.h" #include "intel_batchbuffer.h" -#include "intel_blit.h" +//#include "intel_blit.h" #include "intel_clear.h" +#include "intel_extensions.h" #include "intel_pixel.h" #include "intel_regions.h" #include "intel_buffer_objects.h" @@ -66,43 +67,17 @@ #include "vblank.h" #include "utils.h" #include "xmlpool.h" /* for symbolic values of enum-type options */ + + #ifndef INTEL_DEBUG int INTEL_DEBUG = (0); #endif -#define need_GL_ARB_framebuffer_object -#define need_GL_ARB_multisample -#define need_GL_ARB_occlusion_query -#define need_GL_ARB_point_parameters -#define need_GL_ARB_shader_objects -#define need_GL_ARB_texture_compression -#define need_GL_ARB_vertex_buffer_object -#define need_GL_ARB_vertex_program -#define need_GL_ARB_vertex_shader -#define need_GL_ARB_window_pos -#define need_GL_EXT_blend_color -#define need_GL_EXT_blend_equation_separate -#define need_GL_EXT_blend_func_separate -#define need_GL_EXT_blend_minmax -#define need_GL_EXT_cull_vertex -#define need_GL_EXT_fog_coord -#define need_GL_EXT_framebuffer_object -#define need_GL_EXT_framebuffer_blit -#define need_GL_EXT_multi_draw_arrays -#define need_GL_EXT_point_parameters -#define need_GL_EXT_secondary_color -#define need_GL_EXT_stencil_two_side -#define need_GL_ATI_separate_stencil -#define need_GL_NV_point_sprite -#define need_GL_NV_vertex_program -#define need_GL_VERSION_2_0 -#define need_GL_VERSION_2_1 - -#include "extension_helper.h" #define DRIVER_DATE "20090114" #define DRIVER_DATE_GEM "GEM " DRIVER_DATE + static const GLubyte * intelGetString(GLcontext * ctx, GLenum name) { @@ -345,117 +320,6 @@ intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) ctx->Driver.Viewport = old_viewport; } -/** - * Extension strings exported by the intel driver. - * - * Extensions supported by all chips supported by i830_dri, i915_dri, or - * i965_dri. - */ -static const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, - { "GL_ARB_multitexture", NULL }, - { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, - { "GL_ARB_texture_border_clamp", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, - { "GL_ARB_texture_cube_map", NULL }, - { "GL_ARB_texture_env_add", NULL }, - { "GL_ARB_texture_env_combine", NULL }, - { "GL_ARB_texture_env_crossbar", NULL }, - { "GL_ARB_texture_env_dot3", NULL }, - { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_ARB_texture_rectangle", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, - { "GL_ARB_vertex_program", GL_ARB_vertex_program_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 }, - { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, - { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, - { "GL_EXT_blend_logic_op", NULL }, - { "GL_EXT_blend_subtract", NULL }, - { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions }, - { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, - { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, - { "GL_EXT_packed_depth_stencil", NULL }, - { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, - { "GL_EXT_stencil_wrap", NULL }, - { "GL_EXT_texture_edge_clamp", NULL }, - { "GL_EXT_texture_env_combine", NULL }, - { "GL_EXT_texture_env_dot3", NULL }, - { "GL_EXT_texture_filter_anisotropic", NULL }, - { "GL_EXT_texture_lod_bias", NULL }, - { "GL_3DFX_texture_compression_FXT1", NULL }, - { "GL_APPLE_client_storage", NULL }, - { "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_texture_env_combine4", NULL }, - { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, - { "GL_NV_vertex_program1_1", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, - { NULL, NULL } -}; - -static const struct dri_extension brw_extensions[] = { - { "GL_ARB_depth_texture", NULL }, - { "GL_ARB_draw_buffers", NULL }, - { "GL_ARB_fragment_program", NULL }, - { "GL_ARB_fragment_program_shadow", NULL }, - { "GL_ARB_fragment_shader", NULL }, - { "GL_ARB_framebuffer_object", GL_ARB_framebuffer_object_functions}, - { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_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 }, -#if 0 - /* Support for GLSL 1.20 is currently broken in core Mesa. - */ - { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, -#endif - { "GL_ARB_shadow", 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 }, - { "GL_EXT_vertex_array_bgra", NULL }, - { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, - { "GL_ATI_texture_env_combine3", NULL }, - { NULL, NULL } -}; - -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 } -}; - -/** - * Initializes potential list of extensions if ctx == NULL, or actually enables - * extensions for a context. - */ -void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) -{ - 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); - - if (intel == NULL || intel->ttm) - driInitExtensions(ctx, ttm_extensions, GL_FALSE); - - if (intel == NULL || IS_965(intel->intelScreen->deviceID)) - driInitExtensions(ctx, brw_extensions, GL_FALSE); -} static const struct dri_debug_control debug_control[] = { { "tex", DEBUG_TEXTURE}, diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 048286c196..553abbb560 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -437,7 +437,6 @@ extern void intelFinish(GLcontext * ctx); extern void intelFlush(GLcontext * ctx); extern void intelInitDriverFunctions(struct dd_function_table *functions); -extern void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging); /* ================================================================ diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c new file mode 100644 index 0000000000..23955018bf --- /dev/null +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -0,0 +1,180 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "intel_chipset.h" +#include "intel_context.h" +#include "intel_extensions.h" + + +#define need_GL_ARB_framebuffer_object +#define need_GL_ARB_multisample +#define need_GL_ARB_occlusion_query +#define need_GL_ARB_point_parameters +#define need_GL_ARB_shader_objects +#define need_GL_ARB_texture_compression +#define need_GL_ARB_vertex_buffer_object +#define need_GL_ARB_vertex_program +#define need_GL_ARB_vertex_shader +#define need_GL_ARB_window_pos +#define need_GL_EXT_blend_color +#define need_GL_EXT_blend_equation_separate +#define need_GL_EXT_blend_func_separate +#define need_GL_EXT_blend_minmax +#define need_GL_EXT_cull_vertex +#define need_GL_EXT_fog_coord +#define need_GL_EXT_framebuffer_object +#define need_GL_EXT_framebuffer_blit +#define need_GL_EXT_multi_draw_arrays +#define need_GL_EXT_point_parameters +#define need_GL_EXT_secondary_color +#define need_GL_EXT_stencil_two_side +#define need_GL_ATI_separate_stencil +#define need_GL_NV_point_sprite +#define need_GL_NV_vertex_program +#define need_GL_VERSION_2_0 +#define need_GL_VERSION_2_1 + +#include "extension_helper.h" + + +/** + * Extension strings exported by the intel driver. + * + * Extensions supported by all chips supported by i830_dri, i915_dri, or + * i965_dri. + */ +static const struct dri_extension card_extensions[] = { + { "GL_ARB_multisample", GL_ARB_multisample_functions }, + { "GL_ARB_multitexture", NULL }, + { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, + { "GL_ARB_texture_border_clamp", NULL }, + { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, + { "GL_ARB_texture_cube_map", NULL }, + { "GL_ARB_texture_env_add", NULL }, + { "GL_ARB_texture_env_combine", NULL }, + { "GL_ARB_texture_env_crossbar", NULL }, + { "GL_ARB_texture_env_dot3", NULL }, + { "GL_ARB_texture_mirrored_repeat", NULL }, + { "GL_ARB_texture_rectangle", NULL }, + { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, + { "GL_ARB_vertex_program", GL_ARB_vertex_program_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 }, + { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, + { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, + { "GL_EXT_blend_logic_op", NULL }, + { "GL_EXT_blend_subtract", NULL }, + { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions }, + { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, + { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, + { "GL_EXT_packed_depth_stencil", NULL }, + { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, + { "GL_EXT_stencil_wrap", NULL }, + { "GL_EXT_texture_edge_clamp", NULL }, + { "GL_EXT_texture_env_combine", NULL }, + { "GL_EXT_texture_env_dot3", NULL }, + { "GL_EXT_texture_filter_anisotropic", NULL }, + { "GL_EXT_texture_lod_bias", NULL }, + { "GL_3DFX_texture_compression_FXT1", NULL }, + { "GL_APPLE_client_storage", NULL }, + { "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_texture_env_combine4", NULL }, + { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, + { "GL_NV_vertex_program1_1", NULL }, + { "GL_SGIS_generate_mipmap", NULL }, + { NULL, NULL } +}; + + +/** i965-only extensions */ +static const struct dri_extension brw_extensions[] = { + { "GL_ARB_depth_texture", NULL }, + { "GL_ARB_draw_buffers", NULL }, + { "GL_ARB_fragment_program", NULL }, + { "GL_ARB_fragment_program_shadow", NULL }, + { "GL_ARB_fragment_shader", NULL }, + { "GL_ARB_framebuffer_object", GL_ARB_framebuffer_object_functions}, + { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_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 }, +#if 0 + /* Support for GLSL 1.20 is currently broken in core Mesa. + */ + { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, +#endif + { "GL_ARB_shadow", 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 }, + { "GL_EXT_vertex_array_bgra", NULL }, + { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, + { "GL_ATI_texture_env_combine3", NULL }, + { NULL, NULL } +}; + + +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 } +}; + + +/** + * Initializes potential list of extensions if ctx == NULL, or actually enables + * extensions for a context. + */ +void +intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) +{ + 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); + + if (intel == NULL || intel->ttm) + driInitExtensions(ctx, ttm_extensions, GL_FALSE); + + if (intel == NULL || IS_965(intel->intelScreen->deviceID)) + driInitExtensions(ctx, brw_extensions, GL_FALSE); +} diff --git a/src/mesa/drivers/dri/intel/intel_extensions.h b/src/mesa/drivers/dri/intel/intel_extensions.h new file mode 100644 index 0000000000..97147ecdb0 --- /dev/null +++ b/src/mesa/drivers/dri/intel/intel_extensions.h @@ -0,0 +1,36 @@ +/************************************************************************** + * + * Copyright 2003 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 INTEL_EXTENSIONS_H +#define INTEL_EXTENSIONS_H + + +extern void +intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging); + + +#endif diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 26ab35306d..fc3a6c013e 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -39,6 +39,7 @@ #include "intel_screen.h" #include "intel_buffers.h" +#include "intel_extensions.h" #include "intel_tex.h" #include "intel_span.h" #include "intel_fbo.h" -- cgit v1.2.3 From 66c7f06413cc96a75befa4323677b26a2917ebb3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:33:58 -0700 Subject: intel: remove unused var --- src/mesa/drivers/dri/intel/intel_screen.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index fc3a6c013e..fcac24e18c 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -318,8 +318,6 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, __DRIdrawablePrivate * driDrawPriv, const __GLcontextModes * mesaVis, GLboolean isPixmap) { - intelScreenPrivate *screen = (intelScreenPrivate *) driScrnPriv->private; - if (isPixmap) { return GL_FALSE; /* not implemented */ } -- cgit v1.2.3 From aae2729aeb3f6eed26e8f7673f47f2b978786bb1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:36:17 -0700 Subject: intel: make intelUpdateScreenFromSAREA() static --- src/mesa/drivers/dri/intel/intel_screen.c | 2 +- src/mesa/drivers/dri/intel/intel_screen.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index fcac24e18c..080f65fdd8 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -161,7 +161,7 @@ intelPrintSAREA(const drm_i915_sarea_t * sarea) * A number of the screen parameters are obtained/computed from * information in the SAREA. This function updates those parameters. */ -void +static void intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, drm_i915_sarea_t * sarea) { diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h index 230b2c3461..e1036de4db 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.h +++ b/src/mesa/drivers/dri/intel/intel_screen.h @@ -92,10 +92,6 @@ extern GLboolean intelMapScreenRegions(__DRIscreenPrivate * sPriv); extern void intelUnmapScreenRegions(intelScreenPrivate * intelScreen); -extern void -intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, - drm_i915_sarea_t * sarea); - extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv); extern GLboolean intelUnbindContext(__DRIcontextPrivate * driContextPriv); -- cgit v1.2.3 From d555cdbe3ed6b503863886a2d4499c812bee5acb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:37:14 -0700 Subject: intel: remove old #includes --- src/mesa/drivers/dri/intel/intel_context.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 404abb7f0a..0d9487b99a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -29,8 +29,6 @@ #include "main/glheader.h" #include "main/context.h" #include "main/extensions.h" -//#include "main/matrix.h" -//#include "main/simple_list.h" #include "main/framebuffer.h" #include "main/imports.h" #include "main/points.h" @@ -38,21 +36,14 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" - -//#include "tnl/t_pipeline.h" -//#include "tnl/t_vertex.h" - #include "drivers/common/driverfuncs.h" -#include "intel_screen.h" - #include "i830_dri.h" #include "intel_chipset.h" #include "intel_buffers.h" #include "intel_tex.h" #include "intel_batchbuffer.h" -//#include "intel_blit.h" #include "intel_clear.h" #include "intel_extensions.h" #include "intel_pixel.h" @@ -61,6 +52,7 @@ #include "intel_fbo.h" #include "intel_decode.h" #include "intel_bufmgr.h" +#include "intel_screen.h" #include "intel_swapbuffers.h" #include "drirenderbuffer.h" -- cgit v1.2.3 From 6c244b0f326504ae6add1ddcb407e73c3e72da78 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:38:46 -0700 Subject: intel: #include clean-ups --- src/mesa/drivers/dri/intel/intel_screen.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 080f65fdd8..fe890c390f 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -28,29 +28,27 @@ #include "main/glheader.h" #include "main/context.h" #include "main/framebuffer.h" -#include "main/matrix.h" #include "main/renderbuffer.h" -#include "main/simple_list.h" + #include "utils.h" #include "vblank.h" #include "xmlpool.h" - -#include "intel_screen.h" - +#include "intel_batchbuffer.h" #include "intel_buffers.h" +#include "intel_bufmgr.h" +#include "intel_chipset.h" #include "intel_extensions.h" -#include "intel_tex.h" -#include "intel_span.h" #include "intel_fbo.h" -#include "intel_chipset.h" +#include "intel_regions.h" #include "intel_swapbuffers.h" +#include "intel_screen.h" +#include "intel_span.h" +#include "intel_tex.h" #include "i915_drm.h" #include "i830_dri.h" -#include "intel_regions.h" -#include "intel_batchbuffer.h" -#include "intel_bufmgr.h" + PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN -- cgit v1.2.3 From 36daee1c7bec44b9d3641f056c84b3b2f39fabd9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 12:44:05 -0700 Subject: intel: asst. casts to silence warnings --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++-- src/mesa/drivers/dri/intel/intel_tex.c | 2 +- src/mesa/drivers/dri/intel/intel_tex_image.c | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index f89c0c2ba4..02998d5957 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -296,7 +296,7 @@ copy_array_to_vbo_array( struct brw_context *brw, } else { void *data; char *dest; - const char *src = element->glarray->Ptr; + const unsigned char *src = element->glarray->Ptr; int i; data = _mesa_malloc(dst_stride * element->count); @@ -565,7 +565,7 @@ static void brw_prepare_indices(struct brw_context *brw) */ dri_bo_subdata(bo, offset, ib_size, index_buffer->ptr); } else { - offset = (GLuint)index_buffer->ptr; + offset = (GLuint) (unsigned long) index_buffer->ptr; /* If the index buffer isn't aligned to its element size, we have to * rebase it into a temporary. diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index e64d8a1556..ae0994b183 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -93,7 +93,7 @@ intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage) static void * do_memcpy(void *dest, const void *src, size_t n) { - if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) { + if ((((unsigned long) src) & 63) || (((unsigned long) dest) & 63)) { return __memcpy(dest, src, n); } else diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 2ac7dceb0f..866022d0ce 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -209,7 +209,8 @@ try_pbo_upload(struct intel_context *intel, return GL_FALSE; } - src_offset = (GLuint) pixels; + /* note: potential 64-bit ptr to 32-bit int cast */ + src_offset = (GLuint) (unsigned long) pixels; if (unpack->RowLength > 0) src_stride = unpack->RowLength; @@ -264,7 +265,8 @@ try_pbo_zcopy(struct intel_context *intel, return GL_FALSE; } - src_offset = (GLuint) pixels; + /* note: potential 64-bit ptr to 32-bit int cast */ + src_offset = (GLuint) (unsigned long) pixels; if (unpack->RowLength > 0) src_stride = unpack->RowLength; -- cgit v1.2.3 From 723648f2ee2a8e529063c9da84e9dff9c8c6be99 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 14:01:32 -0700 Subject: intel: save/restore GL matrix mode in intel_meta_set_passthrough_transform(), intel_meta_restore_transform() --- src/mesa/drivers/dri/intel/intel_context.h | 1 + src/mesa/drivers/dri/intel/intel_pixel.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 553abbb560..9a84451e7c 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -168,6 +168,7 @@ struct intel_context GLint saved_vp_x, saved_vp_y; GLsizei saved_vp_width, saved_vp_height; + GLenum saved_matrix_mode; } meta; GLint refcount; diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index cf2f32d384..5e32288844 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -181,6 +181,7 @@ intel_meta_set_passthrough_transform(struct intel_context *intel) intel->meta.saved_vp_y = ctx->Viewport.Y; intel->meta.saved_vp_width = ctx->Viewport.Width; intel->meta.saved_vp_height = ctx->Viewport.Height; + intel->meta.saved_matrix_mode = ctx->Transform.MatrixMode; _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height); @@ -202,6 +203,8 @@ intel_meta_restore_transform(struct intel_context *intel) _mesa_MatrixMode(GL_MODELVIEW); _mesa_PopMatrix(); + _mesa_MatrixMode(intel->meta.saved_matrix_mode); + _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y, intel->meta.saved_vp_width, intel->meta.saved_vp_height); } -- cgit v1.2.3 From 72ee0e247d799c85612c72bbd2257648e11fa583 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 14:22:30 -0700 Subject: intel: check if stencil test is enabled in intel_stencil_drawpixels() --- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 0e83afa645..bb36649dac 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -92,7 +92,7 @@ intel_texture_drawpixels(GLcontext * ctx, return GL_FALSE; } - /* We don't have a way to generate fragments with stencil values which * + /* We don't have a way to generate fragments with stencil values which * will set the resulting stencil value. */ if (format == GL_STENCIL_INDEX) @@ -225,6 +225,10 @@ intel_stencil_drawpixels(GLcontext * ctx, return GL_FALSE; } + /* We don't support stencil testing/ops here */ + if (ctx->Stencil.Enabled) + return GL_FALSE; + /* We use FBOs for our wrapping of the depthbuffer into a color * destination. */ -- cgit v1.2.3 From 84c8b5bbf980deea6322009354c3331dc5d5eb57 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 16:33:45 -0700 Subject: intel: move some driver functions around A step toward consolidating i915/intel_state.c and i965/intel_state.c --- src/mesa/drivers/dri/i915/i915_state.c | 70 ++++++++++++++++++++++++++++++ src/mesa/drivers/dri/i915/intel_state.c | 64 --------------------------- src/mesa/drivers/dri/i965/intel_state.c | 42 ++++++++++-------- src/mesa/drivers/dri/intel/intel_context.h | 1 - 4 files changed, 95 insertions(+), 82 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index a53f120a81..f94de41a57 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -301,6 +301,74 @@ i915DepthMask(GLcontext * ctx, GLboolean flag) i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_WRITE_ENABLE; } + + +/** + * Update the viewport transformation matrix. Depends on: + * - viewport pos/size + * - depthrange + * - window pos/size or FBO size + */ +static void +intelCalcViewport(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + const GLfloat *v = ctx->Viewport._WindowMap.m; + const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; + GLfloat *m = intel->ViewportMatrix.m; + GLfloat yScale, yBias; + + if (ctx->DrawBuffer->Name) { + /* User created FBO */ + struct intel_renderbuffer *irb + = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); + if (irb && !irb->RenderToTexture) { + /* y=0=top */ + yScale = -1.0; + yBias = irb->Base.Height; + } + else { + /* y=0=bottom */ + yScale = 1.0; + yBias = 0.0; + } + } + else { + /* window buffer, y=0=top */ + yScale = -1.0; + yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F; + } + + m[MAT_SX] = v[MAT_SX]; + m[MAT_TX] = v[MAT_TX]; + + m[MAT_SY] = v[MAT_SY] * yScale; + m[MAT_TY] = v[MAT_TY] * yScale + yBias; + + m[MAT_SZ] = v[MAT_SZ] * depthScale; + m[MAT_TZ] = v[MAT_TZ] * depthScale; +} + + +/** Called from ctx->Driver.Viewport() */ +static void +intelViewport(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height) +{ + intelCalcViewport(ctx); + + intel_viewport(ctx, x, y, width, height); +} + + +/** Called from ctx->Driver.DepthRange() */ +static void +intelDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) +{ + intelCalcViewport(ctx); +} + + /* ============================================================= * Polygon stipple * @@ -964,6 +1032,8 @@ i915InitStateFunctions(struct dd_function_table *functions) functions->StencilFuncSeparate = i915StencilFuncSeparate; functions->StencilMaskSeparate = i915StencilMaskSeparate; functions->StencilOpSeparate = i915StencilOpSeparate; + functions->DepthRange = intelDepthRange; + functions->Viewport = intelViewport; } diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c index 4aa43e5f3a..8d96e9baec 100644 --- a/src/mesa/drivers/dri/i915/intel_state.c +++ b/src/mesa/drivers/dri/i915/intel_state.c @@ -35,7 +35,6 @@ #include "intel_screen.h" #include "intel_context.h" -#include "intel_fbo.h" #include "intel_regions.h" #include "swrast/swrast.h" @@ -216,67 +215,6 @@ intelClearColor(GLcontext * ctx, const GLfloat color[4]) } -/** - * Update the viewport transformation matrix. Depends on: - * - viewport pos/size - * - depthrange - * - window pos/size or FBO size - */ -static void -intelCalcViewport(GLcontext * ctx) -{ - struct intel_context *intel = intel_context(ctx); - const GLfloat *v = ctx->Viewport._WindowMap.m; - const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; - GLfloat *m = intel->ViewportMatrix.m; - GLfloat yScale, yBias; - - if (ctx->DrawBuffer->Name) { - /* User created FBO */ - struct intel_renderbuffer *irb - = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); - if (irb && !irb->RenderToTexture) { - /* y=0=top */ - yScale = -1.0; - yBias = irb->Base.Height; - } - else { - /* y=0=bottom */ - yScale = 1.0; - yBias = 0.0; - } - } - else { - /* window buffer, y=0=top */ - yScale = -1.0; - yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F; - } - - m[MAT_SX] = v[MAT_SX]; - m[MAT_TX] = v[MAT_TX]; - - m[MAT_SY] = v[MAT_SY] * yScale; - m[MAT_TY] = v[MAT_TY] * yScale + yBias; - - m[MAT_SZ] = v[MAT_SZ] * depthScale; - m[MAT_TZ] = v[MAT_TZ] * depthScale; -} - -static void -intelViewport(GLcontext * ctx, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - intelCalcViewport(ctx); - - intel_viewport(ctx, x, y, width, height); -} - -static void -intelDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) -{ - intelCalcViewport(ctx); -} - /* Fallback to swrast for select and feedback. */ static void @@ -291,7 +229,5 @@ void intelInitStateFuncs(struct dd_function_table *functions) { functions->RenderMode = intelRenderMode; - functions->Viewport = intelViewport; - functions->DepthRange = intelDepthRange; functions->ClearColor = intelClearColor; } diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c index 67ef5f78c1..0c9c6707f9 100644 --- a/src/mesa/drivers/dri/i965/intel_state.c +++ b/src/mesa/drivers/dri/i965/intel_state.c @@ -38,7 +38,8 @@ #include "intel_regions.h" #include "swrast/swrast.h" -int intel_translate_shadow_compare_func( GLenum func ) +int +intel_translate_shadow_compare_func( GLenum func ) { switch(func) { case GL_NEVER: @@ -63,7 +64,8 @@ int intel_translate_shadow_compare_func( GLenum func ) return COMPAREFUNC_NEVER; } -int intel_translate_compare_func( GLenum func ) +int +intel_translate_compare_func( GLenum func ) { switch(func) { case GL_NEVER: @@ -88,7 +90,8 @@ int intel_translate_compare_func( GLenum func ) return COMPAREFUNC_ALWAYS; } -int intel_translate_stencil_op( GLenum op ) +int +intel_translate_stencil_op( GLenum op ) { switch(op) { case GL_KEEP: @@ -112,7 +115,8 @@ int intel_translate_stencil_op( GLenum op ) } } -int intel_translate_blend_factor( GLenum factor ) +int +intel_translate_blend_factor( GLenum factor ) { switch(factor) { case GL_ZERO: @@ -151,7 +155,8 @@ int intel_translate_blend_factor( GLenum factor ) return BLENDFACT_ZERO; } -int intel_translate_logic_op( GLenum opcode ) +int +intel_translate_logic_op( GLenum opcode ) { switch(opcode) { case GL_CLEAR: @@ -192,33 +197,36 @@ int intel_translate_logic_op( GLenum opcode ) } -static void intelClearColor(GLcontext *ctx, const GLfloat color[4]) +static void +intelClearColor(GLcontext *ctx, const GLfloat color[4]) { struct intel_context *intel = intel_context(ctx); + GLubyte clear[4]; - UNCLAMPED_FLOAT_TO_RGBA_CHAN(intel->clear_chan, color); + 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]); - intel->ClearColor8888 = INTEL_PACKCOLOR8888(intel->clear_chan[0], - intel->clear_chan[1], - intel->clear_chan[2], - intel->clear_chan[3]); - intel->ClearColor565 = INTEL_PACKCOLOR565(intel->clear_chan[0], - intel->clear_chan[1], - intel->clear_chan[2]); + /* 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 intelRenderMode( GLcontext *ctx, GLenum mode ) +static void +intelRenderMode( GLcontext *ctx, GLenum mode ) { struct intel_context *intel = intel_context(ctx); FALLBACK( intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER) ); } -void intelInitStateFuncs( struct dd_function_table *functions ) +void +intelInitStateFuncs( struct dd_function_table *functions ) { functions->RenderMode = intelRenderMode; functions->ClearColor = intelClearColor; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 9a84451e7c..18dc43c4a4 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -210,7 +210,6 @@ struct intel_context char *prevLockFile; int prevLockLine; - GLubyte clear_chan[4]; GLuint ClearColor565; GLuint ClearColor8888; -- cgit v1.2.3 From 69fd665b6491ece8c948784014ab52839c3aeb8b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 16:38:01 -0700 Subject: intel: whitespace changes --- src/mesa/drivers/dri/i915/intel_state.c | 26 ++-- src/mesa/drivers/dri/i965/intel_state.c | 210 ++++++++++++++++---------------- 2 files changed, 118 insertions(+), 118 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c index 8d96e9baec..4ee742377d 100644 --- a/src/mesa/drivers/dri/i915/intel_state.c +++ b/src/mesa/drivers/dri/i915/intel_state.c @@ -38,30 +38,30 @@ #include "intel_regions.h" #include "swrast/swrast.h" -int -intel_translate_shadow_compare_func( GLenum func ) +int +intel_translate_shadow_compare_func(GLenum func) { - switch(func) { + switch (func) { case GL_NEVER: - return COMPAREFUNC_ALWAYS; + return COMPAREFUNC_ALWAYS; case GL_LESS: - return COMPAREFUNC_LEQUAL; + return COMPAREFUNC_LEQUAL; case GL_LEQUAL: return COMPAREFUNC_LESS; case GL_GREATER: - return COMPAREFUNC_GEQUAL; + return COMPAREFUNC_GEQUAL; case GL_GEQUAL: - return COMPAREFUNC_GREATER; + return COMPAREFUNC_GREATER; case GL_NOTEQUAL: - return COMPAREFUNC_EQUAL; + return COMPAREFUNC_EQUAL; case GL_EQUAL: - return COMPAREFUNC_NOTEQUAL; + return COMPAREFUNC_NOTEQUAL; case GL_ALWAYS: - return COMPAREFUNC_NEVER; + return COMPAREFUNC_NEVER; } fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); - return COMPAREFUNC_NEVER; + return COMPAREFUNC_NEVER; } int @@ -198,7 +198,7 @@ intel_translate_logic_op(GLenum opcode) static void -intelClearColor(GLcontext * ctx, const GLfloat color[4]) +intelClearColor(GLcontext *ctx, const GLfloat color[4]) { struct intel_context *intel = intel_context(ctx); GLubyte clear[4]; @@ -218,7 +218,7 @@ intelClearColor(GLcontext * ctx, const GLfloat color[4]) /* Fallback to swrast for select and feedback. */ static void -intelRenderMode(GLcontext * ctx, GLenum mode) +intelRenderMode(GLcontext *ctx, GLenum mode) { struct intel_context *intel = intel_context(ctx); FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER)); diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c index 0c9c6707f9..4ee742377d 100644 --- a/src/mesa/drivers/dri/i965/intel_state.c +++ b/src/mesa/drivers/dri/i965/intel_state.c @@ -39,158 +39,158 @@ #include "swrast/swrast.h" int -intel_translate_shadow_compare_func( GLenum func ) +intel_translate_shadow_compare_func(GLenum func) { - switch(func) { + switch (func) { case GL_NEVER: - return COMPAREFUNC_ALWAYS; + return COMPAREFUNC_ALWAYS; case GL_LESS: - return COMPAREFUNC_LEQUAL; + return COMPAREFUNC_LEQUAL; case GL_LEQUAL: return COMPAREFUNC_LESS; case GL_GREATER: - return COMPAREFUNC_GEQUAL; + return COMPAREFUNC_GEQUAL; case GL_GEQUAL: - return COMPAREFUNC_GREATER; + return COMPAREFUNC_GREATER; case GL_NOTEQUAL: - return COMPAREFUNC_EQUAL; + return COMPAREFUNC_EQUAL; case GL_EQUAL: - return COMPAREFUNC_NOTEQUAL; + return COMPAREFUNC_NOTEQUAL; case GL_ALWAYS: - return COMPAREFUNC_NEVER; + return COMPAREFUNC_NEVER; } fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); - return COMPAREFUNC_NEVER; + return COMPAREFUNC_NEVER; } int -intel_translate_compare_func( GLenum func ) +intel_translate_compare_func(GLenum func) { - switch(func) { - case GL_NEVER: - return COMPAREFUNC_NEVER; - case GL_LESS: - return COMPAREFUNC_LESS; - case GL_LEQUAL: - return COMPAREFUNC_LEQUAL; - case GL_GREATER: - return COMPAREFUNC_GREATER; - case GL_GEQUAL: - return COMPAREFUNC_GEQUAL; - case GL_NOTEQUAL: - return COMPAREFUNC_NOTEQUAL; - case GL_EQUAL: - return COMPAREFUNC_EQUAL; - case GL_ALWAYS: - return COMPAREFUNC_ALWAYS; + switch (func) { + case GL_NEVER: + return COMPAREFUNC_NEVER; + case GL_LESS: + return COMPAREFUNC_LESS; + case GL_LEQUAL: + return COMPAREFUNC_LEQUAL; + case GL_GREATER: + return COMPAREFUNC_GREATER; + case GL_GEQUAL: + return COMPAREFUNC_GEQUAL; + case GL_NOTEQUAL: + return COMPAREFUNC_NOTEQUAL; + case GL_EQUAL: + return COMPAREFUNC_EQUAL; + case GL_ALWAYS: + return COMPAREFUNC_ALWAYS; } fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); - return COMPAREFUNC_ALWAYS; + return COMPAREFUNC_ALWAYS; } int -intel_translate_stencil_op( GLenum op ) +intel_translate_stencil_op(GLenum op) { - switch(op) { - case GL_KEEP: - return STENCILOP_KEEP; - case GL_ZERO: - return STENCILOP_ZERO; - case GL_REPLACE: - return STENCILOP_REPLACE; - case GL_INCR: + switch (op) { + case GL_KEEP: + return STENCILOP_KEEP; + case GL_ZERO: + return STENCILOP_ZERO; + case GL_REPLACE: + return STENCILOP_REPLACE; + case GL_INCR: return STENCILOP_INCRSAT; - case GL_DECR: + case GL_DECR: return STENCILOP_DECRSAT; case GL_INCR_WRAP: - return STENCILOP_INCR; + return STENCILOP_INCR; case GL_DECR_WRAP: - return STENCILOP_DECR; - case GL_INVERT: - return STENCILOP_INVERT; - default: + return STENCILOP_DECR; + case GL_INVERT: + return STENCILOP_INVERT; + default: return STENCILOP_ZERO; } } int -intel_translate_blend_factor( GLenum factor ) +intel_translate_blend_factor(GLenum factor) { - switch(factor) { - case GL_ZERO: - return BLENDFACT_ZERO; - case GL_SRC_ALPHA: - return BLENDFACT_SRC_ALPHA; - case GL_ONE: - return BLENDFACT_ONE; - case GL_SRC_COLOR: - return BLENDFACT_SRC_COLR; - case GL_ONE_MINUS_SRC_COLOR: - return BLENDFACT_INV_SRC_COLR; - case GL_DST_COLOR: - return BLENDFACT_DST_COLR; - case GL_ONE_MINUS_DST_COLOR: - return BLENDFACT_INV_DST_COLR; + switch (factor) { + case GL_ZERO: + return BLENDFACT_ZERO; + case GL_SRC_ALPHA: + return BLENDFACT_SRC_ALPHA; + case GL_ONE: + return BLENDFACT_ONE; + case GL_SRC_COLOR: + return BLENDFACT_SRC_COLR; + case GL_ONE_MINUS_SRC_COLOR: + return BLENDFACT_INV_SRC_COLR; + case GL_DST_COLOR: + return BLENDFACT_DST_COLR; + case GL_ONE_MINUS_DST_COLOR: + return BLENDFACT_INV_DST_COLR; case GL_ONE_MINUS_SRC_ALPHA: - return BLENDFACT_INV_SRC_ALPHA; - case GL_DST_ALPHA: - return BLENDFACT_DST_ALPHA; + return BLENDFACT_INV_SRC_ALPHA; + case GL_DST_ALPHA: + return BLENDFACT_DST_ALPHA; case GL_ONE_MINUS_DST_ALPHA: - return BLENDFACT_INV_DST_ALPHA; - case GL_SRC_ALPHA_SATURATE: + return BLENDFACT_INV_DST_ALPHA; + case GL_SRC_ALPHA_SATURATE: return BLENDFACT_SRC_ALPHA_SATURATE; case GL_CONSTANT_COLOR: - return BLENDFACT_CONST_COLOR; + return BLENDFACT_CONST_COLOR; case GL_ONE_MINUS_CONSTANT_COLOR: return BLENDFACT_INV_CONST_COLOR; case GL_CONSTANT_ALPHA: - return BLENDFACT_CONST_ALPHA; + return BLENDFACT_CONST_ALPHA; case GL_ONE_MINUS_CONSTANT_ALPHA: return BLENDFACT_INV_CONST_ALPHA; } - + fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor); return BLENDFACT_ZERO; } int -intel_translate_logic_op( GLenum opcode ) +intel_translate_logic_op(GLenum opcode) { - switch(opcode) { - case GL_CLEAR: - return LOGICOP_CLEAR; - case GL_AND: - return LOGICOP_AND; - case GL_AND_REVERSE: - return LOGICOP_AND_RVRSE; - case GL_COPY: - return LOGICOP_COPY; - case GL_COPY_INVERTED: - return LOGICOP_COPY_INV; - case GL_AND_INVERTED: - return LOGICOP_AND_INV; - case GL_NOOP: - return LOGICOP_NOOP; - case GL_XOR: - return LOGICOP_XOR; - case GL_OR: - return LOGICOP_OR; - case GL_OR_INVERTED: - return LOGICOP_OR_INV; - case GL_NOR: - return LOGICOP_NOR; - case GL_EQUIV: - return LOGICOP_EQUIV; - case GL_INVERT: - return LOGICOP_INV; - case GL_OR_REVERSE: - return LOGICOP_OR_RVRSE; - case GL_NAND: - return LOGICOP_NAND; - case GL_SET: - return LOGICOP_SET; + switch (opcode) { + case GL_CLEAR: + return LOGICOP_CLEAR; + case GL_AND: + return LOGICOP_AND; + case GL_AND_REVERSE: + return LOGICOP_AND_RVRSE; + case GL_COPY: + return LOGICOP_COPY; + case GL_COPY_INVERTED: + return LOGICOP_COPY_INV; + case GL_AND_INVERTED: + return LOGICOP_AND_INV; + case GL_NOOP: + return LOGICOP_NOOP; + case GL_XOR: + return LOGICOP_XOR; + case GL_OR: + return LOGICOP_OR; + case GL_OR_INVERTED: + return LOGICOP_OR_INV; + case GL_NOR: + return LOGICOP_NOR; + case GL_EQUIV: + return LOGICOP_EQUIV; + case GL_INVERT: + return LOGICOP_INV; + case GL_OR_REVERSE: + return LOGICOP_OR_RVRSE; + case GL_NAND: + return LOGICOP_NAND; + case GL_SET: + return LOGICOP_SET; default: return LOGICOP_SET; } @@ -218,15 +218,15 @@ intelClearColor(GLcontext *ctx, const GLfloat color[4]) /* Fallback to swrast for select and feedback. */ static void -intelRenderMode( GLcontext *ctx, GLenum mode ) +intelRenderMode(GLcontext *ctx, GLenum mode) { struct intel_context *intel = intel_context(ctx); - FALLBACK( intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER) ); + FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER)); } void -intelInitStateFuncs( struct dd_function_table *functions ) +intelInitStateFuncs(struct dd_function_table *functions) { functions->RenderMode = intelRenderMode; functions->ClearColor = intelClearColor; -- cgit v1.2.3 From d0c8ed73cc6f2b08906a18a8d60e3bc364e5e48f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 16:40:08 -0700 Subject: intel: replace i915/intel_state.c and i965/intel_state.c with shared file --- src/mesa/drivers/dri/i915/intel_state.c | 234 +------------------------------ src/mesa/drivers/dri/i965/intel_state.c | 234 +------------------------------ src/mesa/drivers/dri/intel/intel_state.c | 233 ++++++++++++++++++++++++++++++ 3 files changed, 235 insertions(+), 466 deletions(-) mode change 100644 => 120000 src/mesa/drivers/dri/i915/intel_state.c mode change 100644 => 120000 src/mesa/drivers/dri/i965/intel_state.c create mode 100644 src/mesa/drivers/dri/intel/intel_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c deleted file mode 100644 index 4ee742377d..0000000000 --- a/src/mesa/drivers/dri/i915/intel_state.c +++ /dev/null @@ -1,233 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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. - * - **************************************************************************/ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/enums.h" -#include "main/colormac.h" -#include "main/dd.h" - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_regions.h" -#include "swrast/swrast.h" - -int -intel_translate_shadow_compare_func(GLenum func) -{ - switch (func) { - case GL_NEVER: - return COMPAREFUNC_ALWAYS; - case GL_LESS: - return COMPAREFUNC_LEQUAL; - case GL_LEQUAL: - return COMPAREFUNC_LESS; - case GL_GREATER: - return COMPAREFUNC_GEQUAL; - case GL_GEQUAL: - return COMPAREFUNC_GREATER; - case GL_NOTEQUAL: - return COMPAREFUNC_EQUAL; - case GL_EQUAL: - return COMPAREFUNC_NOTEQUAL; - case GL_ALWAYS: - return COMPAREFUNC_NEVER; - } - - fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); - return COMPAREFUNC_NEVER; -} - -int -intel_translate_compare_func(GLenum func) -{ - switch (func) { - case GL_NEVER: - return COMPAREFUNC_NEVER; - case GL_LESS: - return COMPAREFUNC_LESS; - case GL_LEQUAL: - return COMPAREFUNC_LEQUAL; - case GL_GREATER: - return COMPAREFUNC_GREATER; - case GL_GEQUAL: - return COMPAREFUNC_GEQUAL; - case GL_NOTEQUAL: - return COMPAREFUNC_NOTEQUAL; - case GL_EQUAL: - return COMPAREFUNC_EQUAL; - case GL_ALWAYS: - return COMPAREFUNC_ALWAYS; - } - - fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); - return COMPAREFUNC_ALWAYS; -} - -int -intel_translate_stencil_op(GLenum op) -{ - switch (op) { - case GL_KEEP: - return STENCILOP_KEEP; - case GL_ZERO: - return STENCILOP_ZERO; - case GL_REPLACE: - return STENCILOP_REPLACE; - case GL_INCR: - return STENCILOP_INCRSAT; - case GL_DECR: - return STENCILOP_DECRSAT; - case GL_INCR_WRAP: - return STENCILOP_INCR; - case GL_DECR_WRAP: - return STENCILOP_DECR; - case GL_INVERT: - return STENCILOP_INVERT; - default: - return STENCILOP_ZERO; - } -} - -int -intel_translate_blend_factor(GLenum factor) -{ - switch (factor) { - case GL_ZERO: - return BLENDFACT_ZERO; - case GL_SRC_ALPHA: - return BLENDFACT_SRC_ALPHA; - case GL_ONE: - return BLENDFACT_ONE; - case GL_SRC_COLOR: - return BLENDFACT_SRC_COLR; - case GL_ONE_MINUS_SRC_COLOR: - return BLENDFACT_INV_SRC_COLR; - case GL_DST_COLOR: - return BLENDFACT_DST_COLR; - case GL_ONE_MINUS_DST_COLOR: - return BLENDFACT_INV_DST_COLR; - case GL_ONE_MINUS_SRC_ALPHA: - return BLENDFACT_INV_SRC_ALPHA; - case GL_DST_ALPHA: - return BLENDFACT_DST_ALPHA; - case GL_ONE_MINUS_DST_ALPHA: - return BLENDFACT_INV_DST_ALPHA; - case GL_SRC_ALPHA_SATURATE: - return BLENDFACT_SRC_ALPHA_SATURATE; - case GL_CONSTANT_COLOR: - return BLENDFACT_CONST_COLOR; - case GL_ONE_MINUS_CONSTANT_COLOR: - return BLENDFACT_INV_CONST_COLOR; - case GL_CONSTANT_ALPHA: - return BLENDFACT_CONST_ALPHA; - case GL_ONE_MINUS_CONSTANT_ALPHA: - return BLENDFACT_INV_CONST_ALPHA; - } - - fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor); - return BLENDFACT_ZERO; -} - -int -intel_translate_logic_op(GLenum opcode) -{ - switch (opcode) { - case GL_CLEAR: - return LOGICOP_CLEAR; - case GL_AND: - return LOGICOP_AND; - case GL_AND_REVERSE: - return LOGICOP_AND_RVRSE; - case GL_COPY: - return LOGICOP_COPY; - case GL_COPY_INVERTED: - return LOGICOP_COPY_INV; - case GL_AND_INVERTED: - return LOGICOP_AND_INV; - case GL_NOOP: - return LOGICOP_NOOP; - case GL_XOR: - return LOGICOP_XOR; - case GL_OR: - return LOGICOP_OR; - case GL_OR_INVERTED: - return LOGICOP_OR_INV; - case GL_NOR: - return LOGICOP_NOR; - case GL_EQUIV: - return LOGICOP_EQUIV; - case GL_INVERT: - return LOGICOP_INV; - case GL_OR_REVERSE: - return LOGICOP_OR_RVRSE; - case GL_NAND: - return LOGICOP_NAND; - case GL_SET: - return LOGICOP_SET; - default: - return LOGICOP_SET; - } -} - - -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 -intelRenderMode(GLcontext *ctx, GLenum mode) -{ - struct intel_context *intel = intel_context(ctx); - FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER)); -} - - -void -intelInitStateFuncs(struct dd_function_table *functions) -{ - functions->RenderMode = intelRenderMode; - functions->ClearColor = intelClearColor; -} diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c new file mode 120000 index 0000000000..519672fc35 --- /dev/null +++ b/src/mesa/drivers/dri/i915/intel_state.c @@ -0,0 +1 @@ +../intel/intel_state.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c deleted file mode 100644 index 4ee742377d..0000000000 --- a/src/mesa/drivers/dri/i965/intel_state.c +++ /dev/null @@ -1,233 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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. - * - **************************************************************************/ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/enums.h" -#include "main/colormac.h" -#include "main/dd.h" - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_regions.h" -#include "swrast/swrast.h" - -int -intel_translate_shadow_compare_func(GLenum func) -{ - switch (func) { - case GL_NEVER: - return COMPAREFUNC_ALWAYS; - case GL_LESS: - return COMPAREFUNC_LEQUAL; - case GL_LEQUAL: - return COMPAREFUNC_LESS; - case GL_GREATER: - return COMPAREFUNC_GEQUAL; - case GL_GEQUAL: - return COMPAREFUNC_GREATER; - case GL_NOTEQUAL: - return COMPAREFUNC_EQUAL; - case GL_EQUAL: - return COMPAREFUNC_NOTEQUAL; - case GL_ALWAYS: - return COMPAREFUNC_NEVER; - } - - fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); - return COMPAREFUNC_NEVER; -} - -int -intel_translate_compare_func(GLenum func) -{ - switch (func) { - case GL_NEVER: - return COMPAREFUNC_NEVER; - case GL_LESS: - return COMPAREFUNC_LESS; - case GL_LEQUAL: - return COMPAREFUNC_LEQUAL; - case GL_GREATER: - return COMPAREFUNC_GREATER; - case GL_GEQUAL: - return COMPAREFUNC_GEQUAL; - case GL_NOTEQUAL: - return COMPAREFUNC_NOTEQUAL; - case GL_EQUAL: - return COMPAREFUNC_EQUAL; - case GL_ALWAYS: - return COMPAREFUNC_ALWAYS; - } - - fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); - return COMPAREFUNC_ALWAYS; -} - -int -intel_translate_stencil_op(GLenum op) -{ - switch (op) { - case GL_KEEP: - return STENCILOP_KEEP; - case GL_ZERO: - return STENCILOP_ZERO; - case GL_REPLACE: - return STENCILOP_REPLACE; - case GL_INCR: - return STENCILOP_INCRSAT; - case GL_DECR: - return STENCILOP_DECRSAT; - case GL_INCR_WRAP: - return STENCILOP_INCR; - case GL_DECR_WRAP: - return STENCILOP_DECR; - case GL_INVERT: - return STENCILOP_INVERT; - default: - return STENCILOP_ZERO; - } -} - -int -intel_translate_blend_factor(GLenum factor) -{ - switch (factor) { - case GL_ZERO: - return BLENDFACT_ZERO; - case GL_SRC_ALPHA: - return BLENDFACT_SRC_ALPHA; - case GL_ONE: - return BLENDFACT_ONE; - case GL_SRC_COLOR: - return BLENDFACT_SRC_COLR; - case GL_ONE_MINUS_SRC_COLOR: - return BLENDFACT_INV_SRC_COLR; - case GL_DST_COLOR: - return BLENDFACT_DST_COLR; - case GL_ONE_MINUS_DST_COLOR: - return BLENDFACT_INV_DST_COLR; - case GL_ONE_MINUS_SRC_ALPHA: - return BLENDFACT_INV_SRC_ALPHA; - case GL_DST_ALPHA: - return BLENDFACT_DST_ALPHA; - case GL_ONE_MINUS_DST_ALPHA: - return BLENDFACT_INV_DST_ALPHA; - case GL_SRC_ALPHA_SATURATE: - return BLENDFACT_SRC_ALPHA_SATURATE; - case GL_CONSTANT_COLOR: - return BLENDFACT_CONST_COLOR; - case GL_ONE_MINUS_CONSTANT_COLOR: - return BLENDFACT_INV_CONST_COLOR; - case GL_CONSTANT_ALPHA: - return BLENDFACT_CONST_ALPHA; - case GL_ONE_MINUS_CONSTANT_ALPHA: - return BLENDFACT_INV_CONST_ALPHA; - } - - fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor); - return BLENDFACT_ZERO; -} - -int -intel_translate_logic_op(GLenum opcode) -{ - switch (opcode) { - case GL_CLEAR: - return LOGICOP_CLEAR; - case GL_AND: - return LOGICOP_AND; - case GL_AND_REVERSE: - return LOGICOP_AND_RVRSE; - case GL_COPY: - return LOGICOP_COPY; - case GL_COPY_INVERTED: - return LOGICOP_COPY_INV; - case GL_AND_INVERTED: - return LOGICOP_AND_INV; - case GL_NOOP: - return LOGICOP_NOOP; - case GL_XOR: - return LOGICOP_XOR; - case GL_OR: - return LOGICOP_OR; - case GL_OR_INVERTED: - return LOGICOP_OR_INV; - case GL_NOR: - return LOGICOP_NOR; - case GL_EQUIV: - return LOGICOP_EQUIV; - case GL_INVERT: - return LOGICOP_INV; - case GL_OR_REVERSE: - return LOGICOP_OR_RVRSE; - case GL_NAND: - return LOGICOP_NAND; - case GL_SET: - return LOGICOP_SET; - default: - return LOGICOP_SET; - } -} - - -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 -intelRenderMode(GLcontext *ctx, GLenum mode) -{ - struct intel_context *intel = intel_context(ctx); - FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER)); -} - - -void -intelInitStateFuncs(struct dd_function_table *functions) -{ - functions->RenderMode = intelRenderMode; - functions->ClearColor = intelClearColor; -} diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c new file mode 120000 index 0000000000..519672fc35 --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_state.c @@ -0,0 +1 @@ +../intel/intel_state.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_state.c b/src/mesa/drivers/dri/intel/intel_state.c new file mode 100644 index 0000000000..4ee742377d --- /dev/null +++ b/src/mesa/drivers/dri/intel/intel_state.c @@ -0,0 +1,233 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/dd.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_regions.h" +#include "swrast/swrast.h" + +int +intel_translate_shadow_compare_func(GLenum func) +{ + switch (func) { + case GL_NEVER: + return COMPAREFUNC_ALWAYS; + case GL_LESS: + return COMPAREFUNC_LEQUAL; + case GL_LEQUAL: + return COMPAREFUNC_LESS; + case GL_GREATER: + return COMPAREFUNC_GEQUAL; + case GL_GEQUAL: + return COMPAREFUNC_GREATER; + case GL_NOTEQUAL: + return COMPAREFUNC_EQUAL; + case GL_EQUAL: + return COMPAREFUNC_NOTEQUAL; + case GL_ALWAYS: + return COMPAREFUNC_NEVER; + } + + fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); + return COMPAREFUNC_NEVER; +} + +int +intel_translate_compare_func(GLenum func) +{ + switch (func) { + case GL_NEVER: + return COMPAREFUNC_NEVER; + case GL_LESS: + return COMPAREFUNC_LESS; + case GL_LEQUAL: + return COMPAREFUNC_LEQUAL; + case GL_GREATER: + return COMPAREFUNC_GREATER; + case GL_GEQUAL: + return COMPAREFUNC_GEQUAL; + case GL_NOTEQUAL: + return COMPAREFUNC_NOTEQUAL; + case GL_EQUAL: + return COMPAREFUNC_EQUAL; + case GL_ALWAYS: + return COMPAREFUNC_ALWAYS; + } + + fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); + return COMPAREFUNC_ALWAYS; +} + +int +intel_translate_stencil_op(GLenum op) +{ + switch (op) { + case GL_KEEP: + return STENCILOP_KEEP; + case GL_ZERO: + return STENCILOP_ZERO; + case GL_REPLACE: + return STENCILOP_REPLACE; + case GL_INCR: + return STENCILOP_INCRSAT; + case GL_DECR: + return STENCILOP_DECRSAT; + case GL_INCR_WRAP: + return STENCILOP_INCR; + case GL_DECR_WRAP: + return STENCILOP_DECR; + case GL_INVERT: + return STENCILOP_INVERT; + default: + return STENCILOP_ZERO; + } +} + +int +intel_translate_blend_factor(GLenum factor) +{ + switch (factor) { + case GL_ZERO: + return BLENDFACT_ZERO; + case GL_SRC_ALPHA: + return BLENDFACT_SRC_ALPHA; + case GL_ONE: + return BLENDFACT_ONE; + case GL_SRC_COLOR: + return BLENDFACT_SRC_COLR; + case GL_ONE_MINUS_SRC_COLOR: + return BLENDFACT_INV_SRC_COLR; + case GL_DST_COLOR: + return BLENDFACT_DST_COLR; + case GL_ONE_MINUS_DST_COLOR: + return BLENDFACT_INV_DST_COLR; + case GL_ONE_MINUS_SRC_ALPHA: + return BLENDFACT_INV_SRC_ALPHA; + case GL_DST_ALPHA: + return BLENDFACT_DST_ALPHA; + case GL_ONE_MINUS_DST_ALPHA: + return BLENDFACT_INV_DST_ALPHA; + case GL_SRC_ALPHA_SATURATE: + return BLENDFACT_SRC_ALPHA_SATURATE; + case GL_CONSTANT_COLOR: + return BLENDFACT_CONST_COLOR; + case GL_ONE_MINUS_CONSTANT_COLOR: + return BLENDFACT_INV_CONST_COLOR; + case GL_CONSTANT_ALPHA: + return BLENDFACT_CONST_ALPHA; + case GL_ONE_MINUS_CONSTANT_ALPHA: + return BLENDFACT_INV_CONST_ALPHA; + } + + fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor); + return BLENDFACT_ZERO; +} + +int +intel_translate_logic_op(GLenum opcode) +{ + switch (opcode) { + case GL_CLEAR: + return LOGICOP_CLEAR; + case GL_AND: + return LOGICOP_AND; + case GL_AND_REVERSE: + return LOGICOP_AND_RVRSE; + case GL_COPY: + return LOGICOP_COPY; + case GL_COPY_INVERTED: + return LOGICOP_COPY_INV; + case GL_AND_INVERTED: + return LOGICOP_AND_INV; + case GL_NOOP: + return LOGICOP_NOOP; + case GL_XOR: + return LOGICOP_XOR; + case GL_OR: + return LOGICOP_OR; + case GL_OR_INVERTED: + return LOGICOP_OR_INV; + case GL_NOR: + return LOGICOP_NOR; + case GL_EQUIV: + return LOGICOP_EQUIV; + case GL_INVERT: + return LOGICOP_INV; + case GL_OR_REVERSE: + return LOGICOP_OR_RVRSE; + case GL_NAND: + return LOGICOP_NAND; + case GL_SET: + return LOGICOP_SET; + default: + return LOGICOP_SET; + } +} + + +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 +intelRenderMode(GLcontext *ctx, GLenum mode) +{ + struct intel_context *intel = intel_context(ctx); + FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER)); +} + + +void +intelInitStateFuncs(struct dd_function_table *functions) +{ + functions->RenderMode = intelRenderMode; + functions->ClearColor = intelClearColor; +} -- cgit v1.2.3 From 3cf7f9887ae9f26c006f88071cd69343e2c591e4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Jan 2009 17:23:59 -0700 Subject: i915: rename some functions --- src/mesa/drivers/dri/i915/i915_state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index f94de41a57..b0334d9d79 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -352,7 +352,7 @@ intelCalcViewport(GLcontext * ctx) /** Called from ctx->Driver.Viewport() */ static void -intelViewport(GLcontext * ctx, +i915Viewport(GLcontext * ctx, GLint x, GLint y, GLsizei width, GLsizei height) { intelCalcViewport(ctx); @@ -363,7 +363,7 @@ intelViewport(GLcontext * ctx, /** Called from ctx->Driver.DepthRange() */ static void -intelDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) +i915DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) { intelCalcViewport(ctx); } @@ -1032,8 +1032,8 @@ i915InitStateFunctions(struct dd_function_table *functions) functions->StencilFuncSeparate = i915StencilFuncSeparate; functions->StencilMaskSeparate = i915StencilMaskSeparate; functions->StencilOpSeparate = i915StencilOpSeparate; - functions->DepthRange = intelDepthRange; - functions->Viewport = intelViewport; + functions->DepthRange = i915DepthRange; + functions->Viewport = i915Viewport; } -- cgit v1.2.3 From 38768dbc76f4963587a90823f73a1a2d981f63e6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Jan 2009 09:49:27 -0700 Subject: mesa: move call to _mesa_update_framebuffer_visual() Update the visual info in the _mesa_test_framebuffer_completeness() function when we've determined the FBO to be "complete". Fixes regression seen in progs/demos/shadowtex.c --- src/mesa/main/fbobject.c | 3 +++ src/mesa/main/framebuffer.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index c16ac0f009..1a191cd288 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -630,6 +630,9 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) */ fb->Width = minWidth; fb->Height = minHeight; + + /* finally, update the visual info for the framebuffer */ + _mesa_update_framebuffer_visual(fb); } } diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 2d7e3b0503..52fd3c9d81 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -795,7 +795,6 @@ update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) */ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE) { _mesa_test_framebuffer_completeness(ctx, fb); - _mesa_update_framebuffer_visual(fb); } } -- cgit v1.2.3 From 318e53a4bf27499935c874f475af111ffaa71fdd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Jan 2009 11:07:21 -0700 Subject: mesa: refactor glTexParameter code --- src/mesa/main/texparam.c | 827 +++++++++++++++++++++++++++-------------------- 1 file changed, 480 insertions(+), 347 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a9e752a637..2322d84975 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 1999-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"), @@ -72,404 +73,536 @@ validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) } -void GLAPIENTRY -_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) -{ - _mesa_TexParameterfv(target, pname, ¶m); -} - - -void GLAPIENTRY -_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) +/** + * Get current texture object for given target. + * Return NULL if any error. + */ +static struct gl_texture_object * +get_texobj(GLcontext *ctx, GLenum target) { - const GLenum eparam = (GLenum) (GLint) params[0]; struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexParameter %s %s %.1f(%s)...\n", - _mesa_lookup_enum_by_nr(target), - _mesa_lookup_enum_by_nr(pname), - *params, - _mesa_lookup_enum_by_nr(eparam)); if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameterfv(current unit)"); - return; + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(current unit)"); + return NULL; } texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; switch (target) { - case GL_TEXTURE_1D: - texObj = texUnit->Current1D; - break; - case GL_TEXTURE_2D: - texObj = texUnit->Current2D; - break; - case GL_TEXTURE_3D: - texObj = texUnit->Current3D; - break; - case GL_TEXTURE_CUBE_MAP: - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->CurrentCubeMap; - break; - case GL_TEXTURE_RECTANGLE_NV: - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->CurrentRect; - break; - case GL_TEXTURE_1D_ARRAY_EXT: - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->Current1DArray; - break; - case GL_TEXTURE_2D_ARRAY_EXT: - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->Current2DArray; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; + case GL_TEXTURE_1D: + return texUnit->Current1D; + case GL_TEXTURE_2D: + return texUnit->Current2D; + case GL_TEXTURE_3D: + return texUnit->Current3D; + case GL_TEXTURE_CUBE_MAP: + if (ctx->Extensions.ARB_texture_cube_map) { + return texUnit->CurrentCubeMap; + } + break; + case GL_TEXTURE_RECTANGLE_NV: + if (ctx->Extensions.NV_texture_rectangle) { + return texUnit->CurrentRect; + } + break; + case GL_TEXTURE_1D_ARRAY_EXT: + if (ctx->Extensions.MESA_texture_array) { + return texUnit->Current1DArray; + } + break; + case GL_TEXTURE_2D_ARRAY_EXT: + if (ctx->Extensions.MESA_texture_array) { + return texUnit->Current2DArray; + } + break; + default: + ; } + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(target)"); + return NULL; +} + + +/** Set an integer-valued texture parameter */ +static void +set_tex_parameteri(GLcontext *ctx, + struct gl_texture_object *texObj, + GLenum pname, const GLint *params) +{ switch (pname) { - case GL_TEXTURE_MIN_FILTER: - /* A small optimization */ - if (texObj->MinFilter == eparam) - return; - if (eparam==GL_NEAREST || eparam==GL_LINEAR) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinFilter = eparam; - } - else if ((eparam==GL_NEAREST_MIPMAP_NEAREST || - eparam==GL_LINEAR_MIPMAP_NEAREST || - eparam==GL_NEAREST_MIPMAP_LINEAR || - eparam==GL_LINEAR_MIPMAP_LINEAR) && - texObj->Target != GL_TEXTURE_RECTANGLE_NV) { + case GL_TEXTURE_MIN_FILTER: + if (texObj->MinFilter == params[0]) + return; + switch (params[0]) { + case GL_NEAREST: + case GL_LINEAR: + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MinFilter = params[0]; + return; + case GL_NEAREST_MIPMAP_NEAREST: + case GL_LINEAR_MIPMAP_NEAREST: + case GL_NEAREST_MIPMAP_LINEAR: + case GL_LINEAR_MIPMAP_LINEAR: + if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinFilter = eparam; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + texObj->MinFilter = params[0]; return; } - break; - case GL_TEXTURE_MAG_FILTER: - /* A small optimization */ - if (texObj->MagFilter == eparam) - return; + /* fall-through */ + default: + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + } + return; - if (eparam==GL_NEAREST || eparam==GL_LINEAR) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MagFilter = eparam; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - break; - case GL_TEXTURE_WRAP_S: - if (texObj->WrapS == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapS = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_WRAP_T: - if (texObj->WrapT == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapT = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_WRAP_R: - if (texObj->WrapR == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapR = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_BORDER_COLOR: + case GL_TEXTURE_MAG_FILTER: + if (texObj->MagFilter == params[0]) + return; + switch (params[0]) { + case GL_NEAREST: + case GL_LINEAR: FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->BorderColor[RCOMP] = params[0]; - texObj->BorderColor[GCOMP] = params[1]; - texObj->BorderColor[BCOMP] = params[2]; - texObj->BorderColor[ACOMP] = params[3]; - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); - break; - case GL_TEXTURE_MIN_LOD: - if (texObj->MinLod == params[0]) - return; + texObj->MagFilter = params[0]; + return; + default: + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + } + return; + + case GL_TEXTURE_WRAP_S: + if (texObj->WrapS == params[0]) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinLod = params[0]; - break; - case GL_TEXTURE_MAX_LOD: - if (texObj->MaxLod == params[0]) - return; + texObj->WrapS = params[0]; + } + return; + + case GL_TEXTURE_WRAP_T: + if (texObj->WrapT == params[0]) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MaxLod = params[0]; - break; - case GL_TEXTURE_BASE_LEVEL: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - if (target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } + texObj->WrapT = params[0]; + } + return; + + case GL_TEXTURE_WRAP_R: + if (texObj->WrapR == params[0]) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->BaseLevel = (GLint) params[0]; - break; - case GL_TEXTURE_MAX_LEVEL: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - if (target == GL_TEXTURE_RECTANGLE_ARB) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); - return; - } + texObj->WrapR = params[0]; + } + return; + + case GL_TEXTURE_BASE_LEVEL: + if (texObj->BaseLevel == params[0]) + return; + if (params[0] < 0 || + (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->BaseLevel = params[0]; + return; + + case GL_TEXTURE_MAX_LEVEL: + if (texObj->MaxLevel == params[0]) + return; + if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MaxLevel = params[0]; + return; + + case GL_TEXTURE_COMPARE_SGIX: + if (ctx->Extensions.SGIX_shadow) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MaxLevel = (GLint) params[0]; - break; - case GL_TEXTURE_PRIORITY: + texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); + } + return; + + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + if (ctx->Extensions.SGIX_shadow && + (params[0] == GL_TEXTURE_LEQUAL_R_SGIX || + params[0] == GL_TEXTURE_GEQUAL_R_SGIX)) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->Priority = CLAMP( params[0], 0.0F, 1.0F ); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - if (params[0] < 1.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - /* clamp to max, that's what NVIDIA does */ - texObj->MaxAnisotropy = MIN2(params[0], - ctx->Const.MaxTextureMaxAnisotropy); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); - return; - } - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); - return; - } - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - GLenum op = (GLenum) params[0]; - if (op == GL_TEXTURE_LEQUAL_R_SGIX || - op == GL_TEXTURE_GEQUAL_R_SGIX) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareOperator = op; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); - return; - } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { + texObj->CompareOperator = params[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); + } + return; + + case GL_GENERATE_MIPMAP_SGIS: + if (ctx->Extensions.SGIS_generate_mipmap) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); + } + return; + + case GL_TEXTURE_COMPARE_MODE_ARB: + if (ctx->Extensions.ARB_shadow && + (params[0] == GL_NONE || + params[0] == GL_COMPARE_R_TO_TEXTURE_ARB)) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareMode = params[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)"); + } + return; + + case GL_TEXTURE_COMPARE_FUNC_ARB: + if (ctx->Extensions.ARB_shadow) { + switch (params[0]) { + case GL_LEQUAL: + case GL_GEQUAL: FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); + texObj->CompareFunc = params[0]; return; - } - break; - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); - return; - } - break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - const GLenum mode = (GLenum) params[0]; - if (mode == GL_NONE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) { + case GL_EQUAL: + case GL_NOTEQUAL: + case GL_LESS: + case GL_GREATER: + case GL_ALWAYS: + case GL_NEVER: + if (ctx->Extensions.EXT_shadow_funcs) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareMode = mode; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_TEXTURE_COMPARE_MODE_ARB: 0x%x)", mode); + texObj->CompareFunc = params[0]; return; } - } - else { + /* fall-through */ + default: _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_MODE_ARB)"); - return; + "glTexParameter(GL_TEXTURE_COMPARE_FUNC_ARB)"); } - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - const GLenum func = (GLenum) params[0]; - if (func == GL_LEQUAL || func == GL_GEQUAL) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFunc = func; - } - else if (ctx->Extensions.EXT_shadow_funcs && - (func == GL_EQUAL || - func == GL_NOTEQUAL || - func == GL_LESS || - func == GL_GREATER || - func == GL_ALWAYS || - func == GL_NEVER)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFunc = func; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_FUNC_ARB)"); - return; - } - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - const GLenum result = (GLenum) params[0]; - if (result == GL_LUMINANCE || result == GL_INTENSITY - || result == GL_ALPHA) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->DepthMode = result; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_DEPTH_TEXTURE_MODE_ARB)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_DEPTH_TEXTURE_MODE_ARB)"); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); + } + return; + + case GL_DEPTH_TEXTURE_MODE_ARB: + if (ctx->Extensions.ARB_depth_texture && + (params[0] == GL_LUMINANCE || + params[0] == GL_INTENSITY || + params[0] == GL_ALPHA)) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->DepthMode = params[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)"); + } + return; + +#ifdef FEATURE_OES_draw_texture + case GL_TEXTURE_CROP_RECT_OES: + texObj->CropRect[0] = params[0]; + texObj->CropRect[1] = params[1]; + texObj->CropRect[2] = params[2]; + texObj->CropRect[3] = params[3]; + break; +#endif + + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); + } +} + + +/** Set a float-valued texture parameter */ +static void +set_tex_parameterf(GLcontext *ctx, + struct gl_texture_object *texObj, + GLenum pname, const GLfloat *params) +{ + switch (pname) { + case GL_TEXTURE_MIN_LOD: + if (texObj->MinLod == params[0]) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MinLod = params[0]; + return; + + case GL_TEXTURE_MAX_LOD: + if (texObj->MaxLod == params[0]) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MaxLod = params[0]; + return; + + case GL_TEXTURE_PRIORITY: + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); + return; + + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + if (ctx->Extensions.EXT_texture_filter_anisotropic) { + if (params[0] < 1.0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); return; } - break; - case GL_TEXTURE_LOD_BIAS: - /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias*/ - if (ctx->Extensions.EXT_texture_lod_bias) { - if (texObj->LodBias != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->LodBias = params[0]; - } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + /* clamp to max, that's what NVIDIA does */ + texObj->MaxAnisotropy = MIN2(params[0], + ctx->Const.MaxTextureMaxAnisotropy); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); + } + return; + + case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + if (ctx->Extensions.SGIX_shadow_ambient) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); + } + return; + + case GL_TEXTURE_LOD_BIAS: + /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */ + if (ctx->Extensions.EXT_texture_lod_bias) { + if (texObj->LodBias != params[0]) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->LodBias = params[0]; } - break; + } + break; + + case GL_TEXTURE_BORDER_COLOR: + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->BorderColor[RCOMP] = params[0]; + texObj->BorderColor[GCOMP] = params[1]; + texObj->BorderColor[BCOMP] = params[2]; + texObj->BorderColor[ACOMP] = params[3]; + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); + return; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); + } +} + + +void GLAPIENTRY +_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + case GL_TEXTURE_WRAP_R: + case GL_TEXTURE_BASE_LEVEL: + case GL_TEXTURE_MAX_LEVEL: + case GL_TEXTURE_COMPARE_SGIX: + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + case GL_GENERATE_MIPMAP_SGIS: + case GL_TEXTURE_COMPARE_MODE_ARB: + case GL_TEXTURE_COMPARE_FUNC_ARB: + case GL_DEPTH_TEXTURE_MODE_ARB: + { + /* convert float param to int */ + GLint p = (GLint) param; + set_tex_parameteri(ctx, texObj, pname, &p); + } + return; + default: + /* this will generate an error if pname is illegal */ + set_tex_parameterf(ctx, texObj, pname, ¶m); + } + + texObj->_Complete = GL_FALSE; + + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m); + } +} + + +void GLAPIENTRY +_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + case GL_TEXTURE_WRAP_R: + case GL_TEXTURE_BASE_LEVEL: + case GL_TEXTURE_MAX_LEVEL: + case GL_TEXTURE_COMPARE_SGIX: + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + case GL_GENERATE_MIPMAP_SGIS: + case GL_TEXTURE_COMPARE_MODE_ARB: + case GL_TEXTURE_COMPARE_FUNC_ARB: + case GL_DEPTH_TEXTURE_MODE_ARB: + { + /* convert float param to int */ + GLint p = (GLint) params[0]; + set_tex_parameteri(ctx, texObj, pname, &p); + } + break; + #ifdef FEATURE_OES_draw_texture - case GL_TEXTURE_CROP_RECT_OES: - texObj->CropRect[0] = (GLint) params[0]; - texObj->CropRect[1] = (GLint) params[1]; - texObj->CropRect[2] = (GLint) params[2]; - texObj->CropRect[3] = (GLint) params[3]; - break; + case GL_TEXTURE_CROP_RECT_OES: + { + /* convert float params to int */ + GLint iparams[4]; + iparams[0] = (GLint) params[0]; + iparams[1] = (GLint) params[1]; + iparams[2] = (GLint) params[2]; + iparams[3] = (GLint) params[3]; + set_tex_parameteri(ctx, target, iparams); + } + break; #endif - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=0x%x)", pname); - return; + default: + /* this will generate an error if pname is illegal */ + set_tex_parameterf(ctx, texObj, pname, params); } texObj->_Complete = GL_FALSE; - if (ctx->Driver.TexParameter) { - (*ctx->Driver.TexParameter)( ctx, target, texObj, pname, params ); + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + ctx->Driver.TexParameter(ctx, target, texObj, pname, params); } } void GLAPIENTRY -_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ) +_mesa_TexParameteri(GLenum target, GLenum pname, GLint param) { - GLfloat fparam[4]; - if (pname == GL_TEXTURE_PRIORITY) - fparam[0] = INT_TO_FLOAT(param); - else - fparam[0] = (GLfloat) param; - fparam[1] = fparam[2] = fparam[3] = 0.0; - _mesa_TexParameterfv(target, pname, fparam); + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_MIN_LOD: + case GL_TEXTURE_MAX_LOD: + case GL_TEXTURE_PRIORITY: + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + case GL_TEXTURE_LOD_BIAS: + case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { + GLfloat fparam = (GLfloat) param; + /* convert int param to float */ + set_tex_parameterf(ctx, texObj, pname, &fparam); + } + break; + default: + /* this will generate an error if pname is illegal */ + set_tex_parameteri(ctx, texObj, pname, ¶m); + } + + texObj->_Complete = GL_FALSE; + + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + GLfloat fparam = (GLfloat) param; + ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam); + } } void GLAPIENTRY -_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) +_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) { - GLfloat fparam[4]; - if (pname == GL_TEXTURE_BORDER_COLOR) { - fparam[0] = INT_TO_FLOAT(params[0]); - fparam[1] = INT_TO_FLOAT(params[1]); - fparam[2] = INT_TO_FLOAT(params[2]); - fparam[3] = INT_TO_FLOAT(params[3]); - } - else if (pname == GL_TEXTURE_CROP_RECT_OES) { - fparam[0] = (GLfloat) params[0]; - fparam[1] = (GLfloat) params[1]; - fparam[2] = (GLfloat) params[2]; - fparam[3] = (GLfloat) params[3]; + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_BORDER_COLOR: + { + /* convert int params to float */ + GLfloat fparams[4]; + fparams[0] = INT_TO_FLOAT(params[0]); + fparams[1] = INT_TO_FLOAT(params[1]); + fparams[2] = INT_TO_FLOAT(params[2]); + fparams[3] = INT_TO_FLOAT(params[3]); + set_tex_parameterf(ctx, texObj, pname, fparams); + } + break; + case GL_TEXTURE_MIN_LOD: + case GL_TEXTURE_MAX_LOD: + case GL_TEXTURE_PRIORITY: + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + case GL_TEXTURE_LOD_BIAS: + case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { + /* convert int param to float */ + GLfloat fparam = (GLfloat) params[0]; + set_tex_parameterf(ctx, texObj, pname, &fparam); + } + break; + default: + /* this will generate an error if pname is illegal */ + set_tex_parameteri(ctx, texObj, pname, params); } - else { - if (pname == GL_TEXTURE_PRIORITY) - fparam[0] = INT_TO_FLOAT(params[0]); - else - fparam[0] = (GLfloat) params[0]; - fparam[1] = fparam[2] = fparam[3] = 0.0F; + + texObj->_Complete = GL_FALSE; + + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + GLfloat fparams[4]; + fparams[0] = INT_TO_FLOAT(params[0]); + if (pname == GL_TEXTURE_BORDER_COLOR || + pname == GL_TEXTURE_CROP_RECT_OES) { + fparams[1] = INT_TO_FLOAT(params[1]); + fparams[2] = INT_TO_FLOAT(params[2]); + fparams[3] = INT_TO_FLOAT(params[3]); + } + ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams); } - _mesa_TexParameterfv(target, pname, fparam); } -- cgit v1.2.3 From 65d39a9eed9ae60944dd3c5db392a382c5946cbc Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 Jan 2009 12:05:47 -0800 Subject: intel: clean up more pf mess. --- src/mesa/drivers/dri/intel/intel_fbo.c | 2 -- src/mesa/drivers/dri/intel/intel_fbo.h | 3 --- src/mesa/drivers/dri/intel/intel_span.c | 9 +++------ 3 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 05847ee5fe..53a74f5c0b 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -290,8 +290,6 @@ intel_renderbuffer_set_region(struct intel_renderbuffer *rb, rb->region = NULL; intel_region_reference(&rb->region, region); intel_region_release(&old); - - rb->pfPitch = region->pitch; } /** diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index a44989b5fd..41ced2a01a 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -63,11 +63,8 @@ struct intel_renderbuffer { struct gl_renderbuffer Base; struct intel_region *region; - GLuint pfPitch; /* possibly paged flipped pitch */ GLboolean RenderToTexture; /* RTT? */ - GLuint pf_pending; /**< sequence number of pending flip */ - 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 d9315043e6..c990caf3eb 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -150,7 +150,7 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb, int x_tile_number, y_tile_number; int tile_off, tile_base; - tile_stride = (irb->pfPitch * irb->region->cpp) << 3; + tile_stride = (irb->region->pitch * irb->region->cpp) << 3; xbyte = x * irb->region->cpp; @@ -190,7 +190,7 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb, printf("(%d,%d) -> %d + %d = %d (pitch = %d, tstride = %d)\n", x, y, tile_off, tile_base, tile_off + tile_base, - irb->pfPitch, tile_stride); + irb->region->pitch, tile_stride); #endif return tile_base + tile_off; @@ -205,7 +205,7 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, int x_tile_number, y_tile_number; int tile_off, tile_base; - tile_stride = (irb->pfPitch * irb->region->cpp) << 5; + tile_stride = (irb->region->pitch * irb->region->cpp) << 5; xbyte = x * irb->region->cpp; @@ -528,8 +528,6 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) if (irb == NULL || irb->region == NULL) return; - irb->pfPitch = irb->region->pitch; - intel_set_span_functions(intel, rb); } @@ -543,7 +541,6 @@ intel_renderbuffer_unmap(struct intel_context *intel, return; clear_span_cache(irb); - irb->pfPitch = 0; rb->GetRow = NULL; rb->PutRow = NULL; -- cgit v1.2.3 From 0f72de55386c391c4cc3ee346216f09152a6b5ab Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 Jan 2009 14:34:29 -0800 Subject: dri2: add complaints for more initialization failures. Somehow we're running into DRI2Authenticate failing, and silent demotion to swrast is bad. --- src/glx/x11/dri2_glx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index 2bee67780b..d16f809126 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -282,8 +282,10 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, return NULL; psc->driver = driOpenDriver(driverName); - if (psc->driver == NULL) + if (psc->driver == NULL) { + ErrorMessageF("driver pointer missing\n"); goto handle_error; + } extensions = dlsym(psc->driver, __DRI_DRIVER_EXTENSIONS); if (extensions == NULL) { @@ -309,11 +311,15 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, return NULL; } - if (drmGetMagic(psc->fd, &magic)) + if (drmGetMagic(psc->fd, &magic)) { + ErrorMessageF("failed to get magic\n"); return NULL; + } - if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic)) + if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic)) { + ErrorMessageF("failed to authenticate magic %d\n", magic); return NULL; + } psc->__driScreen = psc->dri2->createNewScreen(screen, psc->fd, -- cgit v1.2.3 From be1a76f88f4c3482e61e0a048a0b28b6b628f223 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 09:16:11 -0700 Subject: mesa: if texObj is NULL in fetch_texel_*(), return black. --- src/mesa/swrast/s_fragprog.c | 52 +++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 525cf9d724..45ba91ff86 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -40,20 +40,26 @@ static void fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, GLuint unit, GLfloat color[4] ) { - GLchan rgba[4]; - SWcontext *swrast = SWRAST_CONTEXT(ctx); const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - if (texObj) + if (texObj) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLchan rgba[4]; + lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); - /* XXX use a float-valued TextureSample routine here!!! */ - swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + /* XXX use a float-valued TextureSample routine here!!! */ + swrast->TextureSample[unit](ctx, texObj, 1, + (const GLfloat (*)[4]) texcoord, + &lambda, &rgba); + color[0] = CHAN_TO_FLOAT(rgba[0]); + color[1] = CHAN_TO_FLOAT(rgba[1]); + color[2] = CHAN_TO_FLOAT(rgba[2]); + color[3] = CHAN_TO_FLOAT(rgba[3]); + } + else { + color[0] = color[1] = color[2] = color[3] = 0.0F; + } } @@ -69,13 +75,14 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], { SWcontext *swrast = SWRAST_CONTEXT(ctx); const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - GLfloat lambda; - GLchan rgba[4]; if (texObj) { - const struct gl_texture_image *texImg = texObj->Image[0][texObj->BaseLevel]; + const struct gl_texture_image *texImg = + texObj->Image[0][texObj->BaseLevel]; const GLfloat texW = (GLfloat) texImg->WidthScale; const GLfloat texH = (GLfloat) texImg->HeightScale; + GLfloat lambda; + GLchan rgba[4]; lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ texdx[1], texdy[1], /* dt/dx, dt/dy */ @@ -85,14 +92,19 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], 1.0F / texcoord[3]) + lodBias; lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); - } - swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + /* XXX use a float-valued TextureSample routine here!!! */ + swrast->TextureSample[unit](ctx, texObj, 1, + (const GLfloat (*)[4]) texcoord, + &lambda, &rgba); + color[0] = CHAN_TO_FLOAT(rgba[0]); + color[1] = CHAN_TO_FLOAT(rgba[1]); + color[2] = CHAN_TO_FLOAT(rgba[2]); + color[3] = CHAN_TO_FLOAT(rgba[3]); + } + else { + color[0] = color[1] = color[2] = color[3] = 0.0F; + } } -- cgit v1.2.3 From 4a89e51c5f88b57040b361b62e80a57c8248ba4b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 10:27:33 -0700 Subject: mesa: set/get new state for GL_EXT_texture_swizzle --- src/mesa/main/extensions.c | 1 + src/mesa/main/mtypes.h | 3 + src/mesa/main/texobj.c | 9 ++ src/mesa/main/texparam.c | 219 ++++++++++++++++++++++++++++++++++++++------- 4 files changed, 198 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 0b4cbec648..053f3697d7 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -127,6 +127,7 @@ static const struct { { ON, "GL_EXT_texture_object", F(EXT_texture_object) }, { OFF, "GL_EXT_texture_rectangle", F(NV_texture_rectangle) }, { OFF, "GL_EXT_texture_sRGB", F(EXT_texture_sRGB) }, + { OFF, "GL_EXT_texture_swizzle", F(EXT_texture_swizzle) }, { OFF, "GL_EXT_timer_query", F(EXT_timer_query) }, { ON, "GL_EXT_vertex_array", F(EXT_vertex_array) }, { OFF, "GL_EXT_vertex_array_bgra", F(EXT_vertex_array_bgra) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index b09c5910f8..8ab0d26f45 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1446,6 +1446,8 @@ struct gl_texture_object GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ GLint CropRect[4]; /**< GL_OES_draw_texture */ + GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */ + GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLboolean _Complete; /**< Is texture object complete? */ @@ -2621,6 +2623,7 @@ struct gl_extensions GLboolean EXT_texture_lod_bias; GLboolean EXT_texture_mirror_clamp; GLboolean EXT_texture_sRGB; + GLboolean EXT_texture_swizzle; GLboolean EXT_timer_query; GLboolean EXT_vertex_array; GLboolean EXT_vertex_array_bgra; diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 7848f0be35..fad39a0634 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -42,6 +42,8 @@ #include "texstate.h" #include "texobj.h" #include "mtypes.h" +#include "shader/prog_instruction.h" + /**********************************************************************/ @@ -138,6 +140,11 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */ obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */ obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */ + obj->Swizzle[0] = GL_RED; + obj->Swizzle[1] = GL_GREEN; + obj->Swizzle[2] = GL_BLUE; + obj->Swizzle[3] = GL_ALPHA; + obj->_Swizzle = SWIZZLE_NOOP; } @@ -252,6 +259,8 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, dest->GenerateMipmap = src->GenerateMipmap; dest->Palette = src->Palette; dest->_Complete = src->_Complete; + COPY_4V(dest->Swizzle, src->Swizzle); + dest->_Swizzle = src->_Swizzle; } diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 2322d84975..695bff0097 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -38,6 +38,7 @@ #include "main/texcompress.h" #include "main/texparam.h" #include "main/teximage.h" +#include "shader/prog_instruction.h" /** @@ -125,6 +126,45 @@ get_texobj(GLcontext *ctx, GLenum target) } +/** + * Convert GL_RED/GREEN/BLUE/ALPHA/ZERO/ONE to SWIZZLE_X/Y/Z/W/ZERO/ONE. + * \return -1 if error. + */ +static GLint +comp_to_swizzle(GLenum comp) +{ + switch (comp) { + case GL_RED: + return SWIZZLE_X; + case GL_GREEN: + return SWIZZLE_Y; + case GL_BLUE: + return SWIZZLE_Z; + case GL_ALPHA: + return SWIZZLE_W; + case GL_ZERO: + return SWIZZLE_ZERO; + case GL_ONE: + return SWIZZLE_ONE; + default: + return -1; + } +} + + +static void +set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz) +{ + ASSERT(comp < 4); + ASSERT(swz <= SWIZZLE_NIL); + { + GLuint mask = 0x7 << (3 * comp); + GLuint s = (*swizzle & ~mask) | (swz << (3 * comp)); + *swizzle = s; + } +} + + /** Set an integer-valued texture parameter */ static void set_tex_parameteri(GLcontext *ctx, @@ -318,9 +358,48 @@ set_tex_parameteri(GLcontext *ctx, texObj->CropRect[1] = params[1]; texObj->CropRect[2] = params[2]; texObj->CropRect[3] = params[3]; - break; + return; #endif + case GL_TEXTURE_SWIZZLE_R_EXT: + case GL_TEXTURE_SWIZZLE_G_EXT: + case GL_TEXTURE_SWIZZLE_B_EXT: + case GL_TEXTURE_SWIZZLE_A_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT; + const GLint swz = comp_to_swizzle(params[0]); + ASSERT(comp < 4); + if (swz >= 0) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->Swizzle[comp] = params[0]; + set_swizzle_component(&texObj->_Swizzle, comp, swz); + return; + } + } + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); + return; + + case GL_TEXTURE_SWIZZLE_RGBA_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + for (comp = 0; comp < 4; comp++) { + const GLint swz = comp_to_swizzle(params[comp]); + if (swz >= 0) { + texObj->Swizzle[comp] = params[comp]; + set_swizzle_component(&texObj->_Swizzle, comp, swz); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)", + params[comp]); + return; + } + } + return; + } + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); + return; + default: _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); } @@ -974,63 +1053,63 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = obj->MaxAnisotropy; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_COMPARE_SGIX: if (ctx->Extensions.SGIX_shadow) { *params = (GLfloat) obj->CompareFlag; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_COMPARE_OPERATOR_SGIX: if (ctx->Extensions.SGIX_shadow) { *params = (GLfloat) obj->CompareOperator; } else - error = 1; + error = GL_TRUE; break; case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ if (ctx->Extensions.SGIX_shadow_ambient) { *params = obj->ShadowAmbient; } else - error = 1; + error = GL_TRUE; break; case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { *params = (GLfloat) obj->GenerateMipmap; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareMode; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareFunc; } else - error = 1; + error = GL_TRUE; break; case GL_DEPTH_TEXTURE_MODE_ARB: if (ctx->Extensions.ARB_depth_texture) { *params = (GLfloat) obj->DepthMode; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_LOD_BIAS: if (ctx->Extensions.EXT_texture_lod_bias) { *params = obj->LodBias; } else - error = 1; + error = GL_TRUE; break; #ifdef FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: @@ -1040,10 +1119,37 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) params[3] = obj->CropRect[3]; break; #endif + + case GL_TEXTURE_SWIZZLE_R_EXT: + case GL_TEXTURE_SWIZZLE_G_EXT: + case GL_TEXTURE_SWIZZLE_B_EXT: + case GL_TEXTURE_SWIZZLE_A_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT; + *params = (GLfloat) obj->Swizzle[comp]; + } + else { + error = GL_TRUE; + } + break; + + case GL_TEXTURE_SWIZZLE_RGBA_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp; + for (comp = 0; comp < 4; comp++) { + params[comp] = (GLfloat) obj->Swizzle[comp]; + } + } + else { + error = GL_TRUE; + } + break; + default: - error = 1; + error = GL_TRUE; break; } + if (error) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", pname); @@ -1057,6 +1163,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) { struct gl_texture_unit *texUnit; struct gl_texture_object *obj; + GLboolean error = GL_FALSE; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1077,19 +1184,19 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) switch (pname) { case GL_TEXTURE_MAG_FILTER: *params = (GLint) obj->MagFilter; - return; + break;; case GL_TEXTURE_MIN_FILTER: *params = (GLint) obj->MinFilter; - return; + break;; case GL_TEXTURE_WRAP_S: *params = (GLint) obj->WrapS; - return; + break;; case GL_TEXTURE_WRAP_T: *params = (GLint) obj->WrapT; - return; + break;; case GL_TEXTURE_WRAP_R: *params = (GLint) obj->WrapR; - return; + break;; case GL_TEXTURE_BORDER_COLOR: { GLfloat b[4]; @@ -1102,7 +1209,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) params[2] = FLOAT_TO_INT(b[2]); params[3] = FLOAT_TO_INT(b[3]); } - return; + break;; case GL_TEXTURE_RESIDENT: { GLboolean resident; @@ -1112,74 +1219,92 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) resident = GL_TRUE; *params = (GLint) resident; } - return; + break;; case GL_TEXTURE_PRIORITY: *params = FLOAT_TO_INT(obj->Priority); - return; + break;; case GL_TEXTURE_MIN_LOD: *params = (GLint) obj->MinLod; - return; + break;; case GL_TEXTURE_MAX_LOD: *params = (GLint) obj->MaxLod; - return; + break;; case GL_TEXTURE_BASE_LEVEL: *params = obj->BaseLevel; - return; + break;; case GL_TEXTURE_MAX_LEVEL: *params = obj->MaxLevel; - return; + break;; case GL_TEXTURE_MAX_ANISOTROPY_EXT: if (ctx->Extensions.EXT_texture_filter_anisotropic) { *params = (GLint) obj->MaxAnisotropy; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_COMPARE_SGIX: if (ctx->Extensions.SGIX_shadow) { *params = (GLint) obj->CompareFlag; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_COMPARE_OPERATOR_SGIX: if (ctx->Extensions.SGIX_shadow) { *params = (GLint) obj->CompareOperator; - return; + } + else { + error = GL_TRUE; } break; case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ if (ctx->Extensions.SGIX_shadow_ambient) { *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); - return; + } + else { + error = GL_TRUE; } break; case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { *params = (GLint) obj->GenerateMipmap; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLint) obj->CompareMode; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLint) obj->CompareFunc; - return; + } + else { + error = GL_TRUE; } break; case GL_DEPTH_TEXTURE_MODE_ARB: if (ctx->Extensions.ARB_depth_texture) { *params = (GLint) obj->DepthMode; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_LOD_BIAS: if (ctx->Extensions.EXT_texture_lod_bias) { *params = (GLint) obj->LodBias; - return; + } + else { + error = GL_TRUE; } break; #ifdef FEATURE_OES_draw_texture @@ -1190,9 +1315,35 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) params[3] = obj->CropRect[3]; break; #endif + case GL_TEXTURE_SWIZZLE_R_EXT: + case GL_TEXTURE_SWIZZLE_G_EXT: + case GL_TEXTURE_SWIZZLE_B_EXT: + case GL_TEXTURE_SWIZZLE_A_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT; + *params = obj->Swizzle[comp]; + } + else { + error = GL_TRUE; + } + break; + + case GL_TEXTURE_SWIZZLE_RGBA_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + COPY_4V(params, obj->Swizzle); + } + else { + error = GL_TRUE; + } + break; + default: ; /* silence warnings */ } - /* If we get here, pname was an unrecognized enum */ - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname); + + if (error) + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", + pname); + + _mesa_unlock_texture(ctx, obj); } -- cgit v1.2.3 From 54c62ba5c36f3e2b279151f5df851d2ceee15319 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 10:31:05 -0700 Subject: mesa: implement texture swizzling in swrast And enable GL_EXT_texture_swizzle for software drivers. --- src/mesa/main/extensions.c | 1 + src/mesa/swrast/s_fragprog.c | 39 +++++++++++++++++++++++++++++++-------- src/mesa/swrast/s_texcombine.c | 39 +++++++++++++++++++++++++++++++++++++++ src/mesa/swrast/s_triangle.c | 2 ++ 4 files changed, 73 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 053f3697d7..86144c42ad 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -274,6 +274,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; #endif + ctx->Extensions.EXT_texture_swizzle = GL_TRUE; ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE; ctx->Extensions.MESA_pack_invert = GL_TRUE; diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 45ba91ff86..58ef91ec01 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -32,6 +32,35 @@ #include "s_span.h" +/** + * Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel' + * and return results in 'colorOut'. + */ +static INLINE void +swizzle_texel(const GLchan texel[4], GLfloat colorOut[4], GLuint swizzle) +{ + if (swizzle == SWIZZLE_NOOP) { + colorOut[0] = CHAN_TO_FLOAT(texel[0]); + colorOut[1] = CHAN_TO_FLOAT(texel[1]); + colorOut[2] = CHAN_TO_FLOAT(texel[2]); + colorOut[3] = CHAN_TO_FLOAT(texel[3]); + } + else { + GLfloat vector[6]; + vector[SWIZZLE_X] = CHAN_TO_FLOAT(texel[0]); + vector[SWIZZLE_Y] = CHAN_TO_FLOAT(texel[1]); + vector[SWIZZLE_Z] = CHAN_TO_FLOAT(texel[2]); + vector[SWIZZLE_W] = CHAN_TO_FLOAT(texel[3]); + vector[SWIZZLE_ZERO] = 0.0F; + vector[SWIZZLE_ONE] = 1.0F; + colorOut[0] = vector[GET_SWZ(swizzle, 0)]; + colorOut[1] = vector[GET_SWZ(swizzle, 1)]; + colorOut[2] = vector[GET_SWZ(swizzle, 2)]; + colorOut[3] = vector[GET_SWZ(swizzle, 3)]; + } +} + + /** * Fetch a texel with given lod. * Called via machine->FetchTexelLod() @@ -52,10 +81,7 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord, &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + swizzle_texel(rgba, color, texObj->_Swizzle); } else { color[0] = color[1] = color[2] = color[3] = 0.0F; @@ -97,10 +123,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord, &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + swizzle_texel(rgba, color, texObj->_Swizzle); } else { color[0] = color[1] = color[2] = color[3] = 0.0F; diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index df6efad66c..1b8775bf30 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -31,6 +31,7 @@ #include "main/imports.h" #include "main/macros.h" #include "main/pixel.h" +#include "shader/prog_instruction.h" #include "s_context.h" #include "s_texcombine.h" @@ -815,6 +816,36 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, #undef PROD +/** + * Apply X/Y/Z/W/0/1 swizzle to an array of colors/texels. + * See GL_EXT_texture_swizzle. + */ +static void +swizzle_texels(GLuint swizzle, GLuint count, GLchan (*texels)[4]) +{ + const GLuint swzR = GET_SWZ(swizzle, 0); + const GLuint swzG = GET_SWZ(swizzle, 1); + const GLuint swzB = GET_SWZ(swizzle, 2); + const GLuint swzA = GET_SWZ(swizzle, 3); + GLchan vector[6]; + GLuint i; + + vector[SWIZZLE_ZERO] = 0; + vector[SWIZZLE_ONE] = CHAN_MAX; + + for (i = 0; i < count; i++) { + vector[SWIZZLE_X] = texels[i][0]; + vector[SWIZZLE_Y] = texels[i][1]; + vector[SWIZZLE_Z] = texels[i][2]; + vector[SWIZZLE_W] = texels[i][3]; + texels[i][RCOMP] = vector[swzR]; + texels[i][GCOMP] = vector[swzG]; + texels[i][BCOMP] = vector[swzB]; + texels[i][ACOMP] = vector[swzA]; + } +} + + /** * Apply a conventional OpenGL texture env mode (REPLACE, ADD, BLEND, * MODULATE, or DECAL) to an array of fragments. @@ -1241,9 +1272,15 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) _mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels); #endif } + + /* GL_EXT_texture_swizzle */ + if (curObj->_Swizzle != SWIZZLE_NOOP) { + swizzle_texels(curObj->_Swizzle, span->end, texels); + } } } + /* * OK, now apply the texture (aka texture combine/blend). * We modify the span->color.rgba values. @@ -1262,6 +1299,8 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) const GLchan (*texels)[4] = (const GLchan (*)[4]) (swrast->TexelBuffer + unit * (span->end * 4 * sizeof(GLchan))); + + texture_apply( ctx, texUnit, span->end, (CONST GLchan (*)[4]) primary_rgba, texels, span->array->rgba ); diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 5d232487f3..063130714c 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -35,6 +35,7 @@ #include "main/imports.h" #include "main/macros.h" #include "main/texformat.h" +#include "shader/prog_instruction.h" #include "s_aatriangle.h" #include "s_context.h" @@ -1063,6 +1064,7 @@ _swrast_choose_triangle( GLcontext *ctx ) && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && texObj2D->WrapS == GL_REPEAT && texObj2D->WrapT == GL_REPEAT + && texObj2D->_Swizzle == SWIZZLE_NOOP && texImg->_IsPowerOfTwo && texImg->Border == 0 && texImg->Width == texImg->RowStride -- cgit v1.2.3 From 72f0b4a55ba36bb8571b4c11d0098361f766814e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 10:44:04 -0700 Subject: mesa: additional GL_INVALID_OPERATION tests for texture swizzle --- src/mesa/main/texparam.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 695bff0097..41c914e5b3 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -368,6 +368,11 @@ set_tex_parameteri(GLcontext *ctx, if (ctx->Extensions.EXT_texture_swizzle) { const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT; const GLint swz = comp_to_swizzle(params[0]); + if (swz < 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTexParameter(swizzle 0x%x)", params[0]); + return; + } ASSERT(comp < 4); if (swz >= 0) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -390,8 +395,8 @@ set_tex_parameteri(GLcontext *ctx, set_swizzle_component(&texObj->_Swizzle, comp, swz); } else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)", - params[comp]); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTexParameter(swizzle 0x%x)", params[comp]); return; } } -- cgit v1.2.3 From 3147d7785d5cd8c898b19040cb1d30265fba2350 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 11:36:39 -0700 Subject: i965: minor comments --- src/mesa/drivers/dri/i965/brw_structs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 4e577d0f6a..d97ff27f0a 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -1031,10 +1031,10 @@ struct brw_surface_state GLuint writedisable_green:1; GLuint writedisable_red:1; GLuint writedisable_alpha:1; - GLuint surface_format:9; + GLuint surface_format:9; /**< BRW_SURFACEFORMAT_x */ GLuint data_return_format:1; GLuint pad0:1; - GLuint surface_type:3; + GLuint surface_type:3; /**< BRW_SURFACE_1D/2D/3D/CUBE */ } ss0; struct { -- cgit v1.2.3 From f78c388b6c156cb155f089b00612f00919090a8e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 11:37:11 -0700 Subject: i965: widen per-texture bitfields for 16 texture image units --- src/mesa/drivers/dri/i965/brw_wm.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index ded079695e..f990bde839 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -60,16 +60,16 @@ struct brw_wm_prog_key { GLuint aa_dest_stencil_reg:3; GLuint dest_depth_reg:3; GLuint nr_depth_regs:3; - GLuint projtex_mask:8; - GLuint shadowtex_mask:8; GLuint computes_depth:1; /* could be derived from program string */ GLuint source_depth_to_render_target:1; GLuint flat_shade:1; GLuint runtime_check_aads_emit:1; - GLuint yuvtex_mask:8; - GLuint yuvtex_swap_mask:8; /* UV swaped */ - GLuint pad1:16; + GLuint projtex_mask:16; + GLuint shadowtex_mask:16; + GLuint yuvtex_mask:16; + GLuint yuvtex_swap_mask:16; /* UV swaped */ + // GLuint pad1:16; GLuint program_string_id:32; GLuint origin_x, origin_y; -- cgit v1.2.3 From 177eda834ee26656b4f9b2ec64b8b3e915c1854c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 11:38:42 -0700 Subject: i965: remove pad field --- src/mesa/drivers/dri/i965/brw_wm.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index f990bde839..388c6f7618 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -69,7 +69,6 @@ struct brw_wm_prog_key { GLuint shadowtex_mask:16; GLuint yuvtex_mask:16; GLuint yuvtex_swap_mask:16; /* UV swaped */ - // GLuint pad1:16; GLuint program_string_id:32; GLuint origin_x, origin_y; -- cgit v1.2.3 From 89fddf978c9d2ab5042f89110015234e979c2686 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 11:42:42 -0700 Subject: i965: minor improvements in brw_wm_populate_key() --- src/mesa/drivers/dri/i965/brw_wm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 24149cf8a1..1683308f44 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -233,14 +233,14 @@ static void brw_wm_populate_key( struct brw_context *brw, /* _NEW_TEXTURE */ for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { const struct gl_texture_unit *unit = &brw->attribs.Texture->Unit[i]; - const struct gl_texture_object *t = unit->_Current; if (unit->_ReallyEnabled) { - if (t->Image[0][t->BaseLevel]->InternalFormat == GL_YCBCR_MESA) { - key->yuvtex_mask |= 1<Image[0][t->BaseLevel]->TexFormat->MesaFormat == - MESA_FORMAT_YCBCR) - key->yuvtex_swap_mask |= 1<< i; + const struct gl_texture_object *t = unit->_Current; + 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) + key->yuvtex_swap_mask |= 1 << i; } } } -- cgit v1.2.3 From 2ace634024dc14ab15087f3718f8f84e23fba47c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 14:33:07 -0700 Subject: i965: minor comment additions/edits --- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index d0c6b82290..318eab34aa 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -51,6 +51,7 @@ static struct brw_wm_value *get_value( struct brw_wm_compile *c) return &c->vreg[c->nr_vreg++]; } +/** return pointer to a newly allocated instruction */ static struct brw_wm_instruction *get_instruction( struct brw_wm_compile *c ) { assert(c->nr_insns < BRW_WM_MAX_INSN); @@ -60,6 +61,7 @@ static struct brw_wm_instruction *get_instruction( struct brw_wm_compile *c ) /*********************************************************************** */ +/** Init the "undef" register */ static void pass0_init_undef( struct brw_wm_compile *c) { struct brw_wm_ref *ref = &c->undef_ref; @@ -69,6 +71,7 @@ static void pass0_init_undef( struct brw_wm_compile *c) ref->prevuse = NULL; } +/** Set a FP register to a value */ static void pass0_set_fpreg_value( struct brw_wm_compile *c, GLuint file, GLuint idx, @@ -83,6 +86,7 @@ static void pass0_set_fpreg_value( struct brw_wm_compile *c, c->pass0_fp_reg[file][idx][component] = ref; } +/** Set a FP register to a ref */ static void pass0_set_fpreg_ref( struct brw_wm_compile *c, GLuint file, GLuint idx, @@ -121,6 +125,7 @@ static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, } +/** Return a ref to a constant/literal value */ static const struct brw_wm_ref *get_const_ref( struct brw_wm_compile *c, const GLfloat *constval ) { @@ -187,7 +192,7 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c, /* There's something really hokey about parameters parsed in * arb programs - they all end up in here, whether they be - * state values, paramters or constants. This duplicates the + * state values, parameters or constants. This duplicates the * structure above & also seems to subvert the limits set for * each type of constant/param. */ -- cgit v1.2.3 From faa48915d27634a12f123eaa6e954ec79565e365 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 14:35:58 -0700 Subject: i965: fix bug in pass0_precalc_mov() Previously, "in-place" swizzles such as: MOV t, t.xxyx; were handled incorrectly. Fixed by splitting the one loop into two loops so we get all the refs before assigning them (to avoid potential clobbering). --- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index 318eab34aa..590cd946ec 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -379,14 +379,22 @@ static void pass0_precalc_mov( struct brw_wm_compile *c, { const struct prog_dst_register *dst = &inst->DstReg; GLuint writemask = inst->DstReg.WriteMask; + struct brw_wm_ref *refs[4]; GLuint i; /* Get the effect of a MOV by manipulating our register table: + * First get all refs, then assign refs. This ensures that "in-place" + * swizzles such as: + * MOV t, t.xxyx + * are handled correctly. Previously, these two steps were done in + * one loop and the above case was incorrectly handled. */ for (i = 0; i < 4; i++) { - if (writemask & (1<File, dst->Index, i, - get_new_ref(c, inst->SrcReg[0], i, NULL)); + refs[i] = get_new_ref(c, inst->SrcReg[0], i, NULL); + } + for (i = 0; i < 4; i++) { + if (writemask & (1 << i)) { + pass0_set_fpreg_ref( c, dst->File, dst->Index, i, refs[i]); } } } -- cgit v1.2.3 From 9e7903e492ad842481a166484e0474dd4f3100ba Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 14:48:41 -0700 Subject: i965: minor clean-up, comments, etc. --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 46 +++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 6df2c95d80..fdacad0053 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -554,12 +554,19 @@ static void precalc_lit( struct brw_wm_compile *c, } } + +/** + * Some TEX instructions require extra code, cube map coordinate + * normalization, or coordinate scaling for RECT textures, etc. + * This function emits those extra instructions and the TEX + * instruction itself. + */ static void precalc_tex( struct brw_wm_compile *c, const struct prog_instruction *inst ) { struct prog_src_register coord; struct prog_dst_register tmpcoord; - GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; + const GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) { struct prog_instruction *out; @@ -569,9 +576,11 @@ static void precalc_tex( struct brw_wm_compile *c, struct prog_src_register tmp1src = src_reg_from_dst(tmp1); struct prog_src_register src0 = inst->SrcReg[0]; + /* find longest component of coord vector and normalize it */ tmpcoord = get_temp(c); coord = src_reg_from_dst(tmpcoord); + /* tmpcoord = src0 (i.e.: coord = src0) */ out = emit_op(c, OPCODE_MOV, tmpcoord, 0, 0, 0, @@ -581,6 +590,7 @@ static void precalc_tex( struct brw_wm_compile *c, out->SrcReg[0].NegateBase = 0; out->SrcReg[0].Abs = 1; + /* tmp0 = MAX(coord.X, coord.Y) */ emit_op(c, OPCODE_MAX, tmp0, 0, 0, 0, @@ -588,6 +598,7 @@ static void precalc_tex( struct brw_wm_compile *c, src_swizzle1(coord, Y), src_undef()); + /* tmp1 = MAX(tmp0, coord.Z) */ emit_op(c, OPCODE_MAX, tmp1, 0, 0, 0, @@ -595,6 +606,7 @@ static void precalc_tex( struct brw_wm_compile *c, src_swizzle1(coord, Z), src_undef()); + /* tmp0 = 1 / tmp1 */ emit_op(c, OPCODE_RCP, tmp0, 0, 0, 0, @@ -602,6 +614,7 @@ static void precalc_tex( struct brw_wm_compile *c, src_undef(), src_undef()); + /* tmpCoord = src0 * tmp0 */ emit_op(c, OPCODE_MUL, tmpcoord, 0, 0, 0, @@ -611,7 +624,8 @@ static void precalc_tex( struct brw_wm_compile *c, release_temp(c, tmp0); release_temp(c, tmp1); - } else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) { + } + else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) { struct prog_src_register scale = search_or_add_param5( c, STATE_INTERNAL, @@ -642,19 +656,9 @@ static void precalc_tex( struct brw_wm_compile *c, * conversion requires allocating a temporary variable which we * don't have the facility to do that late in the compilation. */ - if (!(c->key.yuvtex_mask & (1<DstReg, - inst->SaturateMode, - unit, - inst->TexSrcTarget, - coord, - src_undef(), - src_undef()); - } - else { - GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<key.yuvtex_mask & (1 << unit)) { + /* convert ycbcr to RGBA */ + GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<DstReg, + inst->SaturateMode, + unit, + inst->TexSrcTarget, + coord, + src_undef(), + src_undef()); + } if ((inst->TexSrcTarget == TEXTURE_RECT_INDEX) || (inst->TexSrcTarget == TEXTURE_CUBE_INDEX)) -- cgit v1.2.3 From c0d3b7679aa90e1a0dca2db152205efaec088b90 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 14:50:03 -0700 Subject: i965: implement GL_EXT_texture_swizzle If the texture swizzle is not XYZW (no-op) add an extra MOV instruction after the TEX instruction to rearrange the components. --- src/mesa/drivers/dri/i965/brw_wm.c | 5 +++++ src/mesa/drivers/dri/i965/brw_wm.h | 2 ++ src/mesa/drivers/dri/i965/brw_wm_fp.c | 19 +++++++++++++++++++ src/mesa/drivers/dri/intel/intel_extensions.c | 1 + 4 files changed, 27 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 1683308f44..3ee0ead993 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -242,6 +242,11 @@ static void brw_wm_populate_key( struct brw_context *brw, if (img->TexFormat->MesaFormat == MESA_FORMAT_YCBCR) key->yuvtex_swap_mask |= 1 << i; } + + key->tex_swizzles[i] = t->_Swizzle; + } + else { + key->tex_swizzles[i] = SWIZZLE_NOOP; } } diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 388c6f7618..0f46a25b1a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -70,6 +70,8 @@ struct brw_wm_prog_key { GLuint yuvtex_mask:16; GLuint yuvtex_swap_mask:16; /* UV swaped */ + GLuint tex_swizzles[BRW_MAX_TEX_UNIT]; + GLuint program_string_id:32; GLuint origin_x, origin_y; GLuint drawable_height; diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index fdacad0053..6b3f51dadc 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -111,6 +111,12 @@ static struct prog_src_register src_swizzle1( struct prog_src_register reg, int return src_swizzle(reg, x, x, x, x); } +static struct prog_src_register src_swizzle4( struct prog_src_register reg, uint swizzle ) +{ + reg.Swizzle = swizzle; + return reg; +} + /*********************************************************************** * Dest regs @@ -751,6 +757,19 @@ static void precalc_tex( struct brw_wm_compile *c, src_undef()); } + /* For GL_EXT_texture_swizzle: */ + if (c->key.tex_swizzles[unit] != SWIZZLE_NOOP) { + /* swizzle the result of the TEX instruction */ + struct prog_src_register tmpsrc = src_reg_from_dst(inst->DstReg); + emit_op(c, OPCODE_MOV, + inst->DstReg, + SATURATE_OFF, /* saturate already done above */ + 0, 0, /* tex unit, target N/A */ + src_swizzle4(tmpsrc, c->key.tex_swizzles[unit]), + src_undef(), + src_undef()); + } + if ((inst->TexSrcTarget == TEXTURE_RECT_INDEX) || (inst->TexSrcTarget == TEXTURE_CUBE_INDEX)) release_temp(c, tmpcoord); diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 23955018bf..8f09f8d645 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -137,6 +137,7 @@ static const struct dri_extension brw_extensions[] = { { "GL_EXT_shadow_funcs", NULL }, { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, { "GL_EXT_texture_sRGB", NULL }, + { "GL_EXT_texture_swizzle", NULL }, { "GL_EXT_vertex_array_bgra", NULL }, { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, { "GL_ATI_texture_env_combine3", NULL }, -- cgit v1.2.3 From 3dcc48e6882385f58ec9b19a3a7d5307ef9fc976 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 14:51:35 -0700 Subject: i965: minor tweak: replace OPCODE_MOV with OPCODE_SWZ Just to reinforce the understanding that an extended swizzle with 0 and 1 terms is possible there. --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 6b3f51dadc..ea3f3fc678 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -761,7 +761,7 @@ static void precalc_tex( struct brw_wm_compile *c, if (c->key.tex_swizzles[unit] != SWIZZLE_NOOP) { /* swizzle the result of the TEX instruction */ struct prog_src_register tmpsrc = src_reg_from_dst(inst->DstReg); - emit_op(c, OPCODE_MOV, + emit_op(c, OPCODE_SWZ, inst->DstReg, SATURATE_OFF, /* saturate already done above */ 0, 0, /* tex unit, target N/A */ -- cgit v1.2.3 From 26da28c995557c8b913e5ccfe31b31dc32e6c735 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jan 2009 16:49:28 -0700 Subject: mesa: remove GL_SGIX_shadow, GL_SGIX_shadow_ambient and GL_SGIX_depth_texture Everyone should be using the newer/better ARB versions of these extensions. --- docs/relnotes-7.5.html | 2 + src/mesa/main/attrib.c | 12 ++--- src/mesa/main/extensions.c | 7 +-- src/mesa/main/mtypes.h | 7 +-- src/mesa/main/texobj.c | 8 +--- src/mesa/main/texparam.c | 82 +++++---------------------------- src/mesa/main/texstate.c | 10 ---- src/mesa/shader/prog_statevars.c | 10 ++-- src/mesa/swrast/s_texfilter.c | 99 +--------------------------------------- 9 files changed, 29 insertions(+), 208 deletions(-) (limited to 'src') diff --git a/docs/relnotes-7.5.html b/docs/relnotes-7.5.html index ef8759ba6a..621bd4afac 100644 --- a/docs/relnotes-7.5.html +++ b/docs/relnotes-7.5.html @@ -48,6 +48,8 @@ including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0

Changes

    +
  • Remove support for GL_SGIX_shadow, GL_SGIX_shadow_ambient and +GL_SGIX_depth_texture extensions. Superseded by the ARB versions.
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 825c841ee2..3be7fd5a2d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -820,15 +820,9 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate) _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, obj->MaxAnisotropy); } - if (ctx->Extensions.SGIX_shadow) { - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_SGIX, - obj->CompareFlag); - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_OPERATOR_SGIX, - obj->CompareOperator); - } - if (ctx->Extensions.SGIX_shadow_ambient) { - _mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX, - obj->ShadowAmbient); + if (ctx->Extensions.ARB_shadow_ambient) { + _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB, + obj->CompareFailValue); } } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 86144c42ad..4ebdb5d9ae 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -62,7 +62,7 @@ static const struct { { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) }, { OFF, "GL_ARB_shadow", F(ARB_shadow) }, - { OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) }, + { OFF, "GL_ARB_shadow_ambient", F(ARB_shadow_ambient) }, { OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) }, { OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) }, { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, @@ -170,8 +170,6 @@ static const struct { { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, { OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) }, - { OFF, "GL_SGIX_shadow", F(SGIX_shadow) }, - { OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) }, { OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_S3_s3tc", F(S3_s3tc) }, }; @@ -214,6 +212,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_shading_language_120 = GL_FALSE; /* not quite done */ #endif ctx->Extensions.ARB_shadow = GL_TRUE; + ctx->Extensions.ARB_shadow_ambient = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; ctx->Extensions.ARB_texture_cube_map = GL_TRUE; ctx->Extensions.ARB_texture_env_combine = GL_TRUE; @@ -302,8 +301,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.SGI_texture_color_table = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; - ctx->Extensions.SGIX_shadow = GL_TRUE; - ctx->Extensions.SGIX_shadow_ambient = GL_TRUE; #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; #endif diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 8ab0d26f45..da243eceac 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1433,11 +1433,9 @@ struct gl_texture_object GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLboolean CompareFlag; /**< GL_SGIX_shadow */ - GLenum CompareOperator; /**< GL_SGIX_shadow */ - GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ GLenum CompareMode; /**< GL_ARB_shadow */ GLenum CompareFunc; /**< GL_ARB_shadow */ + GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */ GLenum _Function; /**< Comparison function derived from * \c CompareOperator, \c CompareMode, and * \c CompareFunc. @@ -2563,6 +2561,7 @@ struct gl_extensions GLboolean ARB_shading_language_100; GLboolean ARB_shading_language_120; GLboolean ARB_shadow; + GLboolean ARB_shadow_ambient; /* or GL_ARB_shadow_ambient */ GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_compression; GLboolean ARB_texture_cube_map; @@ -2660,8 +2659,6 @@ struct gl_extensions GLboolean SGIS_generate_mipmap; GLboolean SGIS_texture_edge_clamp; GLboolean SGIS_texture_lod; - GLboolean SGIX_shadow; - GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */ GLboolean TDFX_texture_compression_FXT1; GLboolean S3_s3tc; /*@}*/ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index fad39a0634..4e6cf439fc 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -134,12 +134,10 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, obj->BaseLevel = 0; obj->MaxLevel = 1000; obj->MaxAnisotropy = 1.0; - obj->CompareFlag = GL_FALSE; /* SGIX_shadow */ - obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX; /* SGIX_shadow */ obj->CompareMode = GL_NONE; /* ARB_shadow */ obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */ + obj->CompareFailValue = 0.0F; /* ARB_shadow_ambient */ obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */ - obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */ obj->Swizzle[0] = GL_RED; obj->Swizzle[1] = GL_GREEN; obj->Swizzle[2] = GL_BLUE; @@ -248,11 +246,9 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, dest->BaseLevel = src->BaseLevel; dest->MaxLevel = src->MaxLevel; dest->MaxAnisotropy = src->MaxAnisotropy; - dest->CompareFlag = src->CompareFlag; - dest->CompareOperator = src->CompareOperator; - dest->ShadowAmbient = src->ShadowAmbient; dest->CompareMode = src->CompareMode; dest->CompareFunc = src->CompareFunc; + dest->CompareFailValue = src->CompareFailValue; dest->DepthMode = src->DepthMode; dest->_MaxLevel = src->_MaxLevel; dest->_MaxLambda = src->_MaxLambda; diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 41c914e5b3..f610fa8dda 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -260,30 +260,6 @@ set_tex_parameteri(GLcontext *ctx, texObj->MaxLevel = params[0]; return; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); - } - return; - - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow && - (params[0] == GL_TEXTURE_LEQUAL_R_SGIX || - params[0] == GL_TEXTURE_GEQUAL_R_SGIX)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareOperator = params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); - } - return; - case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -454,14 +430,14 @@ set_tex_parameterf(GLcontext *ctx, } return; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); + texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); } else { _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); + "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)"); } return; @@ -512,8 +488,6 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) case GL_TEXTURE_WRAP_R: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: case GL_GENERATE_MIPMAP_SGIS: case GL_TEXTURE_COMPARE_MODE_ARB: case GL_TEXTURE_COMPARE_FUNC_ARB: @@ -556,8 +530,6 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) case GL_TEXTURE_WRAP_R: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: case GL_GENERATE_MIPMAP_SGIS: case GL_TEXTURE_COMPARE_MODE_ARB: case GL_TEXTURE_COMPARE_FUNC_ARB: @@ -613,7 +585,7 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) case GL_TEXTURE_PRIORITY: case GL_TEXTURE_MAX_ANISOTROPY_EXT: case GL_TEXTURE_LOD_BIAS: - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { GLfloat fparam = (GLfloat) param; /* convert int param to float */ @@ -662,7 +634,7 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) case GL_TEXTURE_PRIORITY: case GL_TEXTURE_MAX_ANISOTROPY_EXT: case GL_TEXTURE_LOD_BIAS: - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { /* convert int param to float */ GLfloat fparam = (GLfloat) params[0]; @@ -1060,23 +1032,9 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) else error = GL_TRUE; break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareFlag; - } - else - error = GL_TRUE; - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareOperator; - } - else - error = GL_TRUE; - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = obj->ShadowAmbient; + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { + *params = obj->CompareFailValue; } else error = GL_TRUE; @@ -1248,25 +1206,9 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) error = GL_TRUE; } break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareFlag; - } - else { - error = GL_TRUE; - } - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareOperator; - } - else { - error = GL_TRUE; - } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { + *params = (GLint) FLOAT_TO_INT(obj->CompareFailValue); } else { error = GL_TRUE; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 7cddec0bce..f7a4d8b323 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -404,16 +404,6 @@ update_texture_compare_function(GLcontext *ctx, */ tObj->_Function = GL_NONE; } - else if (tObj->CompareFlag) { - /* GL_SGIX_shadow */ - if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - tObj->_Function = GL_LEQUAL; - } - else { - ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX); - tObj->_Function = GL_GEQUAL; - } - } else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { /* GL_ARB_shadow */ tObj->_Function = tObj->CompareFunc; diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 615826b210..3ce60427bf 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -493,10 +493,10 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; if (texObj) { - value[0] = texObj->ShadowAmbient; - value[1] = texObj->ShadowAmbient; - value[2] = texObj->ShadowAmbient; - value[3] = texObj->ShadowAmbient; + value[0] = + value[1] = + value[2] = + value[3] = texObj->CompareFailValue; } } return; @@ -777,7 +777,7 @@ append_token(char *dst, gl_state_index k) append(dst, "PCMbias"); break; case STATE_SHADOW_AMBIENT: - append(dst, "ShadowAmbient"); + append(dst, "CompareFailValue"); break; default: /* probably STATE_INTERNAL_DRIVER+i (driver private state) */ diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index a095b255ab..8d72018cf4 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -2826,7 +2826,7 @@ sample_depth_texture( GLcontext *ctx, tObj->Target == GL_TEXTURE_1D_ARRAY_EXT || tObj->Target == GL_TEXTURE_2D_ARRAY_EXT); - UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient); + UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->CompareFailValue); /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */ @@ -3156,103 +3156,6 @@ sample_depth_texture( GLcontext *ctx, } -#if 0 -/* - * Experimental depth texture sampling function. - */ -static void -sample_depth_texture2(const GLcontext *ctx, - const struct gl_texture_unit *texUnit, - GLuint n, const GLfloat texcoords[][4], - GLchan texel[][4]) -{ - const struct gl_texture_object *texObj = texUnit->_Current; - const GLint baseLevel = texObj->BaseLevel; - const struct gl_texture_image *texImage = texObj->Image[0][baseLevel]; - const GLuint width = texImage->Width; - const GLuint height = texImage->Height; - GLchan ambient; - GLboolean lequal, gequal; - - if (texObj->Target != GL_TEXTURE_2D) { - _mesa_problem(ctx, "only 2-D depth textures supported at this time"); - return; - } - - if (texObj->MinFilter != texObj->MagFilter) { - _mesa_problem(ctx, "mipmapped depth textures not supported at this time"); - return; - } - - /* XXX the GL_SGIX_shadow extension spec doesn't say what to do if - * GL_TEXTURE_COMPARE_SGIX == GL_TRUE but the current texture object - * isn't a depth texture. - */ - if (texImage->TexFormat->BaseFormat != GL_DEPTH_COMPONENT) { - _mesa_problem(ctx,"GL_TEXTURE_COMPARE_SGIX enabled with non-depth texture"); - return; - } - - UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient); - - if (texObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - lequal = GL_TRUE; - gequal = GL_FALSE; - } - else { - lequal = GL_FALSE; - gequal = GL_TRUE; - } - - { - GLuint i; - for (i = 0; i < n; i++) { - const GLint K = 3; - GLint col, row, ii, jj, imin, imax, jmin, jmax, samples, count; - GLfloat w; - GLchan lum; - col = nearest_texel_location(texObj->WrapS, img, width, - texcoords[i][0]); - row = nearest_texel_location(texObj->WrapT, img, height, - texcoords[i][1]); - - imin = col - K; - imax = col + K; - jmin = row - K; - jmax = row + K; - - if (imin < 0) imin = 0; - if (imax >= width) imax = width - 1; - if (jmin < 0) jmin = 0; - if (jmax >= height) jmax = height - 1; - - samples = (imax - imin + 1) * (jmax - jmin + 1); - count = 0; - for (jj = jmin; jj <= jmax; jj++) { - for (ii = imin; ii <= imax; ii++) { - GLfloat depthSample; - texImage->FetchTexelf(texImage, ii, jj, 0, &depthSample); - if ((depthSample <= r[i] && lequal) || - (depthSample >= r[i] && gequal)) { - count++; - } - } - } - - w = (GLfloat) count / (GLfloat) samples; - w = CHAN_MAXF - w * (CHAN_MAXF - (GLfloat) ambient); - lum = (GLint) w; - - texel[i][RCOMP] = lum; - texel[i][GCOMP] = lum; - texel[i][BCOMP] = lum; - texel[i][ACOMP] = CHAN_MAX; - } - } -} -#endif - - /** * We use this function when a texture object is in an "incomplete" state. * When a fragment program attempts to sample an incomplete texture we -- cgit v1.2.3 From 33fa5e4bfad8005f09ad3c9fc92c40fa863935d1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2009 17:36:03 -0800 Subject: Make GL_ARB_texture_compression mandatory Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/common/utils.c | 2 + src/mesa/drivers/dri/i810/i810context.c | 2 - src/mesa/drivers/dri/intel/intel_extensions.c | 2 - src/mesa/drivers/dri/mach64/mach64_tex.c | 6 ++ src/mesa/drivers/dri/mga/mga_xmesa.c | 2 - src/mesa/drivers/dri/r128/r128_context.c | 2 - src/mesa/drivers/dri/r200/r200_context.c | 2 - src/mesa/drivers/dri/r300/r300_context.c | 2 - src/mesa/drivers/dri/radeon/radeon_context.c | 2 - src/mesa/drivers/dri/savage/savage_xmesa.c | 2 - src/mesa/drivers/dri/sis/sis_context.c | 3 - src/mesa/drivers/dri/tdfx/tdfx_context.c | 2 - src/mesa/drivers/glide/fxdd.c | 2 - src/mesa/main/attrib.c | 5 +- src/mesa/main/extensions.c | 4 +- src/mesa/main/get.c | 9 --- src/mesa/main/get_gen.py | 6 +- src/mesa/main/hint.c | 4 -- src/mesa/main/texcompress.c | 94 +++++++++++++-------------- src/mesa/main/texformat.c | 52 +++++++-------- src/mesa/main/teximage.c | 32 +++++---- src/mesa/main/texparam.c | 38 ++++------- 22 files changed, 114 insertions(+), 161 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 30c860b96c..7bee525770 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -180,6 +180,7 @@ driGetRendererString( char * buffer, const char * hardware_name, #define need_GL_ARB_multisample +#define need_GL_ARB_texture_compression #define need_GL_ARB_transpose_matrix #define need_GL_ARB_window_pos #define need_GL_EXT_compiled_vertex_array @@ -199,6 +200,7 @@ driGetRendererString( char * buffer, const char * hardware_name, static const struct dri_extension all_mesa_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, + { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions }, { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index c281a4990e..29c7363b49 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -64,7 +64,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #include "extension_helper.h" @@ -125,7 +124,6 @@ const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_crossbar", NULL }, diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 8f09f8d645..9030af113b 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -35,7 +35,6 @@ #define need_GL_ARB_occlusion_query #define need_GL_ARB_point_parameters #define need_GL_ARB_shader_objects -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_ARB_vertex_shader @@ -72,7 +71,6 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, { "GL_ARB_texture_border_clamp", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_cube_map", NULL }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_env_combine", NULL }, diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 1f9d3c57eb..9fe267eafd 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -152,6 +152,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: + case GL_COMPRESSED_ALPHA: case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: @@ -160,9 +161,11 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: + case GL_COMPRESSED_LUMINANCE_ALPHA: case 4: case GL_RGBA: case GL_RGBA2: + case GL_COMPRESSED_RGBA: if (mmesa->mach64Screen->cpp == 4) return &_mesa_texformat_argb8888; else @@ -193,6 +196,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: + case GL_COMPRESSED_RGB: if (mmesa->mach64Screen->cpp == 4) return &_mesa_texformat_argb8888; else @@ -204,6 +208,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: + case GL_COMPRESSED_LUMINANCE: if (mmesa->mach64Screen->cpp == 4) return &_mesa_texformat_argb8888; /* inefficient but accurate */ else @@ -214,6 +219,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: + case GL_COMPRESSED_INTENSITY: if (mmesa->mach64Screen->cpp == 4) return &_mesa_texformat_argb8888; /* inefficient but accurate */ else diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 86da3a2cac..0ebffe9e13 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -70,7 +70,6 @@ #include "GL/internal/dri_interface.h" #define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_EXT_fog_coord @@ -386,7 +385,6 @@ static const struct dri_extension g400_extensions[] = static const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_rectangle", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_blend_logic_op", NULL }, diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 535a98cc01..9437d900c3 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -66,7 +66,6 @@ int R128_DEBUG = 0; #endif #define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord @@ -77,7 +76,6 @@ const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 5531e0a739..cdd96ef2d3 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -63,7 +63,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_vertprog.h" #define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_ATI_fragment_shader @@ -123,7 +122,6 @@ const struct dri_extension card_extensions[] = { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_dot3", NULL }, diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index dc4cd5731d..4f7afbc20c 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -80,7 +80,6 @@ int hw_tcl_on = 1; #define need_GL_VERSION_2_0 #define need_GL_ARB_multisample #define need_GL_ARB_point_parameters -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_EXT_blend_equation_separate @@ -105,7 +104,6 @@ const struct dri_extension card_extensions[] = { {"GL_ARB_shadow", NULL}, {"GL_ARB_shadow_ambient", NULL}, {"GL_ARB_texture_border_clamp", NULL}, - {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions}, {"GL_ARB_texture_cube_map", NULL}, {"GL_ARB_texture_env_add", NULL}, {"GL_ARB_texture_env_combine", NULL}, diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 1e992c0b3d..cc34f24214 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -63,7 +63,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_maos.h" #define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord @@ -117,7 +116,6 @@ const struct dri_extension card_extensions[] = { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_crossbar", NULL }, diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index a344aab71b..d9dd28a7e6 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -60,7 +60,6 @@ #include "texmem.h" #define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_secondary_color #include "extension_helper.h" @@ -135,7 +134,6 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_texture_lod_bias", NULL }, diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 00d17da3ba..ce3a583b3b 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -58,7 +58,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_pipeline.h" #define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color @@ -77,7 +76,6 @@ struct dri_extension card_extensions[] = { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, /*{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },*/ @@ -93,7 +91,6 @@ struct dri_extension card_extensions_6326[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, /*{ "GL_ARB_texture_border_clamp", NULL },*/ - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, /*{ "GL_ARB_texture_mirrored_repeat", NULL },*/ /*{ "GL_MESA_ycbcr_texture", NULL },*/ { NULL, NULL } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index ef688d103d..53672daa97 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -61,7 +61,6 @@ #define need_GL_ARB_multisample /* #define need_GL_ARB_point_parameters */ #define need_GL_ARB_occlusion_query -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object /* #define need_GL_ARB_vertex_program */ #define need_GL_EXT_blend_equation_separate @@ -122,7 +121,6 @@ const struct dri_extension card_extensions[] = */ const struct dri_extension napalm_extensions[] = { - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_env_combine", NULL }, { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions }, { "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions }, diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 213ef2382f..f2d52cb493 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1862,7 +1862,6 @@ fxDDInitExtensions(GLcontext * ctx) } if (fxMesa->type >= GR_SSTTYPE_Voodoo4) { - _mesa_enable_extension(ctx, "GL_ARB_texture_compression"); _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); _mesa_enable_extension(ctx, "GL_S3_s3tc"); @@ -1894,7 +1893,6 @@ fxDDInitExtensions(GLcontext * ctx) * fxSetupSingleTMU_NoLock/fxSetupDoubleTMU_NoLock: * grTexDownloadTable(GR_TEXTABLE_NCC0, &(ti->palette)); */ - /*_mesa_enable_extension(ctx, "GL_ARB_texture_compression");*/ _mesa_enable_extension(ctx, "GL_SGIS_generate_mipmap"); } diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 3be7fd5a2d..36586758a4 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1006,9 +1006,8 @@ _mesa_PopAttrib(void) _mesa_Hint(GL_FOG_HINT, hint->Fog); _mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, hint->ClipVolumeClipping); - if (ctx->Extensions.ARB_texture_compression) - _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB, - hint->TextureCompression); + _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB, + hint->TextureCompression); } break; case GL_LIGHTING_BIT: diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 4ebdb5d9ae..46ca2ce766 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -64,7 +64,7 @@ static const struct { { OFF, "GL_ARB_shadow", F(ARB_shadow) }, { OFF, "GL_ARB_shadow_ambient", F(ARB_shadow_ambient) }, { OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) }, - { OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) }, + { ON, "GL_ARB_texture_compression", F(ARB_texture_compression) }, { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, { OFF, "GL_ARB_texture_env_add", F(EXT_texture_env_add) }, { OFF, "GL_ARB_texture_env_combine", F(ARB_texture_env_combine) }, @@ -345,7 +345,7 @@ _mesa_enable_1_3_extensions(GLcontext *ctx) ctx->Extensions.ARB_multisample = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; - ctx->Extensions.ARB_texture_compression = GL_TRUE; + /*ctx->Extensions.ARB_texture_compression = GL_TRUE;*/ ctx->Extensions.ARB_texture_cube_map = GL_TRUE; ctx->Extensions.ARB_texture_env_combine = GL_TRUE; ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index a5909913c8..d214ddc890 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1078,15 +1078,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN((1 << (ctx->Const.MaxCubeTextureLevels - 1))); break; case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Hint.TextureCompression); break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); { GLint formats[100]; GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); @@ -2930,15 +2927,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)((1 << (ctx->Const.MaxCubeTextureLevels - 1))); break; case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); params[0] = (GLfloat)(ctx->Hint.TextureCompression); break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); params[0] = (GLfloat)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); { GLint formats[100]; GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); @@ -4782,15 +4776,12 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1)); break; case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); params[0] = ctx->Hint.TextureCompression; break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); { GLint formats[100]; GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 4bdbfed0bf..c4d0aa9cc9 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -523,10 +523,10 @@ StateVars = [ # GL_ARB_texture_compression */ ( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint, - ["ctx->Hint.TextureCompression"], "", ["ARB_texture_compression"] ), + ["ctx->Hint.TextureCompression"], "", None ), ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint, ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"], - "", ["ARB_texture_compression"] ), + "", None ), ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum, [], """GLint formats[100]; @@ -534,7 +534,7 @@ StateVars = [ ASSERT(n <= 100); for (i = 0; i < n; i++) params[i] = CONVERSION(formats[i]);""", - ["ARB_texture_compression"] ), + None ), # GL_EXT_compiled_vertex_array ( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint, ["ctx->Array.LockFirst"], diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index dcfa9c7363..e2d4129a38 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -89,10 +89,6 @@ _mesa_Hint( GLenum target, GLenum mode ) /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSION_HINT_ARB: - if (!ctx->Extensions.ARB_texture_compression) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); - return; - } if (ctx->Hint.TextureCompression == mode) return; FLUSH_VERTICES(ctx, _NEW_HINT); diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 3ff633acd2..09eba151c0 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -56,60 +56,58 @@ GLuint _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) { GLuint n = 0; - if (ctx->Extensions.ARB_texture_compression) { - if (ctx->Extensions.TDFX_texture_compression_FXT1) { - if (formats) { - formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX; - formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX; - } - else { - n += 2; - } + if (ctx->Extensions.TDFX_texture_compression_FXT1) { + if (formats) { + formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX; + formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX; } - if (ctx->Extensions.EXT_texture_compression_s3tc) { - if (formats) { - formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; - /* This format has some restrictions/limitations and so should - * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query. - * Specifically, all transparent pixels become black. NVIDIA - * omits this format too. - */ - if (all) - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - } - else { - n += 3; - if (all) - n += 1; - } + else { + n += 2; } - if (ctx->Extensions.S3_s3tc) { - if (formats) { - formats[n++] = GL_RGB_S3TC; - formats[n++] = GL_RGB4_S3TC; - formats[n++] = GL_RGBA_S3TC; - formats[n++] = GL_RGBA4_S3TC; - } - else { - n += 4; - } + } + if (ctx->Extensions.EXT_texture_compression_s3tc) { + if (formats) { + formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + /* This format has some restrictions/limitations and so should + * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query. + * Specifically, all transparent pixels become black. NVIDIA + * omits this format too. + */ + if (all) + formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + } + else { + n += 3; + if (all) + n += 1; + } + } + if (ctx->Extensions.S3_s3tc) { + if (formats) { + formats[n++] = GL_RGB_S3TC; + formats[n++] = GL_RGB4_S3TC; + formats[n++] = GL_RGBA_S3TC; + formats[n++] = GL_RGBA4_S3TC; + } + else { + n += 4; } + } #if FEATURE_EXT_texture_sRGB - if (ctx->Extensions.EXT_texture_sRGB) { - if (formats) { - formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; - } - else { - n += 4; - } + if (ctx->Extensions.EXT_texture_sRGB) { + if (formats) { + formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; + formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + } + else { + n += 4; } -#endif /* FEATURE_EXT_texture_sRGB */ } +#endif /* FEATURE_EXT_texture_sRGB */ return n; } diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 08725846c6..ffbb7fb19d 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -1481,41 +1481,39 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } } - if (ctx->Extensions.ARB_texture_compression) { - switch (internalFormat) { - case GL_COMPRESSED_ALPHA_ARB: - return &_mesa_texformat_alpha; - case GL_COMPRESSED_LUMINANCE_ARB: - return &_mesa_texformat_luminance; - case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - return &_mesa_texformat_luminance_alpha; - case GL_COMPRESSED_INTENSITY_ARB: - return &_mesa_texformat_intensity; - case GL_COMPRESSED_RGB_ARB: + switch (internalFormat) { + case GL_COMPRESSED_ALPHA_ARB: + return &_mesa_texformat_alpha; + case GL_COMPRESSED_LUMINANCE_ARB: + return &_mesa_texformat_luminance; + case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: + return &_mesa_texformat_luminance_alpha; + 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; + 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; + 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: + 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; + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_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 */ + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.S3_s3tc) + return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ #endif - return &_mesa_texformat_rgba; - default: - ; /* fallthrough */ - } + return &_mesa_texformat_rgba; + default: + ; /* fallthrough */ } if (ctx->Extensions.MESA_ycbcr_texture) { diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 9e968ba743..2f594532cc 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -253,23 +253,21 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) } } - if (ctx->Extensions.ARB_texture_compression) { - switch (internalFormat) { - case GL_COMPRESSED_ALPHA: - return GL_ALPHA; - case GL_COMPRESSED_LUMINANCE: - return GL_LUMINANCE; - case GL_COMPRESSED_LUMINANCE_ALPHA: - return GL_LUMINANCE_ALPHA; - case GL_COMPRESSED_INTENSITY: - return GL_INTENSITY; - case GL_COMPRESSED_RGB: - return GL_RGB; - case GL_COMPRESSED_RGBA: - return GL_RGBA; - default: - ; /* fallthrough */ - } + switch (internalFormat) { + case GL_COMPRESSED_ALPHA: + return GL_ALPHA; + case GL_COMPRESSED_LUMINANCE: + return GL_LUMINANCE; + case GL_COMPRESSED_LUMINANCE_ALPHA: + return GL_LUMINANCE_ALPHA; + case GL_COMPRESSED_INTENSITY: + return GL_INTENSITY; + case GL_COMPRESSED_RGB: + return GL_RGB; + case GL_COMPRESSED_RGBA: + return GL_RGBA; + default: + ; /* fallthrough */ } if (ctx->Extensions.TDFX_texture_compression_FXT1) { diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index f610fa8dda..8df22fe9e2 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -849,33 +849,21 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: - if (ctx->Extensions.ARB_texture_compression) { - if (img->IsCompressed && !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, - img->TexFormat->MesaFormat); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexLevelParameter[if]v(pname)"); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } + if (img->IsCompressed && !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, + img->TexFormat->MesaFormat); + } + else { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexLevelParameter[if]v(pname)"); + } break; case GL_TEXTURE_COMPRESSED: - if (ctx->Extensions.ARB_texture_compression) { - *params = (GLint) img->IsCompressed; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } + *params = (GLint) img->IsCompressed; break; /* GL_ARB_texture_float */ -- cgit v1.2.3 From 2b77b1d62e6480f19aac1bde6f730b7da1046ce0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2009 17:50:45 -0800 Subject: Make GL_ARB_multisample mandatory Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/i810/i810context.c | 2 -- src/mesa/drivers/dri/intel/intel_extensions.c | 2 -- src/mesa/drivers/dri/mach64/mach64_context.c | 2 -- src/mesa/drivers/dri/mga/mga_xmesa.c | 2 -- src/mesa/drivers/dri/r128/r128_context.c | 2 -- src/mesa/drivers/dri/r200/r200_context.c | 2 -- src/mesa/drivers/dri/r300/r300_context.c | 2 -- src/mesa/drivers/dri/radeon/radeon_context.c | 2 -- src/mesa/drivers/dri/savage/savage_xmesa.c | 2 -- src/mesa/drivers/dri/sis/sis_context.c | 3 --- src/mesa/drivers/dri/tdfx/tdfx_context.c | 2 -- src/mesa/drivers/dri/unichrome/via_context.c | 2 -- src/mesa/main/enable.c | 10 ---------- src/mesa/main/extensions.c | 4 ++-- src/mesa/main/get.c | 24 ------------------------ src/mesa/main/get_gen.py | 16 ++++++++-------- src/mesa/main/multisample.c | 5 ----- 17 files changed, 10 insertions(+), 74 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index 29c7363b49..540aace3d0 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -63,7 +63,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" #include "utils.h" -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #include "extension_helper.h" @@ -122,7 +121,6 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) */ const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_env_combine", NULL }, diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 9030af113b..e43e34a858 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -31,7 +31,6 @@ #define need_GL_ARB_framebuffer_object -#define need_GL_ARB_multisample #define need_GL_ARB_occlusion_query #define need_GL_ARB_point_parameters #define need_GL_ARB_shader_objects @@ -67,7 +66,6 @@ * i965_dri. */ static const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, { "GL_ARB_texture_border_clamp", NULL }, diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 99abd209b6..f9667477c5 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -57,7 +57,6 @@ #include "utils.h" #include "vblank.h" -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #include "extension_helper.h" @@ -82,7 +81,6 @@ static const struct dri_debug_control debug_control[] = const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_texture_edge_clamp", NULL }, diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 0ebffe9e13..e41848d269 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -69,7 +69,6 @@ #include "GL/internal/dri_interface.h" -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_EXT_fog_coord @@ -384,7 +383,6 @@ static const struct dri_extension g400_extensions[] = static const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_texture_rectangle", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_blend_logic_op", NULL }, diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 9437d900c3..cbd05e3d4c 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -65,7 +65,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. int R128_DEBUG = 0; #endif -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord @@ -74,7 +73,6 @@ int R128_DEBUG = 0; const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index cdd96ef2d3..027d9a92dc 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -62,7 +62,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_maos.h" #include "r200_vertprog.h" -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_ATI_fragment_shader @@ -119,7 +118,6 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name ) */ const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, { "GL_ARB_texture_env_add", NULL }, diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 4f7afbc20c..56b9a3883a 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -78,7 +78,6 @@ int future_hw_tcl_on = 1; int hw_tcl_on = 1; #define need_GL_VERSION_2_0 -#define need_GL_ARB_multisample #define need_GL_ARB_point_parameters #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program @@ -98,7 +97,6 @@ const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ {"GL_ARB_depth_texture", NULL}, {"GL_ARB_fragment_program", NULL}, - {"GL_ARB_multisample", GL_ARB_multisample_functions}, {"GL_ARB_multitexture", NULL}, {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, {"GL_ARB_shadow", NULL}, diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index cc34f24214..156906e795 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -62,7 +62,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_tcl.h" #include "radeon_maos.h" -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord @@ -113,7 +112,6 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name ) */ const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, { "GL_ARB_texture_env_add", NULL }, diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index d9dd28a7e6..6ae42b6461 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -59,7 +59,6 @@ #include "drirenderbuffer.h" #include "texmem.h" -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_secondary_color #include "extension_helper.h" @@ -132,7 +131,6 @@ struct timeval tv_s1,tv_f1; static const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_stencil_wrap", NULL }, diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index ce3a583b3b..6c40f6db18 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -57,7 +57,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "tnl/t_pipeline.h" -#define need_GL_ARB_multisample #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color @@ -73,7 +72,6 @@ int GlobalCmdQueueLen = 0; struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, @@ -89,7 +87,6 @@ struct dri_extension card_extensions[] = struct dri_extension card_extensions_6326[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, /*{ "GL_ARB_texture_border_clamp", NULL },*/ /*{ "GL_ARB_texture_mirrored_repeat", NULL },*/ /*{ "GL_MESA_ycbcr_texture", NULL },*/ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 53672daa97..9d2d57ccc9 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -58,7 +58,6 @@ #include "utils.h" -#define need_GL_ARB_multisample /* #define need_GL_ARB_point_parameters */ #define need_GL_ARB_occlusion_query #define need_GL_ARB_vertex_buffer_object @@ -81,7 +80,6 @@ */ const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index f5bdb65eb0..990671fc49 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -62,7 +62,6 @@ #include "main/macros.h" #include "drirenderbuffer.h" -#define need_GL_ARB_multisample #define need_GL_ARB_point_parameters #define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_fog_coord @@ -366,7 +365,6 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, */ const struct dri_extension card_extensions[] = { - { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, { "GL_ARB_texture_env_add", NULL }, diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 1c026174b8..1b03410535 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -772,35 +772,30 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_ARB_multisample */ case GL_MULTISAMPLE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.Enabled == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.Enabled = state; break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleAlphaToCoverage == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.SampleAlphaToCoverage = state; break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleAlphaToOne == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.SampleAlphaToOne = state; break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleCoverage == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.SampleCoverage = state; break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleCoverageInvert == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); @@ -1284,19 +1279,14 @@ _mesa_IsEnabled( GLenum cap ) /* GL_ARB_multisample */ case GL_MULTISAMPLE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.Enabled; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleAlphaToCoverage; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleAlphaToOne; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleCoverage; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleCoverageInvert; /* GL_IBM_rasterpos_clip */ diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 46ca2ce766..3fb06764a6 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -52,7 +52,7 @@ static const struct { { OFF, "GL_ARB_framebuffer_object", F(ARB_framebuffer_object) }, { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, { OFF, "GL_ARB_imaging", F(ARB_imaging) }, - { OFF, "GL_ARB_multisample", F(ARB_multisample) }, + { ON, "GL_ARB_multisample", F(ARB_multisample) }, { OFF, "GL_ARB_multitexture", F(ARB_multitexture) }, { OFF, "GL_ARB_occlusion_query", F(ARB_occlusion_query) }, { OFF, "GL_ARB_pixel_buffer_object", F(EXT_pixel_buffer_object) }, @@ -342,7 +342,7 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) void _mesa_enable_1_3_extensions(GLcontext *ctx) { - ctx->Extensions.ARB_multisample = GL_TRUE; + /*ctx->Extensions.ARB_multisample = GL_TRUE;*/ ctx->Extensions.ARB_multitexture = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /*ctx->Extensions.ARB_texture_compression = GL_TRUE;*/ diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index d214ddc890..9aa2b4e1dc 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1365,35 +1365,27 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureMaxAnisotropy); break; case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.Enabled; break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleAlphaToCoverage; break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleAlphaToOne; break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleCoverage; break; case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = FLOAT_TO_BOOLEAN(ctx->Multisample.SampleCoverageValue); break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleCoverageInvert; break; case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.sampleBuffers); break; case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.samples); break; case GL_RASTER_POSITION_UNCLIPPED_IBM: @@ -3214,35 +3206,27 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Const.MaxTextureMaxAnisotropy; break; case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.Enabled); break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToCoverage); break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToOne); break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverage); break; case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = ctx->Multisample.SampleCoverageValue; break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverageInvert); break; case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = (GLfloat)(ctx->DrawBuffer->Visual.sampleBuffers); break; case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = (GLfloat)(ctx->DrawBuffer->Visual.samples); break; case GL_RASTER_POSITION_UNCLIPPED_IBM: @@ -5063,35 +5047,27 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Const.MaxTextureMaxAnisotropy); break; case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.Enabled); break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToCoverage); break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToOne); break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverage); break; case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = IROUND(ctx->Multisample.SampleCoverageValue); break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverageInvert); break; case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = ctx->DrawBuffer->Visual.sampleBuffers; break; case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = ctx->DrawBuffer->Visual.samples; break; case GL_RASTER_POSITION_UNCLIPPED_IBM: diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index c4d0aa9cc9..797f1354aa 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -681,21 +681,21 @@ StateVars = [ # GL_ARB_multisample ( "GL_MULTISAMPLE_ARB", GLboolean, - ["ctx->Multisample.Enabled"], "", ["ARB_multisample"] ), + ["ctx->Multisample.Enabled"], "", None ), ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean, - ["ctx->Multisample.SampleAlphaToCoverage"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleAlphaToCoverage"], "", None ), ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean, - ["ctx->Multisample.SampleAlphaToOne"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleAlphaToOne"], "", None ), ( "GL_SAMPLE_COVERAGE_ARB", GLboolean, - ["ctx->Multisample.SampleCoverage"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleCoverage"], "", None ), ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat, - ["ctx->Multisample.SampleCoverageValue"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleCoverageValue"], "", None ), ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean, - ["ctx->Multisample.SampleCoverageInvert"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleCoverageInvert"], "", None ), ( "GL_SAMPLE_BUFFERS_ARB", GLint, - ["ctx->DrawBuffer->Visual.sampleBuffers"], "", ["ARB_multisample"] ), + ["ctx->DrawBuffer->Visual.sampleBuffers"], "", None ), ( "GL_SAMPLES_ARB", GLint, - ["ctx->DrawBuffer->Visual.samples"], "", ["ARB_multisample"] ), + ["ctx->DrawBuffer->Visual.samples"], "", None ), # GL_IBM_rasterpos_clip ( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean, diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index b9cfad9216..01b68df7af 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -37,11 +37,6 @@ _mesa_SampleCoverageARB(GLclampf value, GLboolean invert) { GET_CURRENT_CONTEXT(ctx); - if (!ctx->Extensions.ARB_multisample) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleCoverageARB"); - return; - } - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); ctx->Multisample.SampleCoverageValue = (GLfloat) CLAMP(value, 0.0, 1.0); -- cgit v1.2.3 From 82b9661894315362f857192439bdcbc9db090387 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2009 18:04:12 -0800 Subject: Make GL_ARB_vertex_buffer_object mandatory Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/common/utils.c | 2 ++ src/mesa/drivers/dri/i810/i810context.c | 4 ---- src/mesa/drivers/dri/intel/intel_extensions.c | 2 -- src/mesa/drivers/dri/mach64/mach64_context.c | 4 ---- src/mesa/drivers/dri/mga/mga_xmesa.c | 2 -- src/mesa/drivers/dri/r128/r128_context.c | 2 -- src/mesa/drivers/dri/r200/r200_context.c | 2 -- src/mesa/drivers/dri/r300/r300_context.c | 2 -- src/mesa/drivers/dri/radeon/radeon_context.c | 2 -- src/mesa/drivers/dri/savage/savage_xmesa.c | 2 -- src/mesa/drivers/dri/sis/sis_context.c | 2 -- src/mesa/drivers/dri/tdfx/tdfx_context.c | 2 -- src/mesa/drivers/dri/unichrome/via_context.c | 2 -- src/mesa/drivers/glide/fxdd.c | 1 - src/mesa/main/extensions.c | 6 +++--- src/mesa/main/get.c | 30 --------------------------- src/mesa/main/get_gen.py | 20 +++++++++--------- src/mesa/shader/arbprogram.c | 4 ---- src/mesa/shader/nvprogram.c | 4 ---- 19 files changed, 15 insertions(+), 80 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 7bee525770..3fd88ea8fb 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -182,6 +182,7 @@ driGetRendererString( char * buffer, const char * hardware_name, #define need_GL_ARB_multisample #define need_GL_ARB_texture_compression #define need_GL_ARB_transpose_matrix +#define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_window_pos #define need_GL_EXT_compiled_vertex_array #define need_GL_EXT_polygon_offset @@ -202,6 +203,7 @@ static const struct dri_extension all_mesa_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions }, + { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions }, diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index 540aace3d0..6785655686 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -63,9 +63,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" #include "utils.h" -#define need_GL_ARB_vertex_buffer_object -#include "extension_helper.h" - #ifndef I810_DEBUG int I810_DEBUG = (0); #endif @@ -126,7 +123,6 @@ const struct dri_extension card_extensions[] = { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_crossbar", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_texture_edge_clamp", NULL }, { "GL_EXT_texture_env_combine", NULL }, diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index e43e34a858..c963892d98 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -34,7 +34,6 @@ #define need_GL_ARB_occlusion_query #define need_GL_ARB_point_parameters #define need_GL_ARB_shader_objects -#define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_ARB_vertex_shader #define need_GL_ARB_window_pos @@ -76,7 +75,6 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_texture_env_dot3", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_ARB_texture_rectangle", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, { "GL_EXT_blend_color", GL_EXT_blend_color_functions }, diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index f9667477c5..4edab846b0 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -57,9 +57,6 @@ #include "utils.h" #include "vblank.h" -#define need_GL_ARB_vertex_buffer_object -#include "extension_helper.h" - #ifndef MACH64_DEBUG int MACH64_DEBUG = (0); #endif @@ -82,7 +79,6 @@ static const struct dri_debug_control debug_control[] = const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_texture_edge_clamp", NULL }, { "GL_MESA_ycbcr_texture", NULL }, { "GL_SGIS_generate_mipmap", NULL }, diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index e41848d269..23ab5bca2d 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -69,7 +69,6 @@ #include "GL/internal/dri_interface.h" -#define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_EXT_fog_coord #define need_GL_EXT_gpu_program_parameters @@ -384,7 +383,6 @@ static const struct dri_extension g400_extensions[] = static const struct dri_extension card_extensions[] = { { "GL_ARB_texture_rectangle", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_blend_logic_op", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index cbd05e3d4c..4d6031f527 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -65,7 +65,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. int R128_DEBUG = 0; #endif -#define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color @@ -76,7 +75,6 @@ const struct dri_extension card_extensions[] = { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, { "GL_EXT_texture_edge_clamp", NULL }, diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 027d9a92dc..51b216a5f8 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -62,7 +62,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_maos.h" #include "r200_vertprog.h" -#define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_ATI_fragment_shader #define need_GL_EXT_blend_minmax @@ -125,7 +124,6 @@ const struct dri_extension card_extensions[] = { "GL_ARB_texture_env_dot3", NULL }, { "GL_ARB_texture_env_crossbar", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, { "GL_EXT_blend_subtract", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 56b9a3883a..bdf41e5392 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -79,7 +79,6 @@ int hw_tcl_on = 1; #define need_GL_VERSION_2_0 #define need_GL_ARB_point_parameters -#define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_vertex_program #define need_GL_EXT_blend_equation_separate #define need_GL_EXT_blend_func_separate @@ -108,7 +107,6 @@ 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_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, {"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}, diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 156906e795..38066134a9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -62,7 +62,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_tcl.h" #include "radeon_maos.h" -#define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color @@ -119,7 +118,6 @@ 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_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_blend_logic_op", NULL }, { "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 6ae42b6461..ab21505cbd 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -59,7 +59,6 @@ #include "drirenderbuffer.h" #include "texmem.h" -#define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_secondary_color #include "extension_helper.h" @@ -132,7 +131,6 @@ struct timeval tv_s1,tv_f1; static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_texture_lod_bias", NULL }, { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 6c40f6db18..a070fe3d79 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -57,7 +57,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "tnl/t_pipeline.h" -#define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color #include "extension_helper.h" @@ -75,7 +74,6 @@ struct dri_extension card_extensions[] = { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, /*{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },*/ { "GL_EXT_texture_lod_bias", NULL }, { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 9d2d57ccc9..1cebb59571 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -60,7 +60,6 @@ /* #define need_GL_ARB_point_parameters */ #define need_GL_ARB_occlusion_query -#define need_GL_ARB_vertex_buffer_object /* #define need_GL_ARB_vertex_program */ #define need_GL_EXT_blend_equation_separate #define need_GL_EXT_blend_func_separate @@ -82,7 +81,6 @@ const struct dri_extension card_extensions[] = { { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index 990671fc49..cb66c2d89d 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -63,7 +63,6 @@ #include "drirenderbuffer.h" #define need_GL_ARB_point_parameters -#define need_GL_ARB_vertex_buffer_object #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color #include "extension_helper.h" @@ -371,7 +370,6 @@ const struct dri_extension card_extensions[] = { "GL_ARB_texture_env_combine", NULL }, /* { "GL_ARB_texture_env_dot3", NULL }, */ { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, { "GL_EXT_stencil_wrap", NULL }, diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index f2d52cb493..2088f037dc 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1917,7 +1917,6 @@ fxDDInitExtensions(GLcontext * ctx) /* core-level extensions */ _mesa_enable_extension(ctx, "GL_EXT_multi_draw_arrays"); _mesa_enable_extension(ctx, "GL_IBM_multimode_draw_arrays"); - _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object"); /* dangerous */ if (getenv("MESA_FX_ALLOW_VP")) { _mesa_enable_extension(ctx, "GL_ARB_vertex_program"); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 3fb06764a6..0205a529aa 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -75,7 +75,7 @@ static const struct { { OFF, "GL_ARB_texture_non_power_of_two", F(ARB_texture_non_power_of_two)}, { OFF, "GL_ARB_texture_rectangle", F(NV_texture_rectangle) }, { ON, "GL_ARB_transpose_matrix", F(ARB_transpose_matrix) }, - { OFF, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) }, + { ON, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) }, { OFF, "GL_ARB_vertex_program", F(ARB_vertex_program) }, { OFF, "GL_ARB_vertex_shader", F(ARB_vertex_shader) }, { ON, "GL_ARB_window_pos", F(ARB_window_pos) }, @@ -228,7 +228,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_vertex_shader = GL_TRUE; #endif #if FEATURE_ARB_vertex_buffer_object - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; + /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/ #endif ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; #if FEATURE_ATI_fragment_shader @@ -389,7 +389,7 @@ void _mesa_enable_1_5_extensions(GLcontext *ctx) { ctx->Extensions.ARB_occlusion_query = GL_TRUE; - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; + /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/ ctx->Extensions.EXT_shadow_funcs = GL_TRUE; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 9aa2b4e1dc..613f067caa 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1581,43 +1581,33 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxSpotExponent); break; case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayBufferObj->Name); break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.BufferObj->Name); break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.BufferObj->Name); break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.BufferObj->Name); break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.BufferObj->Name); break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ElementArrayBufferObj->Name); break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: @@ -3422,43 +3412,33 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Const.MaxSpotExponent; break; case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayBufferObj->Name); break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.BufferObj->Name); break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.BufferObj->Name); break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.BufferObj->Name); break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.BufferObj->Name); break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ElementArrayBufferObj->Name); break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: @@ -5263,43 +5243,33 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Const.MaxSpotExponent); break; case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayBufferObj->Name; break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name; break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name; break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name; break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name; break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name; break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name; break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name; break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name; break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ElementArrayBufferObj->Name; break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 797f1354aa..78ccee9019 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -815,30 +815,30 @@ StateVars = [ # GL_ARB_vertex_buffer_object ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayBufferObj->Name"], "", None ), ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", None ), ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", None ), ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", None ), ( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", None ), ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), ( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", None ), ( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), ( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ArrayObj->FogCoord.BufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ElementArrayBufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), # GL_EXT_pixel_buffer_object ( "GL_PIXEL_PACK_BUFFER_BINDING_EXT", GLint, diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 7c2b747c43..7831e0faf9 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -335,10 +335,6 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]); break; case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - if (!ctx->Extensions.ARB_vertex_buffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribfvARB(pname)"); - return; - } params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name; break; default: diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 88272fff3f..16116c4339 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -469,10 +469,6 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params) params[3] = (GLint) ctx->Current.Attrib[index][3]; break; case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - if (!ctx->Extensions.ARB_vertex_buffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } params[0] = ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name; break; default: -- cgit v1.2.3 From 474cda6fa912a766821d20b5b21d6eeba6ea9225 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2009 18:16:51 -0800 Subject: Make GL_{EXT,SUN}_multi_draw_arrays and GL_IBM_multimode_draw_arrays mandatory Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/common/utils.c | 4 ++++ src/mesa/drivers/dri/intel/intel_extensions.c | 2 -- src/mesa/drivers/dri/mga/mga_xmesa.c | 2 -- src/mesa/drivers/dri/r200/r200_context.c | 2 -- src/mesa/drivers/dri/r300/r300_context.c | 2 -- src/mesa/drivers/dri/swrast/swrast.c | 2 -- src/mesa/drivers/dri/tdfx/tdfx_context.c | 4 ---- src/mesa/drivers/glide/fxdd.c | 2 -- src/mesa/drivers/x11/xm_api.c | 2 -- src/mesa/main/extensions.c | 12 ++++++------ 10 files changed, 10 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 3fd88ea8fb..04d334f278 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -185,9 +185,11 @@ driGetRendererString( char * buffer, const char * hardware_name, #define need_GL_ARB_vertex_buffer_object #define need_GL_ARB_window_pos #define need_GL_EXT_compiled_vertex_array +#define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_polygon_offset #define need_GL_EXT_texture_object #define need_GL_EXT_vertex_array +#define need_GL_IBM_multimode_draw_arrays #define need_GL_MESA_window_pos /* These are needed in *all* drivers because Mesa internally implements @@ -207,9 +209,11 @@ static const struct dri_extension all_mesa_extensions[] = { { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions }, + { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, { "GL_EXT_polygon_offset", GL_EXT_polygon_offset_functions }, { "GL_EXT_texture_object", GL_EXT_texture_object_functions }, { "GL_EXT_vertex_array", GL_EXT_vertex_array_functions }, + { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions }, { "GL_MESA_window_pos", GL_MESA_window_pos_functions }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { NULL, NULL } diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index c963892d98..549b239bd3 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -45,7 +45,6 @@ #define need_GL_EXT_fog_coord #define need_GL_EXT_framebuffer_object #define need_GL_EXT_framebuffer_blit -#define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_point_parameters #define need_GL_EXT_secondary_color #define need_GL_EXT_stencil_two_side @@ -85,7 +84,6 @@ static const struct dri_extension card_extensions[] = { { "GL_EXT_blend_subtract", NULL }, { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, - { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, { "GL_EXT_packed_depth_stencil", NULL }, { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, { "GL_EXT_stencil_wrap", NULL }, diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 23ab5bca2d..41fa9b29ff 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -72,7 +72,6 @@ #define need_GL_ARB_vertex_program #define need_GL_EXT_fog_coord #define need_GL_EXT_gpu_program_parameters -#define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_secondary_color #if 0 #define need_GL_EXT_paletted_texture @@ -385,7 +384,6 @@ static const struct dri_extension card_extensions[] = { "GL_ARB_texture_rectangle", NULL }, { "GL_EXT_blend_logic_op", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, - { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, /* paletted_textures currently doesn't work, but we could fix them later */ #if defined( need_GL_EXT_paletted_texture ) { "GL_EXT_shared_texture_palette", NULL }, diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 51b216a5f8..47ecd4b05a 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -66,7 +66,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_ATI_fragment_shader #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord -#define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_secondary_color #define need_GL_EXT_blend_equation_separate #define need_GL_EXT_blend_func_separate @@ -127,7 +126,6 @@ const struct dri_extension card_extensions[] = { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, { "GL_EXT_blend_subtract", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, - { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_texture_edge_clamp", NULL }, diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index bdf41e5392..e74d29e580 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -85,7 +85,6 @@ int hw_tcl_on = 1; #define need_GL_EXT_blend_minmax //#define need_GL_EXT_fog_coord #define need_GL_EXT_gpu_program_parameters -#define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_secondary_color #define need_GL_EXT_stencil_two_side #define need_GL_ATI_separate_stencil @@ -113,7 +112,6 @@ const struct dri_extension card_extensions[] = { {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, {"GL_EXT_blend_subtract", NULL}, // {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, - {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions}, {"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions}, {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, {"GL_EXT_shadow_funcs", NULL}, diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 4197603871..07e4ba0710 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -73,7 +73,6 @@ #define need_GL_EXT_gpu_program_parameters #define need_GL_EXT_paletted_texture #define need_GL_EXT_stencil_two_side -#define need_GL_IBM_multimode_draw_arrays #define need_GL_MESA_resize_buffers #define need_GL_NV_vertex_program #define need_GL_NV_fragment_program @@ -105,7 +104,6 @@ const struct dri_extension card_extensions[] = { "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_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions }, { "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 }, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 1cebb59571..aeb267a64a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -65,10 +65,8 @@ #define need_GL_EXT_blend_func_separate #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord -#define need_GL_EXT_multi_draw_arrays #define need_GL_EXT_paletted_texture /* #define need_GL_EXT_secondary_color */ -#define need_GL_IBM_multimode_draw_arrays /* #define need_GL_MESA_program_debug */ /* #define need_GL_NV_vertex_program */ #include "extension_helper.h" @@ -84,13 +82,11 @@ const struct dri_extension card_extensions[] = { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, - { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions }, { "GL_EXT_shared_texture_palette", NULL }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_texture_env_add", NULL }, { "GL_EXT_texture_lod_bias", NULL }, - { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions }, #ifdef need_GL_ARB_point_parameters { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 2088f037dc..e93ada2893 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1915,8 +1915,6 @@ fxDDInitExtensions(GLcontext * ctx) } /* core-level extensions */ - _mesa_enable_extension(ctx, "GL_EXT_multi_draw_arrays"); - _mesa_enable_extension(ctx, "GL_IBM_multimode_draw_arrays"); /* dangerous */ if (getenv("MESA_FX_ALLOW_VP")) { _mesa_enable_extension(ctx, "GL_ARB_vertex_program"); diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 18aa8bcc09..00ce3ba723 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1325,7 +1325,6 @@ xmesa_convert_from_x_visual_type( int visualType ) #define need_GL_EXT_framebuffer_blit #define need_GL_EXT_gpu_program_parameters #define need_GL_EXT_paletted_texture -#define need_GL_IBM_multimode_draw_arrays #define need_GL_MESA_resize_buffers #define need_GL_NV_vertex_program #define need_GL_NV_fragment_program @@ -1355,7 +1354,6 @@ const struct dri_extension card_extensions[] = { "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_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions }, { "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 }, diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 0205a529aa..ec6ba70800 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -99,7 +99,7 @@ static const struct { { 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) }, - { OFF, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) }, + { ON, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_EXT_packed_depth_stencil", F(EXT_packed_depth_stencil) }, { ON, "GL_EXT_packed_pixels", F(EXT_packed_pixels) }, { OFF, "GL_EXT_paletted_texture", F(EXT_paletted_texture) }, @@ -141,7 +141,7 @@ static const struct { { OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)}, { OFF, "GL_ATI_fragment_shader", F(ATI_fragment_shader)}, { OFF, "GL_ATI_separate_stencil", F(ATI_separate_stencil)}, - { OFF, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) }, + { ON, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) }, { ON, "GL_IBM_rasterpos_clip", F(IBM_rasterpos_clip) }, { OFF, "GL_IBM_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)}, { OFF, "GL_INGR_blend_func_separate", F(EXT_blend_func_separate) }, @@ -170,7 +170,7 @@ static const struct { { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, { OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) }, - { OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, + { ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_S3_s3tc", F(S3_s3tc) }, }; @@ -253,7 +253,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; #endif ctx->Extensions.EXT_histogram = GL_TRUE; - ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; + /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; ctx->Extensions.EXT_paletted_texture = GL_TRUE; #if FEATURE_EXT_pixel_buffer_object @@ -275,7 +275,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif ctx->Extensions.EXT_texture_swizzle = GL_TRUE; ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; - ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE; + /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/ ctx->Extensions.MESA_pack_invert = GL_TRUE; #if FEATURE_MESA_program_debug ctx->Extensions.MESA_program_debug = GL_TRUE; @@ -372,7 +372,7 @@ _mesa_enable_1_4_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; - ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; + /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ ctx->Extensions.EXT_point_parameters = GL_TRUE; ctx->Extensions.EXT_secondary_color = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; -- cgit v1.2.3 From 8aa209c766b79144db499063dd1c8482562b07bf Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2009 19:10:43 -0800 Subject: Make GL_ARB_draw_buffers mandatory Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/common/utils.c | 2 ++ src/mesa/drivers/dri/ffb/ffb_xmesa.c | 2 ++ src/mesa/drivers/dri/gamma/gamma_context.c | 2 ++ src/mesa/drivers/dri/i915/i830_context.c | 2 ++ src/mesa/drivers/dri/i915/i915_context.c | 2 ++ src/mesa/drivers/dri/intel/intel_extensions.c | 1 - src/mesa/drivers/dri/mach64/mach64_context.c | 1 + src/mesa/drivers/dri/mga/mga_xmesa.c | 2 ++ src/mesa/drivers/dri/r128/r128_context.c | 2 ++ src/mesa/drivers/dri/r200/r200_context.c | 2 ++ src/mesa/drivers/dri/r300/r300_context.c | 2 ++ src/mesa/drivers/dri/radeon/radeon_context.c | 2 ++ src/mesa/drivers/dri/s3v/s3v_context.c | 2 ++ src/mesa/drivers/dri/savage/savage_xmesa.c | 4 +++- src/mesa/drivers/dri/tdfx/tdfx_context.c | 2 ++ src/mesa/drivers/dri/trident/trident_context.c | 2 ++ src/mesa/drivers/dri/unichrome/via_context.c | 2 ++ src/mesa/drivers/glide/fxdd.c | 2 ++ src/mesa/drivers/windows/gldirect/dglcontext.c | 1 + src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c | 2 ++ src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c | 1 + src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c | 1 + src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c | 1 + src/mesa/main/attrib.c | 15 +++++++-------- src/mesa/main/buffers.c | 4 ---- src/mesa/main/extensions.c | 6 +++--- src/mesa/main/get.c | 15 --------------- src/mesa/main/get_gen.py | 10 +++++----- src/mesa/shader/arbprogparse.c | 3 +-- src/mesa/shader/slang/slang_preprocess.c | 3 +-- 30 files changed, 57 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 04d334f278..e4d228c575 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -179,6 +179,7 @@ driGetRendererString( char * buffer, const char * hardware_name, +#define need_GL_ARB_draw_buffers #define need_GL_ARB_multisample #define need_GL_ARB_texture_compression #define need_GL_ARB_transpose_matrix @@ -202,6 +203,7 @@ driGetRendererString( char * buffer, const char * hardware_name, #include "extension_helper.h" static const struct dri_extension all_mesa_extensions[] = { + { "GL_ARB_draw_buffers", GL_ARB_draw_buffers_functions }, { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions }, diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 679f8561d2..0cdbbd0ace 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -260,6 +260,8 @@ ffbCreateContext(const __GLcontextModes *mesaVis, ctx->Const.MaxLineWidthAA = 1.0; ctx->Const.LineWidthGranularity = 1.0; + ctx->Const.MaxDrawBuffers = 1; + /* Instead of having GCC emit these constants a zillion times * everywhere in the driver, put them here. */ diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c index c91bedce3a..b0ac299daa 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.c +++ b/src/mesa/drivers/dri/gamma/gamma_context.c @@ -133,6 +133,8 @@ GLboolean gammaCreateContext( const __GLcontextModes *glVisual, ctx->Const.MaxPointSizeAA = 16.0; ctx->Const.PointSizeGranularity = 0.25; + ctx->Const.MaxDrawBuffers = 1; + gmesa->texHeap = mmInit( 0, gmesa->gammaScreen->textureSize ); make_empty_list(&gmesa->TexObjList); diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index 09b1ec922f..fdce8af31f 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -97,6 +97,8 @@ i830CreateContext(const __GLcontextModes * mesaVis, ctx->Const.MaxTextureRectSize = (1 << 11); ctx->Const.MaxTextureUnits = I830_TEX_UNITS; + ctx->Const.MaxDrawBuffers = 1; + _tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12, 18 * sizeof(GLfloat)); diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 3d6af38057..c224c68b66 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -172,6 +172,8 @@ i915CreateContext(const __GLcontextModes * mesaVis, ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; + ctx->Const.MaxDrawBuffers = 1; + driInitExtensions(ctx, i915_extensions, GL_FALSE); diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 549b239bd3..27d056a3b7 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -109,7 +109,6 @@ static const struct dri_extension card_extensions[] = { /** i965-only extensions */ static const struct dri_extension brw_extensions[] = { { "GL_ARB_depth_texture", NULL }, - { "GL_ARB_draw_buffers", NULL }, { "GL_ARB_fragment_program", NULL }, { "GL_ARB_fragment_program_shadow", NULL }, { "GL_ARB_fragment_shader", NULL }, diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 4edab846b0..9c7f513c6f 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -190,6 +190,7 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual, ctx->Const.MaxTextureUnits = 2; ctx->Const.MaxTextureImageUnits = 2; ctx->Const.MaxTextureCoordUnits = 2; + ctx->Const.MaxDrawBuffers = 1; heap = mach64Screen->IsPCI ? MACH64_CARD_HEAP : MACH64_AGP_HEAP; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 41fa9b29ff..2d0f387cdc 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -531,6 +531,8 @@ mgaCreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxLineWidthAA = 10.0; ctx->Const.LineWidthGranularity = 1.0; + ctx->Const.MaxDrawBuffers = 1; + mmesa->texture_depth = driQueryOptioni (&mmesa->optionCache, "texture_depth"); if (mmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB) diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 4d6031f527..f511a67bad 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -223,6 +223,8 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual, ctx->Const.MaxLineWidthAA = 1.0; ctx->Const.LineWidthGranularity = 1.0; + ctx->Const.MaxDrawBuffers = 1; + #if ENABLE_PERF_BOXES rmesa->boxes = driQueryOptionb(&rmesa->optionCache, "performance_boxes"); #endif diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 47ecd4b05a..c06751516e 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -403,6 +403,8 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, ctx->Const.VertexProgram.MaxNativeParameters = R200_VSF_MAX_PARAM; ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; + ctx->Const.MaxDrawBuffers = 1; + /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index e74d29e580..4c14c7eefe 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -311,6 +311,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, #endif #endif + ctx->Const.MaxDrawBuffers = 1; + /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext(ctx); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 38066134a9..ea81a3250b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -353,6 +353,8 @@ radeonCreateContext( const __GLcontextModes *glVisual, rmesa->boxes = 0; + ctx->Const.MaxDrawBuffers = 1; + /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); diff --git a/src/mesa/drivers/dri/s3v/s3v_context.c b/src/mesa/drivers/dri/s3v/s3v_context.c index 14502f95ae..0a3bf7258d 100644 --- a/src/mesa/drivers/dri/s3v/s3v_context.c +++ b/src/mesa/drivers/dri/s3v/s3v_context.c @@ -108,6 +108,8 @@ GLboolean s3vCreateContext(const __GLcontextModes *glVisual, 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)); diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index ab21505cbd..c5decb093a 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -344,7 +344,9 @@ savageCreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxLineWidthAA = 3.0; ctx->Const.LineWidthGranularity = 1.0; #endif - + + ctx->Const.MaxDrawBuffers = 1; + /* Dri stuff */ imesa->hHWContext = driContextPriv->hHWContext; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index aeb267a64a..20046fcb3a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -309,6 +309,8 @@ GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxLineWidthAA = 1.0; ctx->Const.LineWidthGranularity = 1.0; + ctx->Const.MaxDrawBuffers = 1; + /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index e134cfcf8e..aefd8a243f 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -128,6 +128,8 @@ tridentCreateContext( const __GLcontextModes *glVisual, ctx->Const.MaxPointSizeAA = 16.0; ctx->Const.PointSizeGranularity = 0.25; + ctx->Const.MaxDrawBuffers = 1; + #if 0 tmesa->texHeap = mmInit( 0, tmesa->tridentScreen->textureSize ); diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index cb66c2d89d..6eb19ac079 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -573,6 +573,8 @@ viaCreateContext(const __GLcontextModes *visual, ctx->Const.MaxPointSizeAA = 1.0; ctx->Const.PointSizeGranularity = 1.0; + ctx->Const.MaxDrawBuffers = 1; + ctx->Driver.GetString = viaGetString; ctx->DriverCtx = (void *)vmesa; diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index e93ada2893..338cd37382 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1773,6 +1773,8 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1; ctx->Const.MaxTextureUnits = MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits); + ctx->Const.MaxDrawBuffers = 1; + fxMesa->new_state = _NEW_ALL; if (!fxMesa->haveHwStencil) { /* don't touch stencil if there is none */ diff --git a/src/mesa/drivers/windows/gldirect/dglcontext.c b/src/mesa/drivers/windows/gldirect/dglcontext.c index 4ad7a76e67..e9c23d1ccb 100644 --- a/src/mesa/drivers/windows/gldirect/dglcontext.c +++ b/src/mesa/drivers/windows/gldirect/dglcontext.c @@ -1482,6 +1482,7 @@ SkipPrimaryCreate: #else lpCtx->glCtx->Const.MaxTextureSize = 1024; #endif + lpCtx->glCtx->Const.MaxDrawBuffers = 1; // Setup the Display Driver pointers dglSetupDDPointers(lpCtx->glCtx); diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c index 0f8fe33eb1..fa44a952a0 100644 --- a/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c +++ b/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c @@ -1422,6 +1422,8 @@ BOOL gldInitialiseMesa_DX( lpCtx->glCtx->Const.MaxTextureUnits = 1; } + lpCtx->glCtx->Const.MaxDrawBuffers = 1; + // max texture size // MaxTextureSize = min(gld->d3dCaps8.MaxTextureHeight, gld->d3dCaps8.MaxTextureWidth); MaxTextureSize = min(gld->d3dCaps.dwMaxTextureHeight, gld->d3dCaps.dwMaxTextureWidth); diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c index 690f68b68f..011d810e97 100644 --- a/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c +++ b/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c @@ -1204,6 +1204,7 @@ BOOL gldInitialiseMesa_DX( MaxTextureSize >>= 1; } lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8; + lpCtx->glCtx->Const.MaxDrawBuffers = 1; IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE); IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE); diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c index dc465c5418..a03b865bb4 100644 --- a/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c +++ b/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c @@ -1206,6 +1206,7 @@ BOOL gldInitialiseMesa_DX( MaxTextureSize >>= 1; } lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8; + lpCtx->glCtx->Const.MaxDrawBuffers = 1; IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE); IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE); 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 b590dc795a..342a742867 100644 --- a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c +++ b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c @@ -1625,6 +1625,7 @@ BOOL gldInitialiseMesa_MesaSW( // Added this to force max texture diminsion to 256. KeithH ctx->Const.MaxTextureLevels = 8; + ctx->Const.MaxDrawBuffers = 1; _mesa_enable_sw_extensions(ctx); _mesa_enable_imaging_extensions(ctx); diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 36586758a4..98173cf786 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -903,14 +903,13 @@ _mesa_PopAttrib(void) * function, but legal for the later. */ GLboolean multipleBuffers = GL_FALSE; - if (ctx->Extensions.ARB_draw_buffers) { - GLuint i; - for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) { - if (color->DrawBuffer[i] != GL_NONE) { - multipleBuffers = GL_TRUE; - break; - } - } + GLuint i; + + for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) { + if (color->DrawBuffer[i] != GL_NONE) { + multipleBuffers = GL_TRUE; + break; + } } /* Call the API_level functions, not _mesa_drawbuffers() * since we need to do error checking on the pop'd diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index b23d2f612b..dc415c4f20 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -289,10 +289,6 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.ARB_draw_buffers) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB"); - return; - } if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) { _mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)"); return; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index ec6ba70800..8c9208af70 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -45,7 +45,7 @@ static const struct { int flag_offset; } default_extensions[] = { { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, - { OFF, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, + { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, @@ -184,7 +184,7 @@ void _mesa_enable_sw_extensions(GLcontext *ctx) { ctx->Extensions.ARB_depth_texture = GL_TRUE; - ctx->Extensions.ARB_draw_buffers = GL_TRUE; + /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ #if FEATURE_ARB_fragment_program ctx->Extensions.ARB_fragment_program = GL_TRUE; ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; @@ -401,7 +401,7 @@ _mesa_enable_1_5_extensions(GLcontext *ctx) void _mesa_enable_2_0_extensions(GLcontext *ctx) { - ctx->Extensions.ARB_draw_buffers = GL_TRUE; + /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ #if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; #endif diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 613f067caa..8e04ab9b9d 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1732,15 +1732,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN(ctx->VertexProgram.CurrentPosition); break; case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers); break; case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]); break; case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -1752,7 +1749,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -1764,7 +1760,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -3563,15 +3558,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)(ctx->VertexProgram.CurrentPosition); break; case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers); break; case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]); break; case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -3583,7 +3575,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -3595,7 +3586,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -5394,15 +5384,12 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->VertexProgram.CurrentPosition; break; case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); params[0] = ctx->Const.MaxDrawBuffers; break; case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]); break; case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -5414,7 +5401,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -5426,7 +5412,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 78ccee9019..83a8f2f786 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -914,9 +914,9 @@ StateVars = [ # GL_ARB_draw_buffers ( "GL_MAX_DRAW_BUFFERS_ARB", GLint, - ["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ), + ["ctx->Const.MaxDrawBuffers"], "", None ), ( "GL_DRAW_BUFFER0_ARB", GLenum, - ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", ["ARB_draw_buffers"] ), + ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ), ( "GL_DRAW_BUFFER1_ARB", GLenum, ["buffer"], """GLenum buffer; @@ -924,7 +924,7 @@ StateVars = [ _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); return; } - buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", ["ARB_draw_buffers"] ), + buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", None ), ( "GL_DRAW_BUFFER2_ARB", GLenum, ["buffer"], """GLenum buffer; @@ -932,7 +932,7 @@ StateVars = [ _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); return; } - buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", ["ARB_draw_buffers"] ), + buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", None ), ( "GL_DRAW_BUFFER3_ARB", GLenum, ["buffer"], """GLenum buffer; @@ -940,7 +940,7 @@ StateVars = [ _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); return; } - buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", ["ARB_draw_buffers"] ), + buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", None ), # XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future # GL_OES_read_format diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index a3a75c3b0a..c65d886a91 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -3616,8 +3616,7 @@ enable_parser_extensions(GLcontext *ctx, grammar id) if (ctx->Extensions.NV_texture_rectangle && !enable_ext(ctx, id, "texture_rectangle")) return GL_FALSE; - if (ctx->Extensions.ARB_draw_buffers - && !enable_ext(ctx, id, "draw_buffers")) + if (!enable_ext(ctx, id, "draw_buffers")) return GL_FALSE; if (ctx->Extensions.MESA_texture_array && !enable_ext(ctx, id, "texture_array")) diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index cd79c8b94a..89aaa3a621 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -508,8 +508,7 @@ static GLvoid pp_ext_init(pp_ext *self, const struct gl_extensions *extensions) { pp_ext_disable_all (self); - if (extensions->ARB_draw_buffers) - self->ARB_draw_buffers = GL_TRUE; + self->ARB_draw_buffers = GL_TRUE; if (extensions->NV_texture_rectangle) self->ARB_texture_rectangle = GL_TRUE; } -- cgit v1.2.3 From d485ee54dd7d8e41f6c423030a445e6ac000dd7d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2009 19:12:24 -0800 Subject: Make GLX_SGIX_pbuffer mandatory Signed-off-by: Ian Romanick --- src/glx/x11/glxextensions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c index d061fa9333..051433a006 100644 --- a/src/glx/x11/glxextensions.c +++ b/src/glx/x11/glxextensions.c @@ -99,7 +99,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(SGIS_color_range), VER(0,0), N, N, N, N }, { GLX(SGIS_multisample), VER(0,0), Y, Y, N, N }, { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N }, - { GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N }, + { GLX(SGIX_pbuffer), VER(1,3), Y, Y, N, N }, { GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N }, { GLX(SGIX_swap_group), VER(0,0), N, N, N, N }, { GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N }, -- cgit v1.2.3 From 425c803c039735aaaeb70f1613268fd4909862dc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2009 23:44:18 -0800 Subject: intel: Fix up some extension string issues Move the remaining extension string enables to intel_extensions.c. Make sure that GL_NV_texture_env_combine4 is not enabled on i830. --- src/mesa/drivers/dri/i915/i915_context.c | 13 ------------- src/mesa/drivers/dri/intel/intel_extensions.c | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index c224c68b66..6e2d41e19a 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -50,16 +50,6 @@ * Mesa's Driver Functions ***************************************/ -static const struct dri_extension i915_extensions[] = { - {"GL_ARB_depth_texture", NULL}, - {"GL_ARB_fragment_program", NULL}, - {"GL_ARB_shadow", NULL}, - {"GL_ARB_texture_non_power_of_two", NULL}, - {"GL_ATI_texture_env_combine3", NULL}, - {"GL_EXT_shadow_funcs", NULL}, - {NULL, NULL} -}; - /* Override intel default. */ static void @@ -174,9 +164,6 @@ i915CreateContext(const __GLcontextModes * mesaVis, ctx->Const.MaxDrawBuffers = 1; - driInitExtensions(ctx, i915_extensions, GL_FALSE); - - _tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12, 36 * sizeof(GLfloat)); diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 27d056a3b7..28223ca141 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -98,7 +98,6 @@ static const struct dri_extension card_extensions[] = { { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, { "GL_NV_point_sprite", GL_NV_point_sprite_functions }, - { "GL_NV_texture_env_combine4", NULL }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_vertex_program1_1", NULL }, { "GL_SGIS_generate_mipmap", NULL }, @@ -106,6 +105,19 @@ static const struct dri_extension card_extensions[] = { }; +/** i915 / i945-only extensions */ +static const struct dri_extension i915_extensions[] = { + { "GL_ARB_depth_texture", NULL }, + { "GL_ARB_fragment_program", NULL }, + { "GL_ARB_shadow", NULL }, + { "GL_ARB_texture_non_power_of_two", NULL }, + { "GL_ATI_texture_env_combine3", NULL }, + { "GL_EXT_shadow_funcs", NULL }, + { "GL_NV_texture_env_combine4", NULL }, + { NULL, NULL } +}; + + /** i965-only extensions */ static const struct dri_extension brw_extensions[] = { { "GL_ARB_depth_texture", NULL }, @@ -132,6 +144,7 @@ static const struct dri_extension brw_extensions[] = { { "GL_EXT_vertex_array_bgra", NULL }, { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, { "GL_ATI_texture_env_combine3", NULL }, + { "GL_NV_texture_env_combine4", NULL }, { NULL, NULL } }; @@ -169,4 +182,8 @@ intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) if (intel == NULL || IS_965(intel->intelScreen->deviceID)) driInitExtensions(ctx, brw_extensions, GL_FALSE); + + if (intel == NULL || IS_915(intel->intelScreen->deviceID) + || IS_945(intel->intelScreen->deviceID)) + driInitExtensions(ctx, i915_extensions, GL_FALSE); } -- cgit v1.2.3 From 2897cee99fb877e1f3cd9a881a61418c9c31867f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 09:20:18 -0700 Subject: mesa: fix a render to texture FBO validation bug When glTexImage() is called we need to re-validate any FBOs that point to the texture (i.e. render-to-texture) since changing the texture's size/format will effect FBO completeness. We don't keep a list of all FBOs rendering into each texture (which would be a bit messy) so we check all FBOs in existance. To optimize this, the gl_texture_object->_RenderToTexture flag is used to avoid checking textures that have never been used as renderbuffers. So, we only walk over all FBOs (there's usually only a few) when glTexImage() modifies a RTT texture. Fixes a bug seen in shadowtex.c when toggling packed depth/stencil mode. --- src/mesa/main/fbobject.c | 9 ++++++++ src/mesa/main/mtypes.h | 1 + src/mesa/main/teximage.c | 55 +++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 55 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 1a191cd288..eec8f1564b 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1469,6 +1469,15 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, if (texObj) { _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget, level, zoffset); + /* Set the render-to-texture flag. We'll check this flag in + * glTexImage() and friends to determine if we need to revalidate + * any FBOs that might be rendering into this texture. + * This flag never gets cleared since it's non-trivial to determine + * when all FBOs might be done rendering to this texture. That's OK + * though since it's uncommon to render to a texture then repeatedly + * call glTexImage() to change images in the texture. + */ + texObj->_RenderToTexture = GL_TRUE; } else { _mesa_remove_attachment(ctx, att); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index da243eceac..ad9225e5a9 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1448,6 +1448,7 @@ struct gl_texture_object GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLboolean _Complete; /**< Is texture object complete? */ + GLboolean _RenderToTexture; /**< Any rendering to this texture? */ /** Actual texture images, indexed by [cube face] and [mipmap level] */ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 2f594532cc..7b9efb6e41 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -37,6 +37,7 @@ #endif #include "fbobject.h" #include "framebuffer.h" +#include "hash.h" #include "image.h" #include "imports.h" #include "macros.h" @@ -2378,23 +2379,33 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, } +/** Callback info for walking over FBO hash table */ +struct cb_info +{ + GLcontext *ctx; + struct gl_texture_object *texObj; + GLuint level, face; +}; + /** - * Check if the given texture image is bound to any framebuffer objects - * and update/invalidate them. - * XXX We're only checking the currently bound framebuffer object for now. - * In the future, perhaps struct gl_texture_image should have a pointer (or - * list of pointers (yikes)) to the gl_framebuffer(s) which it's bound to. + * Check render to texture callback. Called from _mesa_HashWalk(). */ static void -update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, - GLuint face, GLuint level) +check_rtt_cb(GLuint key, void *data, void *userData) { - if (ctx->DrawBuffer->Name) { + struct gl_framebuffer *fb = (struct gl_framebuffer *) data; + const struct cb_info *info = (struct cb_info *) userData; + GLcontext *ctx = info->ctx; + const struct gl_texture_object *texObj = info->texObj; + const GLuint level = info->level, face = info->face; + + /* If this is a user-created FBO */ + if (fb->Name) { GLuint i; + /* check if any of the FBO's attachments point to 'texObj' */ for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = - ctx->DrawBuffer->Attachment + i; + struct gl_renderbuffer_attachment *att = fb->Attachment + i; if (att->Type == GL_TEXTURE && att->Texture == texObj && att->TextureLevel == level && @@ -2402,12 +2413,36 @@ update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, ASSERT(att->Texture->Image[att->CubeMapFace][att->TextureLevel]); /* Tell driver about the new renderbuffer texture */ ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att); + /* Mark fb status as indeterminate to force re-validation */ + fb->_Status = 0; } } } } +/** + * When a texture image is specified we have to check if it's bound to + * any framebuffer objects (render to texture) in order to detect changes + * in size or format since that effects FBO completeness. + * Any FBOs rendering into the texture must be re-validated. + */ +static void +update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, + GLuint face, GLuint level) +{ + /* Only check this texture if it's been marked as RenderToTexture */ + if (texObj->_RenderToTexture) { + struct cb_info info; + info.ctx = ctx; + info.texObj = texObj; + info.level = level; + info.face = face; + _mesa_HashWalk(ctx->Shared->FrameBuffers, check_rtt_cb, &info); + } +} + + /* * Called from the API. Note that width includes the border. -- cgit v1.2.3 From ba367f68ccacf255f78ac0c8dd066e64bbb1e5c2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 11:07:14 -0700 Subject: i965: fix render to FBO/texture orientation bugs Anytime we're not rendering to the default/window FBO, need to invert rendering, not just when rendering to a texture. Otherwise, if a FBO consists of a mix of textures and renderbuffers the up/down orientation was inconsistant. Fixes shadowtex.c bad rendering. --- src/mesa/drivers/dri/i965/brw_sf_state.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index af95020756..47bd732d3c 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -43,10 +43,11 @@ static void upload_sf_vp(struct brw_context *brw) const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF; struct brw_sf_viewport sfv; GLfloat y_scale, y_bias; + const GLboolean render_to_fbo = (ctx->DrawBuffer->Name != 0); memset(&sfv, 0, sizeof(sfv)); - if (intel_rendering_to_texture(ctx)) { + if (render_to_fbo) { y_scale = 1.0; y_bias = 0; } @@ -84,7 +85,7 @@ static void upload_sf_vp(struct brw_context *brw) * Note that the hardware's coordinates are inclusive, while Mesa's min is * inclusive but max is exclusive. */ - if (intel_rendering_to_texture(ctx)) { + if (render_to_fbo) { /* texmemory: Y=0=bottom */ sfv.scissor.xmin = ctx->DrawBuffer->_Xmin; sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1; @@ -123,7 +124,7 @@ struct brw_sf_unit_key { GLboolean scissor, line_smooth, point_sprite, point_attenuated; float line_width; float point_size; - GLboolean render_to_texture; + GLboolean render_to_fbo; }; static void @@ -155,7 +156,7 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key) key->point_size = brw->attribs.Point->Size; key->point_attenuated = brw->attribs.Point->_Attenuated; - key->render_to_texture = intel_rendering_to_texture(&brw->intel.ctx); + key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; } static dri_bo * @@ -202,10 +203,10 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key, else sf.sf5.front_winding = BRW_FRONTWINDING_CW; - /* The viewport is inverted for rendering to texture, and that inverts + /* The viewport is inverted for rendering to a FBO, and that inverts * polygon front/back orientation. */ - sf.sf5.front_winding ^= key->render_to_texture; + sf.sf5.front_winding ^= key->render_to_fbo; switch (key->cull_face) { case GL_FRONT: -- cgit v1.2.3 From 818bda3d7428469d7c29ebc08c31c30a877747e1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 11:07:55 -0700 Subject: intel: remove unused intel_rendering_to_texture() --- src/mesa/drivers/dri/intel/intel_fbo.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 41ced2a01a..4c89a48850 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -138,22 +138,4 @@ intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex) } -/** - * Are we currently rendering into a texture? - */ -static INLINE GLboolean -intel_rendering_to_texture(const GLcontext *ctx) -{ - if (ctx->DrawBuffer->Name) { - /* User-created FBO */ - const struct intel_renderbuffer *irb = - intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); - return irb && irb->RenderToTexture; - } - else { - return GL_FALSE; - } -} - - #endif /* INTEL_FBO_H */ -- cgit v1.2.3 From d3aa16d92f1eb228daaa49810e113d2aed06aefd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 11:10:56 -0700 Subject: i965: use bitfields in brw_sf_unit_key struct --- src/mesa/drivers/dri/i965/brw_sf_state.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 47bd732d3c..8fe7b22afb 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -121,10 +121,13 @@ struct brw_sf_unit_key { unsigned int nr_urb_entries, urb_size, sfsize; GLenum front_face, cull_face; - GLboolean scissor, line_smooth, point_sprite, point_attenuated; + unsigned scissor:1; + unsigned line_smooth:1; + unsigned point_sprite:1; + unsigned point_attenuated:1; + unsigned render_to_fbo:1; float line_width; float point_size; - GLboolean render_to_fbo; }; static void -- cgit v1.2.3 From ba3aadf354e197ab56adddc99c3b3335d7e6863e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 14:57:16 -0700 Subject: intel: fix check for Y orientation in span functions. --- src/mesa/drivers/dri/intel/intel_span.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index c990caf3eb..bdd2fd9e85 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -255,8 +255,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define LOCAL_VARS \ struct intel_context *intel = intel_context(ctx); \ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ - const GLint yScale = irb->RenderToTexture ? 1 : -1; \ - const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \ + const GLint yScale = ctx->DrawBuffer->Name ? 1 : -1; \ + const GLint yBias = ctx->DrawBuffer->Name ? 0 : irb->Base.Height - 1;\ unsigned int num_cliprects; \ struct drm_clip_rect *cliprects; \ int x_off, y_off; \ @@ -392,8 +392,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define LOCAL_DEPTH_VARS \ struct intel_context *intel = intel_context(ctx); \ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ - const GLint yScale = irb->RenderToTexture ? 1 : -1; \ - const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \ + const GLint yScale = ctx->DrawBuffer->Name ? 1 : -1; \ + const GLint yBias = ctx->DrawBuffer->Name ? 0 : irb->Base.Height - 1;\ unsigned int num_cliprects; \ struct drm_clip_rect *cliprects; \ int x_off, y_off; \ -- cgit v1.2.3 From 5c38801f8e36fdb4a16ed33c26454b98f3519465 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 14:57:31 -0700 Subject: intel: formatting clean-ups --- src/mesa/drivers/dri/intel/intel_fbo.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 53a74f5c0b..659d206bc8 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -61,6 +61,7 @@ intel_new_framebuffer(GLcontext * ctx, GLuint name) } +/** Called by gl_renderbuffer::Delete() */ static void intel_delete_renderbuffer(struct gl_renderbuffer *rb) { @@ -81,7 +82,6 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb) } - /** * Return a pointer to a specific pixel in a renderbuffer. */ @@ -96,7 +96,6 @@ intel_get_pointer(GLcontext * ctx, struct gl_renderbuffer *rb, } - /** * Called via glRenderbufferStorageEXT() to set the format and allocate * storage for a user-created renderbuffer. @@ -227,7 +226,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, } - /** * Called for each hardware renderbuffer when a _window_ is resized. * Just update fields. @@ -245,6 +243,7 @@ intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb, return GL_TRUE; } + static void intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb, GLuint width, GLuint height) @@ -271,6 +270,8 @@ intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb, } } + +/** Dummy function for gl_renderbuffer::AllocStorage() */ static GLboolean intel_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, GLenum internalFormat, GLuint width, GLuint height) @@ -292,6 +293,7 @@ intel_renderbuffer_set_region(struct intel_renderbuffer *rb, intel_region_release(&old); } + /** * Create a new intel_renderbuffer which corresponds to an on-screen window, * not a user-created renderbuffer. @@ -434,6 +436,7 @@ intel_framebuffer_renderbuffer(GLcontext * ctx, intel_draw_buffer(ctx, fb); } + static GLboolean intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, struct gl_texture_image *texImage) @@ -485,6 +488,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, return GL_TRUE; } + /** * When glFramebufferTexture[123]D is called this function sets up the * gl_renderbuffer wrapper around the texture image. @@ -493,7 +497,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, static struct intel_renderbuffer * intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage) { - const GLuint name = ~0; /* not significant, but distinct for debugging */ + const GLuint name = ~0; /* not significant, but distinct for debugging */ struct intel_renderbuffer *irb; /* make an intel_renderbuffer to wrap the texture image */ @@ -540,10 +544,11 @@ intel_render_texture(GLcontext * ctx, /* Fallback on drawing to a texture with a border, which won't have a * miptree. */ - _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); - _mesa_render_texture(ctx, fb, att); - return; - } else if (!irb) { + _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); + _mesa_render_texture(ctx, fb, att); + return; + } + else if (!irb) { irb = intel_wrap_texture(ctx, newImage); if (irb) { /* bind the wrapper to the attachment point */ @@ -554,7 +559,9 @@ intel_render_texture(GLcontext * ctx, _mesa_render_texture(ctx, fb, att); return; } - } if (!intel_update_wrapper(ctx, irb, newImage)) { + } + + if (!intel_update_wrapper(ctx, irb, newImage)) { _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); _mesa_render_texture(ctx, fb, att); return; -- cgit v1.2.3 From 5fec84ad0446d4d6d842f5cf740f9787678113be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 15:01:09 -0700 Subject: mesa: allow glFramebufferTexture1/2/3D(target = GL_READ/DRAW_FRAMEBUFFER) This is part of GL_EXT_framebuffer_blit and GL_ARB_framebuffer_obbject. --- src/mesa/main/fbobject.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index eec8f1564b..d08ad33902 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1367,16 +1367,31 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, struct gl_renderbuffer_attachment *att; struct gl_texture_object *texObj = NULL; struct gl_framebuffer *fb; + GLboolean error = GL_FALSE; ASSERT_OUTSIDE_BEGIN_END(ctx); - if (target != GL_FRAMEBUFFER_EXT) { + switch (target) { + case GL_READ_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + fb = ctx->ReadBuffer; + break; + case GL_DRAW_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + /* fall-through */ + case GL_FRAMEBUFFER_EXT: + fb = ctx->DrawBuffer; + break; + default: + error = GL_TRUE; + } + + if (error) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(target)", caller); + "glFramebufferTexture%sEXT(target=0x%x)", caller, target); return; } - fb = ctx->DrawBuffer; ASSERT(fb); /* check framebuffer binding */ @@ -1518,7 +1533,7 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, (textarget != GL_TEXTURE_RECTANGLE_ARB) && (!IS_CUBE_FACE(textarget))) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture2DEXT(textarget)"); + "glFramebufferTexture2DEXT(textarget=0x%x)", textarget); return; } -- cgit v1.2.3 From d332a74e772eb60cf3cef33cafad997436fd9e93 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 15:06:55 -0700 Subject: intel: remove unused #includes --- src/mesa/drivers/dri/intel/intel_fbo.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 659d206bc8..133fa9b8fe 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -38,11 +38,9 @@ #include "intel_context.h" #include "intel_buffers.h" -#include "intel_depthstencil.h" #include "intel_fbo.h" #include "intel_mipmap_tree.h" #include "intel_regions.h" -#include "intel_span.h" #define FILE_DEBUG_FLAG DEBUG_FBO -- cgit v1.2.3 From 1d4f3ccb210874ead3cb75c2a0b1f1945c892acd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 15:07:32 -0700 Subject: intel: remove unused intel_depthstencil.[ch] --- src/mesa/drivers/dri/intel/intel_depthstencil.c | 261 ------------------------ src/mesa/drivers/dri/intel/intel_depthstencil.h | 15 -- 2 files changed, 276 deletions(-) delete mode 100644 src/mesa/drivers/dri/intel/intel_depthstencil.c delete mode 100644 src/mesa/drivers/dri/intel/intel_depthstencil.h (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_depthstencil.c b/src/mesa/drivers/dri/intel/intel_depthstencil.c deleted file mode 100644 index 354b3bf0d7..0000000000 --- a/src/mesa/drivers/dri/intel/intel_depthstencil.c +++ /dev/null @@ -1,261 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 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. - * - **************************************************************************/ - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/context.h" -#include "main/depthstencil.h" -#include "main/fbobject.h" -#include "main/framebuffer.h" -#include "main/hash.h" -#include "main/mtypes.h" -#include "main/renderbuffer.h" - -#include "intel_context.h" -#include "intel_fbo.h" -#include "intel_depthstencil.h" -#include "intel_regions.h" -#include "intel_span.h" - -/** - * The GL_EXT_framebuffer_object allows the user to create their own - * framebuffer objects consisting of color renderbuffers (0 or more), - * depth renderbuffers (0 or 1) and stencil renderbuffers (0 or 1). - * - * The spec considers depth and stencil renderbuffers to be totally independent - * buffers. In reality, most graphics hardware today uses a combined - * depth+stencil buffer (one 32-bit pixel = 24 bits of Z + 8 bits of stencil). - * - * This causes difficulty because the user may create some number of depth - * renderbuffers and some number of stencil renderbuffers and bind them - * together in framebuffers in any combination. - * - * This code manages all that. - * - * 1. Depth renderbuffers are always allocated in hardware as 32bpp - * GL_DEPTH24_STENCIL8 buffers. - * - * 2. Stencil renderbuffers are initially allocated in software as 8bpp - * GL_STENCIL_INDEX8 buffers. - * - * 3. Depth and Stencil renderbuffers use the PairedStencil and PairedDepth - * fields (respectively) to indicate if the buffer's currently paired - * with another stencil or depth buffer (respectively). - * - * 4. When a depth and stencil buffer are initially both attached to the - * current framebuffer, we merge the stencil buffer values into the - * depth buffer (really a depth+stencil buffer). The then hardware uses - * the combined buffer. - * - * 5. Whenever a depth or stencil buffer is reallocated (with - * glRenderbufferStorage) we undo the pairing and copy the stencil values - * from the combined depth/stencil buffer back to the stencil-only buffer. - * - * 6. We also undo the pairing when we find a change in buffer bindings. - * - * 7. If a framebuffer is only using a depth renderbuffer (no stencil), we - * just use the combined depth/stencil buffer and ignore the stencil values. - * - * 8. If a framebuffer is only using a stencil renderbuffer (no depth) we have - * to promote the 8bpp software stencil buffer to a 32bpp hardware - * depth+stencil buffer. - * - */ - -/** - * Undo the pairing/interleaving between depth and stencil buffers. - * irb should be a depth/stencil or stencil renderbuffer. - */ -void -intel_unpair_depth_stencil(GLcontext *ctx, struct intel_renderbuffer *irb) -{ - struct intel_context *intel = intel_context(ctx); - struct gl_renderbuffer *rb = &irb->Base; - - if (irb->PairedStencil) { - /* irb is a depth/stencil buffer */ - struct gl_renderbuffer *stencilRb; - struct intel_renderbuffer *stencilIrb; - - ASSERT(rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - - stencilRb = _mesa_lookup_renderbuffer(ctx, irb->PairedStencil); - stencilIrb = intel_renderbuffer(stencilRb); - if (stencilIrb) { - /* need to extract stencil values from the depth buffer */ - ASSERT(stencilIrb->PairedDepth == rb->Name); - intel_renderbuffer_map(intel, rb); - intel_renderbuffer_map(intel, stencilRb); -#if 0 - /* disable for now */ - _mesa_extract_stencil(ctx, rb, stencilRb); -#endif - intel_renderbuffer_unmap(intel, stencilRb); - intel_renderbuffer_unmap(intel, rb); - stencilIrb->PairedDepth = 0; - } - irb->PairedStencil = 0; - } - else if (irb->PairedDepth) { - /* irb is a stencil buffer */ - struct gl_renderbuffer *depthRb; - struct intel_renderbuffer *depthIrb; - - ASSERT(rb->_ActualFormat == GL_STENCIL_INDEX8_EXT || - rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - - depthRb = _mesa_lookup_renderbuffer(ctx, irb->PairedDepth); - depthIrb = intel_renderbuffer(depthRb); - if (depthIrb) { - /* need to extract stencil values from the depth buffer */ - ASSERT(depthIrb->PairedStencil == rb->Name); - intel_renderbuffer_map(intel, rb); - intel_renderbuffer_map(intel, depthRb); -#if 0 - /* disable for now */ - _mesa_extract_stencil(ctx, depthRb, rb); -#endif - intel_renderbuffer_unmap(intel, depthRb); - intel_renderbuffer_unmap(intel, rb); - depthIrb->PairedStencil = 0; - } - irb->PairedDepth = 0; - } - else { - _mesa_problem(ctx, "Problem in undo_depth_stencil_pairing"); - } - - ASSERT(irb->PairedStencil == 0); - ASSERT(irb->PairedDepth == 0); -} - - -/** - * Examine the depth and stencil renderbuffers which are attached to the - * framebuffer. If both depth and stencil are attached, make sure that the - * renderbuffers are 'paired' (combined). If only depth or only stencil is - * attached, undo any previous pairing. - * - * Must be called if NewState & _NEW_BUFFER (when renderbuffer attachments - * change, for example). - */ -void -intel_validate_paired_depth_stencil(GLcontext * ctx, - struct gl_framebuffer *fb) -{ - struct intel_context *intel = intel_context(ctx); - struct intel_renderbuffer *depthRb, *stencilRb; - - depthRb = intel_get_renderbuffer(fb, BUFFER_DEPTH); - stencilRb = intel_get_renderbuffer(fb, BUFFER_STENCIL); - - if (depthRb && stencilRb) { - if (depthRb == stencilRb) { - /* Using a user-created combined depth/stencil buffer. - * Nothing to do. - */ - ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_STENCIL_EXT); - ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); - } - else { - /* Separate depth/stencil buffers, need to interleave now */ - ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_COMPONENT || - depthRb->Base._BaseFormat == GL_DEPTH_STENCIL); - ASSERT(stencilRb->Base._BaseFormat == GL_STENCIL_INDEX || - stencilRb->Base._BaseFormat == GL_DEPTH_STENCIL); - - /* may need to interleave depth/stencil now */ - if (depthRb->PairedStencil == stencilRb->Base.Name) { - /* OK, the depth and stencil buffers are already interleaved */ - ASSERT(stencilRb->PairedDepth == depthRb->Base.Name); - } - else { - /* need to setup new pairing/interleaving */ - if (depthRb->PairedStencil) { - intel_unpair_depth_stencil(ctx, depthRb); - } - if (stencilRb->PairedDepth) { - intel_unpair_depth_stencil(ctx, stencilRb); - } - - ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT || - stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); - - /* establish new pairing: interleave stencil into depth buffer */ - intel_renderbuffer_map(intel, &depthRb->Base); - intel_renderbuffer_map(intel, &stencilRb->Base); - _mesa_insert_stencil(ctx, &depthRb->Base, &stencilRb->Base); - intel_renderbuffer_unmap(intel, &stencilRb->Base); - intel_renderbuffer_unmap(intel, &depthRb->Base); - depthRb->PairedStencil = stencilRb->Base.Name; - stencilRb->PairedDepth = depthRb->Base.Name; - } - - } - } - else if (depthRb) { - /* Depth buffer but no stencil buffer. - * We'll use a GL_DEPTH24_STENCIL8 buffer and ignore the stencil bits. - */ - /* can't assert this until storage is allocated: - ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); - */ - /* intel_undo any previous pairing */ - if (depthRb->PairedStencil) { - intel_unpair_depth_stencil(ctx, depthRb); - } - } - else if (stencilRb) { - /* Stencil buffer but no depth buffer. - * Since h/w doesn't typically support just 8bpp stencil w/out Z, - * we'll use a GL_DEPTH24_STENCIL8 buffer and ignore the depth bits. - */ - /* undo any previous pairing */ - if (stencilRb->PairedDepth) { - intel_unpair_depth_stencil(ctx, stencilRb); - } - if (stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT) { - /* promote buffer to GL_DEPTH24_STENCIL8 for hw rendering */ - _mesa_promote_stencil(ctx, &stencilRb->Base); - ASSERT(stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); - } - } - - /* Finally, update the fb->_DepthBuffer and fb->_StencilBuffer fields */ - _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH); - if (depthRb && depthRb->PairedStencil) - _mesa_update_stencil_buffer(ctx, fb, BUFFER_DEPTH); - else - _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL); - - - /* The hardware should use fb->Attachment[BUFFER_DEPTH].Renderbuffer - * first, if present, then fb->Attachment[BUFFER_STENCIL].Renderbuffer - * if present. - */ -} diff --git a/src/mesa/drivers/dri/intel/intel_depthstencil.h b/src/mesa/drivers/dri/intel/intel_depthstencil.h deleted file mode 100644 index 740eb0d989..0000000000 --- a/src/mesa/drivers/dri/intel/intel_depthstencil.h +++ /dev/null @@ -1,15 +0,0 @@ - -#ifndef INTEL_DEPTH_STENCIL_H -#define INTEL_DEPTH_STENCIL_H - -#include "intel_fbo.h" - -extern void -intel_unpair_depth_stencil(GLcontext * ctx, struct intel_renderbuffer *irb); - -extern void -intel_validate_paired_depth_stencil(GLcontext * ctx, - struct gl_framebuffer *fb); - - -#endif /* INTEL_DEPTH_STENCIL_H */ -- cgit v1.2.3 From bc968e515dff20fc3cbcd01066886ba66f707a1b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 30 Jan 2009 13:25:48 -0800 Subject: Remove stale symlinks to intel/intel_depthstencil.c --- src/mesa/drivers/dri/i915/intel_depthstencil.c | 1 - src/mesa/drivers/dri/i965/intel_depthstencil.c | 1 - 2 files changed, 2 deletions(-) delete mode 120000 src/mesa/drivers/dri/i915/intel_depthstencil.c delete mode 120000 src/mesa/drivers/dri/i965/intel_depthstencil.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/intel_depthstencil.c b/src/mesa/drivers/dri/i915/intel_depthstencil.c deleted file mode 120000 index 4ac4ae690a..0000000000 --- a/src/mesa/drivers/dri/i915/intel_depthstencil.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_depthstencil.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/intel_depthstencil.c b/src/mesa/drivers/dri/i965/intel_depthstencil.c deleted file mode 120000 index 4ac4ae690a..0000000000 --- a/src/mesa/drivers/dri/i965/intel_depthstencil.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_depthstencil.c \ No newline at end of file -- cgit v1.2.3 From 3ee21f30cda27e0ee1357f930163526622ba9434 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Jan 2009 14:57:49 -0800 Subject: intel: Expose more FBconfigs in the 3D driver. We can support any combination of (a8r8g8b8, x8r8g8b8, r5g6b5) x (z0,z24,z24s8) on either class of chipsets. The only restriction is no mixing bpp when also mixing tiling. This shouldn't be occurring currently. --- src/mesa/drivers/dri/common/utils.c | 3 +- src/mesa/drivers/dri/common/utils.h | 3 +- src/mesa/drivers/dri/intel/intel_screen.c | 54 +++++++++++++++++++++++++++++-- src/mesa/drivers/dri/swrast/swrast.c | 8 ++--- 4 files changed, 60 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index e4d228c575..d6de1c0e9b 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -744,7 +744,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, return configs; } -const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b) +const __DRIconfig **driConcatConfigs(const __DRIconfig **a, + const __DRIconfig **b) { const __DRIconfig **all; int i, j, index; diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 0c974dbff3..b0908e530a 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -133,7 +133,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes); -const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b); +const __DRIconfig **driConcatConfigs(const __DRIconfig **a, + const __DRIconfig **b); int driGetConfigAttrib(const __DRIconfig *config, diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index fe890c390f..aad53fb72d 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -671,6 +671,17 @@ static const __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) { intelScreenPrivate *intelScreen; + GLenum fb_format[3]; + GLenum fb_type[3]; + /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't + * support pageflipping at all. + */ + static const GLenum back_buffer_modes[] = { + GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML + }; + uint8_t depth_bits[4], stencil_bits[4]; + int color; + const __DRIconfig **configs = NULL; /* Calling driInitExtensions here, with a NULL context pointer, * does not actually enable the extensions. It just makes sure @@ -710,8 +721,47 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) intelScreen->irq_active = 1; psp->extensions = intelScreenExtensions; - return driConcatConfigs(intelFillInModes(psp, 16, 16, 0, 1), - intelFillInModes(psp, 32, 24, 8, 1)); + depth_bits[0] = 0; + stencil_bits[0] = 0; + depth_bits[1] = 16; + stencil_bits[1] = 0; + depth_bits[2] = 24; + stencil_bits[2] = 0; + depth_bits[3] = 24; + stencil_bits[3] = 8; + + fb_format[0] = GL_RGB; + fb_type[0] = GL_UNSIGNED_SHORT_5_6_5; + + fb_format[1] = GL_RGB; + fb_type[1] = GL_UNSIGNED_INT_8_8_8_8_REV; + + fb_format[2] = GL_RGBA; + fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV; + + for (color = 0; color < ARRAY_SIZE(fb_format); color++) { + const __DRIconfig **new_configs; + + new_configs = (const __DRIconfig **) + driCreateConfigs(fb_format[color], fb_type[color], + depth_bits, + stencil_bits, + ARRAY_SIZE(depth_bits), + back_buffer_modes, + ARRAY_SIZE(back_buffer_modes)); + if (configs == NULL) + configs = new_configs; + else + configs = driConcatConfigs(configs, new_configs); + } + + if (configs == NULL) { + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, + __LINE__); + return NULL; + } + + return configs; } const struct __DriverAPIRec driDriverAPI = { diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 07e4ba0710..390b8f918a 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -127,7 +127,7 @@ setupLoaderExtensions(__DRIscreen *psp, } } -static __DRIconfig ** +static const __DRIconfig ** swrastFillInModes(__DRIscreen *psp, unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer) @@ -187,7 +187,7 @@ swrastFillInModes(__DRIscreen *psp, return NULL; } - return configs; + return (const __DRIconfig **)configs; } static __DRIscreen * @@ -196,7 +196,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, { static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; - __DRIconfig **configs8, **configs16, **configs32; + const __DRIconfig **configs8, **configs16, **configs32; (void) data; @@ -215,7 +215,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, configs16 = swrastFillInModes(psp, 16, 16, 0, 1); configs32 = swrastFillInModes(psp, 32, 24, 8, 1); - configs16 = (__DRIconfig **)driConcatConfigs(configs8, configs16); + configs16 = driConcatConfigs(configs8, configs16); *driver_configs = driConcatConfigs(configs16, configs32); -- cgit v1.2.3 From ac0dfbdf0f5e5dea08ec717ae8c4e1e141b15c05 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Jan 2009 16:45:08 -0800 Subject: i915: Only call CalcViewport from DrawBuffers instead of Viewport. This saves an inadvertent round-trip to the X Server on DrawBuffers, which was hurting some metaops. --- src/mesa/drivers/dri/i915/i915_state.c | 3 ++- src/mesa/drivers/dri/intel/intel_buffers.c | 13 +++++-------- src/mesa/drivers/dri/intel/intel_buffers.h | 3 +++ 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index b0334d9d79..ecb763e127 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -41,6 +41,7 @@ #include "intel_fbo.h" #include "intel_screen.h" #include "intel_batchbuffer.h" +#include "intel_buffers.h" #include "i915_context.h" #include "i915_reg.h" @@ -309,7 +310,7 @@ i915DepthMask(GLcontext * ctx, GLboolean flag) * - depthrange * - window pos/size or FBO size */ -static void +void intelCalcViewport(GLcontext * ctx) { struct intel_context *intel = intel_context(ctx); diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 13555b2e0e..7f2144abd4 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -284,14 +284,11 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) fb->_NumColorDrawBuffers); /* update viewport since it depends on window size */ - if (ctx->Driver.Viewport) { - ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y, - ctx->Viewport.Width, ctx->Viewport.Height); - } - else { - ctx->NewState |= _NEW_VIEWPORT; - } - +#ifdef I915 + intelCalcViewport(ctx); +#else + ctx->NewState |= _NEW_VIEWPORT; +#endif /* Set state we know depends on drawable parameters: */ if (ctx->Driver.Scissor) diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h index 97ae8bf738..6069d38e9e 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.h +++ b/src/mesa/drivers/dri/intel/intel_buffers.h @@ -53,5 +53,8 @@ void intel_get_cliprects(struct intel_context *intel, struct drm_clip_rect **cliprects, unsigned int *num_cliprects, int *x_off, int *y_off); +#ifdef I915 +void intelCalcViewport(GLcontext * ctx); +#endif #endif /* INTEL_BUFFERS_H */ -- cgit v1.2.3 From 67ee22c89f42146e7befb2fdd39bdd68a5258c30 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Jan 2009 11:24:04 -0800 Subject: intel: If we're doing a depth clear with tris, do color with it. This is a 10% win on the ever-important glxgears not-a-benchmark. --- src/mesa/drivers/dri/intel/intel_clear.c | 8 ++++++++ src/mesa/drivers/dri/intel/intel_pixel.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 921ec2dc33..98f7292f59 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -201,6 +201,14 @@ intelClear(GLcontext *ctx, GLbitfield mask) blit_mask |= BUFFER_BIT_DEPTH; } + /* If we're doing a tri pass for depth/stencil, include a likely color + * buffer with it. + */ + if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) { + tri_mask |= blit_mask & BUFFER_BIT_BACK_LEFT; + blit_mask &= ~BUFFER_BIT_BACK_LEFT; + } + /* SW fallback clearing */ swrast_mask = mask & ~tri_mask & ~blit_mask; diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index 5e32288844..f440a7716c 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -183,7 +183,7 @@ intel_meta_set_passthrough_transform(struct intel_context *intel) intel->meta.saved_vp_height = ctx->Viewport.Height; intel->meta.saved_matrix_mode = ctx->Transform.MatrixMode; - _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height); + /* _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height);*/ _mesa_MatrixMode(GL_PROJECTION); _mesa_PushMatrix(); @@ -205,8 +205,8 @@ intel_meta_restore_transform(struct intel_context *intel) _mesa_MatrixMode(intel->meta.saved_matrix_mode); - _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y, - intel->meta.saved_vp_width, intel->meta.saved_vp_height); + /* _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y, + intel->meta.saved_vp_width, intel->meta.saved_vp_height);*/ } /** -- cgit v1.2.3 From 88e0b92a747d9b14885010029133fa1221696e5e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jan 2009 15:24:13 -0700 Subject: mesa: remove incorrect refcounting adjustment in adjust_buffer_object_ref_counts() Fixes bug 19835. However, a more elaborate fix should be implemented someday which uses proper reference counting for gl_array_object. --- src/mesa/main/attrib.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 98173cf786..218e0aeb6b 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1267,9 +1267,6 @@ adjust_buffer_object_ref_counts(struct gl_array_attrib *array, GLint step) array->ArrayObj->TexCoord[i].BufferObj->RefCount += step; for (i = 0; i < VERT_ATTRIB_MAX; i++) array->ArrayObj->VertexAttrib[i].BufferObj->RefCount += step; - - array->ArrayBufferObj->RefCount += step; - array->ElementArrayBufferObj->RefCount += step; } -- cgit v1.2.3 From 7c48719a5f22648302bbd0026681770d8cc43914 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jan 2009 15:34:55 -0700 Subject: mesa: add missing _mesa_reference_texobj() calls for texture array targets --- src/mesa/main/texobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 4e6cf439fc..0fee21c490 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -984,11 +984,11 @@ _mesa_BindTexture( GLenum target, GLuint texName ) ASSERT(texUnit->CurrentRect); break; case GL_TEXTURE_1D_ARRAY_EXT: - texUnit->Current1DArray = newTexObj; + _mesa_reference_texobj(&texUnit->Current1DArray, newTexObj); ASSERT(texUnit->Current1DArray); break; case GL_TEXTURE_2D_ARRAY_EXT: - texUnit->Current2DArray = newTexObj; + _mesa_reference_texobj(&texUnit->Current2DArray, newTexObj); ASSERT(texUnit->Current2DArray); break; default: -- cgit v1.2.3 From 4b37b1129ea7fed915d353c39d4b74dbdbb7f0a5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 15:40:21 -0700 Subject: i915: updated render to texture/fbo test --- src/mesa/drivers/dri/i915/i915_state.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index ecb763e127..814fb59fd3 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -321,18 +321,9 @@ intelCalcViewport(GLcontext * ctx) if (ctx->DrawBuffer->Name) { /* User created FBO */ - struct intel_renderbuffer *irb - = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); - if (irb && !irb->RenderToTexture) { - /* y=0=top */ - yScale = -1.0; - yBias = irb->Base.Height; - } - else { - /* y=0=bottom */ - yScale = 1.0; - yBias = 0.0; - } + /* y=0=bottom */ + yScale = 1.0; + yBias = 0.0; } else { /* window buffer, y=0=top */ -- cgit v1.2.3 From bd944ef78397fd96dc2b239f542066643b06274a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 15:40:43 -0700 Subject: intel: remove unused RenderToTexture field --- src/mesa/drivers/dri/intel/intel_fbo.c | 2 -- src/mesa/drivers/dri/intel/intel_fbo.h | 4 ---- 2 files changed, 6 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 133fa9b8fe..54d6044ad3 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -481,8 +481,6 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, irb->Base.Delete = intel_delete_renderbuffer; irb->Base.AllocStorage = intel_nop_alloc_storage; - irb->RenderToTexture = GL_TRUE; - return GL_TRUE; } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 4c89a48850..7226ee026f 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -55,15 +55,11 @@ struct intel_framebuffer /** * Intel renderbuffer, derived from gl_renderbuffer. - * Note: The PairedDepth and PairedStencil fields use renderbuffer IDs, - * not pointers because in some circumstances a deleted renderbuffer could - * result in a dangling pointer here. */ struct intel_renderbuffer { struct gl_renderbuffer Base; struct intel_region *region; - GLboolean RenderToTexture; /* RTT? */ GLuint vbl_pending; /**< vblank sequence number of pending flip */ -- cgit v1.2.3 From 81ca8b93f212d1946c70660041ce97d98f352608 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 15:56:19 -0700 Subject: swrast: replace macro with inline function --- src/mesa/swrast/s_context.h | 15 ++++++++++++++- src/mesa/swrast/s_fog.c | 4 ++-- src/mesa/swrast/s_texcombine.c | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index a511d1c9a1..46a5fa24f8 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -238,7 +238,20 @@ extern void _swrast_update_texture_samplers(GLcontext *ctx); -#define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context) +/** Return SWcontext for the given GLcontext */ +static INLINE SWcontext * +SWRAST_CONTEXT(GLcontext *ctx) +{ + return (SWcontext *) ctx->swrast_context; +} + +/** const version of above */ +static INLINE const SWcontext * +CONST_SWRAST_CONTEXT(const GLcontext *ctx) +{ + return (const SWcontext *) ctx->swrast_context; +} + #define RENDER_START(SWctx, GLctx) \ do { \ diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index b9ba265db6..77ed0cfef9 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -164,7 +164,7 @@ else { \ void _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) { - const SWcontext *swrast = SWRAST_CONTEXT(ctx); + const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx); GLfloat rFog, gFog, bFog; ASSERT(swrast->_FogEnabled); @@ -283,7 +283,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) void _swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ) { - const SWcontext *swrast = SWRAST_CONTEXT(ctx); + const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx); const GLuint fogIndex = (GLuint) ctx->Fog.Index; GLuint *index = span->array->index; diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 1b8775bf30..38b5633887 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -87,7 +87,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, ASSERT(ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine); - ASSERT(SWRAST_CONTEXT(ctx)->_AnyTextureCombine); + ASSERT(CONST_SWRAST_CONTEXT(ctx)->_AnyTextureCombine); /* printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n", -- cgit v1.2.3 From 2d5b86be25a7ccb729e746aa5e1bdd537d76df68 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 16:05:39 -0700 Subject: swrast: replace RENDER_START/FINISH macros with inline functions --- src/mesa/swrast/s_accum.c | 8 ++++---- src/mesa/swrast/s_bitmap.c | 9 ++++----- src/mesa/swrast/s_blit.c | 5 ++--- src/mesa/swrast/s_buffers.c | 6 ++---- src/mesa/swrast/s_context.h | 35 ++++++++++++++++++++++------------- src/mesa/swrast/s_copypix.c | 4 ++-- src/mesa/swrast/s_drawpix.c | 10 +++++----- src/mesa/swrast/s_imaging.c | 20 ++++++++------------ src/mesa/swrast/s_readpix.c | 12 ++++++------ src/mesa/swrast/s_texstore.c | 15 ++++++--------- 10 files changed, 61 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index ff741777e7..c6c7dbf5cf 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -550,7 +550,7 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value) SWcontext *swrast = SWRAST_CONTEXT(ctx); GLint xpos, ypos, width, height; - if (SWRAST_CONTEXT(ctx)->NewState) + if (swrast->NewState) _swrast_validate_derived( ctx ); if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) { @@ -558,9 +558,9 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value) return; } - RENDER_START(swrast, ctx); + swrast_render_start(ctx); - /* Compute region after calling RENDER_START so that we know the + /* Compute region after calling swrast_render_start() so that we know the * drawbuffer's size/bounds are up to date. */ xpos = ctx->DrawBuffer->_Xmin; @@ -595,5 +595,5 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value) break; } - RENDER_FINISH(swrast, ctx); + swrast_render_finish(ctx); } diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 35b34e654f..5e7822cf32 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -50,7 +50,6 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLint row, col; GLuint count = 0; SWspan span; @@ -61,7 +60,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, if (!bitmap) return; - RENDER_START(swrast,ctx); + swrast_render_start(ctx); if (SWRAST_CONTEXT(ctx)->NewState) _swrast_validate_derived( ctx ); @@ -132,7 +131,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, } } - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); _mesa_unmap_bitmap_pbo(ctx, unpack); } @@ -157,7 +156,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, ASSERT(ctx->RenderMode == GL_RENDER); ASSERT(bitmap); - RENDER_START(swrast,ctx); + swrast_render_start(ctx); if (SWRAST_CONTEXT(ctx)->NewState) _swrast_validate_derived( ctx ); @@ -224,6 +223,6 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, } } - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); } #endif diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index bc4b2ac625..0e32cb8f65 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -737,7 +737,6 @@ _swrast_BlitFramebuffer(GLcontext *ctx, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); static const GLint buffers[3] = { GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, @@ -753,7 +752,7 @@ _swrast_BlitFramebuffer(GLcontext *ctx, return; } - RENDER_START(swrast, ctx); + swrast_render_start(ctx); if (srcX1 - srcX0 == dstX1 - dstX0 && srcY1 - srcY0 == dstY1 - dstY0 && @@ -789,5 +788,5 @@ _swrast_BlitFramebuffer(GLcontext *ctx, } } - RENDER_FINISH(swrast, ctx); + swrast_render_finish(ctx); } diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 9e87d6d485..af475ad8cb 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -307,8 +307,6 @@ clear_color_buffers(GLcontext *ctx) void _swrast_Clear(GLcontext *ctx, GLbitfield buffers) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - #ifdef DEBUG_FOO { const GLbitfield legalBits = @@ -327,7 +325,7 @@ _swrast_Clear(GLcontext *ctx, GLbitfield buffers) } #endif - RENDER_START(swrast,ctx); + swrast_render_start(ctx); /* do software clearing here */ if (buffers) { @@ -347,5 +345,5 @@ _swrast_Clear(GLcontext *ctx, GLbitfield buffers) } } - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); } diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 46a5fa24f8..cdd6fa5048 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -253,19 +253,28 @@ CONST_SWRAST_CONTEXT(const GLcontext *ctx) } -#define RENDER_START(SWctx, GLctx) \ - do { \ - if ((SWctx)->Driver.SpanRenderStart) { \ - (*(SWctx)->Driver.SpanRenderStart)(GLctx); \ - } \ - } while (0) - -#define RENDER_FINISH(SWctx, GLctx) \ - do { \ - if ((SWctx)->Driver.SpanRenderFinish) { \ - (*(SWctx)->Driver.SpanRenderFinish)(GLctx); \ - } \ - } while (0) +/** + * Called prior to framebuffer reading/writing. + * For drivers that rely on swrast for fallback rendering, this is the + * driver's opportunity to map renderbuffers and textures. + */ +static INLINE void +swrast_render_start(GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + if (swrast->Driver.SpanRenderStart) + swrast->Driver.SpanRenderStart(ctx); +} + + +/** Called after framebuffer reading/writing */ +static INLINE void +swrast_render_finish(GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + if (swrast->Driver.SpanRenderFinish) + swrast->Driver.SpanRenderFinish(ctx); +} diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index fc5990b261..5ecfb1e90a 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -899,7 +899,7 @@ _swrast_CopyPixels( GLcontext *ctx, GLint destx, GLint desty, GLenum type ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - RENDER_START(swrast,ctx); + swrast_render_start(ctx); if (swrast->NewState) _swrast_validate_derived( ctx ); @@ -928,5 +928,5 @@ _swrast_CopyPixels( GLcontext *ctx, } } - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); } diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 7af3e3dad1..2fc9fd0d50 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -830,7 +830,7 @@ _swrast_DrawPixels( GLcontext *ctx, { SWcontext *swrast = SWRAST_CONTEXT(ctx); - RENDER_START(swrast,ctx); + swrast_render_start(ctx); if (ctx->NewState) _mesa_update_state(ctx); @@ -840,7 +840,7 @@ _swrast_DrawPixels( GLcontext *ctx, pixels = _mesa_map_drawpix_pbo(ctx, unpack, pixels); if (!pixels) { - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); return; } @@ -879,7 +879,7 @@ _swrast_DrawPixels( GLcontext *ctx, /* don't return yet, clean-up */ } - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); _mesa_unmap_drapix_pbo(ctx, unpack); } @@ -904,7 +904,7 @@ _swrast_DrawDepthPixelsMESA( GLcontext *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - RENDER_START(swrast,ctx); + swrast_render_start(ctx); switch (colorFormat) { case GL_COLOR_INDEX: @@ -933,6 +933,6 @@ _swrast_DrawDepthPixelsMESA( GLcontext *ctx, _mesa_problem(ctx, "unexpected format in glDrawDepthPixelsMESA"); } - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); } #endif diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c index 591857c342..d6be3aa022 100644 --- a/src/mesa/swrast/s_imaging.c +++ b/src/mesa/swrast/s_imaging.c @@ -39,7 +39,6 @@ _swrast_CopyColorTable( GLcontext *ctx, GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLchan data[MAX_WIDTH][4]; struct gl_buffer_object *bufferSave; @@ -51,13 +50,13 @@ _swrast_CopyColorTable( GLcontext *ctx, if (width > MAX_WIDTH) width = MAX_WIDTH; - RENDER_START( swrast, ctx ); + swrast_render_start(ctx); /* read the data from framebuffer */ _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, width, x, y, CHAN_TYPE, data ); - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); /* save PBO binding */ bufferSave = ctx->Unpack.BufferObj; @@ -74,7 +73,6 @@ void _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLchan data[MAX_WIDTH][4]; struct gl_buffer_object *bufferSave; @@ -86,13 +84,13 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, if (width > MAX_WIDTH) width = MAX_WIDTH; - RENDER_START( swrast, ctx ); + swrast_render_start(ctx); /* read the data from framebuffer */ _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, width, x, y, CHAN_TYPE, data ); - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); /* save PBO binding */ bufferSave = ctx->Unpack.BufferObj; @@ -110,7 +108,6 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLchan rgba[MAX_CONVOLUTION_WIDTH][4]; struct gl_buffer_object *bufferSave; @@ -119,13 +116,13 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, return; } - RENDER_START( swrast, ctx ); + swrast_render_start(ctx); /* read the data from framebuffer */ _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, width, x, y, CHAN_TYPE, rgba ); - RENDER_FINISH( swrast, ctx ); + swrast_render_finish(ctx); /* save PBO binding */ bufferSave = ctx->Unpack.BufferObj; @@ -145,7 +142,6 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_pixelstore_attrib packSave; GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4]; GLint i; @@ -156,7 +152,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, return; } - RENDER_START(swrast,ctx); + swrast_render_start(ctx); /* read pixels from framebuffer */ for (i = 0; i < height; i++) { @@ -164,7 +160,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, width, x, y + i, CHAN_TYPE, rgba[i] ); } - RENDER_FINISH(swrast,ctx); + swrast_render_finish(ctx); /* * HACK: save & restore context state so we can store this as a diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index f263045170..e901fc6b5d 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -555,11 +555,11 @@ _swrast_ReadPixels( GLcontext *ctx, SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_pixelstore_attrib clippedPacking = *packing; - /* Need to do RENDER_START before clipping or anything else since this - * is where a driver may grab the hw lock and get an updated window - * size. + /* 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. */ - RENDER_START(swrast, ctx); + swrast_render_start(ctx); if (ctx->NewState) _mesa_update_state(ctx); @@ -570,7 +570,7 @@ _swrast_ReadPixels( GLcontext *ctx, /* Do all needed clipping here, so that we can forget about it later */ if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) { /* The ReadPixels region is totally outside the window bounds */ - RENDER_FINISH(swrast, ctx); + swrast_render_finish(ctx); return; } @@ -614,7 +614,7 @@ _swrast_ReadPixels( GLcontext *ctx, /* don't return yet, clean-up */ } - RENDER_FINISH(swrast, ctx); + swrast_render_finish(ctx); _mesa_unmap_readpix_pbo(ctx, &clippedPacking); } diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c index 16b00b9fa1..f9ff9ad6a4 100644 --- a/src/mesa/swrast/s_texstore.c +++ b/src/mesa/swrast/s_texstore.c @@ -67,7 +67,6 @@ static GLvoid * read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, GLsizei width, GLsizei height ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type); const GLint stride = width * pixelSize; @@ -78,7 +77,7 @@ read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, if (!image) return NULL; - RENDER_START(swrast, ctx); + swrast_render_start(ctx); dst = image; for (row = 0; row < height; row++) { @@ -86,7 +85,7 @@ read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, dst += stride; } - RENDER_FINISH(swrast, ctx); + swrast_render_finish(ctx); return image; } @@ -101,7 +100,6 @@ read_depth_image( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ) { struct gl_renderbuffer *rb = ctx->ReadBuffer->_DepthBuffer; - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint *image, *dst; GLint i; @@ -109,7 +107,7 @@ read_depth_image( GLcontext *ctx, GLint x, GLint y, if (!image) return NULL; - RENDER_START(swrast, ctx); + swrast_render_start(ctx); dst = image; for (i = 0; i < height; i++) { @@ -117,7 +115,7 @@ read_depth_image( GLcontext *ctx, GLint x, GLint y, dst += width; } - RENDER_FINISH(swrast, ctx); + swrast_render_finish(ctx); return image; } @@ -132,7 +130,6 @@ read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y, { struct gl_renderbuffer *depthRb = ctx->ReadBuffer->_DepthBuffer; struct gl_renderbuffer *stencilRb = ctx->ReadBuffer->_StencilBuffer; - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint *image, *dst; GLint i; @@ -143,7 +140,7 @@ read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y, if (!image) return NULL; - RENDER_START(swrast, ctx); + swrast_render_start(ctx); /* read from depth buffer */ dst = image; @@ -205,7 +202,7 @@ read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y, dst += width; } - RENDER_FINISH(swrast, ctx); + swrast_render_finish(ctx); return image; } -- cgit v1.2.3 From 5a225dd81295226c63fd57468eadf9518ca9d0e0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jan 2009 09:50:26 -0700 Subject: i965: formatting, comments, whitespace clean-ups --- src/mesa/drivers/dri/i965/brw_vtbl.c | 72 +++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index f7293ef423..b4be144558 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -23,14 +23,12 @@ 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 - */ - - +**********************************************************************/ +/* + * Authors: + * Keith Whitwell + */ #include "main/glheader.h" #include "main/mtypes.h" @@ -44,12 +42,11 @@ #include "brw_context.h" #include "brw_defines.h" #include "brw_state.h" - #include "brw_draw.h" #include "brw_state.h" #include "brw_fallback.h" #include "brw_vs.h" -#include + static void dri_bo_release(dri_bo **bo) @@ -58,7 +55,9 @@ dri_bo_release(dri_bo **bo) *bo = NULL; } -/* called from intelDestroyContext() + +/** + * called from intelDestroyContext() */ static void brw_destroy_context( struct intel_context *intel ) { @@ -72,7 +71,7 @@ static void brw_destroy_context( struct intel_context *intel ) brw_FrameBufferTexDestroy( brw ); for (i = 0; i < brw->state.nr_draw_regions; i++) - intel_region_release(&brw->state.draw_regions[i]); + intel_region_release(&brw->state.draw_regions[i]); brw->state.nr_draw_regions = 0; intel_region_release(&brw->state.depth_region); @@ -99,37 +98,46 @@ static void brw_destroy_context( struct intel_context *intel ) dri_bo_release(&brw->cc.vp_bo); } -/* called from intelDrawBuffer() + +/** + * called from intelDrawBuffer() */ static void brw_set_draw_region( struct intel_context *intel, - struct intel_region *draw_regions[], - struct intel_region *depth_region, - GLuint num_regions) + struct intel_region *draw_regions[], + struct intel_region *depth_region, + GLuint num_regions) { struct brw_context *brw = brw_context(&intel->ctx); int i; + + /* release old color/depth regions */ if (brw->state.depth_region != depth_region) brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER; for (i = 0; i < brw->state.nr_draw_regions; i++) intel_region_release(&brw->state.draw_regions[i]); intel_region_release(&brw->state.depth_region); + + /* reference new color/depth regions */ for (i = 0; i < num_regions; i++) intel_region_reference(&brw->state.draw_regions[i], draw_regions[i]); intel_region_reference(&brw->state.depth_region, depth_region); brw->state.nr_draw_regions = num_regions; } -/* called from intel_batchbuffer_flush and children before sending a + +/** + * called from intel_batchbuffer_flush and children before sending a * batchbuffer off. */ static void brw_finish_batch(struct intel_context *intel) { struct brw_context *brw = brw_context(&intel->ctx); - brw_emit_query_end(brw); } -/* called from intelFlushBatchLocked + +/** + * called from intelFlushBatchLocked */ static void brw_new_batch( struct intel_context *intel ) { @@ -160,22 +168,21 @@ static void brw_new_batch( struct intel_context *intel ) } } -static void brw_note_fence( struct intel_context *intel, - GLuint fence ) + +static void brw_note_fence( struct intel_context *intel, GLuint fence ) { brw_context(&intel->ctx)->state.dirty.brw |= BRW_NEW_FENCE; } - + + static void brw_note_unlock( struct intel_context *intel ) { struct brw_context *brw = brw_context(&intel->ctx); - brw_state_cache_check_size(brw); } -void brw_do_flush( struct brw_context *brw, - GLuint flags ) +void brw_do_flush( struct brw_context *brw, GLuint flags ) { struct brw_mi_flush flush; memset(&flush, 0, sizeof(flush)); @@ -185,8 +192,7 @@ void brw_do_flush( struct brw_context *brw, } -static void brw_emit_flush( struct intel_context *intel, - GLuint unused ) +static void brw_emit_flush( struct intel_context *intel, GLuint unused ) { brw_do_flush(brw_context(&intel->ctx), BRW_FLUSH_STATE_CACHE|BRW_FLUSH_READ_CACHE); @@ -206,6 +212,7 @@ static GLuint brw_flush_cmd( void ) return *(GLuint *)&flush; } + static void brw_invalidate_state( struct intel_context *intel, GLuint new_state ) { /* nothing */ @@ -215,14 +222,14 @@ static void brw_invalidate_state( struct intel_context *intel, GLuint new_state void brwInitVtbl( struct brw_context *brw ) { brw->intel.vtbl.check_vertex_size = 0; - brw->intel.vtbl.emit_state = 0; - brw->intel.vtbl.reduced_primitive_state = 0; + brw->intel.vtbl.emit_state = 0; + brw->intel.vtbl.reduced_primitive_state = 0; brw->intel.vtbl.render_start = 0; - brw->intel.vtbl.update_texture_state = 0; + brw->intel.vtbl.update_texture_state = 0; - brw->intel.vtbl.invalidate_state = brw_invalidate_state; - brw->intel.vtbl.note_fence = brw_note_fence; - brw->intel.vtbl.note_unlock = brw_note_unlock; + brw->intel.vtbl.invalidate_state = brw_invalidate_state; + brw->intel.vtbl.note_fence = brw_note_fence; + brw->intel.vtbl.note_unlock = brw_note_unlock; brw->intel.vtbl.new_batch = brw_new_batch; brw->intel.vtbl.finish_batch = brw_finish_batch; brw->intel.vtbl.destroy = brw_destroy_context; @@ -231,4 +238,3 @@ void brwInitVtbl( struct brw_context *brw ) brw->intel.vtbl.emit_flush = brw_emit_flush; brw->intel.vtbl.debug_batch = brw_debug_batch; } - -- cgit v1.2.3 From 7f0b6a779601d00ab86f794e174d0b4c0ba08c42 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jan 2009 09:58:02 -0700 Subject: intel: more debug info --- src/mesa/drivers/dri/intel/intel_regions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index 51ce32a967..ec85c4131a 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -152,7 +152,7 @@ void intel_region_reference(struct intel_region **dst, struct intel_region *src) { if (src) - DBG("%s %d\n", __FUNCTION__, src->refcount); + DBG("%s %p %d\n", __FUNCTION__, src, src->refcount); assert(*dst == NULL); if (src) { @@ -169,7 +169,7 @@ intel_region_release(struct intel_region **region_handle) if (region == NULL) return; - DBG("%s %d\n", __FUNCTION__, region->refcount - 1); + DBG("%s %p %d\n", __FUNCTION__, region, region->refcount - 1); ASSERT(region->refcount > 0); region->refcount--; -- cgit v1.2.3 From ea4b183b8c3730ec2c6b5152cad1a68889634487 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jan 2009 15:50:43 -0700 Subject: mesa: fix incorrect call to clear_teximage_fields() in _mesa_TexImage2D() Fixes failed assertion / segfault for particular proxy texture tests. --- src/mesa/main/teximage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 7b9efb6e41..a64e2c111b 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2636,7 +2636,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, 1, border)) { /* when error, clear all proxy texture image parameters */ if (texImage) - clear_teximage_fields(ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level]); + clear_teximage_fields(texImage); } else { /* no error, set the tex image parameters */ -- cgit v1.2.3 From 80684649a6d01f0e0517b14f61cbcad6fa101929 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jan 2009 15:51:58 -0700 Subject: mesa: simplify the _mesa_get_proxy_tex_image() function --- src/mesa/main/teximage.c | 115 +++++++++++++---------------------------------- 1 file changed, 30 insertions(+), 85 deletions(-) (limited to 'src') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index a64e2c111b..d119d22b54 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,8 +1,9 @@ /* * mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * 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"), @@ -924,6 +925,7 @@ struct gl_texture_image * _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level) { struct gl_texture_image *texImage; + GLuint texIndex; if (level < 0 ) return NULL; @@ -932,111 +934,54 @@ _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level) case GL_PROXY_TEXTURE_1D: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]; - } - return texImage; + texIndex = TEXTURE_1D_INDEX; + break; case GL_PROXY_TEXTURE_2D: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]; - } - return texImage; + texIndex = TEXTURE_2D_INDEX; + break; case GL_PROXY_TEXTURE_3D: if (level >= ctx->Const.Max3DTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]; - } - return texImage; + texIndex = TEXTURE_3D_INDEX; + break; case GL_PROXY_TEXTURE_CUBE_MAP: if (level >= ctx->Const.MaxCubeTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]; - } - return texImage; + texIndex = TEXTURE_CUBE_INDEX; + break; case GL_PROXY_TEXTURE_RECTANGLE_NV: if (level > 0) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]; - } - return texImage; + texIndex = TEXTURE_RECT_INDEX; + break; case GL_PROXY_TEXTURE_1D_ARRAY_EXT: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]; - } - return texImage; + texIndex = TEXTURE_1D_ARRAY_INDEX; + break; case GL_PROXY_TEXTURE_2D_ARRAY_EXT: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]; - } - return texImage; + texIndex = TEXTURE_2D_ARRAY_INDEX; + break; default: return NULL; } + + texImage = ctx->Texture.ProxyTex[texIndex]->Image[0][level]; + if (!texImage) { + texImage = ctx->Driver.NewTextureImage(ctx); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); + return NULL; + } + ctx->Texture.ProxyTex[texIndex]->Image[0][level] = texImage; + /* Set the 'back' pointer */ + texImage->TexObject = ctx->Texture.ProxyTex[texIndex]; + } + return texImage; } -- cgit v1.2.3 From 954dfba12986f578f2d8461818f9e9ac1f8f2b41 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 30 Jan 2009 21:51:32 -0800 Subject: i965: bump texture limit to 4kx4k Rendering and textures are limited to 8kx8k, but mesa limits things to 4kx4k, and magic guard band stuff may break on 8kx8k drawing. This is safe though, and makes compiz work on bigger screens. Signed-off-by: Keith Packard --- src/mesa/drivers/dri/i965/brw_context.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index d7a2bd95ee..d66781f5ae 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -135,13 +135,12 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxTextureImageUnits); ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */ - /* Advertise the full hardware capabilities. The new memory - * manager should cope much better with overload situations: + /* Mesa limits textures to 4kx4k; it would be nice to fix that someday */ - ctx->Const.MaxTextureLevels = 12; + ctx->Const.MaxTextureLevels = 13; ctx->Const.Max3DTextureLevels = 9; ctx->Const.MaxCubeTextureLevels = 12; - ctx->Const.MaxTextureRectSize = (1<<11); + ctx->Const.MaxTextureRectSize = (1<<12); /* if conformance mode is set, swrast can handle any size AA point */ ctx->Const.MaxPointSizeAA = 255.0; -- cgit v1.2.3 From c6423132ffe2e0b5c6bccc15822c50a60b08a8f8 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 31 Jan 2009 11:22:16 -0700 Subject: mesa: remove remnant of GL_SGIX_depth_texture --- src/mesa/main/extensions.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 8c9208af70..e38e72dbbe 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -169,7 +169,6 @@ static const struct { { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, - { OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) }, { ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_S3_s3tc", F(S3_s3tc) }, }; -- cgit v1.2.3 From 7721bf267b64ef28376f07daae7713814e91af35 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 31 Jan 2009 11:39:28 -0700 Subject: mesa: minor comments, clean-ups --- src/mesa/main/mtypes.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index ad9225e5a9..c740e6d162 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -901,7 +901,7 @@ struct gl_light_attrib /*@{*/ GLboolean _NeedEyeCoords; GLboolean _NeedVertices; /**< Use fast shader? */ - GLbitfield _Flags; /**< LIGHT_* flags, see above */ + GLbitfield _Flags; /**< LIGHT_* flags, see above */ GLfloat _BaseColor[2][3]; /*@}*/ }; @@ -1140,7 +1140,8 @@ struct gl_stencil_attrib }; -#define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */ +/** 1D, 2D, 3D, CUBE, RECT, 1D_ARRAY, and 2D_ARRAY targets */ +#define NUM_TEXTURE_TARGETS 7 /** * An index for each type of texture object @@ -2883,21 +2884,25 @@ struct gl_tnl_module /*@}*/ }; -/* Strictly this is a tnl/ private concept, but it doesn't seem + +/** + * Strictly this is a tnl/ private concept, but it doesn't seem * worthwhile adding a tnl private structure just to hold this one bit * of information: */ #define MESA_DLIST_DANGLING_REFS 0x1 -/* Provide a location where information about a display list can be + +/** + * Provide a location where information about a display list can be * collected. Could be extended with driverPrivate structures, * etc. in the future. */ struct mesa_display_list { - Node *node; + Node *node; /**< The dlist commands are in a linked list of nodes */ GLuint id; - GLbitfield flags; + GLbitfield flags; /**< MESA_DLIST_x flags */ }; -- cgit v1.2.3 From 446abc2799a143c32c4c48472f3f964f9288a623 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 31 Jan 2009 11:57:22 -0700 Subject: mesa: display list clean-ups Rename some structs and fields to be more consistant with the rest of mesa. --- src/mesa/main/context.c | 2 +- src/mesa/main/dd.h | 4 ++-- src/mesa/main/dlist.c | 38 +++++++++++++++++++++----------------- src/mesa/main/dlist.h | 2 +- src/mesa/main/mtypes.h | 32 ++++++++++++++++---------------- src/mesa/vbo/vbo_save.h | 2 +- src/mesa/vbo/vbo_save_api.c | 6 +++--- 7 files changed, 45 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 7d616b2325..608942979f 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -581,7 +581,7 @@ static void delete_displaylist_cb(GLuint id, void *data, void *userData) { #if FEATURE_dlist - struct mesa_display_list *list = (struct mesa_display_list *) data; + 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/dd.h b/src/mesa/main/dd.h index 989791f39f..411b6a7b21 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -34,7 +34,7 @@ /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */ struct gl_pixelstore_attrib; -struct mesa_display_list; +struct gl_display_list; /** * Device driver function table. @@ -999,7 +999,7 @@ struct dd_function_table { * Notify the T&L component before and after calling a display list. */ void (*BeginCallList)( GLcontext *ctx, - struct mesa_display_list *dlist ); + struct gl_display_list *dlist ); /** * Called by glEndCallList(). * diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index d3aee196c7..c03a41aea5 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -370,7 +370,7 @@ typedef enum * contiguous nodes in memory. * Each node is the union of a variety of data types. */ -union node +union gl_dlist_node { OpCode opcode; GLboolean b; @@ -387,6 +387,9 @@ union node }; +typedef union gl_dlist_node Node; + + /** * How many nodes to allocate at a time. * @@ -414,13 +417,13 @@ void mesa_print_display_list(GLuint list); * Make an empty display list. This is used by glGenLists() to * reserve display list IDs. */ -static struct mesa_display_list * +static struct gl_display_list * make_list(GLuint list, GLuint count) { - struct mesa_display_list *dlist = CALLOC_STRUCT(mesa_display_list); - dlist->id = list; - dlist->node = (Node *) _mesa_malloc(sizeof(Node) * count); - dlist->node[0].opcode = OPCODE_END_OF_LIST; + struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list); + dlist->Name = list; + dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count); + dlist->Head[0].opcode = OPCODE_END_OF_LIST; return dlist; } @@ -428,10 +431,10 @@ make_list(GLuint list, GLuint count) /** * Lookup function to just encapsulate casting. */ -static INLINE struct mesa_display_list * +static INLINE struct gl_display_list * lookup_list(GLcontext *ctx, GLuint list) { - return (struct mesa_display_list *) + return (struct gl_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList, list); } @@ -442,12 +445,12 @@ lookup_list(GLcontext *ctx, GLuint list) * \param dlist - display list pointer */ void -_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist) +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) { Node *n, *block; GLboolean done; - n = block = dlist->node; + n = block = dlist->Head; done = block ? GL_FALSE : GL_TRUE; while (!done) { @@ -596,7 +599,7 @@ _mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist) static void destroy_list(GLcontext *ctx, GLuint list) { - struct mesa_display_list *dlist; + struct gl_display_list *dlist; if (list == 0) return; @@ -5731,7 +5734,7 @@ islist(GLcontext *ctx, GLuint list) static void execute_list(GLcontext *ctx, GLuint list) { - struct mesa_display_list *dlist; + struct gl_display_list *dlist; Node *n; GLboolean done; @@ -5752,7 +5755,7 @@ execute_list(GLcontext *ctx, GLuint list) if (ctx->Driver.BeginCallList) ctx->Driver.BeginCallList(ctx, dlist); - n = dlist->node; + n = dlist->Head; done = GL_FALSE; while (!done) { @@ -6757,7 +6760,7 @@ _mesa_NewList(GLuint list, GLenum mode) /* Allocate new display list */ ctx->ListState.CurrentListNum = list; ctx->ListState.CurrentList = make_list(list, BLOCK_SIZE); - ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->node; + ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head; ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock; ctx->ListState.CurrentPos = 0; @@ -6805,7 +6808,8 @@ _mesa_EndList(void) /* Destroy old list, if any */ destroy_list(ctx, ctx->ListState.CurrentListNum); - /* Install the list */ + + /* Install the new list */ _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum, ctx->ListState.CurrentList); @@ -8209,7 +8213,7 @@ enum_string(GLenum k) static void GLAPIENTRY print_list(GLcontext *ctx, GLuint list) { - struct mesa_display_list *dlist; + struct gl_display_list *dlist; Node *n; GLboolean done; @@ -8222,7 +8226,7 @@ print_list(GLcontext *ctx, GLuint list) if (!dlist) return; - n = dlist->node; + n = dlist->Head; _mesa_printf("START-LIST %u, address %p\n", list, (void *) n); diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index ef6a10af83..ab7ec2c8db 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -39,7 +39,7 @@ #if _HAVE_FULL_GL extern void -_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist); +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); extern void GLAPIENTRY _mesa_CallList( GLuint list ); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index c740e6d162..f6e4724588 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2848,13 +2848,6 @@ struct gl_matrix_stack -/* - * Forward declaration of display list data types: - */ -union node; -typedef union node Node; - - /* This has to be included here. */ #include "dd.h" @@ -2886,11 +2879,17 @@ struct gl_tnl_module /** - * Strictly this is a tnl/ private concept, but it doesn't seem + * Display list flags. + * Strictly this is a tnl-private concept, but it doesn't seem * worthwhile adding a tnl private structure just to hold this one bit * of information: */ -#define MESA_DLIST_DANGLING_REFS 0x1 +#define DLIST_DANGLING_REFS 0x1 + +/* + * Forward declaration of display list data types: + */ +union gl_dlist_node; /** @@ -2898,11 +2897,12 @@ struct gl_tnl_module * collected. Could be extended with driverPrivate structures, * etc. in the future. */ -struct mesa_display_list +struct gl_display_list { - Node *node; /**< The dlist commands are in a linked list of nodes */ - GLuint id; - GLbitfield flags; /**< MESA_DLIST_x flags */ + GLuint Name; + GLbitfield Flags; /**< DLIST_x flags */ + /** The dlist commands are in a linked list of nodes */ + union gl_dlist_node *Head; }; @@ -2913,10 +2913,10 @@ struct gl_dlist_state { GLuint CallDepth; /**< Current recursion calling depth */ - struct mesa_display_list *CurrentList; - Node *CurrentListPtr; /**< Head of list being compiled */ + struct gl_display_list *CurrentList; GLuint CurrentListNum; /**< Number of the list being compiled */ - Node *CurrentBlock; /**< Pointer to current block of nodes */ + union gl_dlist_node *CurrentListPtr; /**< Head of list being compiled */ + union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */ GLuint CurrentPos; /**< Index into current block of nodes */ GLvertexformat ListVtxfmt; diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h index b7e9baabf8..7dda54af48 100644 --- a/src/mesa/vbo/vbo_save.h +++ b/src/mesa/vbo/vbo_save.h @@ -166,7 +166,7 @@ void vbo_loopback_vertex_list( GLcontext *ctx, void vbo_save_EndList( GLcontext *ctx ); void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode ); void vbo_save_EndCallList( GLcontext *ctx ); -void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *list ); +void vbo_save_BeginCallList( GLcontext *ctx, struct gl_display_list *list ); void vbo_save_SaveFlushVertices( GLcontext *ctx ); GLboolean vbo_save_NotifyBegin( GLcontext *ctx, GLenum mode ); diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index f69a33d817..ddfd276577 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -293,7 +293,7 @@ static void _save_compile_vertex_list( GLcontext *ctx ) node->count == 0); if (save->dangling_attr_ref) - ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS; + ctx->ListState.CurrentList->Flags |= DLIST_DANGLING_REFS; save->vertex_store->used += save->vertex_size * node->count; save->prim_store->used += node->prim_count; @@ -1076,10 +1076,10 @@ void vbo_save_EndList( GLcontext *ctx ) assert(save->vertex_size == 0); } -void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist ) +void vbo_save_BeginCallList( GLcontext *ctx, struct gl_display_list *dlist ) { struct vbo_save_context *save = &vbo_context(ctx)->save; - save->replay_flags |= dlist->flags; + save->replay_flags |= dlist->Flags; } void vbo_save_EndCallList( GLcontext *ctx ) -- cgit v1.2.3 From 0001deef1108b77cf4879fff4647401fb68c421e Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 31 Jan 2009 12:10:41 -0700 Subject: mesa: more display list cleanups Remove some unneeded fields. Rename some function parameters. --- src/mesa/main/dlist.c | 35 +++++++++++++++-------------------- src/mesa/main/get.c | 6 +++--- src/mesa/main/get_gen.py | 2 +- src/mesa/main/mtypes.h | 9 +++------ 4 files changed, 22 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index c03a41aea5..db1415bc06 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -418,10 +418,10 @@ void mesa_print_display_list(GLuint list); * reserve display list IDs. */ static struct gl_display_list * -make_list(GLuint list, GLuint count) +make_list(GLuint name, GLuint count) { struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list); - dlist->Name = list; + dlist->Name = name; dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count); dlist->Head[0].opcode = OPCODE_END_OF_LIST; return dlist; @@ -2524,12 +2524,12 @@ save_MultMatrixd(const GLdouble * m) static void GLAPIENTRY -save_NewList(GLuint list, GLenum mode) +save_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); /* It's an error to call this function while building a display list */ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList"); - (void) list; + (void) name; (void) mode; } @@ -6726,7 +6726,7 @@ _mesa_GenLists(GLsizei range) * Begin a new display list. */ void GLAPIENTRY -_mesa_NewList(GLuint list, GLenum mode) +_mesa_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); GLint i; @@ -6735,10 +6735,10 @@ _mesa_NewList(GLuint list, GLenum mode) ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glNewList %u %s\n", list, + _mesa_debug(ctx, "glNewList %u %s\n", name, _mesa_lookup_enum_by_nr(mode)); - if (list == 0) { + if (name == 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glNewList"); return; } @@ -6748,7 +6748,7 @@ _mesa_NewList(GLuint list, GLenum mode) return; } - if (ctx->ListState.CurrentListPtr) { + if (ctx->ListState.CurrentList) { /* already compiling a display list */ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList"); return; @@ -6758,10 +6758,8 @@ _mesa_NewList(GLuint list, GLenum mode) ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE); /* Allocate new display list */ - ctx->ListState.CurrentListNum = list; - ctx->ListState.CurrentList = make_list(list, BLOCK_SIZE); + ctx->ListState.CurrentList = make_list(name, BLOCK_SIZE); ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head; - ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock; ctx->ListState.CurrentPos = 0; /* Reset acumulated list state: @@ -6773,7 +6771,7 @@ _mesa_NewList(GLuint list, GLenum mode) ctx->ListState.ActiveMaterialSize[i] = 0; ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; - ctx->Driver.NewList(ctx, list, mode); + ctx->Driver.NewList(ctx, name, mode); ctx->CurrentDispatch = ctx->Save; _glapi_set_dispatch(ctx->CurrentDispatch); @@ -6794,7 +6792,7 @@ _mesa_EndList(void) _mesa_debug(ctx, "glEndList\n"); /* Check that a list is under construction */ - if (!ctx->ListState.CurrentListPtr) { + if (!ctx->ListState.CurrentList) { _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList"); return; } @@ -6807,19 +6805,18 @@ _mesa_EndList(void) (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0); /* Destroy old list, if any */ - destroy_list(ctx, ctx->ListState.CurrentListNum); + destroy_list(ctx, ctx->ListState.CurrentList->Name); /* Install the new list */ - _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum, + _mesa_HashInsert(ctx->Shared->DisplayList, + ctx->ListState.CurrentList->Name, ctx->ListState.CurrentList); if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) - mesa_print_display_list(ctx->ListState.CurrentListNum); + mesa_print_display_list(ctx->ListState.CurrentList->Name); ctx->ListState.CurrentList = NULL; - ctx->ListState.CurrentListNum = 0; - ctx->ListState.CurrentListPtr = NULL; ctx->ExecuteFlag = GL_TRUE; ctx->CompileFlag = GL_FALSE; @@ -8588,9 +8585,7 @@ _mesa_init_display_list(GLcontext *ctx) ctx->ListState.CallDepth = 0; ctx->ExecuteFlag = GL_TRUE; ctx->CompileFlag = GL_FALSE; - ctx->ListState.CurrentListPtr = NULL; ctx->ListState.CurrentBlock = NULL; - ctx->ListState.CurrentListNum = 0; ctx->ListState.CurrentPos = 0; /* Display List group */ diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 8e04ab9b9d..87a821b12d 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -460,7 +460,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN(ctx->List.ListBase); break; case GL_LIST_INDEX: - params[0] = INT_TO_BOOLEAN(ctx->ListState.CurrentListNum); + params[0] = INT_TO_BOOLEAN((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)); break; case GL_LIST_MODE: { @@ -2286,7 +2286,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)(ctx->List.ListBase); break; case GL_LIST_INDEX: - params[0] = (GLfloat)(ctx->ListState.CurrentListNum); + params[0] = (GLfloat)((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)); break; case GL_LIST_MODE: { @@ -4112,7 +4112,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->List.ListBase; break; case GL_LIST_INDEX: - params[0] = ctx->ListState.CurrentListNum; + params[0] = (ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0); break; case GL_LIST_MODE: { diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 83a8f2f786..3b2496c663 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -254,7 +254,7 @@ StateVars = [ ["ctx->Const.MinLineWidth", "ctx->Const.MaxLineWidth"], "", None ), ( "GL_LIST_BASE", GLint, ["ctx->List.ListBase"], "", None ), - ( "GL_LIST_INDEX", GLint, ["ctx->ListState.CurrentListNum"], "", None ), + ( "GL_LIST_INDEX", GLint, ["(ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)"], "", None ), ( "GL_LIST_MODE", GLenum, ["mode"], """GLenum mode; if (!ctx->CompileFlag) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f6e4724588..17dd3e6afd 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2886,9 +2886,8 @@ struct gl_tnl_module */ #define DLIST_DANGLING_REFS 0x1 -/* - * Forward declaration of display list data types: - */ + +/** Opaque declaration of display list payload data type */ union gl_dlist_node; @@ -2913,9 +2912,7 @@ struct gl_dlist_state { GLuint CallDepth; /**< Current recursion calling depth */ - struct gl_display_list *CurrentList; - GLuint CurrentListNum; /**< Number of the list being compiled */ - union gl_dlist_node *CurrentListPtr; /**< Head of list being compiled */ + struct gl_display_list *CurrentList; /**< List currently being compiled */ union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */ GLuint CurrentPos; /**< Index into current block of nodes */ -- cgit v1.2.3 From 1265e7267e086476d9bae560345fd80f064adfc5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Jan 2009 15:56:01 -0800 Subject: Build dri.pc during the build rather than the install process. In a normal build system this is generated by configure. --- src/mesa/drivers/dri/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile index 9e49fb16f5..32db097861 100644 --- a/src/mesa/drivers/dri/Makefile +++ b/src/mesa/drivers/dri/Makefile @@ -6,7 +6,7 @@ include $(TOP)/configs/current -default: $(TOP)/$(LIB_DIR) subdirs +default: $(TOP)/$(LIB_DIR) subdirs dri.pc $(TOP)/$(LIB_DIR): -- cgit v1.2.3 From 24ff169486e315671c09cd8a57a311a935ccfff5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 31 Jan 2009 10:32:34 -0800 Subject: intel: Correct FBconfig color masks with DRI2. Fail at copy and paste. This still leaves us with a broken depth 32 visual, but now it's the server's visual setup that's at fault. --- src/mesa/drivers/dri/intel/intel_screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index aad53fb72d..e17f18a98f 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -733,10 +733,10 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) fb_format[0] = GL_RGB; fb_type[0] = GL_UNSIGNED_SHORT_5_6_5; - fb_format[1] = GL_RGB; + fb_format[1] = GL_BGR; fb_type[1] = GL_UNSIGNED_INT_8_8_8_8_REV; - fb_format[2] = GL_RGBA; + fb_format[2] = GL_BGRA; fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV; for (color = 0; color < ARRAY_SIZE(fb_format); color++) { -- cgit v1.2.3 From b3cf2af13a5d053ce3ff0c4f3715123d34bfcc32 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Thu, 18 Dec 2008 18:29:51 +0100 Subject: amd: initial winsys --- src/gallium/winsys/drm/amd/Makefile | 28 +++ src/gallium/winsys/drm/amd/amd_buffer.c | 240 ++++++++++++++++++ src/gallium/winsys/drm/amd/amd_buffer.h | 54 ++++ src/gallium/winsys/drm/amd/amd_context.c | 298 +++++++++++++++++++++++ src/gallium/winsys/drm/amd/amd_context.h | 68 ++++++ src/gallium/winsys/drm/amd/amd_screen.c | 286 ++++++++++++++++++++++ src/gallium/winsys/drm/amd/amd_screen.h | 42 ++++ src/gallium/winsys/drm/amd/amd_winsys_softpipe.c | 77 ++++++ src/gallium/winsys/drm/amd/amd_winsys_softpipe.h | 37 +++ 9 files changed, 1130 insertions(+) create mode 100644 src/gallium/winsys/drm/amd/Makefile create mode 100644 src/gallium/winsys/drm/amd/amd_buffer.c create mode 100644 src/gallium/winsys/drm/amd/amd_buffer.h create mode 100644 src/gallium/winsys/drm/amd/amd_context.c create mode 100644 src/gallium/winsys/drm/amd/amd_context.h create mode 100644 src/gallium/winsys/drm/amd/amd_screen.c create mode 100644 src/gallium/winsys/drm/amd/amd_screen.h create mode 100644 src/gallium/winsys/drm/amd/amd_winsys_softpipe.c create mode 100644 src/gallium/winsys/drm/amd/amd_winsys_softpipe.h (limited to 'src') diff --git a/src/gallium/winsys/drm/amd/Makefile b/src/gallium/winsys/drm/amd/Makefile new file mode 100644 index 0000000000..a1b5602c05 --- /dev/null +++ b/src/gallium/winsys/drm/amd/Makefile @@ -0,0 +1,28 @@ + +TOP = ../../../../.. +include $(TOP)/configs/current + +LIBNAME = amd_dri.so + +MINIGLX_SOURCES = + +PIPE_DRIVERS = \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a + +DRIVER_SOURCES = \ + amd_buffer.c \ + amd_context.c \ + amd_screen.c \ + amd_winsys_softpipe.c + +C_SOURCES = \ + $(COMMON_GALLIUM_SOURCES) \ + $(DRIVER_SOURCES) + +ASM_SOURCES = + +include ../Makefile.template + +DRI_LIB_DEPS += -ldrm-radeon + +symlinks: diff --git a/src/gallium/winsys/drm/amd/amd_buffer.c b/src/gallium/winsys/drm/amd/amd_buffer.c new file mode 100644 index 0000000000..3d400243a5 --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_buffer.c @@ -0,0 +1,240 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#include +#include "dri_util.h" +#include "state_tracker/st_public.h" +#include "pipe/p_winsys.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "amd_buffer.h" +#include "amd_screen.h" +#include "amd_context.h" +#include "radeon_bo.h" +#include "radeon_drm.h" + +static const char *amd_get_name(struct pipe_winsys *ws) +{ + return "AMD/DRI2"; +} + +static struct pipe_buffer *amd_buffer_create(struct pipe_winsys *ws, + unsigned alignment, + unsigned usage, + unsigned size) +{ + struct amd_pipe_winsys *amd_ws = (struct amd_pipe_winsys *)ws; + struct amd_pipe_buffer *amd_buffer; + uint32_t domain; + + amd_buffer = calloc(1, sizeof(*amd_buffer)); + if (amd_buffer == NULL) { + return NULL; + } + amd_buffer->base.refcount = 1; + amd_buffer->base.alignment = alignment; + amd_buffer->base.usage = usage; + amd_buffer->base.size = size; + + domain = 0; + + if (usage & PIPE_BUFFER_USAGE_PIXEL) { + domain |= RADEON_GEM_DOMAIN_VRAM; + } + if (usage & PIPE_BUFFER_USAGE_VERTEX) { + domain |= RADEON_GEM_DOMAIN_GTT; + } + + if (usage & PIPE_BUFFER_USAGE_INDEX) { + domain |= RADEON_GEM_DOMAIN_GTT; + } + amd_buffer->bo = radeon_bo_open(amd_ws->amd_screen->bom, 0, + size, alignment, domain, 0); + if (amd_buffer->bo == NULL) { + free(amd_buffer); + } + return &amd_buffer->base; +} + +static struct pipe_buffer *amd_buffer_user_create(struct pipe_winsys *ws, + void *ptr, + unsigned bytes) +{ + struct amd_pipe_buffer *amd_buffer; + + amd_buffer = (struct amd_pipe_buffer*)amd_buffer_create(ws, 0, 0, bytes); + if (amd_buffer == NULL) { + return NULL; + } + radeon_bo_map(amd_buffer->bo, 1); + memcpy(amd_buffer->bo->ptr, ptr, bytes); + radeon_bo_unmap(amd_buffer->bo); + return &amd_buffer->base; +} + +static void amd_buffer_del(struct pipe_winsys *ws, struct pipe_buffer *buffer) +{ + struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; + + radeon_bo_unref(amd_buffer->bo); + free(amd_buffer); +} + +static void *amd_buffer_map(struct pipe_winsys *ws, + struct pipe_buffer *buffer, + unsigned flags) +{ + struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; + int write = 0; + + if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { + write = 1; + } + if (radeon_bo_map(amd_buffer->bo, write)) + return NULL; + return amd_buffer->bo->ptr; +} + +static void amd_buffer_unmap(struct pipe_winsys *ws, struct pipe_buffer *buffer) +{ + struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; + + radeon_bo_unmap(amd_buffer->bo); +} + +static void amd_fence_reference(struct pipe_winsys *ws, + struct pipe_fence_handle **ptr, + struct pipe_fence_handle *pfence) +{ +} + +static int amd_fence_signalled(struct pipe_winsys *ws, + struct pipe_fence_handle *pfence, + unsigned flag) +{ + return 1; +} + +static int amd_fence_finish(struct pipe_winsys *ws, + struct pipe_fence_handle *pfence, + unsigned flag) +{ + return 0; +} + +static void amd_flush_frontbuffer(struct pipe_winsys *pipe_winsys, + struct pipe_surface *pipe_surface, + void *context_private) +{ + /* TODO: call dri2CopyRegion */ +} + +struct pipe_winsys *amd_pipe_winsys(struct amd_screen *amd_screen) +{ + struct amd_pipe_winsys *amd_ws; + + amd_ws = calloc(1, sizeof(struct amd_pipe_winsys)); + if (amd_ws == NULL) { + return NULL; + } + amd_ws->amd_screen = amd_screen; + + amd_ws->winsys.flush_frontbuffer = amd_flush_frontbuffer; + + amd_ws->winsys.buffer_create = amd_buffer_create; + amd_ws->winsys.buffer_destroy = amd_buffer_del; + amd_ws->winsys.user_buffer_create = amd_buffer_user_create; + amd_ws->winsys.buffer_map = amd_buffer_map; + amd_ws->winsys.buffer_unmap = amd_buffer_unmap; + + amd_ws->winsys.fence_reference = amd_fence_reference; + amd_ws->winsys.fence_signalled = amd_fence_signalled; + amd_ws->winsys.fence_finish = amd_fence_finish; + + amd_ws->winsys.get_name = amd_get_name; + + return &amd_ws->winsys; +} + +static struct pipe_buffer *amd_buffer_from_handle(struct amd_screen *amd_screen, + uint32_t handle) +{ + struct amd_pipe_buffer *amd_buffer; + struct radeon_bo *bo = NULL; + + bo = radeon_bo_open(amd_screen->bom, handle, 0, 0, 0, 0); + if (bo == NULL) { + return NULL; + } + amd_buffer = calloc(1, sizeof(struct amd_pipe_buffer)); + if (amd_buffer == NULL) { + radeon_bo_unref(bo); + return NULL; + } + amd_buffer->base.refcount = 1; + amd_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; + amd_buffer->bo = bo; + return &amd_buffer->base; +} + +struct pipe_surface *amd_surface_from_handle(struct amd_context *amd_context, + uint32_t handle, + enum pipe_format format, + int w, int h, int pitch) +{ + struct pipe_screen *pipe_screen = amd_context->pipe_screen; + struct pipe_winsys *pipe_winsys = amd_context->pipe_winsys; + struct pipe_texture tmpl; + struct pipe_surface *ps; + struct pipe_texture *pt; + struct pipe_buffer *pb; + + pb = amd_buffer_from_handle(amd_context->amd_screen, handle); + if (pb == NULL) { + return NULL; + } + memset(&tmpl, 0, sizeof(tmpl)); + tmpl.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + tmpl.target = PIPE_TEXTURE_2D; + tmpl.width[0] = w; + tmpl.height[0] = h; + tmpl.depth[0] = 1; + tmpl.format = format; + pf_get_block(tmpl.format, &tmpl.block); + tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w); + tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h); + + pt = pipe_screen->texture_blanket(pipe_screen, &tmpl, &pitch, pb); + if (pt == NULL) { + winsys_buffer_reference(pipe_winsys, &pb, NULL); + } + ps = pipe_screen->get_tex_surface(pipe_screen, pt, 0, 0, 0, + PIPE_BUFFER_USAGE_GPU_WRITE); + return ps; +} diff --git a/src/gallium/winsys/drm/amd/amd_buffer.h b/src/gallium/winsys/drm/amd/amd_buffer.h new file mode 100644 index 0000000000..d67967ebea --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_buffer.h @@ -0,0 +1,54 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef AMD_BUFFER_H +#define AMD_BUFFER_H + +#include "pipe/p_winsys.h" +#include "amd_screen.h" +#include "amd_context.h" +#include "radeon_bo.h" + +struct amd_pipe_buffer { + struct pipe_buffer base; + struct radeon_bo *bo; +}; + +struct amd_pipe_winsys { + struct pipe_winsys winsys; + struct amd_screen *amd_screen; +}; + +struct pipe_winsys *amd_pipe_winsys(struct amd_screen *amd_screen); +struct pipe_surface *amd_surface_from_handle(struct amd_context *amd_context, + uint32_t handle, + enum pipe_format format, + int w, int h, int pitch); + +#endif diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c new file mode 100644 index 0000000000..228bd826d3 --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -0,0 +1,298 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#include +#include "dri_util.h" +#include "pipe/p_winsys.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "state_tracker/st_public.h" +#include "state_tracker/st_context.h" +#include "amd_screen.h" +#include "amd_context.h" +#include "amd_buffer.h" +#include "amd_winsys_softpipe.h" + +#define need_GL_ARB_fragment_program +#define need_GL_ARB_multisample +#define need_GL_ARB_point_parameters +#define need_GL_ARB_shader_objects +#define need_GL_ARB_texture_compression +#define need_GL_ARB_vertex_buffer_object +#define need_GL_ARB_vertex_program +#define need_GL_ARB_vertex_shader +#define need_GL_EXT_blend_color +#define need_GL_EXT_blend_equation_separate +#define need_GL_EXT_blend_func_separate +#define need_GL_EXT_blend_minmax +#define need_GL_EXT_cull_vertex +#define need_GL_EXT_compiled_vertex_array +#define need_GL_EXT_fog_coord +#define need_GL_EXT_framebuffer_object +#define need_GL_EXT_multi_draw_arrays +#define need_GL_EXT_secondary_color +#define need_GL_VERSION_2_0 +#define need_GL_VERSION_2_1 +#include "extension_helper.h" + +/** + * Extension strings exported by the amd driver. + */ +const struct dri_extension amd_card_extensions[] = { + {"GL_ARB_multitexture", NULL}, + {"GL_ARB_texture_border_clamp", NULL}, + {"GL_ARB_texture_rectangle", NULL}, + {"GL_ARB_pixel_buffer_object", NULL}, + {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, + {"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_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, + {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions}, + {"GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions}, + {"GL_EXT_blend_color", GL_EXT_blend_color_functions}, + {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions}, + {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, + {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, + {"GL_EXT_blend_subtract", NULL}, + {"GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions}, + {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions}, + {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions}, + {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions}, + {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions}, + {"GL_EXT_packed_depth_stencil", NULL}, + {"GL_EXT_pixel_buffer_object", NULL}, + {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, + {"GL_EXT_stencil_wrap", NULL}, + {NULL, NULL} +}; + +static void amd_update_renderbuffers(__DRIcontext *dri_context, + __DRIdrawable *dri_drawable) +{ + struct amd_framebuffer *amd_fb; + struct amd_context *amd_context; + unsigned attachments[10]; + __DRIbuffer *buffers; + __DRIscreen *screen; + int i, count; + + amd_context = dri_context->driverPrivate; + screen = dri_drawable->driScreenPriv; + amd_fb = dri_drawable->driverPrivate; + for (count = 0, i = 0; count < 6; count++) { + if (amd_fb->attachments & (1 << count)) { + attachments[i++] = count; + } + } + + buffers = (*screen->dri2.loader->getBuffers)(dri_drawable, + &dri_drawable->w, + &dri_drawable->h, + attachments, + i, + &count, + dri_drawable->loaderPrivate); + if (buffers == NULL) { + return; + } + + /* set one cliprect to cover the whole dri_drawable */ + dri_drawable->x = 0; + dri_drawable->y = 0; + dri_drawable->backX = 0; + dri_drawable->backY = 0; + dri_drawable->numClipRects = 1; + dri_drawable->pClipRects[0].x1 = 0; + dri_drawable->pClipRects[0].y1 = 0; + dri_drawable->pClipRects[0].x2 = dri_drawable->w; + dri_drawable->pClipRects[0].y2 = dri_drawable->h; + dri_drawable->numBackClipRects = 1; + dri_drawable->pBackClipRects[0].x1 = 0; + dri_drawable->pBackClipRects[0].y1 = 0; + dri_drawable->pBackClipRects[0].x2 = dri_drawable->w; + dri_drawable->pBackClipRects[0].y2 = dri_drawable->h; + + for (i = 0; i < count; i++) { + struct pipe_surface *ps; + enum pipe_format format = 0; + int index = 0; + + switch (buffers[i].attachment) { + case __DRI_BUFFER_FRONT_LEFT: + index = ST_SURFACE_FRONT_LEFT; + switch (buffers[i].cpp) { + case 4: + format = PIPE_FORMAT_A8R8G8B8_UNORM; + break; + case 2: + format = PIPE_FORMAT_R5G6B5_UNORM; + break; + default: + /* FIXME: error */ + return; + } + break; + case __DRI_BUFFER_BACK_LEFT: + index = ST_SURFACE_BACK_LEFT; + switch (buffers[i].cpp) { + case 4: + format = PIPE_FORMAT_A8R8G8B8_UNORM; + break; + case 2: + format = PIPE_FORMAT_R5G6B5_UNORM; + break; + default: + /* FIXME: error */ + return; + } + break; + case __DRI_BUFFER_STENCIL: + case __DRI_BUFFER_DEPTH: + index = ST_SURFACE_DEPTH; + switch (buffers[i].cpp) { + case 4: + format = PIPE_FORMAT_Z24S8_UNORM; + break; + case 2: + format = PIPE_FORMAT_Z16_UNORM; + break; + default: + /* FIXME: error */ + return; + } + break; + case __DRI_BUFFER_ACCUM: + default: + fprintf(stderr, + "unhandled buffer attach event, attacment type %d\n", + buffers[i].attachment); + return; + } + + ps = amd_surface_from_handle(amd_context, + buffers[i].name, + format, + dri_drawable->w, + dri_drawable->h, + buffers[i].pitch); + assert(ps); + st_set_framebuffer_surface(amd_fb->st_framebuffer, index, ps); + } + st_resize_framebuffer(amd_fb->st_framebuffer, + dri_drawable->w, + dri_drawable->h); +} + +GLboolean amd_context_create(const __GLcontextModes *visual, + __DRIcontextPrivate *dri_context, + void *shared_context) +{ + __DRIscreenPrivate *dri_screen; + struct amd_context *amd_context; + struct amd_screen *amd_screen; + struct pipe_context *pipe; + struct st_context *shared_st_context = NULL; + + dri_context->driverPrivate = NULL; + amd_context = calloc(1, sizeof(struct amd_context)); + if (amd_context == NULL) { + return GL_FALSE; + } + + if (shared_context) { + shared_st_context = ((struct amd_context*)shared_context)->st_context; + } + + dri_screen = dri_context->driScreenPriv; + amd_screen = dri_screen->private; + amd_context->dri_screen = dri_screen; + amd_context->amd_screen = amd_screen; + amd_context->drm_fd = dri_screen->fd; + + amd_context->pipe_winsys = amd_pipe_winsys(amd_screen); + if (amd_context->pipe_winsys == NULL) { + free(amd_context); + return GL_FALSE; + } + + pipe = amd_create_softpipe(amd_context); + amd_context->st_context = st_create_context(pipe, visual, + shared_st_context); + driInitExtensions(amd_context->st_context->ctx, + amd_card_extensions, GL_TRUE); + dri_context->driverPrivate = amd_context; + return GL_TRUE; +} + +void amd_context_destroy(__DRIcontextPrivate *dri_context) +{ + struct amd_context *amd_context; + + amd_context = dri_context->driverPrivate; + st_finish(amd_context->st_context); + st_destroy_context(amd_context->st_context); + free(amd_context); +} + +GLboolean amd_context_bind(__DRIcontextPrivate *dri_context, + __DRIdrawablePrivate *dri_drawable, + __DRIdrawablePrivate *dri_readable) +{ + struct amd_framebuffer *drawable; + struct amd_framebuffer *readable; + struct amd_context *amd_context; + + if (dri_context == NULL) { + st_make_current(NULL, NULL, NULL); + return GL_TRUE; + } + + amd_context = dri_context->driverPrivate; + drawable = dri_drawable->driverPrivate; + readable = dri_readable->driverPrivate; + st_make_current(amd_context->st_context, + drawable->st_framebuffer, + readable->st_framebuffer); + + amd_update_renderbuffers(dri_context, dri_drawable); + if (dri_drawable != dri_readable) { + amd_update_renderbuffers(dri_context, dri_readable); + } + return GL_TRUE; +} + +GLboolean amd_context_unbind(__DRIcontextPrivate *dri_context) +{ + struct amd_context *amd_context; + + amd_context = dri_context->driverPrivate; + st_flush(amd_context->st_context, PIPE_FLUSH_RENDER_CACHE, NULL); + return GL_TRUE; +} diff --git a/src/gallium/winsys/drm/amd/amd_context.h b/src/gallium/winsys/drm/amd/amd_context.h new file mode 100644 index 0000000000..54a831f15a --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_context.h @@ -0,0 +1,68 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef AMD_CONTEXT_H +#define AMD_CONTEXT_H + +#include "dri_util.h" +#include "state_tracker/st_public.h" +#include "state_tracker/st_context.h" +#include "amd_screen.h" + +struct amd_framebuffer { + struct st_framebuffer *st_framebuffer; + unsigned attachments; +}; + +struct amd_context { + /* st */ + struct st_context *st_context; + /* pipe */ + struct pipe_screen *pipe_screen; + struct pipe_winsys *pipe_winsys; + /* DRI */ + __DRIscreenPrivate *dri_screen; + __DRIdrawablePrivate *dri_drawable; + __DRIdrawablePrivate *dri_readable; + /* DRM */ + int drm_fd; + /* AMD */ + struct amd_screen *amd_screen; +}; + +GLboolean amd_context_create(const __GLcontextModes*, + __DRIcontextPrivate*, + void*); +void amd_context_destroy(__DRIcontextPrivate*); +GLboolean amd_context_bind(__DRIcontextPrivate*, + __DRIdrawablePrivate*, + __DRIdrawablePrivate*); +GLboolean amd_context_unbind(__DRIcontextPrivate*); + +#endif diff --git a/src/gallium/winsys/drm/amd/amd_screen.c b/src/gallium/winsys/drm/amd/amd_screen.c new file mode 100644 index 0000000000..22d8973eb7 --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_screen.c @@ -0,0 +1,286 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#include +#include "pipe/p_screen.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "pipe/p_context.h" +#include "pipe/p_state.h" +#include "state_tracker/st_public.h" +#include "state_tracker/st_context.h" +#include "utils.h" +#include "xf86drm.h" +#include "drm.h" +#include "dri_util.h" +#include "amd_screen.h" +#include "amd_context.h" +#include "amd_buffer.h" +#include "radeon_bo.h" +#include "radeon_bo_gem.h" +#include "radeon_drm.h" + +extern const struct dri_extension amd_card_extensions[]; + +static const __DRIextension *amd_screen_extensions[] = { + &driReadDrawableExtension, + &driCopySubBufferExtension.base, + &driSwapControlExtension.base, + &driFrameTrackingExtension.base, + &driMediaStreamCounterExtension.base, + NULL +}; + +static __DRIconfig **amd_fill_in_modes(unsigned pixel_bits, + unsigned depth_bits, + GLboolean have_back_buffer) +{ + __DRIconfig **configs; + unsigned depth_buffer_factor; + unsigned back_buffer_factor; + unsigned num_modes; + GLenum fb_format; + GLenum fb_type; + uint8_t depth_bits_array[3]; + uint8_t stencil_bits_array[3]; + uint8_t msaa_samples_array[1]; + /* TODO: pageflipping ? */ + static const GLenum back_buffer_modes[] = { + GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML + }; + + stencil_bits_array[0] = 0; + stencil_bits_array[1] = 0; + if (depth_bits == 24) { + stencil_bits_array[2] = 8; + num_modes = 3; + } + + depth_bits_array[0] = 0; + depth_bits_array[1] = depth_bits; + depth_bits_array[2] = depth_bits; + depth_buffer_factor = (depth_bits == 24) ? 3 : 2; + + back_buffer_factor = (have_back_buffer) ? 3 : 1; + + msaa_samples_array[0] = 0; + + if (pixel_bits == 16) { + fb_format = GL_RGB; + fb_type = GL_UNSIGNED_SHORT_5_6_5; + } else { + fb_format = GL_BGRA; + fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; + } + + configs = (__DRIconfig **)driCreateConfigs(fb_format, + fb_type, + depth_bits_array, + stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, + back_buffer_factor, + msaa_samples_array, + 1); + if (configs == NULL) { + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", + __FILE__, __LINE__); + return NULL; + } + return configs; +} + +static void amd_screen_destroy(__DRIscreenPrivate *dri_screen) +{ + struct amd_screen *amd_screen = (struct amd_screen*)dri_screen->private; + + radeon_bo_manager_gem_dtor(amd_screen->bom); + dri_screen = NULL; + free(amd_screen); +} + +static const __DRIconfig **amd_screen_init(__DRIscreenPrivate *dri_screen) +{ + struct amd_screen *amd_screen; + + /* 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, amd_card_extensions, GL_FALSE); + + amd_screen = calloc(1, sizeof(struct amd_screen)); + if (amd_screen == NULL) { + fprintf(stderr, "\nERROR! Allocating private area failed\n"); + return NULL; + } + dri_screen->private = (void*)amd_screen; + dri_screen->extensions = amd_screen_extensions; + amd_screen->dri_screen = dri_screen; + + amd_screen->bom = radeon_bo_manager_gem_ctor(dri_screen->fd); + if (amd_screen->bom == NULL) { + amd_screen_destroy(dri_screen); + return NULL; + } + + return driConcatConfigs(amd_fill_in_modes(16, 16, 1), + amd_fill_in_modes(32, 24, 1)); +} + +static boolean amd_buffer_create(__DRIscreenPrivate *dri_screen, + __DRIdrawablePrivate *dri_drawable, + const __GLcontextModes *visual, + boolean is_pixmap) +{ + if (is_pixmap) { + /* TODO: implement ? */ + return GL_FALSE; + } else { + enum pipe_format color_format, depth_format, stencil_format; + struct amd_framebuffer *amd_fb; + + amd_fb = calloc(1, sizeof(struct amd_framebuffer)); + if (amd_fb == NULL) { + return GL_FALSE; + } + + switch (visual->redBits) { + case 5: + color_format = PIPE_FORMAT_R5G6B5_UNORM; + break; + default: + color_format = PIPE_FORMAT_A8R8G8B8_UNORM; + break; + } + + switch (visual->depthBits) { + case 16: + depth_format = PIPE_FORMAT_Z16_UNORM; + break; + case 24: + depth_format = PIPE_FORMAT_S8Z24_UNORM; + default: + depth_format = PIPE_FORMAT_NONE; + break; + } + + switch (visual->stencilBits) { + case 8: + /* force depth format */ + depth_format = PIPE_FORMAT_S8Z24_UNORM; + stencil_format = PIPE_FORMAT_S8Z24_UNORM; + break; + default: + stencil_format = PIPE_FORMAT_NONE; + break; + } + + amd_fb->st_framebuffer = st_create_framebuffer(visual, + color_format, + depth_format, + stencil_format, + dri_drawable->w, + dri_drawable->h, + (void*)amd_fb); + if (amd_fb->st_framebuffer == NULL) { + free(amd_fb); + return GL_FALSE; + } + dri_drawable->driverPrivate = (void *) amd_fb; + + amd_fb->attachments = (1 << __DRI_BUFFER_FRONT_LEFT); + if (visual->doubleBufferMode) { + amd_fb->attachments |= (1 << __DRI_BUFFER_BACK_LEFT); + } + if (visual->depthBits || visual->stencilBits) { + amd_fb->attachments |= (1 << __DRI_BUFFER_DEPTH); + } + + return GL_TRUE; + } +} + +static void amd_buffer_destroy(__DRIdrawablePrivate * dri_drawable) +{ + struct amd_framebuffer *amd_fb; + + amd_fb = dri_drawable->driverPrivate; + assert(amd_fb->st_framebuffer); + st_unreference_framebuffer(amd_fb->st_framebuffer); + free(amd_fb); +} + +static void amd_swap_buffers(__DRIdrawablePrivate *dri_drawable) +{ + struct amd_framebuffer *amd_fb; + struct pipe_surface *back_surf; + + amd_fb = dri_drawable->driverPrivate; + assert(amd_fb); + assert(amd_fb->st_framebuffer); + + back_surf = st_get_framebuffer_surface(amd_fb->st_framebuffer, + ST_SURFACE_BACK_LEFT); + if (back_surf) { + st_notify_swapbuffers(amd_fb->st_framebuffer); + /* TODO: do we want to do anythings ? */ + st_notify_swapbuffers_complete(amd_fb->st_framebuffer); + } +} + +/** + * Called via glXCopySubBufferMESA() to copy a subrect of the back + * buffer to the front buffer/screen. + */ +static void amd_copy_sub_buffer(__DRIdrawablePrivate *dri_drawable, + int x, int y, int w, int h) +{ + /* TODO: ... */ +} + +const struct __DriverAPIRec driDriverAPI = { + .InitScreen = NULL, + .DestroyScreen = amd_screen_destroy, + .CreateContext = amd_context_create, + .DestroyContext = amd_context_destroy, + .CreateBuffer = amd_buffer_create, + .DestroyBuffer = amd_buffer_destroy, + .SwapBuffers = amd_swap_buffers, + .MakeCurrent = amd_context_bind, + .UnbindContext = amd_context_unbind, + .CopySubBuffer = amd_copy_sub_buffer, + .InitScreen2 = amd_screen_init, +}; diff --git a/src/gallium/winsys/drm/amd/amd_screen.h b/src/gallium/winsys/drm/amd/amd_screen.h new file mode 100644 index 0000000000..7f21fa477c --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_screen.h @@ -0,0 +1,42 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef AMD_SCREEN_H +#define AMD_SCREEN_H + +#include "pipe/p_winsys.h" +#include "dri_util.h" +#include "radeon_bo.h" + +struct amd_screen { + __DRIscreenPrivate *dri_screen; + struct radeon_bo_manager *bom; +}; + +#endif diff --git a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c b/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c new file mode 100644 index 0000000000..b9b2a0e8b8 --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c @@ -0,0 +1,77 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ +/* + * Authors: Keith Whitwell + */ +#include +#include "imports.h" +#include "pipe/p_defines.h" +#include "pipe/p_format.h" +#include "softpipe/sp_winsys.h" +#include "amd_context.h" +#include "amd_winsys_softpipe.h" + +struct amd_softpipe_winsys { + struct softpipe_winsys sp_winsys; + struct amd_context *amd_context; +}; + +/** + * Return list of surface formats supported by this driver. + */ +static boolean amd_is_format_supported(struct softpipe_winsys *sws, uint format) +{ + switch (format) { + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + return TRUE; + default: + break; + }; + return FALSE; +} + +struct pipe_context *amd_create_softpipe(struct amd_context *amd_context) +{ + struct amd_softpipe_winsys *amd_sp_ws; + struct pipe_screen *pipe_screen; + + pipe_screen = softpipe_create_screen(amd_context->pipe_winsys); + + amd_sp_ws = CALLOC_STRUCT(amd_softpipe_winsys); + if (amd_sp_ws == NULL) { + return NULL; + } + amd_context->pipe_screen = pipe_screen; + amd_sp_ws->amd_context = amd_context; + amd_sp_ws->sp_winsys.is_format_supported = amd_is_format_supported; + return softpipe_create(pipe_screen, + amd_context->pipe_winsys, + &amd_sp_ws->sp_winsys); +} diff --git a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h b/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h new file mode 100644 index 0000000000..e5b68cf8a5 --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h @@ -0,0 +1,37 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef AMD_WINSYS_SOFTPIPE_H +#define AMD_WINSYS_SOFTPIPE_H + +#include "amd_context.h" + +struct pipe_context *amd_create_softpipe(struct amd_context *amd_context); + +#endif -- cgit v1.2.3 From da1928d4a6d48e915960798015ed1f0c1fa95f0c Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 5 Jan 2009 23:55:00 -0800 Subject: gallium-r300: Initial commit. Or should it be r300-gallium? Meh, whatever. --- src/gallium/drivers/r300/r300_context.c | 27 ++++++++ src/gallium/drivers/r300/r300_context.h | 4 ++ src/gallium/drivers/r300/r300_screen.c | 119 ++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_state.c | 22 ++++++ 4 files changed, 172 insertions(+) create mode 100644 src/gallium/drivers/r300/r300_context.c create mode 100644 src/gallium/drivers/r300/r300_context.h create mode 100644 src/gallium/drivers/r300/r300_screen.c create mode 100644 src/gallium/drivers/r300/r300_state.c (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c new file mode 100644 index 0000000000..a2ed0270cb --- /dev/null +++ b/src/gallium/drivers/r300/r300_context.c @@ -0,0 +1,27 @@ +#include "r300_context.h" + +static void r300_destroy_context(struct pipe_context* pipe) { + struct r300_context* context = r300_context(pipe); + + draw_destroy(context->draw); + + FREE(context); +} + +struct pipe_context* r300_create_context(struct pipe_screen* screen, + struct pipe_winsys* winsys, + struct amd_winsys* amd_winsys) +{ + struct r300_context* context = CALLOC_STRUCT(r300_context); + + if (!context) + return NULL; + + context->winsys = amd_winsys; + context->pipe.winsys = winsys; + context->pipe.screen = screen; + + context->pipe.destroy = r300_destroy_context; + + return &context->pipe; +} \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h new file mode 100644 index 0000000000..cd4b56c827 --- /dev/null +++ b/src/gallium/drivers/r300/r300_context.h @@ -0,0 +1,4 @@ +/* Convenience cast wrapper. */ +static struct r300_context* r300_context(struct pipe_context* pipe) { + return (struct r300_context*)pipe; +} \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c new file mode 100644 index 0000000000..a1f056b810 --- /dev/null +++ b/src/gallium/drivers/r300/r300_screen.c @@ -0,0 +1,119 @@ +/* XXX put a copyright here */ + +/* I know my style's weird, get used to it */ + +static const char* r300_get_vendor(struct pipe_screen* pscreen) { + return "X.Org R300 Project"; +} + +static const char* r300_get_name(struct pipe_screen* pscreen) { + /* XXX lazy */ + return "unknown"; +} + +static int r300_get_param(struct pipe_screen* pscreen, int param) { + switch (param) { + /* Cases marked "IN THEORY" are possible on the hardware, + * but haven't been implemented yet. */ + case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: + /* XXX I'm told this goes up to 16 */ + return 8; + case PIPE_CAP_NPOT_TEXTURES: + /* IN THEORY */ + return 0; + case PIPE_CAP_S3TC: + /* IN THEORY */ + return 0; + case PIPE_CAP_TWO_SIDED_STENCIL: + /* IN THEORY */ + return 0; + case PIPE_CAP_ANISOTROPIC_FILTER: + /* IN THEORY */ + return 0; + case PIPE_CAP_POINT_SPRITE: + /* IN THEORY */ + return 0; + case PIPE_CAP_OCCLUSION_QUERY: + /* IN THEORY */ + return 0; + case PIPE_CAP_TEXTURE_SHADOW_MAP: + /* IN THEORY */ + return 0; + case PIPE_CAP_GLSL: + /* IN THEORY */ + return 0; + case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: + /* 12 == 2048x2048 + * R500 can do 4096x4096 */ + return 12; + case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: + /* XXX educated guess */ + return 8; + case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: + /* XXX educated guess */ + return 11; + case PIPE_CAP_MAX_RENDER_TARGETS: + /* XXX 4 eventually */ + return 1; + default: + return 0; + } +} + +static float r300_get_paramf(struct pipe_screen* pscreen, float param) { + switch (param) { + case PIPE_CAP_MAX_LINE_WIDTH: + case PIPE_CAP_MAX_LINE_WIDTH_AA: + /* XXX look this up, lazy ass! */ + return 0.0; + case PIPE_CAP_MAX_POINT_WIDTH: + case PIPE_CAP_MAX_POINT_WIDTH_AA: + /* XXX see above */ + return 255.0; + case PIPE_CAP_MAX_TEXTURE_ANISOTROPY: + return 16.0; + case PIPE_CAP_MAX_TEXTURE_LOD_BIAS: + /* XXX again... */ + return 16.0; + default: + return 0.0; + } +} + +static boolean r300_is_format_supported(struct pipe_screen* pscreen, + enum pipe_format format, uint type) +{ + return FALSE; +} + +static r300_destroy_screen(struct pipe_screen* pscreen) { + FREE(pscreen); +} + +struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint pci_id) { + struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen); + + if (!r300screen) + return NULL; + + /* XXX break this into its own function? */ + switch (pci_id) { + default: + debug_printf("%s: unknown PCI ID 0x%x, cannot create screen!\n", + __FUNCTION__, pci_id); + return NULL; + } + + r300screen->pci_id = pci_id; + r300screen->screen.winsys = winsys; + r300screen->screen.destroy = r300_destroy_screen; + r300screen->screen.get_name = r300_get_name; + r300screen->screen.get_vendor = r300_get_vendor; + r300screen->screen.get_param = r300_get_param; + r300screen->screen.get_paramf = r300_get_paramf; + r300screen->screen.is_format_supported = r300_is_format_supported; + r300screen->screen.surface_map = r300_surface_map; + r300screen->screen.surface_unmap = r300_surface_unmap; + + return &r300screen->screen; +} diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c new file mode 100644 index 0000000000..18b3d55752 --- /dev/null +++ b/src/gallium/drivers/r300/r300_state.c @@ -0,0 +1,22 @@ +#include "r300_context.h" + +static void* r300_create_vs_state(struct pipe_context* pipe, + struct pipe_shader_state* state) +{ + struct r300_context* context = r300_context(pipe); + /* XXX handing this off to Draw for now */ + return draw_create_vertex_shader(context->draw, state); +} + +static void r300_bind_vs_state(struct pipe_context* pipe, void* state) { + struct r300_context* context = r300_context(pipe); + /* XXX handing this off to Draw for now */ + draw_bind_vertex_shader(context->draw, (struct draw_vertex_shader*)state); +} + +static void r300_delete_vs_state(struct pipe_context* pipe, void* state) +{ + struct r300_context* context = r300_context(pipe); + /* XXX handing this off to Draw for now */ + draw_delete_vertex_shader(context->draw, (struct draw_vertex_shader*)state); +} \ No newline at end of file -- cgit v1.2.3 From aa96874c7abffa3fa9eef47ea36ab473ad2d2272 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 8 Jan 2009 14:41:29 -0800 Subject: gallium-r300: Add some headers. Oh yeah, we're cookin' now! --- src/gallium/drivers/r300/r300_context.h | 29 ++++++++++++++++++++++++++- src/gallium/drivers/r300/r300_screen.h | 35 +++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_state.h | 26 ++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/gallium/drivers/r300/r300_screen.h create mode 100644 src/gallium/drivers/r300/r300_state.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index cd4b56c827..28363fd36c 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -1,4 +1,31 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_CONTEXT_H +#define R300_CONTEXT_H + /* Convenience cast wrapper. */ static struct r300_context* r300_context(struct pipe_context* pipe) { return (struct r300_context*)pipe; -} \ No newline at end of file +} + +#endif /* R300_CONTEXT_H */ \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h new file mode 100644 index 0000000000..aa12c29a99 --- /dev/null +++ b/src/gallium/drivers/r300/r300_screen.h @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_SCREEN_H +#define R300_SCREEN_H + +struct r300_screen { + /* Parent class */ + struct pipe_screen screen; + + boolean is_r400; + boolean is_r500; + int pci_id; +} + +#endif /* R300_SCREEN_H */ diff --git a/src/gallium/drivers/r300/r300_state.h b/src/gallium/drivers/r300/r300_state.h new file mode 100644 index 0000000000..861425936a --- /dev/null +++ b/src/gallium/drivers/r300/r300_state.h @@ -0,0 +1,26 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_STATE_H +#define R300_STATE_H + +#endif /* R300_STATE_H */ \ No newline at end of file -- cgit v1.2.3 From 3e09a07a265d5ee75b110954d160a73d83793c40 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 8 Jan 2009 14:52:47 -0800 Subject: gallium-r300: Look less like i915. Todo: - Figure out how much code goes in winsys. - Make it build. - Make it suck less. --- src/gallium/drivers/r300/r300_context.c | 8 ++++---- src/gallium/drivers/r300/r300_context.h | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index a2ed0270cb..4aef5030fc 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -18,10 +18,10 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, return NULL; context->winsys = amd_winsys; - context->pipe.winsys = winsys; - context->pipe.screen = screen; + context->context.winsys = winsys; + context->context.screen = screen; - context->pipe.destroy = r300_destroy_context; + context->context.destroy = r300_destroy_context; - return &context->pipe; + return &context->context; } \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 28363fd36c..fd344361d9 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -23,6 +23,14 @@ #ifndef R300_CONTEXT_H #define R300_CONTEXT_H +struct r300_context { + /* Parent class */ + struct pipe_context context; + + struct amd_winsys* winsys; + struct draw_context* draw; +} + /* Convenience cast wrapper. */ static struct r300_context* r300_context(struct pipe_context* pipe) { return (struct r300_context*)pipe; -- cgit v1.2.3 From 3b37cb49b821dd0c59fd5361ada6c0df9ac07db8 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 8 Jan 2009 15:47:23 -0800 Subject: gallium-r300: Make it build. Still todo: - Sort out winsys. - Less suckage. --- src/gallium/drivers/r300/Makefile | 13 +++++++ src/gallium/drivers/r300/r300_context.c | 20 +++++----- src/gallium/drivers/r300/r300_context.h | 8 ++-- src/gallium/drivers/r300/r300_screen.c | 65 +++++++++++++++++++++++++++++---- src/gallium/drivers/r300/r300_screen.h | 13 +++++++ 5 files changed, 98 insertions(+), 21 deletions(-) create mode 100644 src/gallium/drivers/r300/Makefile (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile new file mode 100644 index 0000000000..b33e56f73d --- /dev/null +++ b/src/gallium/drivers/r300/Makefile @@ -0,0 +1,13 @@ +TOP = ../../../.. +include $(TOP)/configs/current + +LIBNAME = r300 + +C_SOURCES = \ + r300_context.c \ + r300_screen.c \ + r300_state.c + +include ../../Makefile.template + +symlinks: diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 4aef5030fc..569fdd3f0f 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -1,9 +1,9 @@ #include "r300_context.h" -static void r300_destroy_context(struct pipe_context* pipe) { - struct r300_context* context = r300_context(pipe); +static void r300_destroy_context(struct pipe_context* context) { + struct r300_context* r300 = r300_context(context); - draw_destroy(context->draw); + draw_destroy(r300->draw); FREE(context); } @@ -12,16 +12,16 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, struct pipe_winsys* winsys, struct amd_winsys* amd_winsys) { - struct r300_context* context = CALLOC_STRUCT(r300_context); + struct r300_context* r300 = CALLOC_STRUCT(r300_context); - if (!context) + if (!r300) return NULL; - context->winsys = amd_winsys; - context->context.winsys = winsys; - context->context.screen = screen; + r300->winsys = amd_winsys; + r300->context.winsys = winsys; + r300->context.screen = screen; - context->context.destroy = r300_destroy_context; + r300->context.destroy = r300_destroy_context; - return &context->context; + return &r300->context; } \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index fd344361d9..7c2055e43e 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -23,17 +23,19 @@ #ifndef R300_CONTEXT_H #define R300_CONTEXT_H +#include "pipe/p_context.h" + struct r300_context { /* Parent class */ struct pipe_context context; struct amd_winsys* winsys; struct draw_context* draw; -} +}; /* Convenience cast wrapper. */ -static struct r300_context* r300_context(struct pipe_context* pipe) { - return (struct r300_context*)pipe; +static struct r300_context* r300_context(struct pipe_context* context) { + return (struct r300_context*)context; } #endif /* R300_CONTEXT_H */ \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index a1f056b810..9c89623df3 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -1,6 +1,26 @@ -/* XXX put a copyright here */ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ -/* I know my style's weird, get used to it */ +#include "r300_screen.h" static const char* r300_get_vendor(struct pipe_screen* pscreen) { return "X.Org R300 Project"; @@ -12,6 +32,8 @@ static const char* r300_get_name(struct pipe_screen* pscreen) { } static int r300_get_param(struct pipe_screen* pscreen, int param) { + struct r300_screen* r300screen = r300_screen(pscreen); + switch (param) { /* Cases marked "IN THEORY" are possible on the hardware, * but haven't been implemented yet. */ @@ -43,9 +65,13 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) { /* IN THEORY */ return 0; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: - /* 12 == 2048x2048 - * R500 can do 4096x4096 */ - return 12; + /* 12 == 2048x2048 */ + if (r300screen->is_r500) { + /* R500 can do 4096x4096 */ + return 13; + } else { + return 12; + } case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: /* XXX educated guess */ return 8; @@ -60,7 +86,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) { } } -static float r300_get_paramf(struct pipe_screen* pscreen, float param) { +static float r300_get_paramf(struct pipe_screen* pscreen, int param) { switch (param) { case PIPE_CAP_MAX_LINE_WIDTH: case PIPE_CAP_MAX_LINE_WIDTH_AA: @@ -81,12 +107,35 @@ static float r300_get_paramf(struct pipe_screen* pscreen, float param) { } static boolean r300_is_format_supported(struct pipe_screen* pscreen, - enum pipe_format format, uint type) + enum pipe_format format, + enum pipe_texture_target target, + unsigned tex_usage, + unsigned geom_flags) { return FALSE; } -static r300_destroy_screen(struct pipe_screen* pscreen) { +static void* r300_surface_map(struct pipe_screen* screen, + struct pipe_surface* surface, + unsigned flags) +{ + /* XXX is this all we need to do here? */ + char* map = pipe_buffer_map(screen, surface->buffer, flags); + + if (!map) { + return NULL; + } + + return map + surface->offset; +} + +static void r300_surface_unmap(struct pipe_screen* screen, + struct pipe_surface* surface) +{ + pipe_buffer_unmap(screen, surface->buffer); +} + +static void r300_destroy_screen(struct pipe_screen* pscreen) { FREE(pscreen); } diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index aa12c29a99..36fc5aa67d 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -23,6 +23,11 @@ #ifndef R300_SCREEN_H #define R300_SCREEN_H +#include "pipe/p_screen.h" +#include "util/u_memory.h" + +#include "r300_context.h" + struct r300_screen { /* Parent class */ struct pipe_screen screen; @@ -30,6 +35,14 @@ struct r300_screen { boolean is_r400; boolean is_r500; int pci_id; +}; + +/* Convenience cast wrapper. */ +static struct r300_screen* r300_screen(struct pipe_screen* screen) { + return (struct r300_screen*)screen; } +/* Creates a new r300 screen. */ +struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint pci_id); + #endif /* R300_SCREEN_H */ -- cgit v1.2.3 From 62363723001a63b86b7526d6528c19996a44463b Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 8 Jan 2009 16:33:29 -0800 Subject: gallium-r300: Add r300_clear. Todo: - Less suckage. - Re-read bo-cs stuff, figure out how the hell to emit state. - Blits. --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_clear.c | 29 +++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_clear.h | 23 +++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 src/gallium/drivers/r300/r300_clear.c create mode 100644 src/gallium/drivers/r300/r300_clear.h (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index b33e56f73d..918eb8e1c4 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configs/current LIBNAME = r300 C_SOURCES = \ + r300_clear.c \ r300_context.c \ r300_screen.c \ r300_state.c diff --git a/src/gallium/drivers/r300/r300_clear.c b/src/gallium/drivers/r300/r300_clear.c new file mode 100644 index 0000000000..f8f0e61931 --- /dev/null +++ b/src/gallium/drivers/r300/r300_clear.c @@ -0,0 +1,29 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +/* This gets its own file because Intel's is in its own file. + * I assume there's a good reason. */ +void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val) +{ + pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue); + ps->status = PIPE_SURFACE_STATUS_DEFINED; +} \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_clear.h b/src/gallium/drivers/r300/r300_clear.h new file mode 100644 index 0000000000..58ac0a875c --- /dev/null +++ b/src/gallium/drivers/r300/r300_clear.h @@ -0,0 +1,23 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val); \ No newline at end of file -- cgit v1.2.3 From fb11fb897c2dc8cde64c84962d40e5fa6f384307 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 02:32:53 -0800 Subject: gallium-r300: Add copyrights, place (broken) CS. Todo: - Fill blits. - Less suck. - Ask glisse about how to get winsys+pipe talking right, so stuff like the CS can be set up right. --- src/gallium/drivers/r300/r300_context.c | 27 +++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_context.h | 7 +++++++ src/gallium/drivers/r300/r300_state.c | 22 ++++++++++++++++++++++ 3 files changed, 56 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 569fdd3f0f..7fde1404d9 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -1,3 +1,25 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_context.h" static void r300_destroy_context(struct pipe_context* context) { @@ -23,5 +45,10 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.destroy = r300_destroy_context; + /* XXX this is almost certainly wrong + * put this all in winsys, where we can get an FD + struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); + r300->cs = cs_gem_create(csm, 64 * 1024 / 4); */ + return &r300->context; } \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 7c2055e43e..f67823aa1e 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -31,6 +31,13 @@ struct r300_context { struct amd_winsys* winsys; struct draw_context* draw; + + /* CS object. This is very much like Intel's batchbuffer. + * Fill it full of dwords and relocs and then submit. + * Repeat as needed. */ + /* Note: Unlike Mesa's version of this, we don't keep a copy of the CSM + * that was used to create this CS. Is this a good idea? */ + struct radeon_cs* cs; }; /* Convenience cast wrapper. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 18b3d55752..a853507fea 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1,3 +1,25 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_context.h" static void* r300_create_vs_state(struct pipe_context* pipe, -- cgit v1.2.3 From d6cdb9db259d617ee21f1881c945e2ebaf6693b9 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 04:34:56 -0800 Subject: gallium-r300: Add r300_blit. Count the XXXs and weep? --- src/gallium/drivers/r300/r300_blit.c | 90 ++++++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_blit.h | 35 ++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 src/gallium/drivers/r300/r300_blit.c create mode 100644 src/gallium/drivers/r300/r300_blit.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c new file mode 100644 index 0000000000..c01855defa --- /dev/null +++ b/src/gallium/drivers/r300/r300_blit.c @@ -0,0 +1,90 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +/* Does a "paint" into the specified rectangle. + * Returns 1 on success, 0 on error. */ +int r300_fill_blit(struct r300_context* r300, + unsigned cpp, + short dst_pitch, + struct pipe_buffer* dst_buffer, + unsigned dst_offset, + short x, short y, + short w, short h, + unsigned color) +{ + uint32_t dest_type; + + /* Check for fallbacks. */ + /* XXX we can do YUV surfaces, too, but only in 3D mode. Hmm... */ + switch(cpp) { + case 2: + case 6: + dest_type = ATI_DATATYPE_CI8; + break; + case 4: + dest_type = ATI_DATATYPE_RGB565; + break; + case 8: + dest_type = ATI_DATATYPE_ARGB8888; + break; + default: + /* Whatever this is, we can't fill it. (Yet.) */ + return 0; + } + + /* XXX odds are *incredibly* good that we were in 3D just a bit ago, + * so flush here first. */ + + /* Set up the 2D engine. */ + OUT_CS_REG(RADEON_DEFAULT_SC_BOTTOM_RIGHT, + RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX); + /* XXX I have no idea what these flags mean, is this awesome? (y/n) */ + OUT_CS_REG(RADEON_DP_GUI_MASTER_CNTL, + RADEON_GMC_DST_PITCH_OFFSET_CNTL | + RADEON_GMC_BRUSH_SOLID_COLOR | + (dest_type << 8) | + RADEON_GMC_SRC_DATATYPE_COLOR | + /* XXX is this the right rop? */ + RADEON_ROP3_ONE | + RADEON_GMC_CLR_CMP_CNTL_DIS); + /* XXX pack this? */ + OUT_CS_REG(RADEON_DP_BRUSH_FRGD_CLR, color); + OUT_CS_REG(RADEON_DP_BRUSH_BKGD_CLR, 0x00000000); + OUT_CS_REG(RADEON_DP_SRC_FRGD_CLR, 0xffffffff); + OUT_CS_REG(RADEON_DP_SRC_BKGD_CLR, 0x00000000); + /* XXX what should this be? */ + OUT_CS_REG(RADEON_DP_WRITE_MASK, 0x00000000); + OUT_CS_REG(RADEON_DP_CNTL, + RADEON_DST_X_LEFT_TO_RIGHT | RADEON_DST_Y_TOP_TO_BOTTOM); + OUT_CS_REG(RADEON_DST_PITCH_OFFSET, 0x0); + /* XXX fix this shit -> OUT_RELOC(dst, 0, RADEON_GEM_DOMAIN_VRAM) */ + + /* Do the actual paint. */ + OUT_CS_REG(RADEON_DST_Y_X, (y << 16) | x); + OUT_CS_REG(RADEON_DST_HEIGHT_WIDTH, (h << 16) | w); + + /* Let the 2D engine settle. */ + OUT_CS_REG(RADEON_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL); + OUT_CS_REG(RADEON_WAIT_UNTIL, + RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_DMA_GUI_IDLE); + return 1; +} diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h new file mode 100644 index 0000000000..ac916ca062 --- /dev/null +++ b/src/gallium/drivers/r300/r300_blit.h @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_BLIT_H +#define R300_BLIT_H + +extern int r300_fill_blit(struct r300_context* r300, + unsigned cpp, + short dst_pitch, + struct pipe_buffer *dst_buffer, + unsigned dst_offset, + short x, short y, + short w, short h, + unsigned color); + +#endif /* R300_BLIT_H */ \ No newline at end of file -- cgit v1.2.3 From b1776eb14471e7a4d09d3c8a73f02b19b106883b Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 04:48:30 -0800 Subject: gallium-r300: Add r300_surface. Todo: - Hook up surface functions. - Take it for a spin and watch it crash 'n' burn. --- src/gallium/drivers/r300/r300_surface.c | 53 +++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_surface.h | 28 +++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 src/gallium/drivers/r300/r300_surface.c create mode 100644 src/gallium/drivers/r300/r300_surface.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c new file mode 100644 index 0000000000..4aa469b97e --- /dev/null +++ b/src/gallium/drivers/r300/r300_surface.c @@ -0,0 +1,53 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_surface.h" + +/* Provides pipe_context's "surface_fill". */ +static void r300_surface_fill(struct pipe_context* context, + struct pipe_surface* dest, + unsigned x, unsigned y, + unsigned w, unsigned h, + unsigned color) +{ + /* Try accelerated fill first. */ + if (!r300_fill_blit(r300_context(context), + dest->block.size, + (short)dest->stride, + dest->buffer, + dest->offset, + (short)x, (short)y, + (short)w, (short)h, + color)) + { + /* Fallback. */ + void* dest_map = context->screen->surface_map(context->screen, dest, + PIPE_BUFFER_USAGE_CPU_WRITE); + pipe_fill_rect(dest_map, &dest->block, dest->stride, x, y, w, h, color); + context->screen->surface_unmap(context->screen, dest); + } +} + +void r300_init_surface_functions(struct r300_context* r300) +{ + r300->context.surface_fill = r300_surface_fill; +} diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h new file mode 100644 index 0000000000..3e3d813d99 --- /dev/null +++ b/src/gallium/drivers/r300/r300_surface.h @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_SURFACE_H +#define R300_SURFACE_H + +#include "r300_blit.h" + +#endif /* R300_SURFACE_H */ -- cgit v1.2.3 From afe2de0a235f8e4312ecbb7275640502098a8a81 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 05:11:19 -0800 Subject: gallium-r300: Fit it all together now. In theory, it could work, but there's still some very big gaps. Anything marked with XXX should be taken care of first, probably. --- src/gallium/drivers/r300/Makefile | 4 +++- src/gallium/drivers/r300/r300_blit.c | 2 ++ src/gallium/drivers/r300/r300_blit.h | 9 ++++++++- src/gallium/drivers/r300/r300_clear.c | 8 ++++++-- src/gallium/drivers/r300/r300_clear.h | 6 +++++- src/gallium/drivers/r300/r300_context.c | 4 +++- src/gallium/drivers/r300/r300_context.h | 2 ++ src/gallium/drivers/r300/r300_screen.c | 2 +- src/gallium/drivers/r300/r300_surface.h | 8 ++++++++ 9 files changed, 38 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 918eb8e1c4..bce7dcbf3a 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -4,10 +4,12 @@ include $(TOP)/configs/current LIBNAME = r300 C_SOURCES = \ + r300_blit.c \ r300_clear.c \ r300_context.c \ r300_screen.c \ - r300_state.c + r300_state.c \ + r300_surface.c include ../../Makefile.template diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index c01855defa..5f5eba90c1 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -20,6 +20,8 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "r300_blit.h" + /* Does a "paint" into the specified rectangle. * Returns 1 on success, 0 on error. */ int r300_fill_blit(struct r300_context* r300, diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h index ac916ca062..698b00083a 100644 --- a/src/gallium/drivers/r300/r300_blit.h +++ b/src/gallium/drivers/r300/r300_blit.h @@ -23,10 +23,17 @@ #ifndef R300_BLIT_H #define R300_BLIT_H +#include "pipe/p_state.h" + +#include "radeon_reg.h" + +/* Forward declarations. */ +struct r300_context; + extern int r300_fill_blit(struct r300_context* r300, unsigned cpp, short dst_pitch, - struct pipe_buffer *dst_buffer, + struct pipe_buffer* dst_buffer, unsigned dst_offset, short x, short y, short w, short h, diff --git a/src/gallium/drivers/r300/r300_clear.c b/src/gallium/drivers/r300/r300_clear.c index f8f0e61931..fd28437aaa 100644 --- a/src/gallium/drivers/r300/r300_clear.c +++ b/src/gallium/drivers/r300/r300_clear.c @@ -20,10 +20,14 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "r300_clear.h" + /* This gets its own file because Intel's is in its own file. * I assume there's a good reason. */ -void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val) +void r300_clear(struct pipe_context* pipe, + struct pipe_surface* ps, + unsigned color) { - pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue); + pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color); ps->status = PIPE_SURFACE_STATUS_DEFINED; } \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_clear.h b/src/gallium/drivers/r300/r300_clear.h index 58ac0a875c..e24a0690c9 100644 --- a/src/gallium/drivers/r300/r300_clear.h +++ b/src/gallium/drivers/r300/r300_clear.h @@ -20,4 +20,8 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val); \ No newline at end of file +#include "pipe/p_context.h" + +void r300_clear(struct pipe_context* pipe, + struct pipe_surface* ps, + unsigned color); diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 7fde1404d9..21bee5beae 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -50,5 +50,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); r300->cs = cs_gem_create(csm, 64 * 1024 / 4); */ + r300_init_surface_functions(r300); + return &r300->context; -} \ No newline at end of file +} diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index f67823aa1e..ae2dab13ff 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -25,6 +25,8 @@ #include "pipe/p_context.h" +#include "r300_surface.h" + struct r300_context { /* Parent class */ struct pipe_context context; diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 9c89623df3..0a114bbc06 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -119,7 +119,7 @@ static void* r300_surface_map(struct pipe_screen* screen, struct pipe_surface* surface, unsigned flags) { - /* XXX is this all we need to do here? */ + /* XXX this is not quite right */ char* map = pipe_buffer_map(screen, surface->buffer, flags); if (!map) { diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index 3e3d813d99..29858eb541 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -23,6 +23,14 @@ #ifndef R300_SURFACE_H #define R300_SURFACE_H +#include "pipe/p_context.h" +#include "pipe/p_screen.h" + +#include "util/u_rect.h" + #include "r300_blit.h" +#include "r300_context.h" + +void r300_init_surface_functions(struct r300_context* r300); #endif /* R300_SURFACE_H */ -- cgit v1.2.3 From 32273c01bd9291dcc23ca2635b848586458a3c81 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 06:05:36 -0800 Subject: gallium-r300: Set right ROP for solid fills. Thanks to MrCooper for pointing me in the right direction. --- src/gallium/drivers/r300/r300_blit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 5f5eba90c1..415e6e0a16 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -59,14 +59,12 @@ int r300_fill_blit(struct r300_context* r300, /* Set up the 2D engine. */ OUT_CS_REG(RADEON_DEFAULT_SC_BOTTOM_RIGHT, RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX); - /* XXX I have no idea what these flags mean, is this awesome? (y/n) */ OUT_CS_REG(RADEON_DP_GUI_MASTER_CNTL, RADEON_GMC_DST_PITCH_OFFSET_CNTL | RADEON_GMC_BRUSH_SOLID_COLOR | (dest_type << 8) | RADEON_GMC_SRC_DATATYPE_COLOR | - /* XXX is this the right rop? */ - RADEON_ROP3_ONE | + RADEON_ROP3_P | RADEON_GMC_CLR_CMP_CNTL_DIS); /* XXX pack this? */ OUT_CS_REG(RADEON_DP_BRUSH_FRGD_CLR, color); -- cgit v1.2.3 From ad14271425185c3535c389ca5bcd2d30c3368c32 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 13:08:19 -0800 Subject: gallium-r300: Max LOD bias is 16.0. --- src/gallium/drivers/r300/r300_screen.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 0a114bbc06..37a74b3c0a 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -99,7 +99,6 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) { case PIPE_CAP_MAX_TEXTURE_ANISOTROPY: return 16.0; case PIPE_CAP_MAX_TEXTURE_LOD_BIAS: - /* XXX again... */ return 16.0; default: return 0.0; -- cgit v1.2.3 From 78b599fb4cac469f4208ae3057b2a33e3e9913c6 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 14:54:08 -0800 Subject: gallium-r300: Add primitive CS. Enough to get us up and running, I suppose. This needs to be pushed down into winsys! --- src/gallium/drivers/r300/r300_blit.c | 6 ++++ src/gallium/drivers/r300/r300_blit.h | 2 +- src/gallium/drivers/r300/r300_cs.h | 70 ++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/gallium/drivers/r300/r300_cs.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 415e6e0a16..c404a667b1 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -33,6 +33,7 @@ int r300_fill_blit(struct r300_context* r300, short w, short h, unsigned color) { + CS_LOCALS(r300); uint32_t dest_type; /* Check for fallbacks. */ @@ -56,6 +57,8 @@ int r300_fill_blit(struct r300_context* r300, /* XXX odds are *incredibly* good that we were in 3D just a bit ago, * so flush here first. */ + BEGIN_CS(10 + 2 + 2); + /* Set up the 2D engine. */ OUT_CS_REG(RADEON_DEFAULT_SC_BOTTOM_RIGHT, RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX); @@ -86,5 +89,8 @@ int r300_fill_blit(struct r300_context* r300, OUT_CS_REG(RADEON_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL); OUT_CS_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_DMA_GUI_IDLE); + + END_CS; + return 1; } diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h index 698b00083a..09cb566b95 100644 --- a/src/gallium/drivers/r300/r300_blit.h +++ b/src/gallium/drivers/r300/r300_blit.h @@ -25,7 +25,7 @@ #include "pipe/p_state.h" -#include "radeon_reg.h" +#include "r300_cs.h" /* Forward declarations. */ struct r300_context; diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h new file mode 100644 index 0000000000..ebd5324119 --- /dev/null +++ b/src/gallium/drivers/r300/r300_cs.h @@ -0,0 +1,70 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_CS_H +#define R300_CS_H + +#include "radeon_cs.h" +#include "radeon_reg.h" + +/* Yes, I know macros are ugly. However, they are much prettier than the code + * that they neatly hide away, and don't have the cost of function setup,so + * we're going to use them. */ + +#define MAX_CS_SIZE 64 * 1024 / 4 + +#define CP_PACKET0(register, count) \ + (RADEON_CP_PACKET0 | ((count) << 16) | ((register) >> 2)) + +#define CS_LOCALS(context) \ + struct radeon_cs* cs = context->cs + + +#define CHECK_CS(size) do { \ + if ((cs->cdw + (size) + 128) > MAX_CS_SIZE || radeon_cs_need_flush(cs)) { \ + /* XXX flush the CS */ \ + } } while (0) + +/* XXX radeon_cs_begin is currently unimplemented on the backend, but let's + * be future-proof, yeah? */ +#define BEGIN_CS(size) do { \ + CHECK_CS(size); \ + radeon_cs_begin(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ +} while (0) + +#define OUT_CS(value) \ + radeon_cs_write_dword(cs, value) + +#define OUT_CS_REG(register, value) do { \ + OUT_CS(CP_PACKET0(register, 0)); \ + OUT_CS(value); } while (0) + +#define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \ + radeon_cs_write_dword(cs, offset); \ + radeon_cs_write_reloc(cs, bo, rd, wd, flags); \ +} while (0) + +/* XXX more future-proofing */ +#define END_CS \ + radeon_cs_end(cs, __FILE__, __FUNCTION__, __LINE__) + +#endif /* R300_CS_H */ \ No newline at end of file -- cgit v1.2.3 From adb74f5c5262d22b3c60a555431c29d36e3170f7 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 18:57:02 -0800 Subject: r300: Hook up to winsys, add missing header. In theory it works, which of course means that it doesn't. --- src/gallium/drivers/r300/r300_context.c | 9 +- src/gallium/drivers/r300/radeon_reg.h | 5324 ++++++++++++++++++++++++++++++ src/gallium/winsys/drm/amd/amd_context.c | 8 +- 3 files changed, 5339 insertions(+), 2 deletions(-) create mode 100644 src/gallium/drivers/r300/radeon_reg.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 21bee5beae..68751dae17 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -41,10 +41,17 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->winsys = amd_winsys; r300->context.winsys = winsys; - r300->context.screen = screen; + if (screen) { + r300->context.screen = screen; + } else { + /* XXX second arg should be pciid, find a way to get it from winsys */ + r300->context.screen = r300_create_screen(winsys, 0x0); + } r300->context.destroy = r300_destroy_context; + r300->draw = draw_create(); + /* XXX this is almost certainly wrong * put this all in winsys, where we can get an FD struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); diff --git a/src/gallium/drivers/r300/radeon_reg.h b/src/gallium/drivers/r300/radeon_reg.h new file mode 100644 index 0000000000..e2fcb70a95 --- /dev/null +++ b/src/gallium/drivers/r300/radeon_reg.h @@ -0,0 +1,5324 @@ +/* + * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and + * VA Linux Systems Inc., Fremont, California. + * + * 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 on 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 + * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS 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. + */ + +/* + * Authors: + * Kevin E. Martin + * Rickard E. Faith + * Alan Hourihane + * + * References: + * + * !!!! FIXME !!!! + * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical + * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April + * 1999. + * + * !!!! FIXME !!!! + * RAGE 128 Software Development Manual (Technical Reference Manual P/N + * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999. + * + */ + +/* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h + * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT + * ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */ + +/* XXX clean this bitch up */ + +#ifndef _RADEON_REG_H_ +#define _RADEON_REG_H_ + +#define ATI_DATATYPE_VQ 0 +#define ATI_DATATYPE_CI4 1 +#define ATI_DATATYPE_CI8 2 +#define ATI_DATATYPE_ARGB1555 3 +#define ATI_DATATYPE_RGB565 4 +#define ATI_DATATYPE_RGB888 5 +#define ATI_DATATYPE_ARGB8888 6 +#define ATI_DATATYPE_RGB332 7 +#define ATI_DATATYPE_Y8 8 +#define ATI_DATATYPE_RGB8 9 +#define ATI_DATATYPE_CI16 10 +#define ATI_DATATYPE_VYUY_422 11 +#define ATI_DATATYPE_YVYU_422 12 +#define ATI_DATATYPE_AYUV_444 14 +#define ATI_DATATYPE_ARGB4444 15 + + /* Registers for 2D/Video/Overlay */ +#define RADEON_ADAPTER_ID 0x0f2c /* PCI */ +#define RADEON_AGP_BASE 0x0170 +#define RADEON_AGP_CNTL 0x0174 +# define RADEON_AGP_APER_SIZE_256MB (0x00 << 0) +# define RADEON_AGP_APER_SIZE_128MB (0x20 << 0) +# define RADEON_AGP_APER_SIZE_64MB (0x30 << 0) +# define RADEON_AGP_APER_SIZE_32MB (0x38 << 0) +# define RADEON_AGP_APER_SIZE_16MB (0x3c << 0) +# define RADEON_AGP_APER_SIZE_8MB (0x3e << 0) +# define RADEON_AGP_APER_SIZE_4MB (0x3f << 0) +# define RADEON_AGP_APER_SIZE_MASK (0x3f << 0) +#define RADEON_STATUS_PCI_CONFIG 0x06 +# define RADEON_CAP_LIST 0x100000 +#define RADEON_CAPABILITIES_PTR_PCI_CONFIG 0x34 /* offset in PCI config*/ +# define RADEON_CAP_PTR_MASK 0xfc /* mask off reserved bits of CAP_PTR */ +# define RADEON_CAP_ID_NULL 0x00 /* End of capability list */ +# define RADEON_CAP_ID_AGP 0x02 /* AGP capability ID */ +# define RADEON_CAP_ID_EXP 0x10 /* PCI Express */ +#define RADEON_AGP_COMMAND 0x0f60 /* PCI */ +#define RADEON_AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/ +# define RADEON_AGP_ENABLE (1<<8) +#define RADEON_AGP_PLL_CNTL 0x000b /* PLL */ +#define RADEON_AGP_STATUS 0x0f5c /* PCI */ +# define RADEON_AGP_1X_MODE 0x01 +# define RADEON_AGP_2X_MODE 0x02 +# define RADEON_AGP_4X_MODE 0x04 +# define RADEON_AGP_FW_MODE 0x10 +# define RADEON_AGP_MODE_MASK 0x17 +# define RADEON_AGPv3_MODE 0x08 +# define RADEON_AGPv3_4X_MODE 0x01 +# define RADEON_AGPv3_8X_MODE 0x02 +#define RADEON_ATTRDR 0x03c1 /* VGA */ +#define RADEON_ATTRDW 0x03c0 /* VGA */ +#define RADEON_ATTRX 0x03c0 /* VGA */ +#define RADEON_AUX_SC_CNTL 0x1660 +# define RADEON_AUX1_SC_EN (1 << 0) +# define RADEON_AUX1_SC_MODE_OR (0 << 1) +# define RADEON_AUX1_SC_MODE_NAND (1 << 1) +# define RADEON_AUX2_SC_EN (1 << 2) +# define RADEON_AUX2_SC_MODE_OR (0 << 3) +# define RADEON_AUX2_SC_MODE_NAND (1 << 3) +# define RADEON_AUX3_SC_EN (1 << 4) +# define RADEON_AUX3_SC_MODE_OR (0 << 5) +# define RADEON_AUX3_SC_MODE_NAND (1 << 5) +#define RADEON_AUX1_SC_BOTTOM 0x1670 +#define RADEON_AUX1_SC_LEFT 0x1664 +#define RADEON_AUX1_SC_RIGHT 0x1668 +#define RADEON_AUX1_SC_TOP 0x166c +#define RADEON_AUX2_SC_BOTTOM 0x1680 +#define RADEON_AUX2_SC_LEFT 0x1674 +#define RADEON_AUX2_SC_RIGHT 0x1678 +#define RADEON_AUX2_SC_TOP 0x167c +#define RADEON_AUX3_SC_BOTTOM 0x1690 +#define RADEON_AUX3_SC_LEFT 0x1684 +#define RADEON_AUX3_SC_RIGHT 0x1688 +#define RADEON_AUX3_SC_TOP 0x168c +#define RADEON_AUX_WINDOW_HORZ_CNTL 0x02d8 +#define RADEON_AUX_WINDOW_VERT_CNTL 0x02dc + +#define RADEON_BASE_CODE 0x0f0b +#define RADEON_BIOS_0_SCRATCH 0x0010 +# define RADEON_FP_PANEL_SCALABLE (1 << 16) +# define RADEON_FP_PANEL_SCALE_EN (1 << 17) +# define RADEON_FP_CHIP_SCALE_EN (1 << 18) +# define RADEON_DRIVER_BRIGHTNESS_EN (1 << 26) +# define RADEON_DISPLAY_ROT_MASK (3 << 28) +# define RADEON_DISPLAY_ROT_00 (0 << 28) +# define RADEON_DISPLAY_ROT_90 (1 << 28) +# define RADEON_DISPLAY_ROT_180 (2 << 28) +# define RADEON_DISPLAY_ROT_270 (3 << 28) +#define RADEON_BIOS_1_SCRATCH 0x0014 +#define RADEON_BIOS_2_SCRATCH 0x0018 +#define RADEON_BIOS_3_SCRATCH 0x001c +#define RADEON_BIOS_4_SCRATCH 0x0020 +# define RADEON_CRT1_ATTACHED_MASK (3 << 0) +# define RADEON_CRT1_ATTACHED_MONO (1 << 0) +# define RADEON_CRT1_ATTACHED_COLOR (2 << 0) +# define RADEON_LCD1_ATTACHED (1 << 2) +# define RADEON_DFP1_ATTACHED (1 << 3) +# define RADEON_TV1_ATTACHED_MASK (3 << 4) +# define RADEON_TV1_ATTACHED_COMP (1 << 4) +# define RADEON_TV1_ATTACHED_SVIDEO (2 << 4) +# define RADEON_CRT2_ATTACHED_MASK (3 << 8) +# define RADEON_CRT2_ATTACHED_MONO (1 << 8) +# define RADEON_CRT2_ATTACHED_COLOR (2 << 8) +# define RADEON_DFP2_ATTACHED (1 << 11) +#define RADEON_BIOS_5_SCRATCH 0x0024 +# define RADEON_LCD1_ON (1 << 0) +# define RADEON_CRT1_ON (1 << 1) +# define RADEON_TV1_ON (1 << 2) +# define RADEON_DFP1_ON (1 << 3) +# define RADEON_CRT2_ON (1 << 5) +# define RADEON_CV1_ON (1 << 6) +# define RADEON_DFP2_ON (1 << 7) +# define RADEON_LCD1_CRTC_MASK (1 << 8) +# define RADEON_LCD1_CRTC_SHIFT 8 +# define RADEON_CRT1_CRTC_MASK (1 << 9) +# define RADEON_CRT1_CRTC_SHIFT 9 +# define RADEON_TV1_CRTC_MASK (1 << 10) +# define RADEON_TV1_CRTC_SHIFT 10 +# define RADEON_DFP1_CRTC_MASK (1 << 11) +# define RADEON_DFP1_CRTC_SHIFT 11 +# define RADEON_CRT2_CRTC_MASK (1 << 12) +# define RADEON_CRT2_CRTC_SHIFT 12 +# define RADEON_CV1_CRTC_MASK (1 << 13) +# define RADEON_CV1_CRTC_SHIFT 13 +# define RADEON_DFP2_CRTC_MASK (1 << 14) +# define RADEON_DFP2_CRTC_SHIFT 14 +#define RADEON_BIOS_6_SCRATCH 0x0028 +# define RADEON_ACC_MODE_CHANGE (1 << 2) +# define RADEON_EXT_DESKTOP_MODE (1 << 3) +# define RADEON_LCD_DPMS_ON (1 << 20) +# define RADEON_CRT_DPMS_ON (1 << 21) +# define RADEON_TV_DPMS_ON (1 << 22) +# define RADEON_DFP_DPMS_ON (1 << 23) +# define RADEON_DPMS_MASK (3 << 24) +# define RADEON_DPMS_ON (0 << 24) +# define RADEON_DPMS_STANDBY (1 << 24) +# define RADEON_DPMS_SUSPEND (2 << 24) +# define RADEON_DPMS_OFF (3 << 24) +# define RADEON_SCREEN_BLANKING (1 << 26) +# define RADEON_DRIVER_CRITICAL (1 << 27) +# define RADEON_DISPLAY_SWITCHING_DIS (1 << 30) +#define RADEON_BIOS_7_SCRATCH 0x002c +# define RADEON_SYS_HOTKEY (1 << 10) +# define RADEON_DRV_LOADED (1 << 12) +#define RADEON_BIOS_ROM 0x0f30 /* PCI */ +#define RADEON_BIST 0x0f0f /* PCI */ +#define RADEON_BRUSH_DATA0 0x1480 +#define RADEON_BRUSH_DATA1 0x1484 +#define RADEON_BRUSH_DATA10 0x14a8 +#define RADEON_BRUSH_DATA11 0x14ac +#define RADEON_BRUSH_DATA12 0x14b0 +#define RADEON_BRUSH_DATA13 0x14b4 +#define RADEON_BRUSH_DATA14 0x14b8 +#define RADEON_BRUSH_DATA15 0x14bc +#define RADEON_BRUSH_DATA16 0x14c0 +#define RADEON_BRUSH_DATA17 0x14c4 +#define RADEON_BRUSH_DATA18 0x14c8 +#define RADEON_BRUSH_DATA19 0x14cc +#define RADEON_BRUSH_DATA2 0x1488 +#define RADEON_BRUSH_DATA20 0x14d0 +#define RADEON_BRUSH_DATA21 0x14d4 +#define RADEON_BRUSH_DATA22 0x14d8 +#define RADEON_BRUSH_DATA23 0x14dc +#define RADEON_BRUSH_DATA24 0x14e0 +#define RADEON_BRUSH_DATA25 0x14e4 +#define RADEON_BRUSH_DATA26 0x14e8 +#define RADEON_BRUSH_DATA27 0x14ec +#define RADEON_BRUSH_DATA28 0x14f0 +#define RADEON_BRUSH_DATA29 0x14f4 +#define RADEON_BRUSH_DATA3 0x148c +#define RADEON_BRUSH_DATA30 0x14f8 +#define RADEON_BRUSH_DATA31 0x14fc +#define RADEON_BRUSH_DATA32 0x1500 +#define RADEON_BRUSH_DATA33 0x1504 +#define RADEON_BRUSH_DATA34 0x1508 +#define RADEON_BRUSH_DATA35 0x150c +#define RADEON_BRUSH_DATA36 0x1510 +#define RADEON_BRUSH_DATA37 0x1514 +#define RADEON_BRUSH_DATA38 0x1518 +#define RADEON_BRUSH_DATA39 0x151c +#define RADEON_BRUSH_DATA4 0x1490 +#define RADEON_BRUSH_DATA40 0x1520 +#define RADEON_BRUSH_DATA41 0x1524 +#define RADEON_BRUSH_DATA42 0x1528 +#define RADEON_BRUSH_DATA43 0x152c +#define RADEON_BRUSH_DATA44 0x1530 +#define RADEON_BRUSH_DATA45 0x1534 +#define RADEON_BRUSH_DATA46 0x1538 +#define RADEON_BRUSH_DATA47 0x153c +#define RADEON_BRUSH_DATA48 0x1540 +#define RADEON_BRUSH_DATA49 0x1544 +#define RADEON_BRUSH_DATA5 0x1494 +#define RADEON_BRUSH_DATA50 0x1548 +#define RADEON_BRUSH_DATA51 0x154c +#define RADEON_BRUSH_DATA52 0x1550 +#define RADEON_BRUSH_DATA53 0x1554 +#define RADEON_BRUSH_DATA54 0x1558 +#define RADEON_BRUSH_DATA55 0x155c +#define RADEON_BRUSH_DATA56 0x1560 +#define RADEON_BRUSH_DATA57 0x1564 +#define RADEON_BRUSH_DATA58 0x1568 +#define RADEON_BRUSH_DATA59 0x156c +#define RADEON_BRUSH_DATA6 0x1498 +#define RADEON_BRUSH_DATA60 0x1570 +#define RADEON_BRUSH_DATA61 0x1574 +#define RADEON_BRUSH_DATA62 0x1578 +#define RADEON_BRUSH_DATA63 0x157c +#define RADEON_BRUSH_DATA7 0x149c +#define RADEON_BRUSH_DATA8 0x14a0 +#define RADEON_BRUSH_DATA9 0x14a4 +#define RADEON_BRUSH_SCALE 0x1470 +#define RADEON_BRUSH_Y_X 0x1474 +#define RADEON_BUS_CNTL 0x0030 +# define RADEON_BUS_MASTER_DIS (1 << 6) +# define RADEON_BUS_BIOS_DIS_ROM (1 << 12) +# define RADEON_BUS_RD_DISCARD_EN (1 << 24) +# define RADEON_BUS_RD_ABORT_EN (1 << 25) +# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28) +# define RADEON_BUS_WRT_BURST (1 << 29) +# define RADEON_BUS_READ_BURST (1 << 30) +#define RADEON_BUS_CNTL1 0x0034 +# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4) + +#define RADEON_CACHE_CNTL 0x1724 +#define RADEON_CACHE_LINE 0x0f0c /* PCI */ +#define RADEON_CAPABILITIES_ID 0x0f50 /* PCI */ +#define RADEON_CAPABILITIES_PTR 0x0f34 /* PCI */ +#define RADEON_CLK_PIN_CNTL 0x0001 /* PLL */ +# define RADEON_SCLK_DYN_START_CNTL (1 << 15) +#define RADEON_CLOCK_CNTL_DATA 0x000c +#define RADEON_CLOCK_CNTL_INDEX 0x0008 +# define RADEON_PLL_WR_EN (1 << 7) +# define RADEON_PLL_DIV_SEL (3 << 8) +# define RADEON_PLL2_DIV_SEL_MASK ~(3 << 8) +#define RADEON_CLK_PWRMGT_CNTL 0x0014 +# define RADEON_ENGIN_DYNCLK_MODE (1 << 12) +# define RADEON_ACTIVE_HILO_LAT_MASK (3 << 13) +# define RADEON_ACTIVE_HILO_LAT_SHIFT 13 +# define RADEON_DISP_DYN_STOP_LAT_MASK (1 << 12) +# define RADEON_MC_BUSY (1 << 16) +# define RADEON_DLL_READY (1 << 19) +# define RADEON_CG_NO1_DEBUG_0 (1 << 24) +# define RADEON_CG_NO1_DEBUG_MASK (0x1f << 24) +# define RADEON_DYN_STOP_MODE_MASK (7 << 21) +# define RADEON_TVPLL_PWRMGT_OFF (1 << 30) +# define RADEON_TVCLK_TURNOFF (1 << 31) +#define RADEON_PLL_PWRMGT_CNTL 0x0015 +# define RADEON_TCL_BYPASS_DISABLE (1 << 20) +#define RADEON_CLR_CMP_CLR_3D 0x1a24 +#define RADEON_CLR_CMP_CLR_DST 0x15c8 +#define RADEON_CLR_CMP_CLR_SRC 0x15c4 +#define RADEON_CLR_CMP_CNTL 0x15c0 +# define RADEON_SRC_CMP_EQ_COLOR (4 << 0) +# define RADEON_SRC_CMP_NEQ_COLOR (5 << 0) +# define RADEON_CLR_CMP_SRC_SOURCE (1 << 24) +#define RADEON_CLR_CMP_MASK 0x15cc +# define RADEON_CLR_CMP_MSK 0xffffffff +#define RADEON_CLR_CMP_MASK_3D 0x1A28 +#define RADEON_COMMAND 0x0f04 /* PCI */ +#define RADEON_COMPOSITE_SHADOW_ID 0x1a0c +#define RADEON_CONFIG_APER_0_BASE 0x0100 +#define RADEON_CONFIG_APER_1_BASE 0x0104 +#define RADEON_CONFIG_APER_SIZE 0x0108 +#define RADEON_CONFIG_BONDS 0x00e8 +#define RADEON_CONFIG_CNTL 0x00e0 +# define RADEON_CFG_ATI_REV_A11 (0 << 16) +# define RADEON_CFG_ATI_REV_A12 (1 << 16) +# define RADEON_CFG_ATI_REV_A13 (2 << 16) +# define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16) +#define RADEON_CONFIG_MEMSIZE 0x00f8 +#define RADEON_CONFIG_MEMSIZE_EMBEDDED 0x0114 +#define RADEON_CONFIG_REG_1_BASE 0x010c +#define RADEON_CONFIG_REG_APER_SIZE 0x0110 +#define RADEON_CONFIG_XSTRAP 0x00e4 +#define RADEON_CONSTANT_COLOR_C 0x1d34 +# define RADEON_CONSTANT_COLOR_MASK 0x00ffffff +# define RADEON_CONSTANT_COLOR_ONE 0x00ffffff +# define RADEON_CONSTANT_COLOR_ZERO 0x00000000 +#define RADEON_CRC_CMDFIFO_ADDR 0x0740 +#define RADEON_CRC_CMDFIFO_DOUT 0x0744 +#define RADEON_GRPH_BUFFER_CNTL 0x02f0 +# define RADEON_GRPH_START_REQ_MASK (0x7f) +# define RADEON_GRPH_START_REQ_SHIFT 0 +# define RADEON_GRPH_STOP_REQ_MASK (0x7f<<8) +# define RADEON_GRPH_STOP_REQ_SHIFT 8 +# define RADEON_GRPH_CRITICAL_POINT_MASK (0x7f<<16) +# define RADEON_GRPH_CRITICAL_POINT_SHIFT 16 +# define RADEON_GRPH_CRITICAL_CNTL (1<<28) +# define RADEON_GRPH_BUFFER_SIZE (1<<29) +# define RADEON_GRPH_CRITICAL_AT_SOF (1<<30) +# define RADEON_GRPH_STOP_CNTL (1<<31) +#define RADEON_GRPH2_BUFFER_CNTL 0x03f0 +# define RADEON_GRPH2_START_REQ_MASK (0x7f) +# define RADEON_GRPH2_START_REQ_SHIFT 0 +# define RADEON_GRPH2_STOP_REQ_MASK (0x7f<<8) +# define RADEON_GRPH2_STOP_REQ_SHIFT 8 +# define RADEON_GRPH2_CRITICAL_POINT_MASK (0x7f<<16) +# define RADEON_GRPH2_CRITICAL_POINT_SHIFT 16 +# define RADEON_GRPH2_CRITICAL_CNTL (1<<28) +# define RADEON_GRPH2_BUFFER_SIZE (1<<29) +# define RADEON_GRPH2_CRITICAL_AT_SOF (1<<30) +# define RADEON_GRPH2_STOP_CNTL (1<<31) +#define RADEON_CRTC_CRNT_FRAME 0x0214 +#define RADEON_CRTC_EXT_CNTL 0x0054 +# define RADEON_CRTC_VGA_XOVERSCAN (1 << 0) +# define RADEON_VGA_ATI_LINEAR (1 << 3) +# define RADEON_XCRT_CNT_EN (1 << 6) +# define RADEON_CRTC_HSYNC_DIS (1 << 8) +# define RADEON_CRTC_VSYNC_DIS (1 << 9) +# define RADEON_CRTC_DISPLAY_DIS (1 << 10) +# define RADEON_CRTC_SYNC_TRISTAT (1 << 11) +# define RADEON_CRTC_CRT_ON (1 << 15) +#define RADEON_CRTC_EXT_CNTL_DPMS_BYTE 0x0055 +# define RADEON_CRTC_HSYNC_DIS_BYTE (1 << 0) +# define RADEON_CRTC_VSYNC_DIS_BYTE (1 << 1) +# define RADEON_CRTC_DISPLAY_DIS_BYTE (1 << 2) +#define RADEON_CRTC_GEN_CNTL 0x0050 +# define RADEON_CRTC_DBL_SCAN_EN (1 << 0) +# define RADEON_CRTC_INTERLACE_EN (1 << 1) +# define RADEON_CRTC_CSYNC_EN (1 << 4) +# define RADEON_CRTC_ICON_EN (1 << 15) +# define RADEON_CRTC_CUR_EN (1 << 16) +# define RADEON_CRTC_CUR_MODE_MASK (7 << 20) +# define RADEON_CRTC_EXT_DISP_EN (1 << 24) +# define RADEON_CRTC_EN (1 << 25) +# define RADEON_CRTC_DISP_REQ_EN_B (1 << 26) +#define RADEON_CRTC2_GEN_CNTL 0x03f8 +# define RADEON_CRTC2_DBL_SCAN_EN (1 << 0) +# define RADEON_CRTC2_INTERLACE_EN (1 << 1) +# define RADEON_CRTC2_SYNC_TRISTAT (1 << 4) +# define RADEON_CRTC2_HSYNC_TRISTAT (1 << 5) +# define RADEON_CRTC2_VSYNC_TRISTAT (1 << 6) +# define RADEON_CRTC2_CRT2_ON (1 << 7) +# define RADEON_CRTC2_PIX_WIDTH_SHIFT 8 +# define RADEON_CRTC2_PIX_WIDTH_MASK (0xf << 8) +# define RADEON_CRTC2_ICON_EN (1 << 15) +# define RADEON_CRTC2_CUR_EN (1 << 16) +# define RADEON_CRTC2_CUR_MODE_MASK (7 << 20) +# define RADEON_CRTC2_DISP_DIS (1 << 23) +# define RADEON_CRTC2_EN (1 << 25) +# define RADEON_CRTC2_DISP_REQ_EN_B (1 << 26) +# define RADEON_CRTC2_CSYNC_EN (1 << 27) +# define RADEON_CRTC2_HSYNC_DIS (1 << 28) +# define RADEON_CRTC2_VSYNC_DIS (1 << 29) +#define RADEON_CRTC_MORE_CNTL 0x27c +# define RADEON_CRTC_AUTO_HORZ_CENTER_EN (1<<2) +# define RADEON_CRTC_AUTO_VERT_CENTER_EN (1<<3) +# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4) +# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5) +#define RADEON_CRTC_GUI_TRIG_VLINE 0x0218 +#define RADEON_CRTC_H_SYNC_STRT_WID 0x0204 +# define RADEON_CRTC_H_SYNC_STRT_PIX (0x07 << 0) +# define RADEON_CRTC_H_SYNC_STRT_CHAR (0x3ff << 3) +# define RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT 3 +# define RADEON_CRTC_H_SYNC_WID (0x3f << 16) +# define RADEON_CRTC_H_SYNC_WID_SHIFT 16 +# define RADEON_CRTC_H_SYNC_POL (1 << 23) +#define RADEON_CRTC2_H_SYNC_STRT_WID 0x0304 +# define RADEON_CRTC2_H_SYNC_STRT_PIX (0x07 << 0) +# define RADEON_CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3) +# define RADEON_CRTC2_H_SYNC_STRT_CHAR_SHIFT 3 +# define RADEON_CRTC2_H_SYNC_WID (0x3f << 16) +# define RADEON_CRTC2_H_SYNC_WID_SHIFT 16 +# define RADEON_CRTC2_H_SYNC_POL (1 << 23) +#define RADEON_CRTC_H_TOTAL_DISP 0x0200 +# define RADEON_CRTC_H_TOTAL (0x03ff << 0) +# define RADEON_CRTC_H_TOTAL_SHIFT 0 +# define RADEON_CRTC_H_DISP (0x01ff << 16) +# define RADEON_CRTC_H_DISP_SHIFT 16 +#define RADEON_CRTC2_H_TOTAL_DISP 0x0300 +# define RADEON_CRTC2_H_TOTAL (0x03ff << 0) +# define RADEON_CRTC2_H_TOTAL_SHIFT 0 +# define RADEON_CRTC2_H_DISP (0x01ff << 16) +# define RADEON_CRTC2_H_DISP_SHIFT 16 + +#define RADEON_CRTC_OFFSET_RIGHT 0x0220 +#define RADEON_CRTC_OFFSET 0x0224 +# define RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET (1<<30) +# define RADEON_CRTC_OFFSET__OFFSET_LOCK (1<<31) + +#define RADEON_CRTC2_OFFSET 0x0324 +# define RADEON_CRTC2_OFFSET__GUI_TRIG_OFFSET (1<<30) +# define RADEON_CRTC2_OFFSET__OFFSET_LOCK (1<<31) +#define RADEON_CRTC_OFFSET_CNTL 0x0228 +# define RADEON_CRTC_TILE_LINE_SHIFT 0 +# define RADEON_CRTC_TILE_LINE_RIGHT_SHIFT 4 +# define R300_CRTC_X_Y_MODE_EN_RIGHT (1 << 6) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_MASK (3 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_AUTO (0 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_SINGLE (1 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DOUBLE (2 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DIS (3 << 7) +# define R300_CRTC_X_Y_MODE_EN (1 << 9) +# define R300_CRTC_MICRO_TILE_BUFFER_MASK (3 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_AUTO (0 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_SINGLE (1 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_DOUBLE (2 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_DIS (3 << 10) +# define R300_CRTC_MICRO_TILE_EN_RIGHT (1 << 12) +# define R300_CRTC_MICRO_TILE_EN (1 << 13) +# define R300_CRTC_MACRO_TILE_EN_RIGHT (1 << 14) +# define R300_CRTC_MACRO_TILE_EN (1 << 15) +# define RADEON_CRTC_TILE_EN_RIGHT (1 << 14) +# define RADEON_CRTC_TILE_EN (1 << 15) +# define RADEON_CRTC_OFFSET_FLIP_CNTL (1 << 16) +# define RADEON_CRTC_STEREO_OFFSET_EN (1 << 17) + +#define R300_CRTC_TILE_X0_Y0 0x0350 +#define R300_CRTC2_TILE_X0_Y0 0x0358 + +#define RADEON_CRTC2_OFFSET_CNTL 0x0328 +# define RADEON_CRTC2_OFFSET_FLIP_CNTL (1 << 16) +# define RADEON_CRTC2_TILE_EN (1 << 15) +#define RADEON_CRTC_PITCH 0x022c +# define RADEON_CRTC_PITCH__SHIFT 0 +# define RADEON_CRTC_PITCH__RIGHT_SHIFT 16 + +#define RADEON_CRTC2_PITCH 0x032c +#define RADEON_CRTC_STATUS 0x005c +# define RADEON_CRTC_VBLANK_SAVE (1 << 1) +# define RADEON_CRTC_VBLANK_SAVE_CLEAR (1 << 1) +#define RADEON_CRTC2_STATUS 0x03fc +# define RADEON_CRTC2_VBLANK_SAVE (1 << 1) +# define RADEON_CRTC2_VBLANK_SAVE_CLEAR (1 << 1) +#define RADEON_CRTC_V_SYNC_STRT_WID 0x020c +# define RADEON_CRTC_V_SYNC_STRT (0x7ff << 0) +# define RADEON_CRTC_V_SYNC_STRT_SHIFT 0 +# define RADEON_CRTC_V_SYNC_WID (0x1f << 16) +# define RADEON_CRTC_V_SYNC_WID_SHIFT 16 +# define RADEON_CRTC_V_SYNC_POL (1 << 23) +#define RADEON_CRTC2_V_SYNC_STRT_WID 0x030c +# define RADEON_CRTC2_V_SYNC_STRT (0x7ff << 0) +# define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0 +# define RADEON_CRTC2_V_SYNC_WID (0x1f << 16) +# define RADEON_CRTC2_V_SYNC_WID_SHIFT 16 +# define RADEON_CRTC2_V_SYNC_POL (1 << 23) +#define RADEON_CRTC_V_TOTAL_DISP 0x0208 +# define RADEON_CRTC_V_TOTAL (0x07ff << 0) +# define RADEON_CRTC_V_TOTAL_SHIFT 0 +# define RADEON_CRTC_V_DISP (0x07ff << 16) +# define RADEON_CRTC_V_DISP_SHIFT 16 +#define RADEON_CRTC2_V_TOTAL_DISP 0x0308 +# define RADEON_CRTC2_V_TOTAL (0x07ff << 0) +# define RADEON_CRTC2_V_TOTAL_SHIFT 0 +# define RADEON_CRTC2_V_DISP (0x07ff << 16) +# define RADEON_CRTC2_V_DISP_SHIFT 16 +#define RADEON_CRTC_VLINE_CRNT_VLINE 0x0210 +# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16) +#define RADEON_CRTC2_CRNT_FRAME 0x0314 +#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318 +#define RADEON_CRTC2_STATUS 0x03fc +#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310 +#define RADEON_CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */ +#define RADEON_CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */ +#define RADEON_CUR_CLR0 0x026c +#define RADEON_CUR_CLR1 0x0270 +#define RADEON_CUR_HORZ_VERT_OFF 0x0268 +#define RADEON_CUR_HORZ_VERT_POSN 0x0264 +#define RADEON_CUR_OFFSET 0x0260 +# define RADEON_CUR_LOCK (1 << 31) +#define RADEON_CUR2_CLR0 0x036c +#define RADEON_CUR2_CLR1 0x0370 +#define RADEON_CUR2_HORZ_VERT_OFF 0x0368 +#define RADEON_CUR2_HORZ_VERT_POSN 0x0364 +#define RADEON_CUR2_OFFSET 0x0360 +# define RADEON_CUR2_LOCK (1 << 31) + +#define RADEON_DAC_CNTL 0x0058 +# define RADEON_DAC_RANGE_CNTL (3 << 0) +# define RADEON_DAC_RANGE_CNTL_PS2 (2 << 0) +# define RADEON_DAC_RANGE_CNTL_MASK 0x03 +# define RADEON_DAC_BLANKING (1 << 2) +# define RADEON_DAC_CMP_EN (1 << 3) +# define RADEON_DAC_CMP_OUTPUT (1 << 7) +# define RADEON_DAC_8BIT_EN (1 << 8) +# define RADEON_DAC_TVO_EN (1 << 10) +# define RADEON_DAC_VGA_ADR_EN (1 << 13) +# define RADEON_DAC_PDWN (1 << 15) +# define RADEON_DAC_MASK_ALL (0xff << 24) +#define RADEON_DAC_CNTL2 0x007c +# define RADEON_DAC2_TV_CLK_SEL (0 << 1) +# define RADEON_DAC2_DAC_CLK_SEL (1 << 0) +# define RADEON_DAC2_DAC2_CLK_SEL (1 << 1) +# define RADEON_DAC2_PALETTE_ACC_CTL (1 << 5) +# define RADEON_DAC2_CMP_EN (1 << 7) +# define RADEON_DAC2_CMP_OUT_R (1 << 8) +# define RADEON_DAC2_CMP_OUT_G (1 << 9) +# define RADEON_DAC2_CMP_OUT_B (1 << 10) +# define RADEON_DAC2_CMP_OUTPUT (1 << 11) +#define RADEON_DAC_EXT_CNTL 0x0280 +# define RADEON_DAC2_FORCE_BLANK_OFF_EN (1 << 0) +# define RADEON_DAC2_FORCE_DATA_EN (1 << 1) +# define RADEON_DAC_FORCE_BLANK_OFF_EN (1 << 4) +# define RADEON_DAC_FORCE_DATA_EN (1 << 5) +# define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_R (0 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_G (1 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_B (2 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_RGB (3 << 6) +# define RADEON_DAC_FORCE_DATA_MASK 0x0003ff00 +# define RADEON_DAC_FORCE_DATA_SHIFT 8 +#define RADEON_DAC_MACRO_CNTL 0x0d04 +# define RADEON_DAC_PDWN_R (1 << 16) +# define RADEON_DAC_PDWN_G (1 << 17) +# define RADEON_DAC_PDWN_B (1 << 18) +#define RADEON_TV_DAC_CNTL 0x088c +# define RADEON_TV_DAC_NBLANK (1 << 0) +# define RADEON_TV_DAC_NHOLD (1 << 1) +# define RADEON_TV_DAC_PEDESTAL (1 << 2) +# define RADEON_TV_MONITOR_DETECT_EN (1 << 4) +# define RADEON_TV_DAC_CMPOUT (1 << 5) +# define RADEON_TV_DAC_STD_MASK (3 << 8) +# define RADEON_TV_DAC_STD_PAL (0 << 8) +# define RADEON_TV_DAC_STD_NTSC (1 << 8) +# define RADEON_TV_DAC_STD_PS2 (2 << 8) +# define RADEON_TV_DAC_STD_RS343 (3 << 8) +# define RADEON_TV_DAC_BGSLEEP (1 << 6) +# define RADEON_TV_DAC_BGADJ_MASK (0xf << 16) +# define RADEON_TV_DAC_BGADJ_SHIFT 16 +# define RADEON_TV_DAC_DACADJ_MASK (0xf << 20) +# define RADEON_TV_DAC_DACADJ_SHIFT 20 +# define RADEON_TV_DAC_RDACPD (1 << 24) +# define RADEON_TV_DAC_GDACPD (1 << 25) +# define RADEON_TV_DAC_BDACPD (1 << 26) +# define RADEON_TV_DAC_RDACDET (1 << 29) +# define RADEON_TV_DAC_GDACDET (1 << 30) +# define RADEON_TV_DAC_BDACDET (1 << 31) +# define R420_TV_DAC_DACADJ_MASK (0x1f << 20) +# define R420_TV_DAC_RDACPD (1 << 25) +# define R420_TV_DAC_GDACPD (1 << 26) +# define R420_TV_DAC_BDACPD (1 << 27) +# define R420_TV_DAC_TVENABLE (1 << 28) +#define RADEON_DISP_HW_DEBUG 0x0d14 +# define RADEON_CRT2_DISP1_SEL (1 << 5) +#define RADEON_DISP_OUTPUT_CNTL 0x0d64 +# define RADEON_DISP_DAC_SOURCE_MASK 0x03 +# define RADEON_DISP_DAC2_SOURCE_MASK 0x0c +# define RADEON_DISP_DAC_SOURCE_CRTC2 0x01 +# define RADEON_DISP_DAC_SOURCE_RMX 0x02 +# define RADEON_DISP_DAC_SOURCE_LTU 0x03 +# define RADEON_DISP_DAC2_SOURCE_CRTC2 0x04 +# define RADEON_DISP_TVDAC_SOURCE_MASK (0x03 << 2) +# define RADEON_DISP_TVDAC_SOURCE_CRTC 0x0 +# define RADEON_DISP_TVDAC_SOURCE_CRTC2 (0x01 << 2) +# define RADEON_DISP_TVDAC_SOURCE_RMX (0x02 << 2) +# define RADEON_DISP_TVDAC_SOURCE_LTU (0x03 << 2) +# define RADEON_DISP_TRANS_MATRIX_MASK (0x03 << 4) +# define RADEON_DISP_TRANS_MATRIX_ALPHA_MSB (0x00 << 4) +# define RADEON_DISP_TRANS_MATRIX_GRAPHICS (0x01 << 4) +# define RADEON_DISP_TRANS_MATRIX_VIDEO (0x02 << 4) +# define RADEON_DISP_TV_SOURCE_CRTC (1 << 16) /* crtc1 or crtc2 */ +# define RADEON_DISP_TV_SOURCE_LTU (0 << 16) /* linear transform unit */ +#define RADEON_DISP_TV_OUT_CNTL 0x0d6c +# define RADEON_DISP_TV_PATH_SRC_CRTC2 (1 << 16) +# define RADEON_DISP_TV_PATH_SRC_CRTC1 (0 << 16) +#define RADEON_DAC_CRC_SIG 0x02cc +#define RADEON_DAC_DATA 0x03c9 /* VGA */ +#define RADEON_DAC_MASK 0x03c6 /* VGA */ +#define RADEON_DAC_R_INDEX 0x03c7 /* VGA */ +#define RADEON_DAC_W_INDEX 0x03c8 /* VGA */ +#define RADEON_DDA_CONFIG 0x02e0 +#define RADEON_DDA_ON_OFF 0x02e4 +#define RADEON_DEFAULT_OFFSET 0x16e0 +#define RADEON_DEFAULT_PITCH 0x16e4 +#define RADEON_DEFAULT_SC_BOTTOM_RIGHT 0x16e8 +# define RADEON_DEFAULT_SC_RIGHT_MAX (0x1fff << 0) +# define RADEON_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16) +#define RADEON_DESTINATION_3D_CLR_CMP_VAL 0x1820 +#define RADEON_DESTINATION_3D_CLR_CMP_MSK 0x1824 +#define RADEON_DEVICE_ID 0x0f02 /* PCI */ +#define RADEON_DISP_MISC_CNTL 0x0d00 +# define RADEON_SOFT_RESET_GRPH_PP (1 << 0) +#define RADEON_DISP_MERGE_CNTL 0x0d60 +# define RADEON_DISP_ALPHA_MODE_MASK 0x03 +# define RADEON_DISP_ALPHA_MODE_KEY 0 +# define RADEON_DISP_ALPHA_MODE_PER_PIXEL 1 +# define RADEON_DISP_ALPHA_MODE_GLOBAL 2 +# define RADEON_DISP_RGB_OFFSET_EN (1 << 8) +# define RADEON_DISP_GRPH_ALPHA_MASK (0xff << 16) +# define RADEON_DISP_OV0_ALPHA_MASK (0xff << 24) +# define RADEON_DISP_LIN_TRANS_BYPASS (0x01 << 9) +#define RADEON_DISP2_MERGE_CNTL 0x0d68 +# define RADEON_DISP2_RGB_OFFSET_EN (1 << 8) +#define RADEON_DISP_LIN_TRANS_GRPH_A 0x0d80 +#define RADEON_DISP_LIN_TRANS_GRPH_B 0x0d84 +#define RADEON_DISP_LIN_TRANS_GRPH_C 0x0d88 +#define RADEON_DISP_LIN_TRANS_GRPH_D 0x0d8c +#define RADEON_DISP_LIN_TRANS_GRPH_E 0x0d90 +#define RADEON_DISP_LIN_TRANS_GRPH_F 0x0d98 +#define RADEON_DP_BRUSH_BKGD_CLR 0x1478 +#define RADEON_DP_BRUSH_FRGD_CLR 0x147c +#define RADEON_DP_CNTL 0x16c0 +# define RADEON_DST_X_LEFT_TO_RIGHT (1 << 0) +# define RADEON_DST_Y_TOP_TO_BOTTOM (1 << 1) +# define RADEON_DP_DST_TILE_LINEAR (0 << 3) +# define RADEON_DP_DST_TILE_MACRO (1 << 3) +# define RADEON_DP_DST_TILE_MICRO (2 << 3) +# define RADEON_DP_DST_TILE_BOTH (3 << 3) +#define RADEON_DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0 +# define RADEON_DST_Y_MAJOR (1 << 2) +# define RADEON_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15) +# define RADEON_DST_X_DIR_LEFT_TO_RIGHT (1 << 31) +#define RADEON_DP_DATATYPE 0x16c4 +# define RADEON_HOST_BIG_ENDIAN_EN (1 << 29) +#define RADEON_DP_GUI_MASTER_CNTL 0x146c +# define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0) +# define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1) +# define RADEON_GMC_SRC_CLIPPING (1 << 2) +# define RADEON_GMC_DST_CLIPPING (1 << 3) +# define RADEON_GMC_BRUSH_DATATYPE_MASK (0x0f << 4) +# define RADEON_GMC_BRUSH_8X8_MONO_FG_BG (0 << 4) +# define RADEON_GMC_BRUSH_8X8_MONO_FG_LA (1 << 4) +# define RADEON_GMC_BRUSH_1X8_MONO_FG_BG (4 << 4) +# define RADEON_GMC_BRUSH_1X8_MONO_FG_LA (5 << 4) +# define RADEON_GMC_BRUSH_32x1_MONO_FG_BG (6 << 4) +# define RADEON_GMC_BRUSH_32x1_MONO_FG_LA (7 << 4) +# define RADEON_GMC_BRUSH_32x32_MONO_FG_BG (8 << 4) +# define RADEON_GMC_BRUSH_32x32_MONO_FG_LA (9 << 4) +# define RADEON_GMC_BRUSH_8x8_COLOR (10 << 4) +# define RADEON_GMC_BRUSH_1X8_COLOR (12 << 4) +# define RADEON_GMC_BRUSH_SOLID_COLOR (13 << 4) +# define RADEON_GMC_BRUSH_NONE (15 << 4) +# define RADEON_GMC_DST_8BPP_CI (2 << 8) +# define RADEON_GMC_DST_15BPP (3 << 8) +# define RADEON_GMC_DST_16BPP (4 << 8) +# define RADEON_GMC_DST_24BPP (5 << 8) +# define RADEON_GMC_DST_32BPP (6 << 8) +# define RADEON_GMC_DST_8BPP_RGB (7 << 8) +# define RADEON_GMC_DST_Y8 (8 << 8) +# define RADEON_GMC_DST_RGB8 (9 << 8) +# define RADEON_GMC_DST_VYUY (11 << 8) +# define RADEON_GMC_DST_YVYU (12 << 8) +# define RADEON_GMC_DST_AYUV444 (14 << 8) +# define RADEON_GMC_DST_ARGB4444 (15 << 8) +# define RADEON_GMC_DST_DATATYPE_MASK (0x0f << 8) +# define RADEON_GMC_DST_DATATYPE_SHIFT 8 +# define RADEON_GMC_SRC_DATATYPE_MASK (3 << 12) +# define RADEON_GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12) +# define RADEON_GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12) +# define RADEON_GMC_SRC_DATATYPE_COLOR (3 << 12) +# define RADEON_GMC_BYTE_PIX_ORDER (1 << 14) +# define RADEON_GMC_BYTE_MSB_TO_LSB (0 << 14) +# define RADEON_GMC_BYTE_LSB_TO_MSB (1 << 14) +# define RADEON_GMC_CONVERSION_TEMP (1 << 15) +# define RADEON_GMC_CONVERSION_TEMP_6500 (0 << 15) +# define RADEON_GMC_CONVERSION_TEMP_9300 (1 << 15) +# define RADEON_GMC_ROP3_MASK (0xff << 16) +# define RADEON_DP_SRC_SOURCE_MASK (7 << 24) +# define RADEON_DP_SRC_SOURCE_MEMORY (2 << 24) +# define RADEON_DP_SRC_SOURCE_HOST_DATA (3 << 24) +# define RADEON_GMC_3D_FCN_EN (1 << 27) +# define RADEON_GMC_CLR_CMP_CNTL_DIS (1 << 28) +# define RADEON_GMC_AUX_CLIP_DIS (1 << 29) +# define RADEON_GMC_WR_MSK_DIS (1 << 30) +# define RADEON_GMC_LD_BRUSH_Y_X (1 << 31) +# define RADEON_ROP3_ZERO 0x00000000 +# define RADEON_ROP3_DSa 0x00880000 +# define RADEON_ROP3_SDna 0x00440000 +# define RADEON_ROP3_S 0x00cc0000 +# define RADEON_ROP3_DSna 0x00220000 +# define RADEON_ROP3_D 0x00aa0000 +# define RADEON_ROP3_DSx 0x00660000 +# define RADEON_ROP3_DSo 0x00ee0000 +# define RADEON_ROP3_DSon 0x00110000 +# define RADEON_ROP3_DSxn 0x00990000 +# define RADEON_ROP3_Dn 0x00550000 +# define RADEON_ROP3_SDno 0x00dd0000 +# define RADEON_ROP3_Sn 0x00330000 +# define RADEON_ROP3_DSno 0x00bb0000 +# define RADEON_ROP3_DSan 0x00770000 +# define RADEON_ROP3_ONE 0x00ff0000 +# define RADEON_ROP3_DPa 0x00a00000 +# define RADEON_ROP3_PDna 0x00500000 +# define RADEON_ROP3_P 0x00f00000 +# define RADEON_ROP3_DPna 0x000a0000 +# define RADEON_ROP3_D 0x00aa0000 +# define RADEON_ROP3_DPx 0x005a0000 +# define RADEON_ROP3_DPo 0x00fa0000 +# define RADEON_ROP3_DPon 0x00050000 +# define RADEON_ROP3_PDxn 0x00a50000 +# define RADEON_ROP3_PDno 0x00f50000 +# define RADEON_ROP3_Pn 0x000f0000 +# define RADEON_ROP3_DPno 0x00af0000 +# define RADEON_ROP3_DPan 0x005f0000 +#define RADEON_DP_GUI_MASTER_CNTL_C 0x1c84 +#define RADEON_DP_MIX 0x16c8 +#define RADEON_DP_SRC_BKGD_CLR 0x15dc +#define RADEON_DP_SRC_FRGD_CLR 0x15d8 +#define RADEON_DP_WRITE_MASK 0x16cc +#define RADEON_DST_BRES_DEC 0x1630 +#define RADEON_DST_BRES_ERR 0x1628 +#define RADEON_DST_BRES_INC 0x162c +#define RADEON_DST_BRES_LNTH 0x1634 +#define RADEON_DST_BRES_LNTH_SUB 0x1638 +#define RADEON_DST_HEIGHT 0x1410 +#define RADEON_DST_HEIGHT_WIDTH 0x143c +#define RADEON_DST_HEIGHT_WIDTH_8 0x158c +#define RADEON_DST_HEIGHT_WIDTH_BW 0x15b4 +#define RADEON_DST_HEIGHT_Y 0x15a0 +#define RADEON_DST_LINE_START 0x1600 +#define RADEON_DST_LINE_END 0x1604 +#define RADEON_DST_LINE_PATCOUNT 0x1608 +# define RADEON_BRES_CNTL_SHIFT 8 +#define RADEON_DST_OFFSET 0x1404 +#define RADEON_DST_PITCH 0x1408 +#define RADEON_DST_PITCH_OFFSET 0x142c +#define RADEON_DST_PITCH_OFFSET_C 0x1c80 +# define RADEON_PITCH_SHIFT 21 +# define RADEON_DST_TILE_LINEAR (0 << 30) +# define RADEON_DST_TILE_MACRO (1 << 30) +# define RADEON_DST_TILE_MICRO (2 << 30) +# define RADEON_DST_TILE_BOTH (3 << 30) +#define RADEON_DST_WIDTH 0x140c +#define RADEON_DST_WIDTH_HEIGHT 0x1598 +#define RADEON_DST_WIDTH_X 0x1588 +#define RADEON_DST_WIDTH_X_INCY 0x159c +#define RADEON_DST_X 0x141c +#define RADEON_DST_X_SUB 0x15a4 +#define RADEON_DST_X_Y 0x1594 +#define RADEON_DST_Y 0x1420 +#define RADEON_DST_Y_SUB 0x15a8 +#define RADEON_DST_Y_X 0x1438 + +#define RADEON_FCP_CNTL 0x0910 +# define RADEON_FCP0_SRC_PCICLK 0 +# define RADEON_FCP0_SRC_PCLK 1 +# define RADEON_FCP0_SRC_PCLKb 2 +# define RADEON_FCP0_SRC_HREF 3 +# define RADEON_FCP0_SRC_GND 4 +# define RADEON_FCP0_SRC_HREFb 5 +#define RADEON_FLUSH_1 0x1704 +#define RADEON_FLUSH_2 0x1708 +#define RADEON_FLUSH_3 0x170c +#define RADEON_FLUSH_4 0x1710 +#define RADEON_FLUSH_5 0x1714 +#define RADEON_FLUSH_6 0x1718 +#define RADEON_FLUSH_7 0x171c +#define RADEON_FOG_3D_TABLE_START 0x1810 +#define RADEON_FOG_3D_TABLE_END 0x1814 +#define RADEON_FOG_3D_TABLE_DENSITY 0x181c +#define RADEON_FOG_TABLE_INDEX 0x1a14 +#define RADEON_FOG_TABLE_DATA 0x1a18 +#define RADEON_FP_CRTC_H_TOTAL_DISP 0x0250 +#define RADEON_FP_CRTC_V_TOTAL_DISP 0x0254 +# define RADEON_FP_CRTC_H_TOTAL_MASK 0x000003ff +# define RADEON_FP_CRTC_H_DISP_MASK 0x01ff0000 +# define RADEON_FP_CRTC_V_TOTAL_MASK 0x00000fff +# define RADEON_FP_CRTC_V_DISP_MASK 0x0fff0000 +# define RADEON_FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8 +# define RADEON_FP_H_SYNC_WID_MASK 0x003f0000 +# define RADEON_FP_V_SYNC_STRT_MASK 0x00000fff +# define RADEON_FP_V_SYNC_WID_MASK 0x001f0000 +# define RADEON_FP_CRTC_H_TOTAL_SHIFT 0x00000000 +# define RADEON_FP_CRTC_H_DISP_SHIFT 0x00000010 +# define RADEON_FP_CRTC_V_TOTAL_SHIFT 0x00000000 +# define RADEON_FP_CRTC_V_DISP_SHIFT 0x00000010 +# define RADEON_FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003 +# define RADEON_FP_H_SYNC_WID_SHIFT 0x00000010 +# define RADEON_FP_V_SYNC_STRT_SHIFT 0x00000000 +# define RADEON_FP_V_SYNC_WID_SHIFT 0x00000010 +#define RADEON_FP_GEN_CNTL 0x0284 +# define RADEON_FP_FPON (1 << 0) +# define RADEON_FP_BLANK_EN (1 << 1) +# define RADEON_FP_TMDS_EN (1 << 2) +# define RADEON_FP_PANEL_FORMAT (1 << 3) +# define RADEON_FP_EN_TMDS (1 << 7) +# define RADEON_FP_DETECT_SENSE (1 << 8) +# define R200_FP_SOURCE_SEL_MASK (3 << 10) +# define R200_FP_SOURCE_SEL_CRTC1 (0 << 10) +# define R200_FP_SOURCE_SEL_CRTC2 (1 << 10) +# define R200_FP_SOURCE_SEL_RMX (2 << 10) +# define R200_FP_SOURCE_SEL_TRANS (3 << 10) +# define RADEON_FP_SEL_CRTC1 (0 << 13) +# define RADEON_FP_SEL_CRTC2 (1 << 13) +# define RADEON_FP_CRTC_DONT_SHADOW_HPAR (1 << 15) +# define RADEON_FP_CRTC_DONT_SHADOW_VPAR (1 << 16) +# define RADEON_FP_CRTC_DONT_SHADOW_HEND (1 << 17) +# define RADEON_FP_CRTC_USE_SHADOW_VEND (1 << 18) +# define RADEON_FP_RMX_HVSYNC_CONTROL_EN (1 << 20) +# define RADEON_FP_DFP_SYNC_SEL (1 << 21) +# define RADEON_FP_CRTC_LOCK_8DOT (1 << 22) +# define RADEON_FP_CRT_SYNC_SEL (1 << 23) +# define RADEON_FP_USE_SHADOW_EN (1 << 24) +# define RADEON_FP_CRT_SYNC_ALT (1 << 26) +#define RADEON_FP2_GEN_CNTL 0x0288 +# define RADEON_FP2_BLANK_EN (1 << 1) +# define RADEON_FP2_ON (1 << 2) +# define RADEON_FP2_PANEL_FORMAT (1 << 3) +# define RADEON_FP2_DETECT_SENSE (1 << 8) +# define R200_FP2_SOURCE_SEL_MASK (3 << 10) +# define R200_FP2_SOURCE_SEL_CRTC1 (0 << 10) +# define R200_FP2_SOURCE_SEL_CRTC2 (1 << 10) +# define R200_FP2_SOURCE_SEL_RMX (2 << 10) +# define R200_FP2_SOURCE_SEL_TRANS_UNIT (3 << 10) +# define RADEON_FP2_SRC_SEL_MASK (3 << 13) +# define RADEON_FP2_SRC_SEL_CRTC2 (1 << 13) +# define RADEON_FP2_FP_POL (1 << 16) +# define RADEON_FP2_LP_POL (1 << 17) +# define RADEON_FP2_SCK_POL (1 << 18) +# define RADEON_FP2_LCD_CNTL_MASK (7 << 19) +# define RADEON_FP2_PAD_FLOP_EN (1 << 22) +# define RADEON_FP2_CRC_EN (1 << 23) +# define RADEON_FP2_CRC_READ_EN (1 << 24) +# define RADEON_FP2_DVO_EN (1 << 25) +# define RADEON_FP2_DVO_RATE_SEL_SDR (1 << 26) +# define R200_FP2_DVO_RATE_SEL_SDR (1 << 27) +# define R300_FP2_DVO_CLOCK_MODE_SINGLE (1 << 28) +# define R300_FP2_DVO_DUAL_CHANNEL_EN (1 << 29) +#define RADEON_FP_H_SYNC_STRT_WID 0x02c4 +#define RADEON_FP_H2_SYNC_STRT_WID 0x03c4 +#define RADEON_FP_HORZ_STRETCH 0x028c +#define RADEON_FP_HORZ2_STRETCH 0x038c +# define RADEON_HORZ_STRETCH_RATIO_MASK 0xffff +# define RADEON_HORZ_STRETCH_RATIO_MAX 4096 +# define RADEON_HORZ_PANEL_SIZE (0x1ff << 16) +# define RADEON_HORZ_PANEL_SHIFT 16 +# define RADEON_HORZ_STRETCH_PIXREP (0 << 25) +# define RADEON_HORZ_STRETCH_BLEND (1 << 26) +# define RADEON_HORZ_STRETCH_ENABLE (1 << 25) +# define RADEON_HORZ_AUTO_RATIO (1 << 27) +# define RADEON_HORZ_FP_LOOP_STRETCH (0x7 << 28) +# define RADEON_HORZ_AUTO_RATIO_INC (1 << 31) +#define RADEON_FP_HORZ_VERT_ACTIVE 0x0278 +#define RADEON_FP_V_SYNC_STRT_WID 0x02c8 +#define RADEON_FP_VERT_STRETCH 0x0290 +#define RADEON_FP_V2_SYNC_STRT_WID 0x03c8 +#define RADEON_FP_VERT2_STRETCH 0x0390 +# define RADEON_VERT_PANEL_SIZE (0xfff << 12) +# define RADEON_VERT_PANEL_SHIFT 12 +# define RADEON_VERT_STRETCH_RATIO_MASK 0xfff +# define RADEON_VERT_STRETCH_RATIO_SHIFT 0 +# define RADEON_VERT_STRETCH_RATIO_MAX 4096 +# define RADEON_VERT_STRETCH_ENABLE (1 << 25) +# define RADEON_VERT_STRETCH_LINEREP (0 << 26) +# define RADEON_VERT_STRETCH_BLEND (1 << 26) +# define RADEON_VERT_AUTO_RATIO_EN (1 << 27) +# define RADEON_VERT_AUTO_RATIO_INC (1 << 31) +# define RADEON_VERT_STRETCH_RESERVED 0x71000000 +#define RS400_FP_2ND_GEN_CNTL 0x0384 +# define RS400_FP_2ND_ON (1 << 0) +# define RS400_FP_2ND_BLANK_EN (1 << 1) +# define RS400_TMDS_2ND_EN (1 << 2) +# define RS400_PANEL_FORMAT_2ND (1 << 3) +# define RS400_FP_2ND_EN_TMDS (1 << 7) +# define RS400_FP_2ND_DETECT_SENSE (1 << 8) +# define RS400_FP_2ND_SOURCE_SEL_MASK (3 << 10) +# define RS400_FP_2ND_SOURCE_SEL_CRTC1 (0 << 10) +# define RS400_FP_2ND_SOURCE_SEL_CRTC2 (1 << 10) +# define RS400_FP_2ND_SOURCE_SEL_RMX (2 << 10) +# define RS400_FP_2ND_DETECT_EN (1 << 12) +# define RS400_HPD_2ND_SEL (1 << 13) +#define RS400_FP2_2_GEN_CNTL 0x0388 +# define RS400_FP2_2_BLANK_EN (1 << 1) +# define RS400_FP2_2_ON (1 << 2) +# define RS400_FP2_2_PANEL_FORMAT (1 << 3) +# define RS400_FP2_2_DETECT_SENSE (1 << 8) +# define RS400_FP2_2_SOURCE_SEL_MASK (3 << 10) +# define RS400_FP2_2_SOURCE_SEL_CRTC1 (0 << 10) +# define RS400_FP2_2_SOURCE_SEL_CRTC2 (1 << 10) +# define RS400_FP2_2_SOURCE_SEL_RMX (2 << 10) +# define RS400_FP2_2_DVO2_EN (1 << 25) +#define RS400_TMDS2_CNTL 0x0394 +#define RS400_TMDS2_TRANSMITTER_CNTL 0x03a4 +# define RS400_TMDS2_PLLEN (1 << 0) +# define RS400_TMDS2_PLLRST (1 << 1) + +#define RADEON_GEN_INT_CNTL 0x0040 +#define RADEON_GEN_INT_STATUS 0x0044 +# define RADEON_VSYNC_INT_AK (1 << 2) +# define RADEON_VSYNC_INT (1 << 2) +# define RADEON_VSYNC2_INT_AK (1 << 6) +# define RADEON_VSYNC2_INT (1 << 6) +#define RADEON_GENENB 0x03c3 /* VGA */ +#define RADEON_GENFC_RD 0x03ca /* VGA */ +#define RADEON_GENFC_WT 0x03da /* VGA, 0x03ba */ +#define RADEON_GENMO_RD 0x03cc /* VGA */ +#define RADEON_GENMO_WT 0x03c2 /* VGA */ +#define RADEON_GENS0 0x03c2 /* VGA */ +#define RADEON_GENS1 0x03da /* VGA, 0x03ba */ +#define RADEON_GPIO_MONID 0x0068 /* DDC interface via I2C */ +#define RADEON_GPIO_MONIDB 0x006c +#define RADEON_GPIO_CRT2_DDC 0x006c +#define RADEON_GPIO_DVI_DDC 0x0064 +#define RADEON_GPIO_VGA_DDC 0x0060 +# define RADEON_GPIO_A_0 (1 << 0) +# define RADEON_GPIO_A_1 (1 << 1) +# define RADEON_GPIO_Y_0 (1 << 8) +# define RADEON_GPIO_Y_1 (1 << 9) +# define RADEON_GPIO_Y_SHIFT_0 8 +# define RADEON_GPIO_Y_SHIFT_1 9 +# define RADEON_GPIO_EN_0 (1 << 16) +# define RADEON_GPIO_EN_1 (1 << 17) +# define RADEON_GPIO_MASK_0 (1 << 24) /*??*/ +# define RADEON_GPIO_MASK_1 (1 << 25) /*??*/ +#define RADEON_GRPH8_DATA 0x03cf /* VGA */ +#define RADEON_GRPH8_IDX 0x03ce /* VGA */ +#define RADEON_GUI_SCRATCH_REG0 0x15e0 +#define RADEON_GUI_SCRATCH_REG1 0x15e4 +#define RADEON_GUI_SCRATCH_REG2 0x15e8 +#define RADEON_GUI_SCRATCH_REG3 0x15ec +#define RADEON_GUI_SCRATCH_REG4 0x15f0 +#define RADEON_GUI_SCRATCH_REG5 0x15f4 + +#define RADEON_HEADER 0x0f0e /* PCI */ +#define RADEON_HOST_DATA0 0x17c0 +#define RADEON_HOST_DATA1 0x17c4 +#define RADEON_HOST_DATA2 0x17c8 +#define RADEON_HOST_DATA3 0x17cc +#define RADEON_HOST_DATA4 0x17d0 +#define RADEON_HOST_DATA5 0x17d4 +#define RADEON_HOST_DATA6 0x17d8 +#define RADEON_HOST_DATA7 0x17dc +#define RADEON_HOST_DATA_LAST 0x17e0 +#define RADEON_HOST_PATH_CNTL 0x0130 +# define RADEON_HDP_SOFT_RESET (1 << 26) +# define RADEON_HDP_APER_CNTL (1 << 23) +#define RADEON_HTOTAL_CNTL 0x0009 /* PLL */ +# define RADEON_HTOT_CNTL_VGA_EN (1 << 28) +#define RADEON_HTOTAL2_CNTL 0x002e /* PLL */ + + /* Multimedia I2C bus */ +#define RADEON_I2C_CNTL_0 0x0090 +#define RADEON_I2C_DONE (1<<0) +#define RADEON_I2C_NACK (1<<1) +#define RADEON_I2C_HALT (1<<2) +#define RADEON_I2C_SOFT_RST (1<<5) +#define RADEON_I2C_DRIVE_EN (1<<6) +#define RADEON_I2C_DRIVE_SEL (1<<7) +#define RADEON_I2C_START (1<<8) +#define RADEON_I2C_STOP (1<<9) +#define RADEON_I2C_RECEIVE (1<<10) +#define RADEON_I2C_ABORT (1<<11) +#define RADEON_I2C_GO (1<<12) +#define RADEON_I2C_CNTL_1 0x0094 +#define RADEON_I2C_SEL (1<<16) +#define RADEON_I2C_EN (1<<17) +#define RADEON_I2C_DATA 0x0098 + +#define RADEON_DVI_I2C_CNTL_0 0x02e0 +#define RADEON_DVI_I2C_CNTL_1 0x02e4 /* ? */ +#define RADEON_DVI_I2C_DATA 0x02e8 + +#define RADEON_INTERRUPT_LINE 0x0f3c /* PCI */ +#define RADEON_INTERRUPT_PIN 0x0f3d /* PCI */ +#define RADEON_IO_BASE 0x0f14 /* PCI */ + +#define RADEON_LATENCY 0x0f0d /* PCI */ +#define RADEON_LEAD_BRES_DEC 0x1608 +#define RADEON_LEAD_BRES_LNTH 0x161c +#define RADEON_LEAD_BRES_LNTH_SUB 0x1624 +#define RADEON_LVDS_GEN_CNTL 0x02d0 +# define RADEON_LVDS_ON (1 << 0) +# define RADEON_LVDS_DISPLAY_DIS (1 << 1) +# define RADEON_LVDS_PANEL_TYPE (1 << 2) +# define RADEON_LVDS_PANEL_FORMAT (1 << 3) +# define RADEON_LVDS_RST_FM (1 << 6) +# define RADEON_LVDS_EN (1 << 7) +# define RADEON_LVDS_BL_MOD_LEVEL_SHIFT 8 +# define RADEON_LVDS_BL_MOD_LEVEL_MASK (0xff << 8) +# define RADEON_LVDS_BL_MOD_EN (1 << 16) +# define RADEON_LVDS_DIGON (1 << 18) +# define RADEON_LVDS_BLON (1 << 19) +# define RADEON_LVDS_SEL_CRTC2 (1 << 23) +#define RADEON_LVDS_PLL_CNTL 0x02d4 +# define RADEON_HSYNC_DELAY_SHIFT 28 +# define RADEON_HSYNC_DELAY_MASK (0xf << 28) +# define RADEON_LVDS_PLL_EN (1 << 16) +# define RADEON_LVDS_PLL_RESET (1 << 17) +# define R300_LVDS_SRC_SEL_MASK (3 << 18) +# define R300_LVDS_SRC_SEL_CRTC1 (0 << 18) +# define R300_LVDS_SRC_SEL_CRTC2 (1 << 18) +# define R300_LVDS_SRC_SEL_RMX (2 << 18) + +#define RADEON_MAX_LATENCY 0x0f3f /* PCI */ +#define RADEON_MC_AGP_LOCATION 0x014c +#define RADEON_MC_FB_LOCATION 0x0148 +#define RADEON_DISPLAY_BASE_ADDR 0x23c +#define RADEON_DISPLAY2_BASE_ADDR 0x33c +#define RADEON_OV0_BASE_ADDR 0x43c +#define RADEON_NB_TOM 0x15c +#define R300_MC_INIT_MISC_LAT_TIMER 0x180 +# define R300_MC_DISP0R_INIT_LAT_SHIFT 8 +# define R300_MC_DISP0R_INIT_LAT_MASK 0xf +# define R300_MC_DISP1R_INIT_LAT_SHIFT 12 +# define R300_MC_DISP1R_INIT_LAT_MASK 0xf +#define RADEON_MCLK_CNTL 0x0012 /* PLL */ +# define RADEON_FORCEON_MCLKA (1 << 16) +# define RADEON_FORCEON_MCLKB (1 << 17) +# define RADEON_FORCEON_YCLKA (1 << 18) +# define RADEON_FORCEON_YCLKB (1 << 19) +# define RADEON_FORCEON_MC (1 << 20) +# define RADEON_FORCEON_AIC (1 << 21) +# define R300_DISABLE_MC_MCLKA (1 << 21) +# define R300_DISABLE_MC_MCLKB (1 << 21) +#define RADEON_MCLK_MISC 0x001f /* PLL */ +# define RADEON_MC_MCLK_MAX_DYN_STOP_LAT (1 << 12) +# define RADEON_IO_MCLK_MAX_DYN_STOP_LAT (1 << 13) +# define RADEON_MC_MCLK_DYN_ENABLE (1 << 14) +# define RADEON_IO_MCLK_DYN_ENABLE (1 << 15) +#define RADEON_LCD_GPIO_MASK 0x01a0 +#define RADEON_GPIOPAD_EN 0x01a0 +#define RADEON_LCD_GPIO_Y_REG 0x01a4 +#define RADEON_MDGPIO_A_REG 0x01ac +#define RADEON_MDGPIO_EN_REG 0x01b0 +#define RADEON_MDGPIO_MASK 0x0198 +#define RADEON_GPIOPAD_MASK 0x0198 +#define RADEON_GPIOPAD_A 0x019c +#define RADEON_MDGPIO_Y_REG 0x01b4 +#define RADEON_MEM_ADDR_CONFIG 0x0148 +#define RADEON_MEM_BASE 0x0f10 /* PCI */ +#define RADEON_MEM_CNTL 0x0140 +# define RADEON_MEM_NUM_CHANNELS_MASK 0x01 +# define RADEON_MEM_USE_B_CH_ONLY (1 << 1) +# define RV100_HALF_MODE (1 << 3) +# define R300_MEM_NUM_CHANNELS_MASK 0x03 +# define R300_MEM_USE_CD_CH_ONLY (1 << 2) +#define RADEON_MEM_TIMING_CNTL 0x0144 /* EXT_MEM_CNTL */ +#define RADEON_MEM_INIT_LAT_TIMER 0x0154 +#define RADEON_MEM_INTF_CNTL 0x014c +#define RADEON_MEM_SDRAM_MODE_REG 0x0158 +# define RADEON_SDRAM_MODE_MASK 0xffff0000 +# define RADEON_B3MEM_RESET_MASK 0x6fffffff +# define RADEON_MEM_CFG_TYPE_DDR (1 << 30) +#define RADEON_MEM_STR_CNTL 0x0150 +# define RADEON_MEM_PWRUP_COMPL_A (1 << 0) +# define RADEON_MEM_PWRUP_COMPL_B (1 << 1) +# define R300_MEM_PWRUP_COMPL_C (1 << 2) +# define R300_MEM_PWRUP_COMPL_D (1 << 3) +# define RADEON_MEM_PWRUP_COMPLETE 0x03 +# define R300_MEM_PWRUP_COMPLETE 0x0f +#define RADEON_MC_STATUS 0x0150 +# define RADEON_MC_IDLE (1 << 2) +# define R300_MC_IDLE (1 << 4) +#define RADEON_MEM_VGA_RP_SEL 0x003c +#define RADEON_MEM_VGA_WP_SEL 0x0038 +#define RADEON_MIN_GRANT 0x0f3e /* PCI */ +#define RADEON_MM_DATA 0x0004 +#define RADEON_MM_INDEX 0x0000 +#define RADEON_MPLL_CNTL 0x000e /* PLL */ +#define RADEON_MPP_TB_CONFIG 0x01c0 /* ? */ +#define RADEON_MPP_GP_CONFIG 0x01c8 /* ? */ +#define RADEON_SEPROM_CNTL1 0x01c0 +# define RADEON_SCK_PRESCALE_SHIFT 24 +# define RADEON_SCK_PRESCALE_MASK (0xff << 24) +#define R300_MC_IND_INDEX 0x01f8 +# define R300_MC_IND_ADDR_MASK 0x3f +# define R300_MC_IND_WR_EN (1 << 8) +#define R300_MC_IND_DATA 0x01fc +#define R300_MC_READ_CNTL_AB 0x017c +# define R300_MEM_RBS_POSITION_A_MASK 0x03 +#define R300_MC_READ_CNTL_CD_mcind 0x24 +# define R300_MEM_RBS_POSITION_C_MASK 0x03 + +#define RADEON_N_VIF_COUNT 0x0248 + +#define RADEON_OV0_AUTO_FLIP_CNTL 0x0470 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_NUM 0x00000007 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_REPEAT_FIELD 0x00000008 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD 0x00000010 +# define RADEON_OV0_AUTO_FLIP_CNTL_IGNORE_REPEAT_FIELD 0x00000020 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE 0x00000040 +# define RADEON_OV0_AUTO_FLIP_CNTL_VID_PORT_SELECT 0x00000300 +# define RADEON_OV0_AUTO_FLIP_CNTL_P1_FIRST_LINE_EVEN 0x00010000 +# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_EVEN_DOWN 0x00040000 +# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_ODD_DOWN 0x00080000 +# define RADEON_OV0_AUTO_FLIP_CNTL_FIELD_POL_SOURCE 0x00800000 + +#define RADEON_OV0_COLOUR_CNTL 0x04E0 +#define RADEON_OV0_DEINTERLACE_PATTERN 0x0474 +#define RADEON_OV0_EXCLUSIVE_HORZ 0x0408 +# define RADEON_EXCL_HORZ_START_MASK 0x000000ff +# define RADEON_EXCL_HORZ_END_MASK 0x0000ff00 +# define RADEON_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000 +# define RADEON_EXCL_HORZ_EXCLUSIVE_EN 0x80000000 +#define RADEON_OV0_EXCLUSIVE_VERT 0x040C +# define RADEON_EXCL_VERT_START_MASK 0x000003ff +# define RADEON_EXCL_VERT_END_MASK 0x03ff0000 +#define RADEON_OV0_FILTER_CNTL 0x04A0 +# define RADEON_FILTER_PROGRAMMABLE_COEF 0x0 +# define RADEON_FILTER_HC_COEF_HORZ_Y 0x1 +# define RADEON_FILTER_HC_COEF_HORZ_UV 0x2 +# define RADEON_FILTER_HC_COEF_VERT_Y 0x4 +# define RADEON_FILTER_HC_COEF_VERT_UV 0x8 +# define RADEON_FILTER_HARDCODED_COEF 0xf +# define RADEON_FILTER_COEF_MASK 0xf + +#define RADEON_OV0_FOUR_TAP_COEF_0 0x04B0 +#define RADEON_OV0_FOUR_TAP_COEF_1 0x04B4 +#define RADEON_OV0_FOUR_TAP_COEF_2 0x04B8 +#define RADEON_OV0_FOUR_TAP_COEF_3 0x04BC +#define RADEON_OV0_FOUR_TAP_COEF_4 0x04C0 +#define RADEON_OV0_FLAG_CNTL 0x04DC +#define RADEON_OV0_GAMMA_000_00F 0x0d40 +#define RADEON_OV0_GAMMA_010_01F 0x0d44 +#define RADEON_OV0_GAMMA_020_03F 0x0d48 +#define RADEON_OV0_GAMMA_040_07F 0x0d4c +#define RADEON_OV0_GAMMA_080_0BF 0x0e00 +#define RADEON_OV0_GAMMA_0C0_0FF 0x0e04 +#define RADEON_OV0_GAMMA_100_13F 0x0e08 +#define RADEON_OV0_GAMMA_140_17F 0x0e0c +#define RADEON_OV0_GAMMA_180_1BF 0x0e10 +#define RADEON_OV0_GAMMA_1C0_1FF 0x0e14 +#define RADEON_OV0_GAMMA_200_23F 0x0e18 +#define RADEON_OV0_GAMMA_240_27F 0x0e1c +#define RADEON_OV0_GAMMA_280_2BF 0x0e20 +#define RADEON_OV0_GAMMA_2C0_2FF 0x0e24 +#define RADEON_OV0_GAMMA_300_33F 0x0e28 +#define RADEON_OV0_GAMMA_340_37F 0x0e2c +#define RADEON_OV0_GAMMA_380_3BF 0x0d50 +#define RADEON_OV0_GAMMA_3C0_3FF 0x0d54 +#define RADEON_OV0_GRAPHICS_KEY_CLR_LOW 0x04EC +#define RADEON_OV0_GRAPHICS_KEY_CLR_HIGH 0x04F0 +#define RADEON_OV0_H_INC 0x0480 +#define RADEON_OV0_KEY_CNTL 0x04F4 +# define RADEON_VIDEO_KEY_FN_MASK 0x00000003L +# define RADEON_VIDEO_KEY_FN_FALSE 0x00000000L +# define RADEON_VIDEO_KEY_FN_TRUE 0x00000001L +# define RADEON_VIDEO_KEY_FN_EQ 0x00000002L +# define RADEON_VIDEO_KEY_FN_NE 0x00000003L +# define RADEON_GRAPHIC_KEY_FN_MASK 0x00000030L +# define RADEON_GRAPHIC_KEY_FN_FALSE 0x00000000L +# define RADEON_GRAPHIC_KEY_FN_TRUE 0x00000010L +# define RADEON_GRAPHIC_KEY_FN_EQ 0x00000020L +# define RADEON_GRAPHIC_KEY_FN_NE 0x00000030L +# define RADEON_CMP_MIX_MASK 0x00000100L +# define RADEON_CMP_MIX_OR 0x00000000L +# define RADEON_CMP_MIX_AND 0x00000100L +#define RADEON_OV0_LIN_TRANS_A 0x0d20 +#define RADEON_OV0_LIN_TRANS_B 0x0d24 +#define RADEON_OV0_LIN_TRANS_C 0x0d28 +#define RADEON_OV0_LIN_TRANS_D 0x0d2c +#define RADEON_OV0_LIN_TRANS_E 0x0d30 +#define RADEON_OV0_LIN_TRANS_F 0x0d34 +#define RADEON_OV0_P1_BLANK_LINES_AT_TOP 0x0430 +# define RADEON_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL +# define RADEON_P1_ACTIVE_LINES_M1 0x0fff0000L +#define RADEON_OV0_P1_H_ACCUM_INIT 0x0488 +#define RADEON_OV0_P1_V_ACCUM_INIT 0x0428 +# define RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L +# define RADEON_OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L +#define RADEON_OV0_P1_X_START_END 0x0494 +#define RADEON_OV0_P2_X_START_END 0x0498 +#define RADEON_OV0_P23_BLANK_LINES_AT_TOP 0x0434 +# define RADEON_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL +# define RADEON_P23_ACTIVE_LINES_M1 0x07ff0000L +#define RADEON_OV0_P23_H_ACCUM_INIT 0x048C +#define RADEON_OV0_P23_V_ACCUM_INIT 0x042C +#define RADEON_OV0_P3_X_START_END 0x049C +#define RADEON_OV0_REG_LOAD_CNTL 0x0410 +# define RADEON_REG_LD_CTL_LOCK 0x00000001L +# define RADEON_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L +# define RADEON_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L +# define RADEON_REG_LD_CTL_LOCK_READBACK 0x00000008L +# define RADEON_REG_LD_CTL_FLIP_READBACK 0x00000010L +#define RADEON_OV0_SCALE_CNTL 0x0420 +# define RADEON_SCALER_HORZ_PICK_NEAREST 0x00000004L +# define RADEON_SCALER_VERT_PICK_NEAREST 0x00000008L +# define RADEON_SCALER_SIGNED_UV 0x00000010L +# define RADEON_SCALER_GAMMA_SEL_MASK 0x00000060L +# define RADEON_SCALER_GAMMA_SEL_BRIGHT 0x00000000L +# define RADEON_SCALER_GAMMA_SEL_G22 0x00000020L +# define RADEON_SCALER_GAMMA_SEL_G18 0x00000040L +# define RADEON_SCALER_GAMMA_SEL_G14 0x00000060L +# define RADEON_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L +# define RADEON_SCALER_SURFAC_FORMAT 0x00000f00L +# define RADEON_SCALER_SOURCE_15BPP 0x00000300L +# define RADEON_SCALER_SOURCE_16BPP 0x00000400L +# define RADEON_SCALER_SOURCE_32BPP 0x00000600L +# define RADEON_SCALER_SOURCE_YUV9 0x00000900L +# define RADEON_SCALER_SOURCE_YUV12 0x00000A00L +# define RADEON_SCALER_SOURCE_VYUY422 0x00000B00L +# define RADEON_SCALER_SOURCE_YVYU422 0x00000C00L +# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L +# define RADEON_SCALER_TEMPORAL_DEINT 0x00002000L +# define RADEON_SCALER_CRTC_SEL 0x00004000L +# define RADEON_SCALER_SMART_SWITCH 0x00008000L +# define RADEON_SCALER_BURST_PER_PLANE 0x007F0000L +# define RADEON_SCALER_DOUBLE_BUFFER 0x01000000L +# define RADEON_SCALER_DIS_LIMIT 0x08000000L +# define RADEON_SCALER_LIN_TRANS_BYPASS 0x10000000L +# define RADEON_SCALER_INT_EMU 0x20000000L +# define RADEON_SCALER_ENABLE 0x40000000L +# define RADEON_SCALER_SOFT_RESET 0x80000000L +#define RADEON_OV0_STEP_BY 0x0484 +#define RADEON_OV0_TEST 0x04F8 +#define RADEON_OV0_V_INC 0x0424 +#define RADEON_OV0_VID_BUF_PITCH0_VALUE 0x0460 +#define RADEON_OV0_VID_BUF_PITCH1_VALUE 0x0464 +#define RADEON_OV0_VID_BUF0_BASE_ADRS 0x0440 +# define RADEON_VIF_BUF0_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF0_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF1_BASE_ADRS 0x0444 +# define RADEON_VIF_BUF1_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF1_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF2_BASE_ADRS 0x0448 +# define RADEON_VIF_BUF2_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF2_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF3_BASE_ADRS 0x044C +#define RADEON_OV0_VID_BUF4_BASE_ADRS 0x0450 +#define RADEON_OV0_VID_BUF5_BASE_ADRS 0x0454 +#define RADEON_OV0_VIDEO_KEY_CLR_HIGH 0x04E8 +#define RADEON_OV0_VIDEO_KEY_CLR_LOW 0x04E4 +#define RADEON_OV0_Y_X_START 0x0400 +#define RADEON_OV0_Y_X_END 0x0404 +#define RADEON_OV1_Y_X_START 0x0600 +#define RADEON_OV1_Y_X_END 0x0604 +#define RADEON_OVR_CLR 0x0230 +#define RADEON_OVR_WID_LEFT_RIGHT 0x0234 +#define RADEON_OVR_WID_TOP_BOTTOM 0x0238 + +/* first capture unit */ + +#define RADEON_CAP0_BUF0_OFFSET 0x0920 +#define RADEON_CAP0_BUF1_OFFSET 0x0924 +#define RADEON_CAP0_BUF0_EVEN_OFFSET 0x0928 +#define RADEON_CAP0_BUF1_EVEN_OFFSET 0x092C + +#define RADEON_CAP0_BUF_PITCH 0x0930 +#define RADEON_CAP0_V_WINDOW 0x0934 +#define RADEON_CAP0_H_WINDOW 0x0938 +#define RADEON_CAP0_VBI0_OFFSET 0x093C +#define RADEON_CAP0_VBI1_OFFSET 0x0940 +#define RADEON_CAP0_VBI_V_WINDOW 0x0944 +#define RADEON_CAP0_VBI_H_WINDOW 0x0948 +#define RADEON_CAP0_PORT_MODE_CNTL 0x094C +#define RADEON_CAP0_TRIG_CNTL 0x0950 +#define RADEON_CAP0_DEBUG 0x0954 +#define RADEON_CAP0_CONFIG 0x0958 +# define RADEON_CAP0_CONFIG_CONTINUOS 0x00000001 +# define RADEON_CAP0_CONFIG_START_FIELD_EVEN 0x00000002 +# define RADEON_CAP0_CONFIG_START_BUF_GET 0x00000004 +# define RADEON_CAP0_CONFIG_START_BUF_SET 0x00000008 +# define RADEON_CAP0_CONFIG_BUF_TYPE_ALT 0x00000010 +# define RADEON_CAP0_CONFIG_BUF_TYPE_FRAME 0x00000020 +# define RADEON_CAP0_CONFIG_ONESHOT_MODE_FRAME 0x00000040 +# define RADEON_CAP0_CONFIG_BUF_MODE_DOUBLE 0x00000080 +# define RADEON_CAP0_CONFIG_BUF_MODE_TRIPLE 0x00000100 +# define RADEON_CAP0_CONFIG_MIRROR_EN 0x00000200 +# define RADEON_CAP0_CONFIG_ONESHOT_MIRROR_EN 0x00000400 +# define RADEON_CAP0_CONFIG_VIDEO_SIGNED_UV 0x00000800 +# define RADEON_CAP0_CONFIG_ANC_DECODE_EN 0x00001000 +# define RADEON_CAP0_CONFIG_VBI_EN 0x00002000 +# define RADEON_CAP0_CONFIG_SOFT_PULL_DOWN_EN 0x00004000 +# define RADEON_CAP0_CONFIG_VIP_EXTEND_FLAG_EN 0x00008000 +# define RADEON_CAP0_CONFIG_FAKE_FIELD_EN 0x00010000 +# define RADEON_CAP0_CONFIG_ODD_ONE_MORE_LINE 0x00020000 +# define RADEON_CAP0_CONFIG_EVEN_ONE_MORE_LINE 0x00040000 +# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_2 0x00080000 +# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_4 0x00100000 +# define RADEON_CAP0_CONFIG_VERT_DIVIDE_2 0x00200000 +# define RADEON_CAP0_CONFIG_VERT_DIVIDE_4 0x00400000 +# define RADEON_CAP0_CONFIG_FORMAT_BROOKTREE 0x00000000 +# define RADEON_CAP0_CONFIG_FORMAT_CCIR656 0x00800000 +# define RADEON_CAP0_CONFIG_FORMAT_ZV 0x01000000 +# define RADEON_CAP0_CONFIG_FORMAT_VIP 0x01800000 +# define RADEON_CAP0_CONFIG_FORMAT_TRANSPORT 0x02000000 +# define RADEON_CAP0_CONFIG_HORZ_DECIMATOR 0x04000000 +# define RADEON_CAP0_CONFIG_VIDEO_IN_YVYU422 0x00000000 +# define RADEON_CAP0_CONFIG_VIDEO_IN_VYUY422 0x20000000 +# define RADEON_CAP0_CONFIG_VBI_DIVIDE_2 0x40000000 +# define RADEON_CAP0_CONFIG_VBI_DIVIDE_4 0x80000000 +#define RADEON_CAP0_ANC_ODD_OFFSET 0x095C +#define RADEON_CAP0_ANC_EVEN_OFFSET 0x0960 +#define RADEON_CAP0_ANC_H_WINDOW 0x0964 +#define RADEON_CAP0_VIDEO_SYNC_TEST 0x0968 +#define RADEON_CAP0_ONESHOT_BUF_OFFSET 0x096C +#define RADEON_CAP0_BUF_STATUS 0x0970 +/* #define RADEON_CAP0_DWNSC_XRATIO 0x0978 */ +/* #define RADEON_CAP0_XSHARPNESS 0x097C */ +#define RADEON_CAP0_VBI2_OFFSET 0x0980 +#define RADEON_CAP0_VBI3_OFFSET 0x0984 +#define RADEON_CAP0_ANC2_OFFSET 0x0988 +#define RADEON_CAP0_ANC3_OFFSET 0x098C +#define RADEON_VID_BUFFER_CONTROL 0x0900 + +/* second capture unit */ + +#define RADEON_CAP1_BUF0_OFFSET 0x0990 +#define RADEON_CAP1_BUF1_OFFSET 0x0994 +#define RADEON_CAP1_BUF0_EVEN_OFFSET 0x0998 +#define RADEON_CAP1_BUF1_EVEN_OFFSET 0x099C + +#define RADEON_CAP1_BUF_PITCH 0x09A0 +#define RADEON_CAP1_V_WINDOW 0x09A4 +#define RADEON_CAP1_H_WINDOW 0x09A8 +#define RADEON_CAP1_VBI_ODD_OFFSET 0x09AC +#define RADEON_CAP1_VBI_EVEN_OFFSET 0x09B0 +#define RADEON_CAP1_VBI_V_WINDOW 0x09B4 +#define RADEON_CAP1_VBI_H_WINDOW 0x09B8 +#define RADEON_CAP1_PORT_MODE_CNTL 0x09BC +#define RADEON_CAP1_TRIG_CNTL 0x09C0 +#define RADEON_CAP1_DEBUG 0x09C4 +#define RADEON_CAP1_CONFIG 0x09C8 +#define RADEON_CAP1_ANC_ODD_OFFSET 0x09CC +#define RADEON_CAP1_ANC_EVEN_OFFSET 0x09D0 +#define RADEON_CAP1_ANC_H_WINDOW 0x09D4 +#define RADEON_CAP1_VIDEO_SYNC_TEST 0x09D8 +#define RADEON_CAP1_ONESHOT_BUF_OFFSET 0x09DC +#define RADEON_CAP1_BUF_STATUS 0x09E0 +#define RADEON_CAP1_DWNSC_XRATIO 0x09E8 +#define RADEON_CAP1_XSHARPNESS 0x09EC + +/* misc multimedia registers */ + +#define RADEON_IDCT_RUNS 0x1F80 +#define RADEON_IDCT_LEVELS 0x1F84 +#define RADEON_IDCT_CONTROL 0x1FBC +#define RADEON_IDCT_AUTH_CONTROL 0x1F88 +#define RADEON_IDCT_AUTH 0x1F8C + +#define RADEON_P2PLL_CNTL 0x002a /* P2PLL */ +# define RADEON_P2PLL_RESET (1 << 0) +# define RADEON_P2PLL_SLEEP (1 << 1) +# define RADEON_P2PLL_PVG_MASK (7 << 11) +# define RADEON_P2PLL_PVG_SHIFT 11 +# define RADEON_P2PLL_ATOMIC_UPDATE_EN (1 << 16) +# define RADEON_P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17) +# define RADEON_P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18) +#define RADEON_P2PLL_DIV_0 0x002c +# define RADEON_P2PLL_FB0_DIV_MASK 0x07ff +# define RADEON_P2PLL_POST0_DIV_MASK 0x00070000 +#define RADEON_P2PLL_REF_DIV 0x002B /* PLL */ +# define RADEON_P2PLL_REF_DIV_MASK 0x03ff +# define RADEON_P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ +# define RADEON_P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ +# define R300_PPLL_REF_DIV_ACC_MASK (0x3ff << 18) +# define R300_PPLL_REF_DIV_ACC_SHIFT 18 +#define RADEON_PALETTE_DATA 0x00b4 +#define RADEON_PALETTE_30_DATA 0x00b8 +#define RADEON_PALETTE_INDEX 0x00b0 +#define RADEON_PCI_GART_PAGE 0x017c +#define RADEON_PIXCLKS_CNTL 0x002d +# define RADEON_PIX2CLK_SRC_SEL_MASK 0x03 +# define RADEON_PIX2CLK_SRC_SEL_CPUCLK 0x00 +# define RADEON_PIX2CLK_SRC_SEL_PSCANCLK 0x01 +# define RADEON_PIX2CLK_SRC_SEL_BYTECLK 0x02 +# define RADEON_PIX2CLK_SRC_SEL_P2PLLCLK 0x03 +# define RADEON_PIX2CLK_ALWAYS_ONb (1<<6) +# define RADEON_PIX2CLK_DAC_ALWAYS_ONb (1<<7) +# define RADEON_PIXCLK_TV_SRC_SEL (1 << 8) +# define RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb (1 << 9) +# define R300_DVOCLK_ALWAYS_ONb (1 << 10) +# define RADEON_PIXCLK_BLEND_ALWAYS_ONb (1 << 11) +# define RADEON_PIXCLK_GV_ALWAYS_ONb (1 << 12) +# define RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb (1 << 13) +# define R300_PIXCLK_DVO_ALWAYS_ONb (1 << 13) +# define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) +# define RADEON_PIXCLK_TMDS_ALWAYS_ONb (1 << 15) +# define R300_PIXCLK_TRANS_ALWAYS_ONb (1 << 16) +# define R300_PIXCLK_TVO_ALWAYS_ONb (1 << 17) +# define R300_P2G2CLK_ALWAYS_ONb (1 << 18) +# define R300_P2G2CLK_DAC_ALWAYS_ONb (1 << 19) +# define R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23) +#define RADEON_PLANE_3D_MASK_C 0x1d44 +#define RADEON_PLL_TEST_CNTL 0x0013 /* PLL */ +# define RADEON_PLL_MASK_READ_B (1 << 9) +#define RADEON_PMI_CAP_ID 0x0f5c /* PCI */ +#define RADEON_PMI_DATA 0x0f63 /* PCI */ +#define RADEON_PMI_NXT_CAP_PTR 0x0f5d /* PCI */ +#define RADEON_PMI_PMC_REG 0x0f5e /* PCI */ +#define RADEON_PMI_PMCSR_REG 0x0f60 /* PCI */ +#define RADEON_PMI_REGISTER 0x0f5c /* PCI */ +#define RADEON_PPLL_CNTL 0x0002 /* PLL */ +# define RADEON_PPLL_RESET (1 << 0) +# define RADEON_PPLL_SLEEP (1 << 1) +# define RADEON_PPLL_PVG_MASK (7 << 11) +# define RADEON_PPLL_PVG_SHIFT 11 +# define RADEON_PPLL_ATOMIC_UPDATE_EN (1 << 16) +# define RADEON_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17) +# define RADEON_PPLL_ATOMIC_UPDATE_VSYNC (1 << 18) +#define RADEON_PPLL_DIV_0 0x0004 /* PLL */ +#define RADEON_PPLL_DIV_1 0x0005 /* PLL */ +#define RADEON_PPLL_DIV_2 0x0006 /* PLL */ +#define RADEON_PPLL_DIV_3 0x0007 /* PLL */ +# define RADEON_PPLL_FB3_DIV_MASK 0x07ff +# define RADEON_PPLL_POST3_DIV_MASK 0x00070000 +#define RADEON_PPLL_REF_DIV 0x0003 /* PLL */ +# define RADEON_PPLL_REF_DIV_MASK 0x03ff +# define RADEON_PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ +# define RADEON_PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ +#define RADEON_PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */ + +#define RADEON_RBBM_GUICNTL 0x172c +# define RADEON_HOST_DATA_SWAP_NONE (0 << 0) +# define RADEON_HOST_DATA_SWAP_16BIT (1 << 0) +# define RADEON_HOST_DATA_SWAP_32BIT (2 << 0) +# define RADEON_HOST_DATA_SWAP_HDW (3 << 0) +#define RADEON_RBBM_SOFT_RESET 0x00f0 +# define RADEON_SOFT_RESET_CP (1 << 0) +# define RADEON_SOFT_RESET_HI (1 << 1) +# define RADEON_SOFT_RESET_SE (1 << 2) +# define RADEON_SOFT_RESET_RE (1 << 3) +# define RADEON_SOFT_RESET_PP (1 << 4) +# define RADEON_SOFT_RESET_E2 (1 << 5) +# define RADEON_SOFT_RESET_RB (1 << 6) +# define RADEON_SOFT_RESET_HDP (1 << 7) +#define RADEON_RBBM_STATUS 0x0e40 +# define RADEON_RBBM_FIFOCNT_MASK 0x007f +# define RADEON_RBBM_ACTIVE (1 << 31) +#define RADEON_RB2D_DSTCACHE_CTLSTAT 0x342c +# define RADEON_RB2D_DC_FLUSH (3 << 0) +# define RADEON_RB2D_DC_FREE (3 << 2) +# define RADEON_RB2D_DC_FLUSH_ALL 0xf +# define RADEON_RB2D_DC_BUSY (1 << 31) +#define RADEON_RB2D_DSTCACHE_MODE 0x3428 +#define RADEON_DSTCACHE_CTLSTAT 0x1714 + +#define RADEON_RB3D_ZCACHE_MODE 0x3250 +#define RADEON_RB3D_ZCACHE_CTLSTAT 0x3254 +# define RADEON_RB3D_ZC_FLUSH_ALL 0x5 +#define RADEON_RB3D_DSTCACHE_MODE 0x3258 +# define RADEON_RB3D_DC_CACHE_ENABLE (0) +# define RADEON_RB3D_DC_2D_CACHE_DISABLE (1) +# define RADEON_RB3D_DC_3D_CACHE_DISABLE (2) +# define RADEON_RB3D_DC_CACHE_DISABLE (3) +# define RADEON_RB3D_DC_2D_CACHE_LINESIZE_128 (1 << 2) +# define RADEON_RB3D_DC_3D_CACHE_LINESIZE_128 (2 << 2) +# define RADEON_RB3D_DC_2D_CACHE_AUTOFLUSH (1 << 8) +# define RADEON_RB3D_DC_3D_CACHE_AUTOFLUSH (2 << 8) +# define R200_RB3D_DC_2D_CACHE_AUTOFREE (1 << 10) +# define R200_RB3D_DC_3D_CACHE_AUTOFREE (2 << 10) +# define RADEON_RB3D_DC_FORCE_RMW (1 << 16) +# define RADEON_RB3D_DC_DISABLE_RI_FILL (1 << 24) +# define RADEON_RB3D_DC_DISABLE_RI_READ (1 << 25) + +#define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325C +# define RADEON_RB3D_DC_FLUSH (3 << 0) +# define RADEON_RB3D_DC_FREE (3 << 2) +# define RADEON_RB3D_DC_FLUSH_ALL 0xf +# define RADEON_RB3D_DC_BUSY (1 << 31) + +#define RADEON_REG_BASE 0x0f18 /* PCI */ +#define RADEON_REGPROG_INF 0x0f09 /* PCI */ +#define RADEON_REVISION_ID 0x0f08 /* PCI */ + +#define RADEON_SC_BOTTOM 0x164c +#define RADEON_SC_BOTTOM_RIGHT 0x16f0 +#define RADEON_SC_BOTTOM_RIGHT_C 0x1c8c +#define RADEON_SC_LEFT 0x1640 +#define RADEON_SC_RIGHT 0x1644 +#define RADEON_SC_TOP 0x1648 +#define RADEON_SC_TOP_LEFT 0x16ec +#define RADEON_SC_TOP_LEFT_C 0x1c88 +# define RADEON_SC_SIGN_MASK_LO 0x8000 +# define RADEON_SC_SIGN_MASK_HI 0x80000000 +#define RADEON_SCLK_CNTL 0x000d /* PLL */ +# define RADEON_SCLK_SRC_SEL_MASK 0x0007 +# define RADEON_DYN_STOP_LAT_MASK 0x00007ff8 +# define RADEON_CP_MAX_DYN_STOP_LAT 0x0008 +# define RADEON_SCLK_FORCEON_MASK 0xffff8000 +# define RADEON_SCLK_FORCE_DISP2 (1<<15) +# define RADEON_SCLK_FORCE_CP (1<<16) +# define RADEON_SCLK_FORCE_HDP (1<<17) +# define RADEON_SCLK_FORCE_DISP1 (1<<18) +# define RADEON_SCLK_FORCE_TOP (1<<19) +# define RADEON_SCLK_FORCE_E2 (1<<20) +# define RADEON_SCLK_FORCE_SE (1<<21) +# define RADEON_SCLK_FORCE_IDCT (1<<22) +# define RADEON_SCLK_FORCE_VIP (1<<23) +# define RADEON_SCLK_FORCE_RE (1<<24) +# define RADEON_SCLK_FORCE_PB (1<<25) +# define RADEON_SCLK_FORCE_TAM (1<<26) +# define RADEON_SCLK_FORCE_TDM (1<<27) +# define RADEON_SCLK_FORCE_RB (1<<28) +# define RADEON_SCLK_FORCE_TV_SCLK (1<<29) +# define RADEON_SCLK_FORCE_SUBPIC (1<<30) +# define RADEON_SCLK_FORCE_OV0 (1<<31) +# define R300_SCLK_FORCE_VAP (1<<21) +# define R300_SCLK_FORCE_SR (1<<25) +# define R300_SCLK_FORCE_PX (1<<26) +# define R300_SCLK_FORCE_TX (1<<27) +# define R300_SCLK_FORCE_US (1<<28) +# define R300_SCLK_FORCE_SU (1<<30) +#define R300_SCLK_CNTL2 0x1e /* PLL */ +# define R300_SCLK_TCL_MAX_DYN_STOP_LAT (1<<10) +# define R300_SCLK_GA_MAX_DYN_STOP_LAT (1<<11) +# define R300_SCLK_CBA_MAX_DYN_STOP_LAT (1<<12) +# define R300_SCLK_FORCE_TCL (1<<13) +# define R300_SCLK_FORCE_CBA (1<<14) +# define R300_SCLK_FORCE_GA (1<<15) +#define RADEON_SCLK_MORE_CNTL 0x0035 /* PLL */ +# define RADEON_SCLK_MORE_MAX_DYN_STOP_LAT 0x0007 +# define RADEON_SCLK_MORE_FORCEON 0x0700 +#define RADEON_SDRAM_MODE_REG 0x0158 +#define RADEON_SEQ8_DATA 0x03c5 /* VGA */ +#define RADEON_SEQ8_IDX 0x03c4 /* VGA */ +#define RADEON_SNAPSHOT_F_COUNT 0x0244 +#define RADEON_SNAPSHOT_VH_COUNTS 0x0240 +#define RADEON_SNAPSHOT_VIF_COUNT 0x024c +#define RADEON_SRC_OFFSET 0x15ac +#define RADEON_SRC_PITCH 0x15b0 +#define RADEON_SRC_PITCH_OFFSET 0x1428 +#define RADEON_SRC_SC_BOTTOM 0x165c +#define RADEON_SRC_SC_BOTTOM_RIGHT 0x16f4 +#define RADEON_SRC_SC_RIGHT 0x1654 +#define RADEON_SRC_X 0x1414 +#define RADEON_SRC_X_Y 0x1590 +#define RADEON_SRC_Y 0x1418 +#define RADEON_SRC_Y_X 0x1434 +#define RADEON_STATUS 0x0f06 /* PCI */ +#define RADEON_SUBPIC_CNTL 0x0540 /* ? */ +#define RADEON_SUB_CLASS 0x0f0a /* PCI */ +#define RADEON_SURFACE_CNTL 0x0b00 +# define RADEON_SURF_TRANSLATION_DIS (1 << 8) +# define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20) +# define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21) +# define RADEON_NONSURF_AP1_SWP_16BPP (1 << 22) +# define RADEON_NONSURF_AP1_SWP_32BPP (1 << 23) +#define RADEON_SURFACE0_INFO 0x0b0c +# define RADEON_SURF_TILE_COLOR_MACRO (0 << 16) +# define RADEON_SURF_TILE_COLOR_BOTH (1 << 16) +# define RADEON_SURF_TILE_DEPTH_32BPP (2 << 16) +# define RADEON_SURF_TILE_DEPTH_16BPP (3 << 16) +# define R200_SURF_TILE_NONE (0 << 16) +# define R200_SURF_TILE_COLOR_MACRO (1 << 16) +# define R200_SURF_TILE_COLOR_MICRO (2 << 16) +# define R200_SURF_TILE_COLOR_BOTH (3 << 16) +# define R200_SURF_TILE_DEPTH_32BPP (4 << 16) +# define R200_SURF_TILE_DEPTH_16BPP (5 << 16) +# define R300_SURF_TILE_NONE (0 << 16) +# define R300_SURF_TILE_COLOR_MACRO (1 << 16) +# define R300_SURF_TILE_DEPTH_32BPP (2 << 16) +# define RADEON_SURF_AP0_SWP_16BPP (1 << 20) +# define RADEON_SURF_AP0_SWP_32BPP (1 << 21) +# define RADEON_SURF_AP1_SWP_16BPP (1 << 22) +# define RADEON_SURF_AP1_SWP_32BPP (1 << 23) +#define RADEON_SURFACE0_LOWER_BOUND 0x0b04 +#define RADEON_SURFACE0_UPPER_BOUND 0x0b08 +#define RADEON_SURFACE1_INFO 0x0b1c +#define RADEON_SURFACE1_LOWER_BOUND 0x0b14 +#define RADEON_SURFACE1_UPPER_BOUND 0x0b18 +#define RADEON_SURFACE2_INFO 0x0b2c +#define RADEON_SURFACE2_LOWER_BOUND 0x0b24 +#define RADEON_SURFACE2_UPPER_BOUND 0x0b28 +#define RADEON_SURFACE3_INFO 0x0b3c +#define RADEON_SURFACE3_LOWER_BOUND 0x0b34 +#define RADEON_SURFACE3_UPPER_BOUND 0x0b38 +#define RADEON_SURFACE4_INFO 0x0b4c +#define RADEON_SURFACE4_LOWER_BOUND 0x0b44 +#define RADEON_SURFACE4_UPPER_BOUND 0x0b48 +#define RADEON_SURFACE5_INFO 0x0b5c +#define RADEON_SURFACE5_LOWER_BOUND 0x0b54 +#define RADEON_SURFACE5_UPPER_BOUND 0x0b58 +#define RADEON_SURFACE6_INFO 0x0b6c +#define RADEON_SURFACE6_LOWER_BOUND 0x0b64 +#define RADEON_SURFACE6_UPPER_BOUND 0x0b68 +#define RADEON_SURFACE7_INFO 0x0b7c +#define RADEON_SURFACE7_LOWER_BOUND 0x0b74 +#define RADEON_SURFACE7_UPPER_BOUND 0x0b78 +#define RADEON_SW_SEMAPHORE 0x013c + +#define RADEON_TEST_DEBUG_CNTL 0x0120 +#define RADEON_TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN 0x00000001 + +#define RADEON_TEST_DEBUG_MUX 0x0124 +#define RADEON_TEST_DEBUG_OUT 0x012c +#define RADEON_TMDS_PLL_CNTL 0x02a8 +#define RADEON_TMDS_TRANSMITTER_CNTL 0x02a4 +# define RADEON_TMDS_TRANSMITTER_PLLEN 1 +# define RADEON_TMDS_TRANSMITTER_PLLRST 2 +#define RADEON_TRAIL_BRES_DEC 0x1614 +#define RADEON_TRAIL_BRES_ERR 0x160c +#define RADEON_TRAIL_BRES_INC 0x1610 +#define RADEON_TRAIL_X 0x1618 +#define RADEON_TRAIL_X_SUB 0x1620 + +#define RADEON_VCLK_ECP_CNTL 0x0008 /* PLL */ +# define RADEON_VCLK_SRC_SEL_MASK 0x03 +# define RADEON_VCLK_SRC_SEL_CPUCLK 0x00 +# define RADEON_VCLK_SRC_SEL_PSCANCLK 0x01 +# define RADEON_VCLK_SRC_SEL_BYTECLK 0x02 +# define RADEON_VCLK_SRC_SEL_PPLLCLK 0x03 +# define RADEON_PIXCLK_ALWAYS_ONb (1<<6) +# define RADEON_PIXCLK_DAC_ALWAYS_ONb (1<<7) +# define R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF (1<<23) + +#define RADEON_VENDOR_ID 0x0f00 /* PCI */ +#define RADEON_VGA_DDA_CONFIG 0x02e8 +#define RADEON_VGA_DDA_ON_OFF 0x02ec +#define RADEON_VID_BUFFER_CONTROL 0x0900 +#define RADEON_VIDEOMUX_CNTL 0x0190 + + /* VIP bus */ +#define RADEON_VIPH_CH0_DATA 0x0c00 +#define RADEON_VIPH_CH1_DATA 0x0c04 +#define RADEON_VIPH_CH2_DATA 0x0c08 +#define RADEON_VIPH_CH3_DATA 0x0c0c +#define RADEON_VIPH_CH0_ADDR 0x0c10 +#define RADEON_VIPH_CH1_ADDR 0x0c14 +#define RADEON_VIPH_CH2_ADDR 0x0c18 +#define RADEON_VIPH_CH3_ADDR 0x0c1c +#define RADEON_VIPH_CH0_SBCNT 0x0c20 +#define RADEON_VIPH_CH1_SBCNT 0x0c24 +#define RADEON_VIPH_CH2_SBCNT 0x0c28 +#define RADEON_VIPH_CH3_SBCNT 0x0c2c +#define RADEON_VIPH_CH0_ABCNT 0x0c30 +#define RADEON_VIPH_CH1_ABCNT 0x0c34 +#define RADEON_VIPH_CH2_ABCNT 0x0c38 +#define RADEON_VIPH_CH3_ABCNT 0x0c3c +#define RADEON_VIPH_CONTROL 0x0c40 +# define RADEON_VIP_BUSY 0 +# define RADEON_VIP_IDLE 1 +# define RADEON_VIP_RESET 2 +# define RADEON_VIPH_EN (1 << 21) +#define RADEON_VIPH_DV_LAT 0x0c44 +#define RADEON_VIPH_BM_CHUNK 0x0c48 +#define RADEON_VIPH_DV_INT 0x0c4c +#define RADEON_VIPH_TIMEOUT_STAT 0x0c50 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_STAT 0x00000010 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_AK 0x00000010 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REGR_DIS 0x01000000 + +#define RADEON_VIPH_REG_DATA 0x0084 +#define RADEON_VIPH_REG_ADDR 0x0080 + + +#define RADEON_WAIT_UNTIL 0x1720 +# define RADEON_WAIT_CRTC_PFLIP (1 << 0) +# define RADEON_WAIT_RE_CRTC_VLINE (1 << 1) +# define RADEON_WAIT_FE_CRTC_VLINE (1 << 2) +# define RADEON_WAIT_CRTC_VLINE (1 << 3) +# define RADEON_WAIT_DMA_VID_IDLE (1 << 8) +# define RADEON_WAIT_DMA_GUI_IDLE (1 << 9) +# define RADEON_WAIT_CMDFIFO (1 << 10) /* wait for CMDFIFO_ENTRIES */ +# define RADEON_WAIT_OV0_FLIP (1 << 11) +# define RADEON_WAIT_AGP_FLUSH (1 << 13) +# define RADEON_WAIT_2D_IDLE (1 << 14) +# define RADEON_WAIT_3D_IDLE (1 << 15) +# define RADEON_WAIT_2D_IDLECLEAN (1 << 16) +# define RADEON_WAIT_3D_IDLECLEAN (1 << 17) +# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18) +# define RADEON_CMDFIFO_ENTRIES_SHIFT 10 +# define RADEON_CMDFIFO_ENTRIES_MASK 0x7f +# define RADEON_WAIT_VAP_IDLE (1 << 28) +# define RADEON_WAIT_BOTH_CRTC_PFLIP (1 << 30) +# define RADEON_ENG_DISPLAY_SELECT_CRTC0 (0 << 31) +# define RADEON_ENG_DISPLAY_SELECT_CRTC1 (1 << 31) + +#define RADEON_X_MPLL_REF_FB_DIV 0x000a /* PLL */ +#define RADEON_XCLK_CNTL 0x000d /* PLL */ +#define RADEON_XDLL_CNTL 0x000c /* PLL */ +#define RADEON_XPLL_CNTL 0x000b /* PLL */ + + + + /* Registers for 3D/TCL */ +#define RADEON_PP_BORDER_COLOR_0 0x1d40 +#define RADEON_PP_BORDER_COLOR_1 0x1d44 +#define RADEON_PP_BORDER_COLOR_2 0x1d48 +#define RADEON_PP_CNTL 0x1c38 +# define RADEON_STIPPLE_ENABLE (1 << 0) +# define RADEON_SCISSOR_ENABLE (1 << 1) +# define RADEON_PATTERN_ENABLE (1 << 2) +# define RADEON_SHADOW_ENABLE (1 << 3) +# define RADEON_TEX_ENABLE_MASK (0xf << 4) +# define RADEON_TEX_0_ENABLE (1 << 4) +# define RADEON_TEX_1_ENABLE (1 << 5) +# define RADEON_TEX_2_ENABLE (1 << 6) +# define RADEON_TEX_3_ENABLE (1 << 7) +# define RADEON_TEX_BLEND_ENABLE_MASK (0xf << 12) +# define RADEON_TEX_BLEND_0_ENABLE (1 << 12) +# define RADEON_TEX_BLEND_1_ENABLE (1 << 13) +# define RADEON_TEX_BLEND_2_ENABLE (1 << 14) +# define RADEON_TEX_BLEND_3_ENABLE (1 << 15) +# define RADEON_PLANAR_YUV_ENABLE (1 << 20) +# define RADEON_SPECULAR_ENABLE (1 << 21) +# define RADEON_FOG_ENABLE (1 << 22) +# define RADEON_ALPHA_TEST_ENABLE (1 << 23) +# define RADEON_ANTI_ALIAS_NONE (0 << 24) +# define RADEON_ANTI_ALIAS_LINE (1 << 24) +# define RADEON_ANTI_ALIAS_POLY (2 << 24) +# define RADEON_ANTI_ALIAS_LINE_POLY (3 << 24) +# define RADEON_BUMP_MAP_ENABLE (1 << 26) +# define RADEON_BUMPED_MAP_T0 (0 << 27) +# define RADEON_BUMPED_MAP_T1 (1 << 27) +# define RADEON_BUMPED_MAP_T2 (2 << 27) +# define RADEON_TEX_3D_ENABLE_0 (1 << 29) +# define RADEON_TEX_3D_ENABLE_1 (1 << 30) +# define RADEON_MC_ENABLE (1 << 31) +#define RADEON_PP_FOG_COLOR 0x1c18 +# define RADEON_FOG_COLOR_MASK 0x00ffffff +# define RADEON_FOG_VERTEX (0 << 24) +# define RADEON_FOG_TABLE (1 << 24) +# define RADEON_FOG_USE_DEPTH (0 << 25) +# define RADEON_FOG_USE_DIFFUSE_ALPHA (2 << 25) +# define RADEON_FOG_USE_SPEC_ALPHA (3 << 25) +#define RADEON_PP_LUM_MATRIX 0x1d00 +#define RADEON_PP_MISC 0x1c14 +# define RADEON_REF_ALPHA_MASK 0x000000ff +# define RADEON_ALPHA_TEST_FAIL (0 << 8) +# define RADEON_ALPHA_TEST_LESS (1 << 8) +# define RADEON_ALPHA_TEST_LEQUAL (2 << 8) +# define RADEON_ALPHA_TEST_EQUAL (3 << 8) +# define RADEON_ALPHA_TEST_GEQUAL (4 << 8) +# define RADEON_ALPHA_TEST_GREATER (5 << 8) +# define RADEON_ALPHA_TEST_NEQUAL (6 << 8) +# define RADEON_ALPHA_TEST_PASS (7 << 8) +# define RADEON_ALPHA_TEST_OP_MASK (7 << 8) +# define RADEON_CHROMA_FUNC_FAIL (0 << 16) +# define RADEON_CHROMA_FUNC_PASS (1 << 16) +# define RADEON_CHROMA_FUNC_NEQUAL (2 << 16) +# define RADEON_CHROMA_FUNC_EQUAL (3 << 16) +# define RADEON_CHROMA_KEY_NEAREST (0 << 18) +# define RADEON_CHROMA_KEY_ZERO (1 << 18) +# define RADEON_SHADOW_ID_AUTO_INC (1 << 20) +# define RADEON_SHADOW_FUNC_EQUAL (0 << 21) +# define RADEON_SHADOW_FUNC_NEQUAL (1 << 21) +# define RADEON_SHADOW_PASS_1 (0 << 22) +# define RADEON_SHADOW_PASS_2 (1 << 22) +# define RADEON_RIGHT_HAND_CUBE_D3D (0 << 24) +# define RADEON_RIGHT_HAND_CUBE_OGL (1 << 24) +#define RADEON_PP_ROT_MATRIX_0 0x1d58 +#define RADEON_PP_ROT_MATRIX_1 0x1d5c +#define RADEON_PP_TXFILTER_0 0x1c54 +#define RADEON_PP_TXFILTER_1 0x1c6c +#define RADEON_PP_TXFILTER_2 0x1c84 +# define RADEON_MAG_FILTER_NEAREST (0 << 0) +# define RADEON_MAG_FILTER_LINEAR (1 << 0) +# define RADEON_MAG_FILTER_MASK (1 << 0) +# define RADEON_MIN_FILTER_NEAREST (0 << 1) +# define RADEON_MIN_FILTER_LINEAR (1 << 1) +# define RADEON_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) +# define RADEON_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) +# define RADEON_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) +# define RADEON_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST (8 << 1) +# define RADEON_MIN_FILTER_ANISO_LINEAR (9 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) +# define RADEON_MIN_FILTER_MASK (15 << 1) +# define RADEON_MAX_ANISO_1_TO_1 (0 << 5) +# define RADEON_MAX_ANISO_2_TO_1 (1 << 5) +# define RADEON_MAX_ANISO_4_TO_1 (2 << 5) +# define RADEON_MAX_ANISO_8_TO_1 (3 << 5) +# define RADEON_MAX_ANISO_16_TO_1 (4 << 5) +# define RADEON_MAX_ANISO_MASK (7 << 5) +# define RADEON_LOD_BIAS_MASK (0xff << 8) +# define RADEON_LOD_BIAS_SHIFT 8 +# define RADEON_MAX_MIP_LEVEL_MASK (0x0f << 16) +# define RADEON_MAX_MIP_LEVEL_SHIFT 16 +# define RADEON_YUV_TO_RGB (1 << 20) +# define RADEON_YUV_TEMPERATURE_COOL (0 << 21) +# define RADEON_YUV_TEMPERATURE_HOT (1 << 21) +# define RADEON_YUV_TEMPERATURE_MASK (1 << 21) +# define RADEON_WRAPEN_S (1 << 22) +# define RADEON_CLAMP_S_WRAP (0 << 23) +# define RADEON_CLAMP_S_MIRROR (1 << 23) +# define RADEON_CLAMP_S_CLAMP_LAST (2 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) +# define RADEON_CLAMP_S_CLAMP_BORDER (4 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) +# define RADEON_CLAMP_S_CLAMP_GL (6 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) +# define RADEON_CLAMP_S_MASK (7 << 23) +# define RADEON_WRAPEN_T (1 << 26) +# define RADEON_CLAMP_T_WRAP (0 << 27) +# define RADEON_CLAMP_T_MIRROR (1 << 27) +# define RADEON_CLAMP_T_CLAMP_LAST (2 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) +# define RADEON_CLAMP_T_CLAMP_BORDER (4 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) +# define RADEON_CLAMP_T_CLAMP_GL (6 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) +# define RADEON_CLAMP_T_MASK (7 << 27) +# define RADEON_BORDER_MODE_OGL (0 << 31) +# define RADEON_BORDER_MODE_D3D (1 << 31) +#define RADEON_PP_TXFORMAT_0 0x1c58 +#define RADEON_PP_TXFORMAT_1 0x1c70 +#define RADEON_PP_TXFORMAT_2 0x1c88 +# define RADEON_TXFORMAT_I8 (0 << 0) +# define RADEON_TXFORMAT_AI88 (1 << 0) +# define RADEON_TXFORMAT_RGB332 (2 << 0) +# define RADEON_TXFORMAT_ARGB1555 (3 << 0) +# define RADEON_TXFORMAT_RGB565 (4 << 0) +# define RADEON_TXFORMAT_ARGB4444 (5 << 0) +# define RADEON_TXFORMAT_ARGB8888 (6 << 0) +# define RADEON_TXFORMAT_RGBA8888 (7 << 0) +# define RADEON_TXFORMAT_Y8 (8 << 0) +# define RADEON_TXFORMAT_VYUY422 (10 << 0) +# define RADEON_TXFORMAT_YVYU422 (11 << 0) +# define RADEON_TXFORMAT_DXT1 (12 << 0) +# define RADEON_TXFORMAT_DXT23 (14 << 0) +# define RADEON_TXFORMAT_DXT45 (15 << 0) +# define RADEON_TXFORMAT_FORMAT_MASK (31 << 0) +# define RADEON_TXFORMAT_FORMAT_SHIFT 0 +# define RADEON_TXFORMAT_APPLE_YUV_MODE (1 << 5) +# define RADEON_TXFORMAT_ALPHA_IN_MAP (1 << 6) +# define RADEON_TXFORMAT_NON_POWER2 (1 << 7) +# define RADEON_TXFORMAT_WIDTH_MASK (15 << 8) +# define RADEON_TXFORMAT_WIDTH_SHIFT 8 +# define RADEON_TXFORMAT_HEIGHT_MASK (15 << 12) +# define RADEON_TXFORMAT_HEIGHT_SHIFT 12 +# define RADEON_TXFORMAT_F5_WIDTH_MASK (15 << 16) +# define RADEON_TXFORMAT_F5_WIDTH_SHIFT 16 +# define RADEON_TXFORMAT_F5_HEIGHT_MASK (15 << 20) +# define RADEON_TXFORMAT_F5_HEIGHT_SHIFT 20 +# define RADEON_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_MASK (3 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) +# define RADEON_TXFORMAT_ENDIAN_NO_SWAP (0 << 26) +# define RADEON_TXFORMAT_ENDIAN_16BPP_SWAP (1 << 26) +# define RADEON_TXFORMAT_ENDIAN_32BPP_SWAP (2 << 26) +# define RADEON_TXFORMAT_ENDIAN_HALFDW_SWAP (3 << 26) +# define RADEON_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) +# define RADEON_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) +# define RADEON_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) +# define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1 << 31) +#define RADEON_PP_CUBIC_FACES_0 0x1d24 +#define RADEON_PP_CUBIC_FACES_1 0x1d28 +#define RADEON_PP_CUBIC_FACES_2 0x1d2c +# define RADEON_FACE_WIDTH_1_SHIFT 0 +# define RADEON_FACE_HEIGHT_1_SHIFT 4 +# define RADEON_FACE_WIDTH_1_MASK (0xf << 0) +# define RADEON_FACE_HEIGHT_1_MASK (0xf << 4) +# define RADEON_FACE_WIDTH_2_SHIFT 8 +# define RADEON_FACE_HEIGHT_2_SHIFT 12 +# define RADEON_FACE_WIDTH_2_MASK (0xf << 8) +# define RADEON_FACE_HEIGHT_2_MASK (0xf << 12) +# define RADEON_FACE_WIDTH_3_SHIFT 16 +# define RADEON_FACE_HEIGHT_3_SHIFT 20 +# define RADEON_FACE_WIDTH_3_MASK (0xf << 16) +# define RADEON_FACE_HEIGHT_3_MASK (0xf << 20) +# define RADEON_FACE_WIDTH_4_SHIFT 24 +# define RADEON_FACE_HEIGHT_4_SHIFT 28 +# define RADEON_FACE_WIDTH_4_MASK (0xf << 24) +# define RADEON_FACE_HEIGHT_4_MASK (0xf << 28) + +#define RADEON_PP_TXOFFSET_0 0x1c5c +#define RADEON_PP_TXOFFSET_1 0x1c74 +#define RADEON_PP_TXOFFSET_2 0x1c8c +# define RADEON_TXO_ENDIAN_NO_SWAP (0 << 0) +# define RADEON_TXO_ENDIAN_BYTE_SWAP (1 << 0) +# define RADEON_TXO_ENDIAN_WORD_SWAP (2 << 0) +# define RADEON_TXO_ENDIAN_HALFDW_SWAP (3 << 0) +# define RADEON_TXO_MACRO_LINEAR (0 << 2) +# define RADEON_TXO_MACRO_TILE (1 << 2) +# define RADEON_TXO_MICRO_LINEAR (0 << 3) +# define RADEON_TXO_MICRO_TILE_X2 (1 << 3) +# define RADEON_TXO_MICRO_TILE_OPT (2 << 3) +# define RADEON_TXO_OFFSET_MASK 0xffffffe0 +# define RADEON_TXO_OFFSET_SHIFT 5 + +#define RADEON_PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */ +#define RADEON_PP_CUBIC_OFFSET_T0_1 0x1dd4 +#define RADEON_PP_CUBIC_OFFSET_T0_2 0x1dd8 +#define RADEON_PP_CUBIC_OFFSET_T0_3 0x1ddc +#define RADEON_PP_CUBIC_OFFSET_T0_4 0x1de0 +#define RADEON_PP_CUBIC_OFFSET_T1_0 0x1e00 +#define RADEON_PP_CUBIC_OFFSET_T1_1 0x1e04 +#define RADEON_PP_CUBIC_OFFSET_T1_2 0x1e08 +#define RADEON_PP_CUBIC_OFFSET_T1_3 0x1e0c +#define RADEON_PP_CUBIC_OFFSET_T1_4 0x1e10 +#define RADEON_PP_CUBIC_OFFSET_T2_0 0x1e14 +#define RADEON_PP_CUBIC_OFFSET_T2_1 0x1e18 +#define RADEON_PP_CUBIC_OFFSET_T2_2 0x1e1c +#define RADEON_PP_CUBIC_OFFSET_T2_3 0x1e20 +#define RADEON_PP_CUBIC_OFFSET_T2_4 0x1e24 + +#define RADEON_PP_TEX_SIZE_0 0x1d04 /* NPOT */ +#define RADEON_PP_TEX_SIZE_1 0x1d0c +#define RADEON_PP_TEX_SIZE_2 0x1d14 +# define RADEON_TEX_USIZE_MASK (0x7ff << 0) +# define RADEON_TEX_USIZE_SHIFT 0 +# define RADEON_TEX_VSIZE_MASK (0x7ff << 16) +# define RADEON_TEX_VSIZE_SHIFT 16 +# define RADEON_SIGNED_RGB_MASK (1 << 30) +# define RADEON_SIGNED_RGB_SHIFT 30 +# define RADEON_SIGNED_ALPHA_MASK (1 << 31) +# define RADEON_SIGNED_ALPHA_SHIFT 31 +#define RADEON_PP_TEX_PITCH_0 0x1d08 /* NPOT */ +#define RADEON_PP_TEX_PITCH_1 0x1d10 /* NPOT */ +#define RADEON_PP_TEX_PITCH_2 0x1d18 /* NPOT */ +/* note: bits 13-5: 32 byte aligned stride of texture map */ + +#define RADEON_PP_TXCBLEND_0 0x1c60 +#define RADEON_PP_TXCBLEND_1 0x1c78 +#define RADEON_PP_TXCBLEND_2 0x1c90 +# define RADEON_COLOR_ARG_A_SHIFT 0 +# define RADEON_COLOR_ARG_A_MASK (0x1f << 0) +# define RADEON_COLOR_ARG_A_ZERO (0 << 0) +# define RADEON_COLOR_ARG_A_CURRENT_COLOR (2 << 0) +# define RADEON_COLOR_ARG_A_CURRENT_ALPHA (3 << 0) +# define RADEON_COLOR_ARG_A_DIFFUSE_COLOR (4 << 0) +# define RADEON_COLOR_ARG_A_DIFFUSE_ALPHA (5 << 0) +# define RADEON_COLOR_ARG_A_SPECULAR_COLOR (6 << 0) +# define RADEON_COLOR_ARG_A_SPECULAR_ALPHA (7 << 0) +# define RADEON_COLOR_ARG_A_TFACTOR_COLOR (8 << 0) +# define RADEON_COLOR_ARG_A_TFACTOR_ALPHA (9 << 0) +# define RADEON_COLOR_ARG_A_T0_COLOR (10 << 0) +# define RADEON_COLOR_ARG_A_T0_ALPHA (11 << 0) +# define RADEON_COLOR_ARG_A_T1_COLOR (12 << 0) +# define RADEON_COLOR_ARG_A_T1_ALPHA (13 << 0) +# define RADEON_COLOR_ARG_A_T2_COLOR (14 << 0) +# define RADEON_COLOR_ARG_A_T2_ALPHA (15 << 0) +# define RADEON_COLOR_ARG_A_T3_COLOR (16 << 0) +# define RADEON_COLOR_ARG_A_T3_ALPHA (17 << 0) +# define RADEON_COLOR_ARG_B_SHIFT 5 +# define RADEON_COLOR_ARG_B_MASK (0x1f << 5) +# define RADEON_COLOR_ARG_B_ZERO (0 << 5) +# define RADEON_COLOR_ARG_B_CURRENT_COLOR (2 << 5) +# define RADEON_COLOR_ARG_B_CURRENT_ALPHA (3 << 5) +# define RADEON_COLOR_ARG_B_DIFFUSE_COLOR (4 << 5) +# define RADEON_COLOR_ARG_B_DIFFUSE_ALPHA (5 << 5) +# define RADEON_COLOR_ARG_B_SPECULAR_COLOR (6 << 5) +# define RADEON_COLOR_ARG_B_SPECULAR_ALPHA (7 << 5) +# define RADEON_COLOR_ARG_B_TFACTOR_COLOR (8 << 5) +# define RADEON_COLOR_ARG_B_TFACTOR_ALPHA (9 << 5) +# define RADEON_COLOR_ARG_B_T0_COLOR (10 << 5) +# define RADEON_COLOR_ARG_B_T0_ALPHA (11 << 5) +# define RADEON_COLOR_ARG_B_T1_COLOR (12 << 5) +# define RADEON_COLOR_ARG_B_T1_ALPHA (13 << 5) +# define RADEON_COLOR_ARG_B_T2_COLOR (14 << 5) +# define RADEON_COLOR_ARG_B_T2_ALPHA (15 << 5) +# define RADEON_COLOR_ARG_B_T3_COLOR (16 << 5) +# define RADEON_COLOR_ARG_B_T3_ALPHA (17 << 5) +# define RADEON_COLOR_ARG_C_SHIFT 10 +# define RADEON_COLOR_ARG_C_MASK (0x1f << 10) +# define RADEON_COLOR_ARG_C_ZERO (0 << 10) +# define RADEON_COLOR_ARG_C_CURRENT_COLOR (2 << 10) +# define RADEON_COLOR_ARG_C_CURRENT_ALPHA (3 << 10) +# define RADEON_COLOR_ARG_C_DIFFUSE_COLOR (4 << 10) +# define RADEON_COLOR_ARG_C_DIFFUSE_ALPHA (5 << 10) +# define RADEON_COLOR_ARG_C_SPECULAR_COLOR (6 << 10) +# define RADEON_COLOR_ARG_C_SPECULAR_ALPHA (7 << 10) +# define RADEON_COLOR_ARG_C_TFACTOR_COLOR (8 << 10) +# define RADEON_COLOR_ARG_C_TFACTOR_ALPHA (9 << 10) +# define RADEON_COLOR_ARG_C_T0_COLOR (10 << 10) +# define RADEON_COLOR_ARG_C_T0_ALPHA (11 << 10) +# define RADEON_COLOR_ARG_C_T1_COLOR (12 << 10) +# define RADEON_COLOR_ARG_C_T1_ALPHA (13 << 10) +# define RADEON_COLOR_ARG_C_T2_COLOR (14 << 10) +# define RADEON_COLOR_ARG_C_T2_ALPHA (15 << 10) +# define RADEON_COLOR_ARG_C_T3_COLOR (16 << 10) +# define RADEON_COLOR_ARG_C_T3_ALPHA (17 << 10) +# define RADEON_COMP_ARG_A (1 << 15) +# define RADEON_COMP_ARG_A_SHIFT 15 +# define RADEON_COMP_ARG_B (1 << 16) +# define RADEON_COMP_ARG_B_SHIFT 16 +# define RADEON_COMP_ARG_C (1 << 17) +# define RADEON_COMP_ARG_C_SHIFT 17 +# define RADEON_BLEND_CTL_MASK (7 << 18) +# define RADEON_BLEND_CTL_ADD (0 << 18) +# define RADEON_BLEND_CTL_SUBTRACT (1 << 18) +# define RADEON_BLEND_CTL_ADDSIGNED (2 << 18) +# define RADEON_BLEND_CTL_BLEND (3 << 18) +# define RADEON_BLEND_CTL_DOT3 (4 << 18) +# define RADEON_SCALE_SHIFT 21 +# define RADEON_SCALE_MASK (3 << 21) +# define RADEON_SCALE_1X (0 << 21) +# define RADEON_SCALE_2X (1 << 21) +# define RADEON_SCALE_4X (2 << 21) +# define RADEON_CLAMP_TX (1 << 23) +# define RADEON_T0_EQ_TCUR (1 << 24) +# define RADEON_T1_EQ_TCUR (1 << 25) +# define RADEON_T2_EQ_TCUR (1 << 26) +# define RADEON_T3_EQ_TCUR (1 << 27) +# define RADEON_COLOR_ARG_MASK 0x1f +# define RADEON_COMP_ARG_SHIFT 15 +#define RADEON_PP_TXABLEND_0 0x1c64 +#define RADEON_PP_TXABLEND_1 0x1c7c +#define RADEON_PP_TXABLEND_2 0x1c94 +# define RADEON_ALPHA_ARG_A_SHIFT 0 +# define RADEON_ALPHA_ARG_A_MASK (0xf << 0) +# define RADEON_ALPHA_ARG_A_ZERO (0 << 0) +# define RADEON_ALPHA_ARG_A_CURRENT_ALPHA (1 << 0) +# define RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA (2 << 0) +# define RADEON_ALPHA_ARG_A_SPECULAR_ALPHA (3 << 0) +# define RADEON_ALPHA_ARG_A_TFACTOR_ALPHA (4 << 0) +# define RADEON_ALPHA_ARG_A_T0_ALPHA (5 << 0) +# define RADEON_ALPHA_ARG_A_T1_ALPHA (6 << 0) +# define RADEON_ALPHA_ARG_A_T2_ALPHA (7 << 0) +# define RADEON_ALPHA_ARG_A_T3_ALPHA (8 << 0) +# define RADEON_ALPHA_ARG_B_SHIFT 4 +# define RADEON_ALPHA_ARG_B_MASK (0xf << 4) +# define RADEON_ALPHA_ARG_B_ZERO (0 << 4) +# define RADEON_ALPHA_ARG_B_CURRENT_ALPHA (1 << 4) +# define RADEON_ALPHA_ARG_B_DIFFUSE_ALPHA (2 << 4) +# define RADEON_ALPHA_ARG_B_SPECULAR_ALPHA (3 << 4) +# define RADEON_ALPHA_ARG_B_TFACTOR_ALPHA (4 << 4) +# define RADEON_ALPHA_ARG_B_T0_ALPHA (5 << 4) +# define RADEON_ALPHA_ARG_B_T1_ALPHA (6 << 4) +# define RADEON_ALPHA_ARG_B_T2_ALPHA (7 << 4) +# define RADEON_ALPHA_ARG_B_T3_ALPHA (8 << 4) +# define RADEON_ALPHA_ARG_C_SHIFT 8 +# define RADEON_ALPHA_ARG_C_MASK (0xf << 8) +# define RADEON_ALPHA_ARG_C_ZERO (0 << 8) +# define RADEON_ALPHA_ARG_C_CURRENT_ALPHA (1 << 8) +# define RADEON_ALPHA_ARG_C_DIFFUSE_ALPHA (2 << 8) +# define RADEON_ALPHA_ARG_C_SPECULAR_ALPHA (3 << 8) +# define RADEON_ALPHA_ARG_C_TFACTOR_ALPHA (4 << 8) +# define RADEON_ALPHA_ARG_C_T0_ALPHA (5 << 8) +# define RADEON_ALPHA_ARG_C_T1_ALPHA (6 << 8) +# define RADEON_ALPHA_ARG_C_T2_ALPHA (7 << 8) +# define RADEON_ALPHA_ARG_C_T3_ALPHA (8 << 8) +# define RADEON_DOT_ALPHA_DONT_REPLICATE (1 << 9) +# define RADEON_ALPHA_ARG_MASK 0xf + +#define RADEON_PP_TFACTOR_0 0x1c68 +#define RADEON_PP_TFACTOR_1 0x1c80 +#define RADEON_PP_TFACTOR_2 0x1c98 + +#define RADEON_RB3D_BLENDCNTL 0x1c20 +# define RADEON_COMB_FCN_MASK (3 << 12) +# define RADEON_COMB_FCN_ADD_CLAMP (0 << 12) +# define RADEON_COMB_FCN_ADD_NOCLAMP (1 << 12) +# define RADEON_COMB_FCN_SUB_CLAMP (2 << 12) +# define RADEON_COMB_FCN_SUB_NOCLAMP (3 << 12) +# define RADEON_SRC_BLEND_GL_ZERO (32 << 16) +# define RADEON_SRC_BLEND_GL_ONE (33 << 16) +# define RADEON_SRC_BLEND_GL_SRC_COLOR (34 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16) +# define RADEON_SRC_BLEND_GL_DST_COLOR (36 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16) +# define RADEON_SRC_BLEND_GL_SRC_ALPHA (38 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16) +# define RADEON_SRC_BLEND_GL_DST_ALPHA (40 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16) +# define RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16) +# define RADEON_SRC_BLEND_MASK (63 << 16) +# define RADEON_DST_BLEND_GL_ZERO (32 << 24) +# define RADEON_DST_BLEND_GL_ONE (33 << 24) +# define RADEON_DST_BLEND_GL_SRC_COLOR (34 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24) +# define RADEON_DST_BLEND_GL_DST_COLOR (36 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24) +# define RADEON_DST_BLEND_GL_SRC_ALPHA (38 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24) +# define RADEON_DST_BLEND_GL_DST_ALPHA (40 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24) +# define RADEON_DST_BLEND_MASK (63 << 24) +#define RADEON_RB3D_CNTL 0x1c3c +# define RADEON_ALPHA_BLEND_ENABLE (1 << 0) +# define RADEON_PLANE_MASK_ENABLE (1 << 1) +# define RADEON_DITHER_ENABLE (1 << 2) +# define RADEON_ROUND_ENABLE (1 << 3) +# define RADEON_SCALE_DITHER_ENABLE (1 << 4) +# define RADEON_DITHER_INIT (1 << 5) +# define RADEON_ROP_ENABLE (1 << 6) +# define RADEON_STENCIL_ENABLE (1 << 7) +# define RADEON_Z_ENABLE (1 << 8) +# define RADEON_DEPTH_XZ_OFFEST_ENABLE (1 << 9) +# define RADEON_COLOR_FORMAT_ARGB1555 (3 << 10) +# define RADEON_COLOR_FORMAT_RGB565 (4 << 10) +# define RADEON_COLOR_FORMAT_ARGB8888 (6 << 10) +# define RADEON_COLOR_FORMAT_RGB332 (7 << 10) +# define RADEON_COLOR_FORMAT_Y8 (8 << 10) +# define RADEON_COLOR_FORMAT_RGB8 (9 << 10) +# define RADEON_COLOR_FORMAT_YUV422_VYUY (11 << 10) +# define RADEON_COLOR_FORMAT_YUV422_YVYU (12 << 10) +# define RADEON_COLOR_FORMAT_aYUV444 (14 << 10) +# define RADEON_COLOR_FORMAT_ARGB4444 (15 << 10) +# define RADEON_CLRCMP_FLIP_ENABLE (1 << 14) +#define RADEON_RB3D_COLOROFFSET 0x1c40 +# define RADEON_COLOROFFSET_MASK 0xfffffff0 +#define RADEON_RB3D_COLORPITCH 0x1c48 +# define RADEON_COLORPITCH_MASK 0x000001ff8 +# define RADEON_COLOR_TILE_ENABLE (1 << 16) +# define RADEON_COLOR_MICROTILE_ENABLE (1 << 17) +# define RADEON_COLOR_ENDIAN_NO_SWAP (0 << 18) +# define RADEON_COLOR_ENDIAN_WORD_SWAP (1 << 18) +# define RADEON_COLOR_ENDIAN_DWORD_SWAP (2 << 18) +#define RADEON_RB3D_DEPTHOFFSET 0x1c24 +#define RADEON_RB3D_DEPTHPITCH 0x1c28 +# define RADEON_DEPTHPITCH_MASK 0x00001ff8 +# define RADEON_DEPTH_ENDIAN_NO_SWAP (0 << 18) +# define RADEON_DEPTH_ENDIAN_WORD_SWAP (1 << 18) +# define RADEON_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) +#define RADEON_RB3D_PLANEMASK 0x1d84 +#define RADEON_RB3D_ROPCNTL 0x1d80 +# define RADEON_ROP_MASK (15 << 8) +# define RADEON_ROP_CLEAR (0 << 8) +# define RADEON_ROP_NOR (1 << 8) +# define RADEON_ROP_AND_INVERTED (2 << 8) +# define RADEON_ROP_COPY_INVERTED (3 << 8) +# define RADEON_ROP_AND_REVERSE (4 << 8) +# define RADEON_ROP_INVERT (5 << 8) +# define RADEON_ROP_XOR (6 << 8) +# define RADEON_ROP_NAND (7 << 8) +# define RADEON_ROP_AND (8 << 8) +# define RADEON_ROP_EQUIV (9 << 8) +# define RADEON_ROP_NOOP (10 << 8) +# define RADEON_ROP_OR_INVERTED (11 << 8) +# define RADEON_ROP_COPY (12 << 8) +# define RADEON_ROP_OR_REVERSE (13 << 8) +# define RADEON_ROP_OR (14 << 8) +# define RADEON_ROP_SET (15 << 8) +#define RADEON_RB3D_STENCILREFMASK 0x1d7c +# define RADEON_STENCIL_REF_SHIFT 0 +# define RADEON_STENCIL_REF_MASK (0xff << 0) +# define RADEON_STENCIL_MASK_SHIFT 16 +# define RADEON_STENCIL_VALUE_MASK (0xff << 16) +# define RADEON_STENCIL_WRITEMASK_SHIFT 24 +# define RADEON_STENCIL_WRITE_MASK (0xff << 24) +#define RADEON_RB3D_ZSTENCILCNTL 0x1c2c +# define RADEON_DEPTH_FORMAT_MASK (0xf << 0) +# define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_INT_Z (4 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0) +# define RADEON_DEPTH_FORMAT_16BIT_FLOAT_W (7 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0) +# define RADEON_Z_TEST_NEVER (0 << 4) +# define RADEON_Z_TEST_LESS (1 << 4) +# define RADEON_Z_TEST_LEQUAL (2 << 4) +# define RADEON_Z_TEST_EQUAL (3 << 4) +# define RADEON_Z_TEST_GEQUAL (4 << 4) +# define RADEON_Z_TEST_GREATER (5 << 4) +# define RADEON_Z_TEST_NEQUAL (6 << 4) +# define RADEON_Z_TEST_ALWAYS (7 << 4) +# define RADEON_Z_TEST_MASK (7 << 4) +# define RADEON_STENCIL_TEST_NEVER (0 << 12) +# define RADEON_STENCIL_TEST_LESS (1 << 12) +# define RADEON_STENCIL_TEST_LEQUAL (2 << 12) +# define RADEON_STENCIL_TEST_EQUAL (3 << 12) +# define RADEON_STENCIL_TEST_GEQUAL (4 << 12) +# define RADEON_STENCIL_TEST_GREATER (5 << 12) +# define RADEON_STENCIL_TEST_NEQUAL (6 << 12) +# define RADEON_STENCIL_TEST_ALWAYS (7 << 12) +# define RADEON_STENCIL_TEST_MASK (0x7 << 12) +# define RADEON_STENCIL_FAIL_KEEP (0 << 16) +# define RADEON_STENCIL_FAIL_ZERO (1 << 16) +# define RADEON_STENCIL_FAIL_REPLACE (2 << 16) +# define RADEON_STENCIL_FAIL_INC (3 << 16) +# define RADEON_STENCIL_FAIL_DEC (4 << 16) +# define RADEON_STENCIL_FAIL_INVERT (5 << 16) +# define RADEON_STENCIL_FAIL_MASK (0x7 << 16) +# define RADEON_STENCIL_ZPASS_KEEP (0 << 20) +# define RADEON_STENCIL_ZPASS_ZERO (1 << 20) +# define RADEON_STENCIL_ZPASS_REPLACE (2 << 20) +# define RADEON_STENCIL_ZPASS_INC (3 << 20) +# define RADEON_STENCIL_ZPASS_DEC (4 << 20) +# define RADEON_STENCIL_ZPASS_INVERT (5 << 20) +# define RADEON_STENCIL_ZPASS_MASK (0x7 << 20) +# define RADEON_STENCIL_ZFAIL_KEEP (0 << 24) +# define RADEON_STENCIL_ZFAIL_ZERO (1 << 24) +# define RADEON_STENCIL_ZFAIL_REPLACE (2 << 24) +# define RADEON_STENCIL_ZFAIL_INC (3 << 24) +# define RADEON_STENCIL_ZFAIL_DEC (4 << 24) +# define RADEON_STENCIL_ZFAIL_INVERT (5 << 24) +# define RADEON_STENCIL_ZFAIL_MASK (0x7 << 24) +# define RADEON_Z_COMPRESSION_ENABLE (1 << 28) +# define RADEON_FORCE_Z_DIRTY (1 << 29) +# define RADEON_Z_WRITE_ENABLE (1 << 30) +#define RADEON_RE_LINE_PATTERN 0x1cd0 +# define RADEON_LINE_PATTERN_MASK 0x0000ffff +# define RADEON_LINE_REPEAT_COUNT_SHIFT 16 +# define RADEON_LINE_PATTERN_START_SHIFT 24 +# define RADEON_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28) +# define RADEON_LINE_PATTERN_BIG_BIT_ORDER (1 << 28) +# define RADEON_LINE_PATTERN_AUTO_RESET (1 << 29) +#define RADEON_RE_LINE_STATE 0x1cd4 +# define RADEON_LINE_CURRENT_PTR_SHIFT 0 +# define RADEON_LINE_CURRENT_COUNT_SHIFT 8 +#define RADEON_RE_MISC 0x26c4 +# define RADEON_STIPPLE_COORD_MASK 0x1f +# define RADEON_STIPPLE_X_OFFSET_SHIFT 0 +# define RADEON_STIPPLE_X_OFFSET_MASK (0x1f << 0) +# define RADEON_STIPPLE_Y_OFFSET_SHIFT 8 +# define RADEON_STIPPLE_Y_OFFSET_MASK (0x1f << 8) +# define RADEON_STIPPLE_LITTLE_BIT_ORDER (0 << 16) +# define RADEON_STIPPLE_BIG_BIT_ORDER (1 << 16) +#define RADEON_RE_SOLID_COLOR 0x1c1c +#define RADEON_RE_TOP_LEFT 0x26c0 +# define RADEON_RE_LEFT_SHIFT 0 +# define RADEON_RE_TOP_SHIFT 16 +#define RADEON_RE_WIDTH_HEIGHT 0x1c44 +# define RADEON_RE_WIDTH_SHIFT 0 +# define RADEON_RE_HEIGHT_SHIFT 16 + +#define RADEON_SE_CNTL 0x1c4c +# define RADEON_FFACE_CULL_CW (0 << 0) +# define RADEON_FFACE_CULL_CCW (1 << 0) +# define RADEON_FFACE_CULL_DIR_MASK (1 << 0) +# define RADEON_BFACE_CULL (0 << 1) +# define RADEON_BFACE_SOLID (3 << 1) +# define RADEON_FFACE_CULL (0 << 3) +# define RADEON_FFACE_SOLID (3 << 3) +# define RADEON_FFACE_CULL_MASK (3 << 3) +# define RADEON_BADVTX_CULL_DISABLE (1 << 5) +# define RADEON_FLAT_SHADE_VTX_0 (0 << 6) +# define RADEON_FLAT_SHADE_VTX_1 (1 << 6) +# define RADEON_FLAT_SHADE_VTX_2 (2 << 6) +# define RADEON_FLAT_SHADE_VTX_LAST (3 << 6) +# define RADEON_DIFFUSE_SHADE_SOLID (0 << 8) +# define RADEON_DIFFUSE_SHADE_FLAT (1 << 8) +# define RADEON_DIFFUSE_SHADE_GOURAUD (2 << 8) +# define RADEON_DIFFUSE_SHADE_MASK (3 << 8) +# define RADEON_ALPHA_SHADE_SOLID (0 << 10) +# define RADEON_ALPHA_SHADE_FLAT (1 << 10) +# define RADEON_ALPHA_SHADE_GOURAUD (2 << 10) +# define RADEON_ALPHA_SHADE_MASK (3 << 10) +# define RADEON_SPECULAR_SHADE_SOLID (0 << 12) +# define RADEON_SPECULAR_SHADE_FLAT (1 << 12) +# define RADEON_SPECULAR_SHADE_GOURAUD (2 << 12) +# define RADEON_SPECULAR_SHADE_MASK (3 << 12) +# define RADEON_FOG_SHADE_SOLID (0 << 14) +# define RADEON_FOG_SHADE_FLAT (1 << 14) +# define RADEON_FOG_SHADE_GOURAUD (2 << 14) +# define RADEON_FOG_SHADE_MASK (3 << 14) +# define RADEON_ZBIAS_ENABLE_POINT (1 << 16) +# define RADEON_ZBIAS_ENABLE_LINE (1 << 17) +# define RADEON_ZBIAS_ENABLE_TRI (1 << 18) +# define RADEON_WIDELINE_ENABLE (1 << 20) +# define RADEON_VPORT_XY_XFORM_ENABLE (1 << 24) +# define RADEON_VPORT_Z_XFORM_ENABLE (1 << 25) +# define RADEON_VTX_PIX_CENTER_D3D (0 << 27) +# define RADEON_VTX_PIX_CENTER_OGL (1 << 27) +# define RADEON_ROUND_MODE_TRUNC (0 << 28) +# define RADEON_ROUND_MODE_ROUND (1 << 28) +# define RADEON_ROUND_MODE_ROUND_EVEN (2 << 28) +# define RADEON_ROUND_MODE_ROUND_ODD (3 << 28) +# define RADEON_ROUND_PREC_16TH_PIX (0 << 30) +# define RADEON_ROUND_PREC_8TH_PIX (1 << 30) +# define RADEON_ROUND_PREC_4TH_PIX (2 << 30) +# define RADEON_ROUND_PREC_HALF_PIX (3 << 30) +#define R200_RE_CNTL 0x1c50 +# define R200_STIPPLE_ENABLE 0x1 +# define R200_SCISSOR_ENABLE 0x2 +# define R200_PATTERN_ENABLE 0x4 +# define R200_PERSPECTIVE_ENABLE 0x8 +# define R200_POINT_SMOOTH 0x20 +# define R200_VTX_STQ0_D3D 0x00010000 +# define R200_VTX_STQ1_D3D 0x00040000 +# define R200_VTX_STQ2_D3D 0x00100000 +# define R200_VTX_STQ3_D3D 0x00400000 +# define R200_VTX_STQ4_D3D 0x01000000 +# define R200_VTX_STQ5_D3D 0x04000000 +#define RADEON_SE_CNTL_STATUS 0x2140 +# define RADEON_VC_NO_SWAP (0 << 0) +# define RADEON_VC_16BIT_SWAP (1 << 0) +# define RADEON_VC_32BIT_SWAP (2 << 0) +# define RADEON_VC_HALF_DWORD_SWAP (3 << 0) +# define RADEON_TCL_BYPASS (1 << 8) +#define RADEON_SE_COORD_FMT 0x1c50 +# define RADEON_VTX_XY_PRE_MULT_1_OVER_W0 (1 << 0) +# define RADEON_VTX_Z_PRE_MULT_1_OVER_W0 (1 << 1) +# define RADEON_VTX_ST0_NONPARAMETRIC (1 << 8) +# define RADEON_VTX_ST1_NONPARAMETRIC (1 << 9) +# define RADEON_VTX_ST2_NONPARAMETRIC (1 << 10) +# define RADEON_VTX_ST3_NONPARAMETRIC (1 << 11) +# define RADEON_VTX_W0_NORMALIZE (1 << 12) +# define RADEON_VTX_W0_IS_NOT_1_OVER_W0 (1 << 16) +# define RADEON_VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17) +# define RADEON_VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19) +# define RADEON_VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21) +# define RADEON_VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23) +# define RADEON_TEX1_W_ROUTING_USE_W0 (0 << 26) +# define RADEON_TEX1_W_ROUTING_USE_Q1 (1 << 26) +#define RADEON_SE_LINE_WIDTH 0x1db8 +#define RADEON_SE_TCL_LIGHT_MODEL_CTL 0x226c +# define RADEON_LIGHTING_ENABLE (1 << 0) +# define RADEON_LIGHT_IN_MODELSPACE (1 << 1) +# define RADEON_LOCAL_VIEWER (1 << 2) +# define RADEON_NORMALIZE_NORMALS (1 << 3) +# define RADEON_RESCALE_NORMALS (1 << 4) +# define RADEON_SPECULAR_LIGHTS (1 << 5) +# define RADEON_DIFFUSE_SPECULAR_COMBINE (1 << 6) +# define RADEON_LIGHT_ALPHA (1 << 7) +# define RADEON_LOCAL_LIGHT_VEC_GL (1 << 8) +# define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9) +# define RADEON_LM_SOURCE_STATE_PREMULT 0 +# define RADEON_LM_SOURCE_STATE_MULT 1 +# define RADEON_LM_SOURCE_VERTEX_DIFFUSE 2 +# define RADEON_LM_SOURCE_VERTEX_SPECULAR 3 +# define RADEON_EMISSIVE_SOURCE_SHIFT 16 +# define RADEON_AMBIENT_SOURCE_SHIFT 18 +# define RADEON_DIFFUSE_SOURCE_SHIFT 20 +# define RADEON_SPECULAR_SOURCE_SHIFT 22 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_RED 0x2220 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA 0x222c +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_RED 0x2230 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN 0x2234 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE 0x2238 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA 0x223c +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED 0x2210 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE 0x2218 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c +#define RADEON_SE_TCL_MATERIAL_SPECULAR_RED 0x2240 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN 0x2244 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c +#define RADEON_SE_TCL_MATRIX_SELECT_0 0x225c +# define RADEON_MODELVIEW_0_SHIFT 0 +# define RADEON_MODELVIEW_1_SHIFT 4 +# define RADEON_MODELVIEW_2_SHIFT 8 +# define RADEON_MODELVIEW_3_SHIFT 12 +# define RADEON_IT_MODELVIEW_0_SHIFT 16 +# define RADEON_IT_MODELVIEW_1_SHIFT 20 +# define RADEON_IT_MODELVIEW_2_SHIFT 24 +# define RADEON_IT_MODELVIEW_3_SHIFT 28 +#define RADEON_SE_TCL_MATRIX_SELECT_1 0x2260 +# define RADEON_MODELPROJECT_0_SHIFT 0 +# define RADEON_MODELPROJECT_1_SHIFT 4 +# define RADEON_MODELPROJECT_2_SHIFT 8 +# define RADEON_MODELPROJECT_3_SHIFT 12 +# define RADEON_TEXMAT_0_SHIFT 16 +# define RADEON_TEXMAT_1_SHIFT 20 +# define RADEON_TEXMAT_2_SHIFT 24 +# define RADEON_TEXMAT_3_SHIFT 28 + + +#define RADEON_SE_TCL_OUTPUT_VTX_FMT 0x2254 +# define RADEON_TCL_VTX_W0 (1 << 0) +# define RADEON_TCL_VTX_FP_DIFFUSE (1 << 1) +# define RADEON_TCL_VTX_FP_ALPHA (1 << 2) +# define RADEON_TCL_VTX_PK_DIFFUSE (1 << 3) +# define RADEON_TCL_VTX_FP_SPEC (1 << 4) +# define RADEON_TCL_VTX_FP_FOG (1 << 5) +# define RADEON_TCL_VTX_PK_SPEC (1 << 6) +# define RADEON_TCL_VTX_ST0 (1 << 7) +# define RADEON_TCL_VTX_ST1 (1 << 8) +# define RADEON_TCL_VTX_Q1 (1 << 9) +# define RADEON_TCL_VTX_ST2 (1 << 10) +# define RADEON_TCL_VTX_Q2 (1 << 11) +# define RADEON_TCL_VTX_ST3 (1 << 12) +# define RADEON_TCL_VTX_Q3 (1 << 13) +# define RADEON_TCL_VTX_Q0 (1 << 14) +# define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15 +# define RADEON_TCL_VTX_NORM0 (1 << 18) +# define RADEON_TCL_VTX_XY1 (1 << 27) +# define RADEON_TCL_VTX_Z1 (1 << 28) +# define RADEON_TCL_VTX_W1 (1 << 29) +# define RADEON_TCL_VTX_NORM1 (1 << 30) +# define RADEON_TCL_VTX_Z0 (1 << 31) + +#define RADEON_SE_TCL_OUTPUT_VTX_SEL 0x2258 +# define RADEON_TCL_COMPUTE_XYZW (1 << 0) +# define RADEON_TCL_COMPUTE_DIFFUSE (1 << 1) +# define RADEON_TCL_COMPUTE_SPECULAR (1 << 2) +# define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3) +# define RADEON_TCL_FORCE_INORDER_PROC (1 << 4) +# define RADEON_TCL_TEX_INPUT_TEX_0 0 +# define RADEON_TCL_TEX_INPUT_TEX_1 1 +# define RADEON_TCL_TEX_INPUT_TEX_2 2 +# define RADEON_TCL_TEX_INPUT_TEX_3 3 +# define RADEON_TCL_TEX_COMPUTED_TEX_0 8 +# define RADEON_TCL_TEX_COMPUTED_TEX_1 9 +# define RADEON_TCL_TEX_COMPUTED_TEX_2 10 +# define RADEON_TCL_TEX_COMPUTED_TEX_3 11 +# define RADEON_TCL_TEX_0_OUTPUT_SHIFT 16 +# define RADEON_TCL_TEX_1_OUTPUT_SHIFT 20 +# define RADEON_TCL_TEX_2_OUTPUT_SHIFT 24 +# define RADEON_TCL_TEX_3_OUTPUT_SHIFT 28 + +#define RADEON_SE_TCL_PER_LIGHT_CTL_0 0x2270 +# define RADEON_LIGHT_0_ENABLE (1 << 0) +# define RADEON_LIGHT_0_ENABLE_AMBIENT (1 << 1) +# define RADEON_LIGHT_0_ENABLE_SPECULAR (1 << 2) +# define RADEON_LIGHT_0_IS_LOCAL (1 << 3) +# define RADEON_LIGHT_0_IS_SPOT (1 << 4) +# define RADEON_LIGHT_0_DUAL_CONE (1 << 5) +# define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6) +# define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7) +# define RADEON_LIGHT_0_SHIFT 0 +# define RADEON_LIGHT_1_ENABLE (1 << 16) +# define RADEON_LIGHT_1_ENABLE_AMBIENT (1 << 17) +# define RADEON_LIGHT_1_ENABLE_SPECULAR (1 << 18) +# define RADEON_LIGHT_1_IS_LOCAL (1 << 19) +# define RADEON_LIGHT_1_IS_SPOT (1 << 20) +# define RADEON_LIGHT_1_DUAL_CONE (1 << 21) +# define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22) +# define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23) +# define RADEON_LIGHT_1_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_1 0x2274 +# define RADEON_LIGHT_2_SHIFT 0 +# define RADEON_LIGHT_3_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_2 0x2278 +# define RADEON_LIGHT_4_SHIFT 0 +# define RADEON_LIGHT_5_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_3 0x227c +# define RADEON_LIGHT_6_SHIFT 0 +# define RADEON_LIGHT_7_SHIFT 16 + +#define RADEON_SE_TCL_SHININESS 0x2250 + +#define RADEON_SE_TCL_TEXTURE_PROC_CTL 0x2268 +# define RADEON_TEXGEN_TEXMAT_0_ENABLE (1 << 0) +# define RADEON_TEXGEN_TEXMAT_1_ENABLE (1 << 1) +# define RADEON_TEXGEN_TEXMAT_2_ENABLE (1 << 2) +# define RADEON_TEXGEN_TEXMAT_3_ENABLE (1 << 3) +# define RADEON_TEXMAT_0_ENABLE (1 << 4) +# define RADEON_TEXMAT_1_ENABLE (1 << 5) +# define RADEON_TEXMAT_2_ENABLE (1 << 6) +# define RADEON_TEXMAT_3_ENABLE (1 << 7) +# define RADEON_TEXGEN_INPUT_MASK 0xf +# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0 +# define RADEON_TEXGEN_INPUT_TEXCOORD_1 1 +# define RADEON_TEXGEN_INPUT_TEXCOORD_2 2 +# define RADEON_TEXGEN_INPUT_TEXCOORD_3 3 +# define RADEON_TEXGEN_INPUT_OBJ 4 +# define RADEON_TEXGEN_INPUT_EYE 5 +# define RADEON_TEXGEN_INPUT_EYE_NORMAL 6 +# define RADEON_TEXGEN_INPUT_EYE_REFLECT 7 +# define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8 +# define RADEON_TEXGEN_0_INPUT_SHIFT 16 +# define RADEON_TEXGEN_1_INPUT_SHIFT 20 +# define RADEON_TEXGEN_2_INPUT_SHIFT 24 +# define RADEON_TEXGEN_3_INPUT_SHIFT 28 + +#define RADEON_SE_TCL_UCP_VERT_BLEND_CTL 0x2264 +# define RADEON_UCP_IN_CLIP_SPACE (1 << 0) +# define RADEON_UCP_IN_MODEL_SPACE (1 << 1) +# define RADEON_UCP_ENABLE_0 (1 << 2) +# define RADEON_UCP_ENABLE_1 (1 << 3) +# define RADEON_UCP_ENABLE_2 (1 << 4) +# define RADEON_UCP_ENABLE_3 (1 << 5) +# define RADEON_UCP_ENABLE_4 (1 << 6) +# define RADEON_UCP_ENABLE_5 (1 << 7) +# define RADEON_TCL_FOG_MASK (3 << 8) +# define RADEON_TCL_FOG_DISABLE (0 << 8) +# define RADEON_TCL_FOG_EXP (1 << 8) +# define RADEON_TCL_FOG_EXP2 (2 << 8) +# define RADEON_TCL_FOG_LINEAR (3 << 8) +# define RADEON_RNG_BASED_FOG (1 << 10) +# define RADEON_LIGHT_TWOSIDE (1 << 11) +# define RADEON_BLEND_OP_COUNT_MASK (7 << 12) +# define RADEON_BLEND_OP_COUNT_SHIFT 12 +# define RADEON_POSITION_BLEND_OP_ENABLE (1 << 16) +# define RADEON_NORMAL_BLEND_OP_ENABLE (1 << 17) +# define RADEON_VERTEX_BLEND_SRC_0_PRIMARY (1 << 18) +# define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18) +# define RADEON_VERTEX_BLEND_SRC_1_PRIMARY (1 << 19) +# define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19) +# define RADEON_VERTEX_BLEND_SRC_2_PRIMARY (1 << 20) +# define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20) +# define RADEON_VERTEX_BLEND_SRC_3_PRIMARY (1 << 21) +# define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21) +# define RADEON_VERTEX_BLEND_WGT_MINUS_ONE (1 << 22) +# define RADEON_CULL_FRONT_IS_CW (0 << 28) +# define RADEON_CULL_FRONT_IS_CCW (1 << 28) +# define RADEON_CULL_FRONT (1 << 29) +# define RADEON_CULL_BACK (1 << 30) +# define RADEON_FORCE_W_TO_ONE (1 << 31) + +#define RADEON_SE_VPORT_XSCALE 0x1d98 +#define RADEON_SE_VPORT_XOFFSET 0x1d9c +#define RADEON_SE_VPORT_YSCALE 0x1da0 +#define RADEON_SE_VPORT_YOFFSET 0x1da4 +#define RADEON_SE_VPORT_ZSCALE 0x1da8 +#define RADEON_SE_VPORT_ZOFFSET 0x1dac +#define RADEON_SE_ZBIAS_FACTOR 0x1db0 +#define RADEON_SE_ZBIAS_CONSTANT 0x1db4 + +#define RADEON_SE_VTX_FMT 0x2080 +# define RADEON_SE_VTX_FMT_XY 0x00000000 +# define RADEON_SE_VTX_FMT_W0 0x00000001 +# define RADEON_SE_VTX_FMT_FPCOLOR 0x00000002 +# define RADEON_SE_VTX_FMT_FPALPHA 0x00000004 +# define RADEON_SE_VTX_FMT_PKCOLOR 0x00000008 +# define RADEON_SE_VTX_FMT_FPSPEC 0x00000010 +# define RADEON_SE_VTX_FMT_FPFOG 0x00000020 +# define RADEON_SE_VTX_FMT_PKSPEC 0x00000040 +# define RADEON_SE_VTX_FMT_ST0 0x00000080 +# define RADEON_SE_VTX_FMT_ST1 0x00000100 +# define RADEON_SE_VTX_FMT_Q1 0x00000200 +# define RADEON_SE_VTX_FMT_ST2 0x00000400 +# define RADEON_SE_VTX_FMT_Q2 0x00000800 +# define RADEON_SE_VTX_FMT_ST3 0x00001000 +# define RADEON_SE_VTX_FMT_Q3 0x00002000 +# define RADEON_SE_VTX_FMT_Q0 0x00004000 +# define RADEON_SE_VTX_FMT_BLND_WEIGHT_CNT_MASK 0x00038000 +# define RADEON_SE_VTX_FMT_N0 0x00040000 +# define RADEON_SE_VTX_FMT_XY1 0x08000000 +# define RADEON_SE_VTX_FMT_Z1 0x10000000 +# define RADEON_SE_VTX_FMT_W1 0x20000000 +# define RADEON_SE_VTX_FMT_N1 0x40000000 +# define RADEON_SE_VTX_FMT_Z 0x80000000 + +#define RADEON_SE_VF_CNTL 0x2084 +# define RADEON_VF_PRIM_TYPE_POINT_LIST 1 +# define RADEON_VF_PRIM_TYPE_LINE_LIST 2 +# define RADEON_VF_PRIM_TYPE_LINE_STRIP 3 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_LIST 4 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_FAN 5 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_STRIP 6 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_FLAG 7 +# define RADEON_VF_PRIM_TYPE_RECTANGLE_LIST 8 +# define RADEON_VF_PRIM_TYPE_POINT_LIST_3 9 +# define RADEON_VF_PRIM_TYPE_LINE_LIST_3 10 +# define RADEON_VF_PRIM_TYPE_SPIRIT_LIST 11 +# define RADEON_VF_PRIM_TYPE_LINE_LOOP 12 +# define RADEON_VF_PRIM_TYPE_QUAD_LIST 13 +# define RADEON_VF_PRIM_TYPE_QUAD_STRIP 14 +# define RADEON_VF_PRIM_TYPE_POLYGON 15 +# define RADEON_VF_PRIM_WALK_STATE (0<<4) +# define RADEON_VF_PRIM_WALK_INDEX (1<<4) +# define RADEON_VF_PRIM_WALK_LIST (2<<4) +# define RADEON_VF_PRIM_WALK_DATA (3<<4) +# define RADEON_VF_COLOR_ORDER_RGBA (1<<6) +# define RADEON_VF_RADEON_MODE (1<<8) +# define RADEON_VF_TCL_OUTPUT_CTL_ENA (1<<9) +# define RADEON_VF_PROG_STREAM_ENA (1<<10) +# define RADEON_VF_INDEX_SIZE_SHIFT 11 +# define RADEON_VF_NUM_VERTICES_SHIFT 16 + +#define RADEON_SE_PORT_DATA0 0x2000 + +#define R200_SE_VAP_CNTL 0x2080 +# define R200_VAP_TCL_ENABLE 0x00000001 +# define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010 +# define R200_VAP_FORCE_W_TO_ONE 0x00010000 +# define R200_VAP_D3D_TEX_DEFAULT 0x00020000 +# define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18 +# define R200_VAP_VF_MAX_VTX_NUM (9 << 18) +# define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000 +#define R200_VF_MAX_VTX_INDX 0x210c +#define R200_VF_MIN_VTX_INDX 0x2110 +#define R200_SE_VTE_CNTL 0x20b0 +# define R200_VPORT_X_SCALE_ENA 0x00000001 +# define R200_VPORT_X_OFFSET_ENA 0x00000002 +# define R200_VPORT_Y_SCALE_ENA 0x00000004 +# define R200_VPORT_Y_OFFSET_ENA 0x00000008 +# define R200_VPORT_Z_SCALE_ENA 0x00000010 +# define R200_VPORT_Z_OFFSET_ENA 0x00000020 +# define R200_VTX_XY_FMT 0x00000100 +# define R200_VTX_Z_FMT 0x00000200 +# define R200_VTX_W0_FMT 0x00000400 +# define R200_VTX_W0_NORMALIZE 0x00000800 +# define R200_VTX_ST_DENORMALIZED 0x00001000 +#define R200_SE_VAP_CNTL_STATUS 0x2140 +# define R200_VC_NO_SWAP (0 << 0) +# define R200_VC_16BIT_SWAP (1 << 0) +# define R200_VC_32BIT_SWAP (2 << 0) +#define R200_PP_TXFILTER_0 0x2c00 +#define R200_PP_TXFILTER_1 0x2c20 +#define R200_PP_TXFILTER_2 0x2c40 +#define R200_PP_TXFILTER_3 0x2c60 +#define R200_PP_TXFILTER_4 0x2c80 +#define R200_PP_TXFILTER_5 0x2ca0 +# define R200_MAG_FILTER_NEAREST (0 << 0) +# define R200_MAG_FILTER_LINEAR (1 << 0) +# define R200_MAG_FILTER_MASK (1 << 0) +# define R200_MIN_FILTER_NEAREST (0 << 1) +# define R200_MIN_FILTER_LINEAR (1 << 1) +# define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) +# define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) +# define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) +# define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST (8 << 1) +# define R200_MIN_FILTER_ANISO_LINEAR (9 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) +# define R200_MIN_FILTER_MASK (15 << 1) +# define R200_MAX_ANISO_1_TO_1 (0 << 5) +# define R200_MAX_ANISO_2_TO_1 (1 << 5) +# define R200_MAX_ANISO_4_TO_1 (2 << 5) +# define R200_MAX_ANISO_8_TO_1 (3 << 5) +# define R200_MAX_ANISO_16_TO_1 (4 << 5) +# define R200_MAX_ANISO_MASK (7 << 5) +# define R200_MAX_MIP_LEVEL_MASK (0x0f << 16) +# define R200_MAX_MIP_LEVEL_SHIFT 16 +# define R200_YUV_TO_RGB (1 << 20) +# define R200_YUV_TEMPERATURE_COOL (0 << 21) +# define R200_YUV_TEMPERATURE_HOT (1 << 21) +# define R200_YUV_TEMPERATURE_MASK (1 << 21) +# define R200_WRAPEN_S (1 << 22) +# define R200_CLAMP_S_WRAP (0 << 23) +# define R200_CLAMP_S_MIRROR (1 << 23) +# define R200_CLAMP_S_CLAMP_LAST (2 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) +# define R200_CLAMP_S_CLAMP_BORDER (4 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) +# define R200_CLAMP_S_CLAMP_GL (6 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) +# define R200_CLAMP_S_MASK (7 << 23) +# define R200_WRAPEN_T (1 << 26) +# define R200_CLAMP_T_WRAP (0 << 27) +# define R200_CLAMP_T_MIRROR (1 << 27) +# define R200_CLAMP_T_CLAMP_LAST (2 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) +# define R200_CLAMP_T_CLAMP_BORDER (4 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) +# define R200_CLAMP_T_CLAMP_GL (6 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) +# define R200_CLAMP_T_MASK (7 << 27) +# define R200_KILL_LT_ZERO (1 << 30) +# define R200_BORDER_MODE_OGL (0 << 31) +# define R200_BORDER_MODE_D3D (1 << 31) +#define R200_PP_TXFORMAT_0 0x2c04 +#define R200_PP_TXFORMAT_1 0x2c24 +#define R200_PP_TXFORMAT_2 0x2c44 +#define R200_PP_TXFORMAT_3 0x2c64 +#define R200_PP_TXFORMAT_4 0x2c84 +#define R200_PP_TXFORMAT_5 0x2ca4 +# define R200_TXFORMAT_I8 (0 << 0) +# define R200_TXFORMAT_AI88 (1 << 0) +# define R200_TXFORMAT_RGB332 (2 << 0) +# define R200_TXFORMAT_ARGB1555 (3 << 0) +# define R200_TXFORMAT_RGB565 (4 << 0) +# define R200_TXFORMAT_ARGB4444 (5 << 0) +# define R200_TXFORMAT_ARGB8888 (6 << 0) +# define R200_TXFORMAT_RGBA8888 (7 << 0) +# define R200_TXFORMAT_Y8 (8 << 0) +# define R200_TXFORMAT_AVYU4444 (9 << 0) +# define R200_TXFORMAT_VYUY422 (10 << 0) +# define R200_TXFORMAT_YVYU422 (11 << 0) +# define R200_TXFORMAT_DXT1 (12 << 0) +# define R200_TXFORMAT_DXT23 (14 << 0) +# define R200_TXFORMAT_DXT45 (15 << 0) +# define R200_TXFORMAT_ABGR8888 (22 << 0) +# define R200_TXFORMAT_FORMAT_MASK (31 << 0) +# define R200_TXFORMAT_FORMAT_SHIFT 0 +# define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6) +# define R200_TXFORMAT_NON_POWER2 (1 << 7) +# define R200_TXFORMAT_WIDTH_MASK (15 << 8) +# define R200_TXFORMAT_WIDTH_SHIFT 8 +# define R200_TXFORMAT_HEIGHT_MASK (15 << 12) +# define R200_TXFORMAT_HEIGHT_SHIFT 12 +# define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */ +# define R200_TXFORMAT_F5_WIDTH_SHIFT 16 +# define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20) +# define R200_TXFORMAT_F5_HEIGHT_SHIFT 20 +# define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) +# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) +# define R200_TXFORMAT_ST_ROUTE_SHIFT 24 +# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) +# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) +# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) +#define R200_PP_TXFORMAT_X_0 0x2c08 +#define R200_PP_TXFORMAT_X_1 0x2c28 +#define R200_PP_TXFORMAT_X_2 0x2c48 +#define R200_PP_TXFORMAT_X_3 0x2c68 +#define R200_PP_TXFORMAT_X_4 0x2c88 +#define R200_PP_TXFORMAT_X_5 0x2ca8 + +#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */ +#define R200_PP_TXSIZE_1 0x2c2c /* NPOT only */ +#define R200_PP_TXSIZE_2 0x2c4c /* NPOT only */ +#define R200_PP_TXSIZE_3 0x2c6c /* NPOT only */ +#define R200_PP_TXSIZE_4 0x2c8c /* NPOT only */ +#define R200_PP_TXSIZE_5 0x2cac /* NPOT only */ + +#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */ +#define R200_PP_TXPITCH_1 0x2c30 /* NPOT only */ +#define R200_PP_TXPITCH_2 0x2c50 /* NPOT only */ +#define R200_PP_TXPITCH_3 0x2c70 /* NPOT only */ +#define R200_PP_TXPITCH_4 0x2c90 /* NPOT only */ +#define R200_PP_TXPITCH_5 0x2cb0 /* NPOT only */ + +#define R200_PP_TXOFFSET_0 0x2d00 +# define R200_TXO_ENDIAN_NO_SWAP (0 << 0) +# define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0) +# define R200_TXO_ENDIAN_WORD_SWAP (2 << 0) +# define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0) +# define R200_TXO_MACRO_LINEAR (0 << 2) +# define R200_TXO_MACRO_TILE (1 << 2) +# define R200_TXO_MICRO_LINEAR (0 << 3) +# define R200_TXO_MICRO_TILE (1 << 3) +# define R200_TXO_OFFSET_MASK 0xffffffe0 +# define R200_TXO_OFFSET_SHIFT 5 +#define R200_PP_TXOFFSET_1 0x2d18 +#define R200_PP_TXOFFSET_2 0x2d30 +#define R200_PP_TXOFFSET_3 0x2d48 +#define R200_PP_TXOFFSET_4 0x2d60 +#define R200_PP_TXOFFSET_5 0x2d78 + +#define R200_PP_TFACTOR_0 0x2ee0 +#define R200_PP_TFACTOR_1 0x2ee4 +#define R200_PP_TFACTOR_2 0x2ee8 +#define R200_PP_TFACTOR_3 0x2eec +#define R200_PP_TFACTOR_4 0x2ef0 +#define R200_PP_TFACTOR_5 0x2ef4 + +#define R200_PP_TXCBLEND_0 0x2f00 +# define R200_TXC_ARG_A_ZERO (0) +# define R200_TXC_ARG_A_CURRENT_COLOR (2) +# define R200_TXC_ARG_A_CURRENT_ALPHA (3) +# define R200_TXC_ARG_A_DIFFUSE_COLOR (4) +# define R200_TXC_ARG_A_DIFFUSE_ALPHA (5) +# define R200_TXC_ARG_A_SPECULAR_COLOR (6) +# define R200_TXC_ARG_A_SPECULAR_ALPHA (7) +# define R200_TXC_ARG_A_TFACTOR_COLOR (8) +# define R200_TXC_ARG_A_TFACTOR_ALPHA (9) +# define R200_TXC_ARG_A_R0_COLOR (10) +# define R200_TXC_ARG_A_R0_ALPHA (11) +# define R200_TXC_ARG_A_R1_COLOR (12) +# define R200_TXC_ARG_A_R1_ALPHA (13) +# define R200_TXC_ARG_A_R2_COLOR (14) +# define R200_TXC_ARG_A_R2_ALPHA (15) +# define R200_TXC_ARG_A_R3_COLOR (16) +# define R200_TXC_ARG_A_R3_ALPHA (17) +# define R200_TXC_ARG_A_R4_COLOR (18) +# define R200_TXC_ARG_A_R4_ALPHA (19) +# define R200_TXC_ARG_A_R5_COLOR (20) +# define R200_TXC_ARG_A_R5_ALPHA (21) +# define R200_TXC_ARG_A_TFACTOR1_COLOR (26) +# define R200_TXC_ARG_A_TFACTOR1_ALPHA (27) +# define R200_TXC_ARG_A_MASK (31 << 0) +# define R200_TXC_ARG_A_SHIFT 0 +# define R200_TXC_ARG_B_ZERO (0 << 5) +# define R200_TXC_ARG_B_CURRENT_COLOR (2 << 5) +# define R200_TXC_ARG_B_CURRENT_ALPHA (3 << 5) +# define R200_TXC_ARG_B_DIFFUSE_COLOR (4 << 5) +# define R200_TXC_ARG_B_DIFFUSE_ALPHA (5 << 5) +# define R200_TXC_ARG_B_SPECULAR_COLOR (6 << 5) +# define R200_TXC_ARG_B_SPECULAR_ALPHA (7 << 5) +# define R200_TXC_ARG_B_TFACTOR_COLOR (8 << 5) +# define R200_TXC_ARG_B_TFACTOR_ALPHA (9 << 5) +# define R200_TXC_ARG_B_R0_COLOR (10 << 5) +# define R200_TXC_ARG_B_R0_ALPHA (11 << 5) +# define R200_TXC_ARG_B_R1_COLOR (12 << 5) +# define R200_TXC_ARG_B_R1_ALPHA (13 << 5) +# define R200_TXC_ARG_B_R2_COLOR (14 << 5) +# define R200_TXC_ARG_B_R2_ALPHA (15 << 5) +# define R200_TXC_ARG_B_R3_COLOR (16 << 5) +# define R200_TXC_ARG_B_R3_ALPHA (17 << 5) +# define R200_TXC_ARG_B_R4_COLOR (18 << 5) +# define R200_TXC_ARG_B_R4_ALPHA (19 << 5) +# define R200_TXC_ARG_B_R5_COLOR (20 << 5) +# define R200_TXC_ARG_B_R5_ALPHA (21 << 5) +# define R200_TXC_ARG_B_TFACTOR1_COLOR (26 << 5) +# define R200_TXC_ARG_B_TFACTOR1_ALPHA (27 << 5) +# define R200_TXC_ARG_B_MASK (31 << 5) +# define R200_TXC_ARG_B_SHIFT 5 +# define R200_TXC_ARG_C_ZERO (0 << 10) +# define R200_TXC_ARG_C_CURRENT_COLOR (2 << 10) +# define R200_TXC_ARG_C_CURRENT_ALPHA (3 << 10) +# define R200_TXC_ARG_C_DIFFUSE_COLOR (4 << 10) +# define R200_TXC_ARG_C_DIFFUSE_ALPHA (5 << 10) +# define R200_TXC_ARG_C_SPECULAR_COLOR (6 << 10) +# define R200_TXC_ARG_C_SPECULAR_ALPHA (7 << 10) +# define R200_TXC_ARG_C_TFACTOR_COLOR (8 << 10) +# define R200_TXC_ARG_C_TFACTOR_ALPHA (9 << 10) +# define R200_TXC_ARG_C_R0_COLOR (10 << 10) +# define R200_TXC_ARG_C_R0_ALPHA (11 << 10) +# define R200_TXC_ARG_C_R1_COLOR (12 << 10) +# define R200_TXC_ARG_C_R1_ALPHA (13 << 10) +# define R200_TXC_ARG_C_R2_COLOR (14 << 10) +# define R200_TXC_ARG_C_R2_ALPHA (15 << 10) +# define R200_TXC_ARG_C_R3_COLOR (16 << 10) +# define R200_TXC_ARG_C_R3_ALPHA (17 << 10) +# define R200_TXC_ARG_C_R4_COLOR (18 << 10) +# define R200_TXC_ARG_C_R4_ALPHA (19 << 10) +# define R200_TXC_ARG_C_R5_COLOR (20 << 10) +# define R200_TXC_ARG_C_R5_ALPHA (21 << 10) +# define R200_TXC_ARG_C_TFACTOR1_COLOR (26 << 10) +# define R200_TXC_ARG_C_TFACTOR1_ALPHA (27 << 10) +# define R200_TXC_ARG_C_MASK (31 << 10) +# define R200_TXC_ARG_C_SHIFT 10 +# define R200_TXC_COMP_ARG_A (1 << 16) +# define R200_TXC_COMP_ARG_A_SHIFT (16) +# define R200_TXC_BIAS_ARG_A (1 << 17) +# define R200_TXC_SCALE_ARG_A (1 << 18) +# define R200_TXC_NEG_ARG_A (1 << 19) +# define R200_TXC_COMP_ARG_B (1 << 20) +# define R200_TXC_COMP_ARG_B_SHIFT (20) +# define R200_TXC_BIAS_ARG_B (1 << 21) +# define R200_TXC_SCALE_ARG_B (1 << 22) +# define R200_TXC_NEG_ARG_B (1 << 23) +# define R200_TXC_COMP_ARG_C (1 << 24) +# define R200_TXC_COMP_ARG_C_SHIFT (24) +# define R200_TXC_BIAS_ARG_C (1 << 25) +# define R200_TXC_SCALE_ARG_C (1 << 26) +# define R200_TXC_NEG_ARG_C (1 << 27) +# define R200_TXC_OP_MADD (0 << 28) +# define R200_TXC_OP_CND0 (2 << 28) +# define R200_TXC_OP_LERP (3 << 28) +# define R200_TXC_OP_DOT3 (4 << 28) +# define R200_TXC_OP_DOT4 (5 << 28) +# define R200_TXC_OP_CONDITIONAL (6 << 28) +# define R200_TXC_OP_DOT2_ADD (7 << 28) +# define R200_TXC_OP_MASK (7 << 28) +#define R200_PP_TXCBLEND2_0 0x2f04 +# define R200_TXC_TFACTOR_SEL_SHIFT 0 +# define R200_TXC_TFACTOR_SEL_MASK 0x7 +# define R200_TXC_TFACTOR1_SEL_SHIFT 4 +# define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4) +# define R200_TXC_SCALE_SHIFT 8 +# define R200_TXC_SCALE_MASK (7 << 8) +# define R200_TXC_SCALE_1X (0 << 8) +# define R200_TXC_SCALE_2X (1 << 8) +# define R200_TXC_SCALE_4X (2 << 8) +# define R200_TXC_SCALE_8X (3 << 8) +# define R200_TXC_SCALE_INV2 (5 << 8) +# define R200_TXC_SCALE_INV4 (6 << 8) +# define R200_TXC_SCALE_INV8 (7 << 8) +# define R200_TXC_CLAMP_SHIFT 12 +# define R200_TXC_CLAMP_MASK (3 << 12) +# define R200_TXC_CLAMP_WRAP (0 << 12) +# define R200_TXC_CLAMP_0_1 (1 << 12) +# define R200_TXC_CLAMP_8_8 (2 << 12) +# define R200_TXC_OUTPUT_REG_MASK (7 << 16) +# define R200_TXC_OUTPUT_REG_NONE (0 << 16) +# define R200_TXC_OUTPUT_REG_R0 (1 << 16) +# define R200_TXC_OUTPUT_REG_R1 (2 << 16) +# define R200_TXC_OUTPUT_REG_R2 (3 << 16) +# define R200_TXC_OUTPUT_REG_R3 (4 << 16) +# define R200_TXC_OUTPUT_REG_R4 (5 << 16) +# define R200_TXC_OUTPUT_REG_R5 (6 << 16) +# define R200_TXC_OUTPUT_MASK_MASK (7 << 20) +# define R200_TXC_OUTPUT_MASK_RGB (0 << 20) +# define R200_TXC_OUTPUT_MASK_RG (1 << 20) +# define R200_TXC_OUTPUT_MASK_RB (2 << 20) +# define R200_TXC_OUTPUT_MASK_R (3 << 20) +# define R200_TXC_OUTPUT_MASK_GB (4 << 20) +# define R200_TXC_OUTPUT_MASK_G (5 << 20) +# define R200_TXC_OUTPUT_MASK_B (6 << 20) +# define R200_TXC_OUTPUT_MASK_NONE (7 << 20) +# define R200_TXC_REPL_NORMAL 0 +# define R200_TXC_REPL_RED 1 +# define R200_TXC_REPL_GREEN 2 +# define R200_TXC_REPL_BLUE 3 +# define R200_TXC_REPL_ARG_A_SHIFT 26 +# define R200_TXC_REPL_ARG_A_MASK (3 << 26) +# define R200_TXC_REPL_ARG_B_SHIFT 28 +# define R200_TXC_REPL_ARG_B_MASK (3 << 28) +# define R200_TXC_REPL_ARG_C_SHIFT 30 +# define R200_TXC_REPL_ARG_C_MASK (3 << 30) +#define R200_PP_TXABLEND_0 0x2f08 +# define R200_TXA_ARG_A_ZERO (0) +# define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */ +# define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */ +# define R200_TXA_ARG_A_DIFFUSE_ALPHA (4) +# define R200_TXA_ARG_A_DIFFUSE_BLUE (5) +# define R200_TXA_ARG_A_SPECULAR_ALPHA (6) +# define R200_TXA_ARG_A_SPECULAR_BLUE (7) +# define R200_TXA_ARG_A_TFACTOR_ALPHA (8) +# define R200_TXA_ARG_A_TFACTOR_BLUE (9) +# define R200_TXA_ARG_A_R0_ALPHA (10) +# define R200_TXA_ARG_A_R0_BLUE (11) +# define R200_TXA_ARG_A_R1_ALPHA (12) +# define R200_TXA_ARG_A_R1_BLUE (13) +# define R200_TXA_ARG_A_R2_ALPHA (14) +# define R200_TXA_ARG_A_R2_BLUE (15) +# define R200_TXA_ARG_A_R3_ALPHA (16) +# define R200_TXA_ARG_A_R3_BLUE (17) +# define R200_TXA_ARG_A_R4_ALPHA (18) +# define R200_TXA_ARG_A_R4_BLUE (19) +# define R200_TXA_ARG_A_R5_ALPHA (20) +# define R200_TXA_ARG_A_R5_BLUE (21) +# define R200_TXA_ARG_A_TFACTOR1_ALPHA (26) +# define R200_TXA_ARG_A_TFACTOR1_BLUE (27) +# define R200_TXA_ARG_A_MASK (31 << 0) +# define R200_TXA_ARG_A_SHIFT 0 +# define R200_TXA_ARG_B_ZERO (0 << 5) +# define R200_TXA_ARG_B_CURRENT_ALPHA (2 << 5) /* guess */ +# define R200_TXA_ARG_B_CURRENT_BLUE (3 << 5) /* guess */ +# define R200_TXA_ARG_B_DIFFUSE_ALPHA (4 << 5) +# define R200_TXA_ARG_B_DIFFUSE_BLUE (5 << 5) +# define R200_TXA_ARG_B_SPECULAR_ALPHA (6 << 5) +# define R200_TXA_ARG_B_SPECULAR_BLUE (7 << 5) +# define R200_TXA_ARG_B_TFACTOR_ALPHA (8 << 5) +# define R200_TXA_ARG_B_TFACTOR_BLUE (9 << 5) +# define R200_TXA_ARG_B_R0_ALPHA (10 << 5) +# define R200_TXA_ARG_B_R0_BLUE (11 << 5) +# define R200_TXA_ARG_B_R1_ALPHA (12 << 5) +# define R200_TXA_ARG_B_R1_BLUE (13 << 5) +# define R200_TXA_ARG_B_R2_ALPHA (14 << 5) +# define R200_TXA_ARG_B_R2_BLUE (15 << 5) +# define R200_TXA_ARG_B_R3_ALPHA (16 << 5) +# define R200_TXA_ARG_B_R3_BLUE (17 << 5) +# define R200_TXA_ARG_B_R4_ALPHA (18 << 5) +# define R200_TXA_ARG_B_R4_BLUE (19 << 5) +# define R200_TXA_ARG_B_R5_ALPHA (20 << 5) +# define R200_TXA_ARG_B_R5_BLUE (21 << 5) +# define R200_TXA_ARG_B_TFACTOR1_ALPHA (26 << 5) +# define R200_TXA_ARG_B_TFACTOR1_BLUE (27 << 5) +# define R200_TXA_ARG_B_MASK (31 << 5) +# define R200_TXA_ARG_B_SHIFT 5 +# define R200_TXA_ARG_C_ZERO (0 << 10) +# define R200_TXA_ARG_C_CURRENT_ALPHA (2 << 10) /* guess */ +# define R200_TXA_ARG_C_CURRENT_BLUE (3 << 10) /* guess */ +# define R200_TXA_ARG_C_DIFFUSE_ALPHA (4 << 10) +# define R200_TXA_ARG_C_DIFFUSE_BLUE (5 << 10) +# define R200_TXA_ARG_C_SPECULAR_ALPHA (6 << 10) +# define R200_TXA_ARG_C_SPECULAR_BLUE (7 << 10) +# define R200_TXA_ARG_C_TFACTOR_ALPHA (8 << 10) +# define R200_TXA_ARG_C_TFACTOR_BLUE (9 << 10) +# define R200_TXA_ARG_C_R0_ALPHA (10 << 10) +# define R200_TXA_ARG_C_R0_BLUE (11 << 10) +# define R200_TXA_ARG_C_R1_ALPHA (12 << 10) +# define R200_TXA_ARG_C_R1_BLUE (13 << 10) +# define R200_TXA_ARG_C_R2_ALPHA (14 << 10) +# define R200_TXA_ARG_C_R2_BLUE (15 << 10) +# define R200_TXA_ARG_C_R3_ALPHA (16 << 10) +# define R200_TXA_ARG_C_R3_BLUE (17 << 10) +# define R200_TXA_ARG_C_R4_ALPHA (18 << 10) +# define R200_TXA_ARG_C_R4_BLUE (19 << 10) +# define R200_TXA_ARG_C_R5_ALPHA (20 << 10) +# define R200_TXA_ARG_C_R5_BLUE (21 << 10) +# define R200_TXA_ARG_C_TFACTOR1_ALPHA (26 << 10) +# define R200_TXA_ARG_C_TFACTOR1_BLUE (27 << 10) +# define R200_TXA_ARG_C_MASK (31 << 10) +# define R200_TXA_ARG_C_SHIFT 10 +# define R200_TXA_COMP_ARG_A (1 << 16) +# define R200_TXA_COMP_ARG_A_SHIFT (16) +# define R200_TXA_BIAS_ARG_A (1 << 17) +# define R200_TXA_SCALE_ARG_A (1 << 18) +# define R200_TXA_NEG_ARG_A (1 << 19) +# define R200_TXA_COMP_ARG_B (1 << 20) +# define R200_TXA_COMP_ARG_B_SHIFT (20) +# define R200_TXA_BIAS_ARG_B (1 << 21) +# define R200_TXA_SCALE_ARG_B (1 << 22) +# define R200_TXA_NEG_ARG_B (1 << 23) +# define R200_TXA_COMP_ARG_C (1 << 24) +# define R200_TXA_COMP_ARG_C_SHIFT (24) +# define R200_TXA_BIAS_ARG_C (1 << 25) +# define R200_TXA_SCALE_ARG_C (1 << 26) +# define R200_TXA_NEG_ARG_C (1 << 27) +# define R200_TXA_OP_MADD (0 << 28) +# define R200_TXA_OP_CND0 (2 << 28) +# define R200_TXA_OP_LERP (3 << 28) +# define R200_TXA_OP_CONDITIONAL (6 << 28) +# define R200_TXA_OP_MASK (7 << 28) +#define R200_PP_TXABLEND2_0 0x2f0c +# define R200_TXA_TFACTOR_SEL_SHIFT 0 +# define R200_TXA_TFACTOR_SEL_MASK 0x7 +# define R200_TXA_TFACTOR1_SEL_SHIFT 4 +# define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4) +# define R200_TXA_SCALE_SHIFT 8 +# define R200_TXA_SCALE_MASK (7 << 8) +# define R200_TXA_SCALE_1X (0 << 8) +# define R200_TXA_SCALE_2X (1 << 8) +# define R200_TXA_SCALE_4X (2 << 8) +# define R200_TXA_SCALE_8X (3 << 8) +# define R200_TXA_SCALE_INV2 (5 << 8) +# define R200_TXA_SCALE_INV4 (6 << 8) +# define R200_TXA_SCALE_INV8 (7 << 8) +# define R200_TXA_CLAMP_SHIFT 12 +# define R200_TXA_CLAMP_MASK (3 << 12) +# define R200_TXA_CLAMP_WRAP (0 << 12) +# define R200_TXA_CLAMP_0_1 (1 << 12) +# define R200_TXA_CLAMP_8_8 (2 << 12) +# define R200_TXA_OUTPUT_REG_MASK (7 << 16) +# define R200_TXA_OUTPUT_REG_NONE (0 << 16) +# define R200_TXA_OUTPUT_REG_R0 (1 << 16) +# define R200_TXA_OUTPUT_REG_R1 (2 << 16) +# define R200_TXA_OUTPUT_REG_R2 (3 << 16) +# define R200_TXA_OUTPUT_REG_R3 (4 << 16) +# define R200_TXA_OUTPUT_REG_R4 (5 << 16) +# define R200_TXA_OUTPUT_REG_R5 (6 << 16) +# define R200_TXA_DOT_ALPHA (1 << 20) +# define R200_TXA_REPL_NORMAL 0 +# define R200_TXA_REPL_RED 1 +# define R200_TXA_REPL_GREEN 2 +# define R200_TXA_REPL_ARG_A_SHIFT 26 +# define R200_TXA_REPL_ARG_A_MASK (3 << 26) +# define R200_TXA_REPL_ARG_B_SHIFT 28 +# define R200_TXA_REPL_ARG_B_MASK (3 << 28) +# define R200_TXA_REPL_ARG_C_SHIFT 30 +# define R200_TXA_REPL_ARG_C_MASK (3 << 30) + +#define R200_SE_VTX_FMT_0 0x2088 +# define R200_VTX_XY 0 /* always have xy */ +# define R200_VTX_Z0 (1<<0) +# define R200_VTX_W0 (1<<1) +# define R200_VTX_WEIGHT_COUNT_SHIFT (2) +# define R200_VTX_PV_MATRIX_SEL (1<<5) +# define R200_VTX_N0 (1<<6) +# define R200_VTX_POINT_SIZE (1<<7) +# define R200_VTX_DISCRETE_FOG (1<<8) +# define R200_VTX_SHININESS_0 (1<<9) +# define R200_VTX_SHININESS_1 (1<<10) +# define R200_VTX_COLOR_NOT_PRESENT 0 +# define R200_VTX_PK_RGBA 1 +# define R200_VTX_FP_RGB 2 +# define R200_VTX_FP_RGBA 3 +# define R200_VTX_COLOR_MASK 3 +# define R200_VTX_COLOR_0_SHIFT 11 +# define R200_VTX_COLOR_1_SHIFT 13 +# define R200_VTX_COLOR_2_SHIFT 15 +# define R200_VTX_COLOR_3_SHIFT 17 +# define R200_VTX_COLOR_4_SHIFT 19 +# define R200_VTX_COLOR_5_SHIFT 21 +# define R200_VTX_COLOR_6_SHIFT 23 +# define R200_VTX_COLOR_7_SHIFT 25 +# define R200_VTX_XY1 (1<<28) +# define R200_VTX_Z1 (1<<29) +# define R200_VTX_W1 (1<<30) +# define R200_VTX_N1 (1<<31) +#define R200_SE_VTX_FMT_1 0x208c +# define R200_VTX_TEX0_COMP_CNT_SHIFT 0 +# define R200_VTX_TEX1_COMP_CNT_SHIFT 3 +# define R200_VTX_TEX2_COMP_CNT_SHIFT 6 +# define R200_VTX_TEX3_COMP_CNT_SHIFT 9 +# define R200_VTX_TEX4_COMP_CNT_SHIFT 12 +# define R200_VTX_TEX5_COMP_CNT_SHIFT 15 + +#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 +#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 +#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250 +# define R200_OUTPUT_XYZW (1<<0) +# define R200_OUTPUT_COLOR_0 (1<<8) +# define R200_OUTPUT_COLOR_1 (1<<9) +# define R200_OUTPUT_TEX_0 (1<<16) +# define R200_OUTPUT_TEX_1 (1<<17) +# define R200_OUTPUT_TEX_2 (1<<18) +# define R200_OUTPUT_TEX_3 (1<<19) +# define R200_OUTPUT_TEX_4 (1<<20) +# define R200_OUTPUT_TEX_5 (1<<21) +# define R200_OUTPUT_TEX_MASK (0x3f<<16) +# define R200_OUTPUT_DISCRETE_FOG (1<<24) +# define R200_OUTPUT_PT_SIZE (1<<25) +# define R200_FORCE_INORDER_PROC (1<<31) +#define R200_PP_CNTL_X 0x2cc4 +#define R200_PP_TXMULTI_CTL_0 0x2c1c +#define R200_SE_VTX_STATE_CNTL 0x2180 +# define R200_UPDATE_USER_COLOR_0_ENA_MASK (1<<16) + + /* Registers for CP and Microcode Engine */ +#define RADEON_CP_ME_RAM_ADDR 0x07d4 +#define RADEON_CP_ME_RAM_RADDR 0x07d8 +#define RADEON_CP_ME_RAM_DATAH 0x07dc +#define RADEON_CP_ME_RAM_DATAL 0x07e0 + +#define RADEON_CP_RB_BASE 0x0700 +#define RADEON_CP_RB_CNTL 0x0704 +#define RADEON_CP_RB_RPTR_ADDR 0x070c +#define RADEON_CP_RB_RPTR 0x0710 +#define RADEON_CP_RB_WPTR 0x0714 + +#define RADEON_CP_IB_BASE 0x0738 +#define RADEON_CP_IB_BUFSZ 0x073c + +#define RADEON_CP_CSQ_CNTL 0x0740 +# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0) +# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28) +# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28) +# define RADEON_CSQ_PRIBM_INDDIS (2 << 28) +# define RADEON_CSQ_PRIPIO_INDBM (3 << 28) +# define RADEON_CSQ_PRIBM_INDBM (4 << 28) +# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28) +#define RADEON_CP_CSQ_STAT 0x07f8 +# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0) +# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8) +# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16) +# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24) +#define RADEON_CP_CSQ_ADDR 0x07f0 +#define RADEON_CP_CSQ_DATA 0x07f4 +#define RADEON_CP_CSQ_APER_PRIMARY 0x1000 +#define RADEON_CP_CSQ_APER_INDIRECT 0x1300 + +#define RADEON_CP_RB_WPTR_DELAY 0x0718 +# define RADEON_PRE_WRITE_TIMER_SHIFT 0 +# define RADEON_PRE_WRITE_LIMIT_SHIFT 23 + +#define RADEON_AIC_CNTL 0x01d0 +# define RADEON_PCIGART_TRANSLATE_EN (1 << 0) +#define RADEON_AIC_LO_ADDR 0x01dc + + + + /* Constants */ +#define RADEON_LAST_FRAME_REG RADEON_GUI_SCRATCH_REG0 +#define RADEON_LAST_CLEAR_REG RADEON_GUI_SCRATCH_REG2 + + + + /* CP packet types */ +#define RADEON_CP_PACKET0 0x00000000 +#define RADEON_CP_PACKET1 0x40000000 +#define RADEON_CP_PACKET2 0x80000000 +#define RADEON_CP_PACKET3 0xC0000000 +# define RADEON_CP_PACKET_MASK 0xC0000000 +# define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000 +# define RADEON_CP_PACKET_MAX_DWORDS (1 << 12) +# define RADEON_CP_PACKET0_REG_MASK 0x000007ff +# define RADEON_CP_PACKET1_REG0_MASK 0x000007ff +# define RADEON_CP_PACKET1_REG1_MASK 0x003ff800 + +#define RADEON_CP_PACKET0_ONE_REG_WR 0x00008000 + +#define RADEON_CP_PACKET3_NOP 0xC0001000 +#define RADEON_CP_PACKET3_NEXT_CHAR 0xC0001900 +#define RADEON_CP_PACKET3_PLY_NEXTSCAN 0xC0001D00 +#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00 +#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300 +#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400 +#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600 +#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800 +#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900 +#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00 +#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00 +#define R200_CP_PACKET3_3D_DRAW_IMMD_2 0xc0003500 +#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00 +#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100 +#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200 +#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300 +#define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400 +#define RADEON_CP_PACKET3_CNTL_POLYLINE 0xC0009500 +#define RADEON_CP_PACKET3_CNTL_POLYSCANLINES 0xC0009800 +#define RADEON_CP_PACKET3_CNTL_PAINT_MULTI 0xC0009A00 +#define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00 +#define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00 + + +#define RADEON_CP_VC_FRMT_XY 0x00000000 +#define RADEON_CP_VC_FRMT_W0 0x00000001 +#define RADEON_CP_VC_FRMT_FPCOLOR 0x00000002 +#define RADEON_CP_VC_FRMT_FPALPHA 0x00000004 +#define RADEON_CP_VC_FRMT_PKCOLOR 0x00000008 +#define RADEON_CP_VC_FRMT_FPSPEC 0x00000010 +#define RADEON_CP_VC_FRMT_FPFOG 0x00000020 +#define RADEON_CP_VC_FRMT_PKSPEC 0x00000040 +#define RADEON_CP_VC_FRMT_ST0 0x00000080 +#define RADEON_CP_VC_FRMT_ST1 0x00000100 +#define RADEON_CP_VC_FRMT_Q1 0x00000200 +#define RADEON_CP_VC_FRMT_ST2 0x00000400 +#define RADEON_CP_VC_FRMT_Q2 0x00000800 +#define RADEON_CP_VC_FRMT_ST3 0x00001000 +#define RADEON_CP_VC_FRMT_Q3 0x00002000 +#define RADEON_CP_VC_FRMT_Q0 0x00004000 +#define RADEON_CP_VC_FRMT_BLND_WEIGHT_CNT_MASK 0x00038000 +#define RADEON_CP_VC_FRMT_N0 0x00040000 +#define RADEON_CP_VC_FRMT_XY1 0x08000000 +#define RADEON_CP_VC_FRMT_Z1 0x10000000 +#define RADEON_CP_VC_FRMT_W1 0x20000000 +#define RADEON_CP_VC_FRMT_N1 0x40000000 +#define RADEON_CP_VC_FRMT_Z 0x80000000 + +#define RADEON_CP_VC_CNTL_PRIM_TYPE_NONE 0x00000000 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_POINT 0x00000001 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE 0x00000002 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP 0x00000003 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST 0x00000004 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN 0x00000005 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP 0x00000006 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_TYPE_2 0x00000007 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST 0x00000008 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST 0x00000009 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST 0x0000000a +#define RADEON_CP_VC_CNTL_PRIM_TYPE_QUAD_LIST 0x0000000d +#define RADEON_CP_VC_CNTL_PRIM_WALK_IND 0x00000010 +#define RADEON_CP_VC_CNTL_PRIM_WALK_LIST 0x00000020 +#define RADEON_CP_VC_CNTL_PRIM_WALK_RING 0x00000030 +#define RADEON_CP_VC_CNTL_COLOR_ORDER_BGRA 0x00000000 +#define RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA 0x00000040 +#define RADEON_CP_VC_CNTL_MAOS_ENABLE 0x00000080 +#define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE 0x00000000 +#define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE 0x00000100 +#define RADEON_CP_VC_CNTL_TCL_DISABLE 0x00000000 +#define RADEON_CP_VC_CNTL_TCL_ENABLE 0x00000200 +#define RADEON_CP_VC_CNTL_NUM_SHIFT 16 + +#define RADEON_VS_MATRIX_0_ADDR 0 +#define RADEON_VS_MATRIX_1_ADDR 4 +#define RADEON_VS_MATRIX_2_ADDR 8 +#define RADEON_VS_MATRIX_3_ADDR 12 +#define RADEON_VS_MATRIX_4_ADDR 16 +#define RADEON_VS_MATRIX_5_ADDR 20 +#define RADEON_VS_MATRIX_6_ADDR 24 +#define RADEON_VS_MATRIX_7_ADDR 28 +#define RADEON_VS_MATRIX_8_ADDR 32 +#define RADEON_VS_MATRIX_9_ADDR 36 +#define RADEON_VS_MATRIX_10_ADDR 40 +#define RADEON_VS_MATRIX_11_ADDR 44 +#define RADEON_VS_MATRIX_12_ADDR 48 +#define RADEON_VS_MATRIX_13_ADDR 52 +#define RADEON_VS_MATRIX_14_ADDR 56 +#define RADEON_VS_MATRIX_15_ADDR 60 +#define RADEON_VS_LIGHT_AMBIENT_ADDR 64 +#define RADEON_VS_LIGHT_DIFFUSE_ADDR 72 +#define RADEON_VS_LIGHT_SPECULAR_ADDR 80 +#define RADEON_VS_LIGHT_DIRPOS_ADDR 88 +#define RADEON_VS_LIGHT_HWVSPOT_ADDR 96 +#define RADEON_VS_LIGHT_ATTENUATION_ADDR 104 +#define RADEON_VS_MATRIX_EYE2CLIP_ADDR 112 +#define RADEON_VS_UCP_ADDR 116 +#define RADEON_VS_GLOBAL_AMBIENT_ADDR 122 +#define RADEON_VS_FOG_PARAM_ADDR 123 +#define RADEON_VS_EYE_VECTOR_ADDR 124 + +#define RADEON_SS_LIGHT_DCD_ADDR 0 +#define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR 8 +#define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR 16 +#define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR 24 +#define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR 32 +#define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR 48 +#define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR 49 +#define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR 50 +#define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 51 +#define RADEON_SS_SHININESS 60 + +#define RADEON_TV_MASTER_CNTL 0x0800 +# define RADEON_TV_ASYNC_RST (1 << 0) +# define RADEON_CRT_ASYNC_RST (1 << 1) +# define RADEON_RESTART_PHASE_FIX (1 << 3) +# define RADEON_TV_FIFO_ASYNC_RST (1 << 4) +# define RADEON_VIN_ASYNC_RST (1 << 5) +# define RADEON_AUD_ASYNC_RST (1 << 6) +# define RADEON_DVS_ASYNC_RST (1 << 7) +# define RADEON_CRT_FIFO_CE_EN (1 << 9) +# define RADEON_TV_FIFO_CE_EN (1 << 10) +# define RADEON_RE_SYNC_NOW_SEL_MASK (3 << 14) +# define RADEON_TVCLK_ALWAYS_ONb (1 << 30) +# define RADEON_TV_ON (1 << 31) +#define RADEON_TV_PRE_DAC_MUX_CNTL 0x0888 +# define RADEON_Y_RED_EN (1 << 0) +# define RADEON_C_GRN_EN (1 << 1) +# define RADEON_CMP_BLU_EN (1 << 2) +# define RADEON_DAC_DITHER_EN (1 << 3) +# define RADEON_RED_MX_FORCE_DAC_DATA (6 << 4) +# define RADEON_GRN_MX_FORCE_DAC_DATA (6 << 8) +# define RADEON_BLU_MX_FORCE_DAC_DATA (6 << 12) +# define RADEON_TV_FORCE_DAC_DATA_SHIFT 16 +#define RADEON_TV_RGB_CNTL 0x0804 +# define RADEON_SWITCH_TO_BLUE (1 << 4) +# define RADEON_RGB_DITHER_EN (1 << 5) +# define RADEON_RGB_SRC_SEL_MASK (3 << 8) +# define RADEON_RGB_SRC_SEL_CRTC1 (0 << 8) +# define RADEON_RGB_SRC_SEL_RMX (1 << 8) +# define RADEON_RGB_SRC_SEL_CRTC2 (2 << 8) +# define RADEON_RGB_CONVERT_BY_PASS (1 << 10) +# define RADEON_UVRAM_READ_MARGIN_SHIFT 16 +# define RADEON_FIFORAM_FFMACRO_READ_MARGIN_SHIFT 20 +# define RADEON_TVOUT_SCALE_EN (1 << 26) +#define RADEON_TV_SYNC_CNTL 0x0808 +# define RADEON_SYNC_OE (1 << 0) +# define RADEON_SYNC_OUT (1 << 1) +# define RADEON_SYNC_IN (1 << 2) +# define RADEON_SYNC_PUB (1 << 3) +# define RADEON_SYNC_PD (1 << 4) +# define RADEON_TV_SYNC_IO_DRIVE (1 << 5) +#define RADEON_TV_HTOTAL 0x080c +#define RADEON_TV_HDISP 0x0810 +#define RADEON_TV_HSTART 0x0818 +#define RADEON_TV_HCOUNT 0x081C +#define RADEON_TV_VTOTAL 0x0820 +#define RADEON_TV_VDISP 0x0824 +#define RADEON_TV_VCOUNT 0x0828 +#define RADEON_TV_FTOTAL 0x082c +#define RADEON_TV_FCOUNT 0x0830 +#define RADEON_TV_FRESTART 0x0834 +#define RADEON_TV_HRESTART 0x0838 +#define RADEON_TV_VRESTART 0x083c +#define RADEON_TV_HOST_READ_DATA 0x0840 +#define RADEON_TV_HOST_WRITE_DATA 0x0844 +#define RADEON_TV_HOST_RD_WT_CNTL 0x0848 +# define RADEON_HOST_FIFO_RD (1 << 12) +# define RADEON_HOST_FIFO_RD_ACK (1 << 13) +# define RADEON_HOST_FIFO_WT (1 << 14) +# define RADEON_HOST_FIFO_WT_ACK (1 << 15) +#define RADEON_TV_VSCALER_CNTL1 0x084c +# define RADEON_UV_INC_MASK 0xffff +# define RADEON_UV_INC_SHIFT 0 +# define RADEON_Y_W_EN (1 << 24) +# define RADEON_RESTART_FIELD (1 << 29) /* restart on field 0 */ +# define RADEON_Y_DEL_W_SIG_SHIFT 26 +#define RADEON_TV_TIMING_CNTL 0x0850 +# define RADEON_H_INC_MASK 0xfff +# define RADEON_H_INC_SHIFT 0 +# define RADEON_REQ_Y_FIRST (1 << 19) +# define RADEON_FORCE_BURST_ALWAYS (1 << 21) +# define RADEON_UV_POST_SCALE_BYPASS (1 << 23) +# define RADEON_UV_OUTPUT_POST_SCALE_SHIFT 24 +#define RADEON_TV_VSCALER_CNTL2 0x0854 +# define RADEON_DITHER_MODE (1 << 0) +# define RADEON_Y_OUTPUT_DITHER_EN (1 << 1) +# define RADEON_UV_OUTPUT_DITHER_EN (1 << 2) +# define RADEON_UV_TO_BUF_DITHER_EN (1 << 3) +#define RADEON_TV_Y_FALL_CNTL 0x0858 +# define RADEON_Y_FALL_PING_PONG (1 << 16) +# define RADEON_Y_COEF_EN (1 << 17) +#define RADEON_TV_Y_RISE_CNTL 0x085c +# define RADEON_Y_RISE_PING_PONG (1 << 16) +#define RADEON_TV_Y_SAW_TOOTH_CNTL 0x0860 +#define RADEON_TV_UPSAMP_AND_GAIN_CNTL 0x0864 +# define RADEON_YUPSAMP_EN (1 << 0) +# define RADEON_UVUPSAMP_EN (1 << 2) +#define RADEON_TV_GAIN_LIMIT_SETTINGS 0x0868 +# define RADEON_Y_GAIN_LIMIT_SHIFT 0 +# define RADEON_UV_GAIN_LIMIT_SHIFT 16 +#define RADEON_TV_LINEAR_GAIN_SETTINGS 0x086c +# define RADEON_Y_GAIN_SHIFT 0 +# define RADEON_UV_GAIN_SHIFT 16 +#define RADEON_TV_MODULATOR_CNTL1 0x0870 +# define RADEON_YFLT_EN (1 << 2) +# define RADEON_UVFLT_EN (1 << 3) +# define RADEON_ALT_PHASE_EN (1 << 6) +# define RADEON_SYNC_TIP_LEVEL (1 << 7) +# define RADEON_BLANK_LEVEL_SHIFT 8 +# define RADEON_SET_UP_LEVEL_SHIFT 16 +# define RADEON_SLEW_RATE_LIMIT (1 << 23) +# define RADEON_CY_FILT_BLEND_SHIFT 28 +#define RADEON_TV_MODULATOR_CNTL2 0x0874 +# define RADEON_TV_U_BURST_LEVEL_MASK 0x1ff +# define RADEON_TV_V_BURST_LEVEL_MASK 0x1ff +# define RADEON_TV_V_BURST_LEVEL_SHIFT 16 +#define RADEON_TV_CRC_CNTL 0x0890 +#define RADEON_TV_UV_ADR 0x08ac +# define RADEON_MAX_UV_ADR_MASK 0x000000ff +# define RADEON_MAX_UV_ADR_SHIFT 0 +# define RADEON_TABLE1_BOT_ADR_MASK 0x0000ff00 +# define RADEON_TABLE1_BOT_ADR_SHIFT 8 +# define RADEON_TABLE3_TOP_ADR_MASK 0x00ff0000 +# define RADEON_TABLE3_TOP_ADR_SHIFT 16 +# define RADEON_HCODE_TABLE_SEL_MASK 0x06000000 +# define RADEON_HCODE_TABLE_SEL_SHIFT 25 +# define RADEON_VCODE_TABLE_SEL_MASK 0x18000000 +# define RADEON_VCODE_TABLE_SEL_SHIFT 27 +# define RADEON_TV_MAX_FIFO_ADDR 0x1a7 +# define RADEON_TV_MAX_FIFO_ADDR_INTERNAL 0x1ff +#define RADEON_TV_PLL_FINE_CNTL 0x0020 /* PLL */ +#define RADEON_TV_PLL_CNTL 0x0021 /* PLL */ +# define RADEON_TV_M0LO_MASK 0xff +# define RADEON_TV_M0HI_MASK 0x7 +# define RADEON_TV_M0HI_SHIFT 18 +# define RADEON_TV_N0LO_MASK 0x1ff +# define RADEON_TV_N0LO_SHIFT 8 +# define RADEON_TV_N0HI_MASK 0x3 +# define RADEON_TV_N0HI_SHIFT 21 +# define RADEON_TV_P_MASK 0xf +# define RADEON_TV_P_SHIFT 24 +# define RADEON_TV_SLIP_EN (1 << 23) +# define RADEON_TV_DTO_EN (1 << 28) +#define RADEON_TV_PLL_CNTL1 0x0022 /* PLL */ +# define RADEON_TVPLL_RESET (1 << 1) +# define RADEON_TVPLL_SLEEP (1 << 3) +# define RADEON_TVPLL_REFCLK_SEL (1 << 4) +# define RADEON_TVPCP_SHIFT 8 +# define RADEON_TVPCP_MASK (7 << 8) +# define RADEON_TVPVG_SHIFT 11 +# define RADEON_TVPVG_MASK (7 << 11) +# define RADEON_TVPDC_SHIFT 14 +# define RADEON_TVPDC_MASK (3 << 14) +# define RADEON_TVPLL_TEST_DIS (1 << 31) +# define RADEON_TVCLK_SRC_SEL_TVPLL (1 << 30) + +#define RS400_DISP2_REQ_CNTL1 0xe30 +# define RS400_DISP2_START_REQ_LEVEL_SHIFT 0 +# define RS400_DISP2_START_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP2_STOP_REQ_LEVEL_SHIFT 12 +# define RS400_DISP2_STOP_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP2_ALLOW_FID_LEVEL_SHIFT 22 +# define RS400_DISP2_ALLOW_FID_LEVEL_MASK 0x3ff +#define RS400_DISP2_REQ_CNTL2 0xe34 +# define RS400_DISP2_CRITICAL_POINT_START_SHIFT 12 +# define RS400_DISP2_CRITICAL_POINT_START_MASK 0x3ff +# define RS400_DISP2_CRITICAL_POINT_STOP_SHIFT 22 +# define RS400_DISP2_CRITICAL_POINT_STOP_MASK 0x3ff +#define RS400_DMIF_MEM_CNTL1 0xe38 +# define RS400_DISP2_START_ADR_SHIFT 0 +# define RS400_DISP2_START_ADR_MASK 0x3ff +# define RS400_DISP1_CRITICAL_POINT_START_SHIFT 12 +# define RS400_DISP1_CRITICAL_POINT_START_MASK 0x3ff +# define RS400_DISP1_CRITICAL_POINT_STOP_SHIFT 22 +# define RS400_DISP1_CRITICAL_POINT_STOP_MASK 0x3ff +#define RS400_DISP1_REQ_CNTL1 0xe3c +# define RS400_DISP1_START_REQ_LEVEL_SHIFT 0 +# define RS400_DISP1_START_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP1_STOP_REQ_LEVEL_SHIFT 12 +# define RS400_DISP1_STOP_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP1_ALLOW_FID_LEVEL_SHIFT 22 +# define RS400_DISP1_ALLOW_FID_LEVEL_MASK 0x3ff + +#define RS690_MC_INDEX 0x78 +# define RS690_MC_INDEX_MASK 0x1ff +# define RS690_MC_INDEX_WR_EN (1 << 9) +# define RS690_MC_INDEX_WR_ACK 0x7f +#define RS690_MC_DATA 0x7c + +#define RS690_MC_FB_LOCATION 0x100 +#define RS690_MC_AGP_LOCATION 0x101 +#define RS690_MC_AGP_BASE 0x102 +#define RS690_MC_AGP_BASE_2 0x103 +#define RS690_MC_INIT_MISC_LAT_TIMER 0x104 +#define RS690_MC_STATUS 0x90 +#define RS690_MC_STATUS_IDLE (1 << 0) + +#define RS600_MC_INDEX 0x78 +# define RS600_MC_INDEX_MASK 0xff +# define RS600_MC_INDEX_WR_EN (1 << 8) +# define RS600_MC_INDEX_WR_ACK 0xff +#define RS600_MC_DATA 0x7c + +#define RS600_MC_FB_LOCATION 0xA +#define RS600_MC_STATUS 0x0 +#define RS600_MC_STATUS_IDLE (1 << 0) + +#define AVIVO_MC_INDEX 0x0070 +#define R520_MC_STATUS 0x00 +# define R520_MC_STATUS_IDLE (1 << 1) +#define RV515_MC_STATUS 0x08 +# define RV515_MC_STATUS_IDLE (1 << 4) +#define RV515_MC_INIT_MISC_LAT_TIMER 0x09 +#define AVIVO_MC_DATA 0x0074 + +#define RV515_MC_FB_LOCATION 0x1 +#define RV515_MC_AGP_LOCATION 0x2 +#define RV515_MC_AGP_BASE 0x3 +#define RV515_MC_AGP_BASE_2 0x4 +#define RV515_MC_CNTL 0x5 +# define RV515_MEM_NUM_CHANNELS_MASK 0x3 +#define R520_MC_FB_LOCATION 0x4 +#define R520_MC_AGP_LOCATION 0x5 +#define R520_MC_AGP_BASE 0x6 +#define R520_MC_AGP_BASE_2 0x7 +#define R520_MC_CNTL0 0x8 +# define R520_MEM_NUM_CHANNELS_MASK (0x3 << 24) +# define R520_MEM_NUM_CHANNELS_SHIFT 24 +# define R520_MC_CHANNEL_SIZE (1 << 23) + +#define R600_RAMCFG 0x2408 +# define R600_CHANSIZE (1 << 7) +# define R600_CHANSIZE_OVERRIDE (1 << 10) + +#define AVIVO_HDP_FB_LOCATION 0x134 + +#define AVIVO_VGA_RENDER_CONTROL 0x0300 +# define AVIVO_VGA_VSTATUS_CNTL_MASK (3 << 16) +#define AVIVO_D1VGA_CONTROL 0x0330 +# define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0) +# define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8) +# define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9) +# define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10) +# define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16) +# define AVIVO_DVGA_CONTROL_ROTATE (1<<24) +#define AVIVO_D2VGA_CONTROL 0x0338 + +#define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400 +#define AVIVO_EXT1_PPLL_REF_DIV 0x404 +#define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408 +#define AVIVO_EXT1_PPLL_UPDATE_CNTL 0x40c + +#define AVIVO_EXT2_PPLL_REF_DIV_SRC 0x410 +#define AVIVO_EXT2_PPLL_REF_DIV 0x414 +#define AVIVO_EXT2_PPLL_UPDATE_LOCK 0x418 +#define AVIVO_EXT2_PPLL_UPDATE_CNTL 0x41c + +#define AVIVO_EXT1_PPLL_FB_DIV 0x430 +#define AVIVO_EXT2_PPLL_FB_DIV 0x434 + +#define AVIVO_EXT1_PPLL_POST_DIV_SRC 0x438 +#define AVIVO_EXT1_PPLL_POST_DIV 0x43c + +#define AVIVO_EXT2_PPLL_POST_DIV_SRC 0x440 +#define AVIVO_EXT2_PPLL_POST_DIV 0x444 + +#define AVIVO_EXT1_PPLL_CNTL 0x448 +#define AVIVO_EXT2_PPLL_CNTL 0x44c + +#define AVIVO_P1PLL_CNTL 0x450 +#define AVIVO_P2PLL_CNTL 0x454 +#define AVIVO_P1PLL_INT_SS_CNTL 0x458 +#define AVIVO_P2PLL_INT_SS_CNTL 0x45c +#define AVIVO_P1PLL_TMDSA_CNTL 0x460 +#define AVIVO_P2PLL_LVTMA_CNTL 0x464 + +#define AVIVO_PCLK_CRTC1_CNTL 0x480 +#define AVIVO_PCLK_CRTC2_CNTL 0x484 + +#define AVIVO_D1CRTC_H_TOTAL 0x6000 +#define AVIVO_D1CRTC_H_BLANK_START_END 0x6004 +#define AVIVO_D1CRTC_H_SYNC_A 0x6008 +#define AVIVO_D1CRTC_H_SYNC_A_CNTL 0x600c +#define AVIVO_D1CRTC_H_SYNC_B 0x6010 +#define AVIVO_D1CRTC_H_SYNC_B_CNTL 0x6014 + +#define AVIVO_D1CRTC_V_TOTAL 0x6020 +#define AVIVO_D1CRTC_V_BLANK_START_END 0x6024 +#define AVIVO_D1CRTC_V_SYNC_A 0x6028 +#define AVIVO_D1CRTC_V_SYNC_A_CNTL 0x602c +#define AVIVO_D1CRTC_V_SYNC_B 0x6030 +#define AVIVO_D1CRTC_V_SYNC_B_CNTL 0x6034 + +#define AVIVO_D1CRTC_CONTROL 0x6080 +# define AVIVO_CRTC_EN (1<<0) +#define AVIVO_D1CRTC_BLANK_CONTROL 0x6084 +#define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088 +#define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c +#define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4 + +/* master controls */ +#define AVIVO_DC_CRTC_MASTER_EN 0x60f8 +#define AVIVO_DC_CRTC_TV_CONTROL 0x60fc + +#define AVIVO_D1GRPH_ENABLE 0x6100 +#define AVIVO_D1GRPH_CONTROL 0x6104 +# define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP (1<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP (2<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP (3<<0) + +# define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED (0<<8) + +# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555 (0<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_RGB565 (1<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444 (2<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_AI88 (3<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_MONO16 (4<<8) + +# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888 (0<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010 (1<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL (2<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010 (3<<8) + + +# define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616 (0<<8) + +# define AVIVO_D1GRPH_SWAP_RB (1<<16) +# define AVIVO_D1GRPH_TILED (1<<20) +# define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1<<21) + +#define AVIVO_D1GRPH_LUT_SEL 0x6108 +#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 +#define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118 +#define AVIVO_D1GRPH_PITCH 0x6120 +#define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124 +#define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128 +#define AVIVO_D1GRPH_X_START 0x612c +#define AVIVO_D1GRPH_Y_START 0x6130 +#define AVIVO_D1GRPH_X_END 0x6134 +#define AVIVO_D1GRPH_Y_END 0x6138 +#define AVIVO_D1GRPH_UPDATE 0x6144 +# define AVIVO_D1GRPH_UPDATE_LOCK (1<<16) +#define AVIVO_D1GRPH_FLIP_CONTROL 0x6148 + +#define AVIVO_D1CUR_CONTROL 0x6400 +# define AVIVO_D1CURSOR_EN (1<<0) +# define AVIVO_D1CURSOR_MODE_SHIFT 8 +# define AVIVO_D1CURSOR_MODE_MASK (0x3<<8) +# define AVIVO_D1CURSOR_MODE_24BPP (0x2) +#define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 +#define AVIVO_D1CUR_SIZE 0x6410 +#define AVIVO_D1CUR_POSITION 0x6414 +#define AVIVO_D1CUR_HOT_SPOT 0x6418 +#define AVIVO_D1CUR_UPDATE 0x6424 +# define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16) + +#define AVIVO_DC_LUT_RW_SELECT 0x6480 +#define AVIVO_DC_LUT_RW_MODE 0x6484 +#define AVIVO_DC_LUT_RW_INDEX 0x6488 +#define AVIVO_DC_LUT_SEQ_COLOR 0x648c +#define AVIVO_DC_LUT_PWL_DATA 0x6490 +#define AVIVO_DC_LUT_30_COLOR 0x6494 +#define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498 +#define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c +#define AVIVO_DC_LUT_AUTOFILL 0x64a0 + +#define AVIVO_DC_LUTA_CONTROL 0x64c0 +#define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4 +#define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8 +#define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc +#define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0 +#define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4 +#define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8 + +#define AVIVO_DC_LB_MEMORY_SPLIT 0x6520 +# define AVIVO_DC_LB_MEMORY_SPLIT_MASK 0x3 +# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT 0 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY 2 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3 +# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2) +# define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4 +# define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff + +#define AVIVO_D1MODE_DATA_FORMAT 0x6528 +# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) +#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652c +#define AVIVO_D1MODE_VIEWPORT_START 0x6580 +#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 +#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 +#define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM 0x658c + +#define AVIVO_D1SCL_SCALER_ENABLE 0x6590 +#define AVIVO_D1SCL_SCALER_TAP_CONTROL 0x6594 +#define AVIVO_D1SCL_UPDATE 0x65cc +# define AVIVO_D1SCL_UPDATE_LOCK (1<<16) + +/* second crtc */ +#define AVIVO_D2CRTC_H_TOTAL 0x6800 +#define AVIVO_D2CRTC_H_BLANK_START_END 0x6804 +#define AVIVO_D2CRTC_H_SYNC_A 0x6808 +#define AVIVO_D2CRTC_H_SYNC_A_CNTL 0x680c +#define AVIVO_D2CRTC_H_SYNC_B 0x6810 +#define AVIVO_D2CRTC_H_SYNC_B_CNTL 0x6814 + +#define AVIVO_D2CRTC_V_TOTAL 0x6820 +#define AVIVO_D2CRTC_V_BLANK_START_END 0x6824 +#define AVIVO_D2CRTC_V_SYNC_A 0x6828 +#define AVIVO_D2CRTC_V_SYNC_A_CNTL 0x682c +#define AVIVO_D2CRTC_V_SYNC_B 0x6830 +#define AVIVO_D2CRTC_V_SYNC_B_CNTL 0x6834 + +#define AVIVO_D2CRTC_CONTROL 0x6880 +#define AVIVO_D2CRTC_BLANK_CONTROL 0x6884 +#define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888 +#define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c +#define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4 + +#define AVIVO_D2GRPH_ENABLE 0x6900 +#define AVIVO_D2GRPH_CONTROL 0x6904 +#define AVIVO_D2GRPH_LUT_SEL 0x6908 +#define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS 0x6910 +#define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS 0x6918 +#define AVIVO_D2GRPH_PITCH 0x6920 +#define AVIVO_D2GRPH_SURFACE_OFFSET_X 0x6924 +#define AVIVO_D2GRPH_SURFACE_OFFSET_Y 0x6928 +#define AVIVO_D2GRPH_X_START 0x692c +#define AVIVO_D2GRPH_Y_START 0x6930 +#define AVIVO_D2GRPH_X_END 0x6934 +#define AVIVO_D2GRPH_Y_END 0x6938 +#define AVIVO_D2GRPH_UPDATE 0x6944 +#define AVIVO_D2GRPH_FLIP_CONTROL 0x6948 + +#define AVIVO_D2CUR_CONTROL 0x6c00 +#define AVIVO_D2CUR_SURFACE_ADDRESS 0x6c08 +#define AVIVO_D2CUR_SIZE 0x6c10 +#define AVIVO_D2CUR_POSITION 0x6c14 + +#define AVIVO_D2MODE_DATA_FORMAT 0x6d28 +#define AVIVO_D2MODE_DESKTOP_HEIGHT 0x6d2c +#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 +#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 +#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 +#define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM 0x6d8c + +#define AVIVO_D2SCL_SCALER_ENABLE 0x6d90 +#define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94 +#define AVIVO_D2SCL_UPDATE 0x6dcc + +#define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214 + +#define AVIVO_DACA_ENABLE 0x7800 +# define AVIVO_DAC_ENABLE (1 << 0) +#define AVIVO_DACA_SOURCE_SELECT 0x7804 +# define AVIVO_DAC_SOURCE_CRTC1 (0 << 0) +# define AVIVO_DAC_SOURCE_CRTC2 (1 << 0) +# define AVIVO_DAC_SOURCE_TV (2 << 0) + +#define AVIVO_DACA_FORCE_OUTPUT_CNTL 0x783c +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) +#define AVIVO_DACA_POWERDOWN 0x7850 +# define AVIVO_DACA_POWERDOWN_POWERDOWN (1 << 0) +# define AVIVO_DACA_POWERDOWN_BLUE (1 << 8) +# define AVIVO_DACA_POWERDOWN_GREEN (1 << 16) +# define AVIVO_DACA_POWERDOWN_RED (1 << 24) + +#define AVIVO_DACB_ENABLE 0x7a00 +#define AVIVO_DACB_SOURCE_SELECT 0x7a04 +#define AVIVO_DACB_FORCE_OUTPUT_CNTL 0x7a3c +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) +#define AVIVO_DACB_POWERDOWN 0x7a50 +# define AVIVO_DACB_POWERDOWN_POWERDOWN (1 << 0) +# define AVIVO_DACB_POWERDOWN_BLUE (1 << 8) +# define AVIVO_DACB_POWERDOWN_GREEN (1 << 16) +# define AVIVO_DACB_POWERDOWN_RED + +#define AVIVO_TMDSA_CNTL 0x7880 +# define AVIVO_TMDSA_CNTL_ENABLE (1 << 0) +# define AVIVO_TMDSA_CNTL_HPD_MASK (1 << 4) +# define AVIVO_TMDSA_CNTL_HPD_SELECT (1 << 8) +# define AVIVO_TMDSA_CNTL_SYNC_PHASE (1 << 12) +# define AVIVO_TMDSA_CNTL_PIXEL_ENCODING (1 << 16) +# define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE (1 << 24) +# define AVIVO_TMDSA_CNTL_SWAP (1 << 28) +#define AVIVO_TMDSA_SOURCE_SELECT 0x7884 +/* 78a8 appears to be some kind of (reasonably tolerant) clock? + * 78d0 definitely hits the transmitter, definitely clock. */ +/* MYSTERY1 This appears to control dithering? */ +#define AVIVO_TMDSA_BIT_DEPTH_CONTROL 0x7894 +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) +#define AVIVO_TMDSA_DCBALANCER_CONTROL 0x78d0 +# define AVIVO_TMDSA_DCBALANCER_CONTROL_EN (1 << 0) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN (1 << 8) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE (1 << 24) +#define AVIVO_TMDSA_DATA_SYNCHRONIZATION 0x78d8 +# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) +# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) +#define AVIVO_TMDSA_CLOCK_ENABLE 0x7900 +#define AVIVO_TMDSA_TRANSMITTER_ENABLE 0x7904 +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE (1 << 0) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE (1 << 8) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK (1 << 16) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) + +#define AVIVO_TMDSA_TRANSMITTER_CONTROL 0x7910 +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK (1 << 8) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK (1 << 14) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) + +#define AVIVO_LVTMA_CNTL 0x7a80 +# define AVIVO_LVTMA_CNTL_ENABLE (1 << 0) +# define AVIVO_LVTMA_CNTL_HPD_MASK (1 << 4) +# define AVIVO_LVTMA_CNTL_HPD_SELECT (1 << 8) +# define AVIVO_LVTMA_CNTL_SYNC_PHASE (1 << 12) +# define AVIVO_LVTMA_CNTL_PIXEL_ENCODING (1 << 16) +# define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE (1 << 24) +# define AVIVO_LVTMA_CNTL_SWAP (1 << 28) +#define AVIVO_LVTMA_SOURCE_SELECT 0x7a84 +#define AVIVO_LVTMA_COLOR_FORMAT 0x7a88 +#define AVIVO_LVTMA_BIT_DEPTH_CONTROL 0x7a94 +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) + + + +#define AVIVO_LVTMA_DCBALANCER_CONTROL 0x7ad0 +# define AVIVO_LVTMA_DCBALANCER_CONTROL_EN (1 << 0) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN (1 << 8) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE (1 << 24) + +#define AVIVO_LVTMA_DATA_SYNCHRONIZATION 0x78d8 +# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) +# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) +#define R500_LVTMA_CLOCK_ENABLE 0x7b00 +#define R600_LVTMA_CLOCK_ENABLE 0x7b04 + +#define R500_LVTMA_TRANSMITTER_ENABLE 0x7b04 +#define R600_LVTMA_TRANSMITTER_ENABLE 0x7b08 +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN (1 << 5) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN (1 << 9) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) + +#define R500_LVTMA_TRANSMITTER_CONTROL 0x7b10 +#define R600_LVTMA_TRANSMITTER_CONTROL 0x7b14 +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK (1 << 8) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK (1 << 14) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) + +#define R500_LVTMA_PWRSEQ_CNTL 0x7af0 +#define R600_LVTMA_PWRSEQ_CNTL 0x7af4 +# define AVIVO_LVTMA_PWRSEQ_EN (1 << 0) +# define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK (1 << 2) +# define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK (1 << 3) +# define AVIVO_LVTMA_PWRSEQ_TARGET_STATE (1 << 4) +# define AVIVO_LVTMA_SYNCEN (1 << 8) +# define AVIVO_LVTMA_SYNCEN_OVRD (1 << 9) +# define AVIVO_LVTMA_SYNCEN_POL (1 << 10) +# define AVIVO_LVTMA_DIGON (1 << 16) +# define AVIVO_LVTMA_DIGON_OVRD (1 << 17) +# define AVIVO_LVTMA_DIGON_POL (1 << 18) +# define AVIVO_LVTMA_BLON (1 << 24) +# define AVIVO_LVTMA_BLON_OVRD (1 << 25) +# define AVIVO_LVTMA_BLON_POL (1 << 26) + +#define R500_LVTMA_PWRSEQ_STATE 0x7af4 +#define R600_LVTMA_PWRSEQ_STATE 0x7af8 +# define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R (1 << 0) +# define AVIVO_LVTMA_PWRSEQ_STATE_DIGON (1 << 1) +# define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN (1 << 2) +# define AVIVO_LVTMA_PWRSEQ_STATE_BLON (1 << 3) +# define AVIVO_LVTMA_PWRSEQ_STATE_DONE (1 << 4) +# define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT (8) + +#define AVIVO_LVDS_BACKLIGHT_CNTL 0x7af8 +# define AVIVO_LVDS_BACKLIGHT_CNTL_EN (1 << 0) +# define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00 +# define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8 + +#define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988 + +#define AVIVO_GPIO_0 0x7e30 +#define AVIVO_GPIO_1 0x7e40 +#define AVIVO_GPIO_2 0x7e50 +#define AVIVO_GPIO_3 0x7e60 + +#define AVIVO_DC_GPIO_HPD_Y 0x7e9c + +#define AVIVO_I2C_STATUS 0x7d30 +# define AVIVO_I2C_STATUS_DONE (1 << 0) +# define AVIVO_I2C_STATUS_NACK (1 << 1) +# define AVIVO_I2C_STATUS_HALT (1 << 2) +# define AVIVO_I2C_STATUS_GO (1 << 3) +# define AVIVO_I2C_STATUS_MASK 0x7 +/* If radeon_mm_i2c is to be believed, this is HALT, NACK, and maybe + * DONE? */ +# define AVIVO_I2C_STATUS_CMD_RESET 0x7 +# define AVIVO_I2C_STATUS_CMD_WAIT (1 << 3) +#define AVIVO_I2C_STOP 0x7d34 +#define AVIVO_I2C_START_CNTL 0x7d38 +# define AVIVO_I2C_START (1 << 8) +# define AVIVO_I2C_CONNECTOR0 (0 << 16) +# define AVIVO_I2C_CONNECTOR1 (1 << 16) +#define R520_I2C_START (1<<0) +#define R520_I2C_STOP (1<<1) +#define R520_I2C_RX (1<<2) +#define R520_I2C_EN (1<<8) +#define R520_I2C_DDC1 (0<<16) +#define R520_I2C_DDC2 (1<<16) +#define R520_I2C_DDC3 (2<<16) +#define R520_I2C_DDC_MASK (3<<16) +#define AVIVO_I2C_CONTROL2 0x7d3c +# define AVIVO_I2C_7D3C_SIZE_SHIFT 8 +# define AVIVO_I2C_7D3C_SIZE_MASK (0xf << 8) +#define AVIVO_I2C_CONTROL3 0x7d40 +/* Reading is done 4 bytes at a time: read the bottom 8 bits from + * 7d44, four times in a row. + * Writing is a little more complex. First write DATA with + * 0xnnnnnnzz, then 0xnnnnnnyy, where nnnnnn is some non-deterministic + * magic number, zz is, I think, the slave address, and yy is the byte + * you want to write. */ +#define AVIVO_I2C_DATA 0x7d44 +#define R520_I2C_ADDR_COUNT_MASK (0x7) +#define R520_I2C_DATA_COUNT_SHIFT (8) +#define R520_I2C_DATA_COUNT_MASK (0xF00) +#define AVIVO_I2C_CNTL 0x7d50 +# define AVIVO_I2C_EN (1 << 0) +# define AVIVO_I2C_RESET (1 << 8) + +#define R600_GENERAL_PWRMGT 0x618 +# define R600_OPEN_DRAIN_PADS (1 << 11) + +#define R600_LOWER_GPIO_ENABLE 0x710 +#define R600_CTXSW_VID_LOWER_GPIO_CNTL 0x718 +#define R600_HIGH_VID_LOWER_GPIO_CNTL 0x71c +#define R600_MEDIUM_VID_LOWER_GPIO_CNTL 0x720 +#define R600_LOW_VID_LOWER_GPIO_CNTL 0x724 + +#define R600_MC_VM_FB_LOCATION 0x2180 +#define R600_MC_VM_AGP_TOP 0x2184 +#define R600_MC_VM_AGP_BOT 0x2188 +#define R600_MC_VM_AGP_BASE 0x218c +#define R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190 +#define R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194 +#define R600_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198 + +#define R700_MC_VM_FB_LOCATION 0x2024 + +#define R600_HDP_NONSURFACE_BASE 0x2c04 + +#define R600_BUS_CNTL 0x5420 +#define R600_CONFIG_CNTL 0x5424 +#define R600_CONFIG_MEMSIZE 0x5428 +#define R600_CONFIG_F0_BASE 0x542C +#define R600_CONFIG_APER_SIZE 0x5430 + +#define R600_ROM_CNTL 0x1600 +# define R600_SCK_OVERWRITE (1 << 1) +# define R600_SCK_PRESCALE_CRYSTAL_CLK_SHIFT 28 +# define R600_SCK_PRESCALE_CRYSTAL_CLK_MASK (0xf << 28) + +#define R600_BIOS_0_SCRATCH 0x1724 +#define R600_BIOS_1_SCRATCH 0x1728 +#define R600_BIOS_2_SCRATCH 0x172c +#define R600_BIOS_3_SCRATCH 0x1730 +#define R600_BIOS_4_SCRATCH 0x1734 +#define R600_BIOS_5_SCRATCH 0x1738 +#define R600_BIOS_6_SCRATCH 0x173c +#define R600_BIOS_7_SCRATCH 0x1740 + +#define R300_GB_TILE_CONFIG 0x4018 +# define R300_ENABLE_TILING (1 << 0) +# define R300_PIPE_COUNT_RV350 (0 << 1) +# define R300_PIPE_COUNT_R300 (3 << 1) +# define R300_PIPE_COUNT_R420_3P (6 << 1) +# define R300_PIPE_COUNT_R420 (7 << 1) +# define R300_TILE_SIZE_8 (0 << 4) +# define R300_TILE_SIZE_16 (1 << 4) +# define R300_TILE_SIZE_32 (2 << 4) +# define R300_SUBPIXEL_1_12 (0 << 16) +# define R300_SUBPIXEL_1_16 (1 << 16) +#define R300_GB_SELECT 0x401c +#define R300_GB_ENABLE 0x4008 +#define R300_GB_AA_CONFIG 0x4020 +#define R400_GB_PIPE_SELECT 0x402c +#define R300_GB_MSPOS0 0x4010 +# define R300_MS_X0_SHIFT 0 +# define R300_MS_Y0_SHIFT 4 +# define R300_MS_X1_SHIFT 8 +# define R300_MS_Y1_SHIFT 12 +# define R300_MS_X2_SHIFT 16 +# define R300_MS_Y2_SHIFT 20 +# define R300_MSBD0_Y_SHIFT 24 +# define R300_MSBD0_X_SHIFT 28 +#define R300_GB_MSPOS1 0x4014 +# define R300_MS_X3_SHIFT 0 +# define R300_MS_Y3_SHIFT 4 +# define R300_MS_X4_SHIFT 8 +# define R300_MS_Y4_SHIFT 12 +# define R300_MS_X5_SHIFT 16 +# define R300_MS_Y5_SHIFT 20 +# define R300_MSBD1_SHIFT 24 + +#define R300_GA_ENHANCE 0x4274 +# define R300_GA_DEADLOCK_CNTL (1 << 0) +# define R300_GA_FASTSYNC_CNTL (1 << 1) + +#define R300_GA_POLY_MODE 0x4288 +# define R300_FRONT_PTYPE_POINT (0 << 4) +# define R300_FRONT_PTYPE_LINE (1 << 4) +# define R300_FRONT_PTYPE_TRIANGE (2 << 4) +# define R300_BACK_PTYPE_POINT (0 << 7) +# define R300_BACK_PTYPE_LINE (1 << 7) +# define R300_BACK_PTYPE_TRIANGE (2 << 7) +#define R300_GA_ROUND_MODE 0x428c +# define R300_GEOMETRY_ROUND_TRUNC (0 << 0) +# define R300_GEOMETRY_ROUND_NEAREST (1 << 0) +# define R300_COLOR_ROUND_TRUNC (0 << 2) +# define R300_COLOR_ROUND_NEAREST (1 << 2) +#define R300_GA_COLOR_CONTROL 0x4278 +# define R300_RGB0_SHADING_SOLID (0 << 0) +# define R300_RGB0_SHADING_FLAT (1 << 0) +# define R300_RGB0_SHADING_GOURAUD (2 << 0) +# define R300_ALPHA0_SHADING_SOLID (0 << 2) +# define R300_ALPHA0_SHADING_FLAT (1 << 2) +# define R300_ALPHA0_SHADING_GOURAUD (2 << 2) +# define R300_RGB1_SHADING_SOLID (0 << 4) +# define R300_RGB1_SHADING_FLAT (1 << 4) +# define R300_RGB1_SHADING_GOURAUD (2 << 4) +# define R300_ALPHA1_SHADING_SOLID (0 << 6) +# define R300_ALPHA1_SHADING_FLAT (1 << 6) +# define R300_ALPHA1_SHADING_GOURAUD (2 << 6) +# define R300_RGB2_SHADING_SOLID (0 << 8) +# define R300_RGB2_SHADING_FLAT (1 << 8) +# define R300_RGB2_SHADING_GOURAUD (2 << 8) +# define R300_ALPHA2_SHADING_SOLID (0 << 10) +# define R300_ALPHA2_SHADING_FLAT (1 << 10) +# define R300_ALPHA2_SHADING_GOURAUD (2 << 10) +# define R300_RGB3_SHADING_SOLID (0 << 12) +# define R300_RGB3_SHADING_FLAT (1 << 12) +# define R300_RGB3_SHADING_GOURAUD (2 << 12) +# define R300_ALPHA3_SHADING_SOLID (0 << 14) +# define R300_ALPHA3_SHADING_FLAT (1 << 14) +# define R300_ALPHA3_SHADING_GOURAUD (2 << 14) +#define R300_GA_OFFSET 0x4290 + +#define R500_SU_REG_DEST 0x42c8 + +#define R300_VAP_CNTL_STATUS 0x2140 +# define R300_PVS_BYPASS (1 << 8) +#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 +#define R300_VAP_CNTL 0x2080 +# define R300_PVS_NUM_SLOTS_SHIFT 0 +# define R300_PVS_NUM_CNTLRS_SHIFT 4 +# define R300_PVS_NUM_FPUS_SHIFT 8 +# define R300_VF_MAX_VTX_NUM_SHIFT 18 +# define R300_GL_CLIP_SPACE_DEF (0 << 22) +# define R300_DX_CLIP_SPACE_DEF (1 << 22) +# define R500_TCL_STATE_OPTIMIZATION (1 << 23) +#define R300_VAP_VTE_CNTL 0x20B0 +# define R300_VPORT_X_SCALE_ENA (1 << 0) +# define R300_VPORT_X_OFFSET_ENA (1 << 1) +# define R300_VPORT_Y_SCALE_ENA (1 << 2) +# define R300_VPORT_Y_OFFSET_ENA (1 << 3) +# define R300_VPORT_Z_SCALE_ENA (1 << 4) +# define R300_VPORT_Z_OFFSET_ENA (1 << 5) +# define R300_VTX_XY_FMT (1 << 8) +# define R300_VTX_Z_FMT (1 << 9) +# define R300_VTX_W0_FMT (1 << 10) +#define R300_VAP_VTX_STATE_CNTL 0x2180 +#define R300_VAP_PSC_SGN_NORM_CNTL 0x21DC +#define R300_VAP_PROG_STREAM_CNTL_0 0x2150 +# define R300_DATA_TYPE_0_SHIFT 0 +# define R300_DATA_TYPE_FLOAT_1 0 +# define R300_DATA_TYPE_FLOAT_2 1 +# define R300_DATA_TYPE_FLOAT_3 2 +# define R300_DATA_TYPE_FLOAT_4 3 +# define R300_DATA_TYPE_BYTE 4 +# define R300_DATA_TYPE_D3DCOLOR 5 +# define R300_DATA_TYPE_SHORT_2 6 +# define R300_DATA_TYPE_SHORT_4 7 +# define R300_DATA_TYPE_VECTOR_3_TTT 8 +# define R300_DATA_TYPE_VECTOR_3_EET 9 +# define R300_SKIP_DWORDS_0_SHIFT 4 +# define R300_DST_VEC_LOC_0_SHIFT 8 +# define R300_LAST_VEC_0 (1 << 13) +# define R300_SIGNED_0 (1 << 14) +# define R300_NORMALIZE_0 (1 << 15) +# define R300_DATA_TYPE_1_SHIFT 16 +# define R300_SKIP_DWORDS_1_SHIFT 20 +# define R300_DST_VEC_LOC_1_SHIFT 24 +# define R300_LAST_VEC_1 (1 << 29) +# define R300_SIGNED_1 (1 << 30) +# define R300_NORMALIZE_1 (1 << 31) +#define R300_VAP_PROG_STREAM_CNTL_1 0x2154 +# define R300_DATA_TYPE_2_SHIFT 0 +# define R300_SKIP_DWORDS_2_SHIFT 4 +# define R300_DST_VEC_LOC_2_SHIFT 8 +# define R300_LAST_VEC_2 (1 << 13) +# define R300_SIGNED_2 (1 << 14) +# define R300_NORMALIZE_2 (1 << 15) +# define R300_DATA_TYPE_3_SHIFT 16 +# define R300_SKIP_DWORDS_3_SHIFT 20 +# define R300_DST_VEC_LOC_3_SHIFT 24 +# define R300_LAST_VEC_3 (1 << 29) +# define R300_SIGNED_3 (1 << 30) +# define R300_NORMALIZE_3 (1 << 31) +#define R300_VAP_PROG_STREAM_CNTL_EXT_0 0x21e0 +# define R300_SWIZZLE_SELECT_X_0_SHIFT 0 +# define R300_SWIZZLE_SELECT_Y_0_SHIFT 3 +# define R300_SWIZZLE_SELECT_Z_0_SHIFT 6 +# define R300_SWIZZLE_SELECT_W_0_SHIFT 9 +# define R300_SWIZZLE_SELECT_X 0 +# define R300_SWIZZLE_SELECT_Y 1 +# define R300_SWIZZLE_SELECT_Z 2 +# define R300_SWIZZLE_SELECT_W 3 +# define R300_SWIZZLE_SELECT_FP_ZERO 4 +# define R300_SWIZZLE_SELECT_FP_ONE 5 +# define R300_WRITE_ENA_0_SHIFT 12 +# define R300_WRITE_ENA_X 1 +# define R300_WRITE_ENA_Y 2 +# define R300_WRITE_ENA_Z 4 +# define R300_WRITE_ENA_W 8 +# define R300_SWIZZLE_SELECT_X_1_SHIFT 16 +# define R300_SWIZZLE_SELECT_Y_1_SHIFT 19 +# define R300_SWIZZLE_SELECT_Z_1_SHIFT 22 +# define R300_SWIZZLE_SELECT_W_1_SHIFT 25 +# define R300_WRITE_ENA_1_SHIFT 28 +#define R300_VAP_PROG_STREAM_CNTL_EXT_1 0x21e4 +# define R300_SWIZZLE_SELECT_X_2_SHIFT 0 +# define R300_SWIZZLE_SELECT_Y_2_SHIFT 3 +# define R300_SWIZZLE_SELECT_Z_2_SHIFT 6 +# define R300_SWIZZLE_SELECT_W_2_SHIFT 9 +# define R300_WRITE_ENA_2_SHIFT 12 +# define R300_SWIZZLE_SELECT_X_3_SHIFT 16 +# define R300_SWIZZLE_SELECT_Y_3_SHIFT 19 +# define R300_SWIZZLE_SELECT_Z_3_SHIFT 22 +# define R300_SWIZZLE_SELECT_W_3_SHIFT 25 +# define R300_WRITE_ENA_3_SHIFT 28 +#define R300_VAP_PVS_CODE_CNTL_0 0x22D0 +# define R300_PVS_FIRST_INST_SHIFT 0 +# define R300_PVS_XYZW_VALID_INST_SHIFT 10 +# define R300_PVS_LAST_INST_SHIFT 20 +#define R300_VAP_PVS_CODE_CNTL_1 0x22D8 +# define R300_PVS_LAST_VTX_SRC_INST_SHIFT 0 +#define R300_VAP_PVS_VECTOR_INDX_REG 0x2200 +#define R300_VAP_PVS_VECTOR_DATA_REG 0x2204 +/* PVS instructions */ +/* Opcode and dst instruction */ +#define R300_PVS_DST_OPCODE(x) (x << 0) +/* Vector ops */ +# define R300_VECTOR_NO_OP 0 +# define R300_VE_DOT_PRODUCT 1 +# define R300_VE_MULTIPLY 2 +# define R300_VE_ADD 3 +# define R300_VE_MULTIPLY_ADD 4 +# define R300_VE_DISTANCE_VECTOR 5 +# define R300_VE_FRACTION 6 +# define R300_VE_MAXIMUM 7 +# define R300_VE_MINIMUM 8 +# define R300_VE_SET_GREATER_THAN_EQUAL 9 +# define R300_VE_SET_LESS_THAN 10 +# define R300_VE_MULTIPLYX2_ADD 11 +# define R300_VE_MULTIPLY_CLAMP 12 +# define R300_VE_FLT2FIX_DX 13 +# define R300_VE_FLT2FIX_DX_RND 14 +/* R500 additions */ +# define R500_VE_PRED_SET_EQ_PUSH 15 +# define R500_VE_PRED_SET_GT_PUSH 16 +# define R500_VE_PRED_SET_GTE_PUSH 17 +# define R500_VE_PRED_SET_NEQ_PUSH 18 +# define R500_VE_COND_WRITE_EQ 19 +# define R500_VE_COND_WRITE_GT 20 +# define R500_VE_COND_WRITE_GTE 21 +# define R500_VE_COND_WRITE_NEQ 22 +# define R500_VE_COND_MUX_EQ 23 +# define R500_VE_COND_MUX_GT 24 +# define R500_VE_COND_MUX_GTE 25 +# define R500_VE_SET_GREATER_THAN 26 +# define R500_VE_SET_EQUAL 27 +# define R500_VE_SET_NOT_EQUAL 28 +/* Math ops */ +# define R300_MATH_NO_OP 0 +# define R300_ME_EXP_BASE2_DX 1 +# define R300_ME_LOG_BASE2_DX 2 +# define R300_ME_EXP_BASEE_FF 3 +# define R300_ME_LIGHT_COEFF_DX 4 +# define R300_ME_POWER_FUNC_FF 5 +# define R300_ME_RECIP_DX 6 +# define R300_ME_RECIP_FF 7 +# define R300_ME_RECIP_SQRT_DX 8 +# define R300_ME_RECIP_SQRT_FF 9 +# define R300_ME_MULTIPLY 10 +# define R300_ME_EXP_BASE2_FULL_DX 11 +# define R300_ME_LOG_BASE2_FULL_DX 12 +# define R300_ME_POWER_FUNC_FF_CLAMP_B 13 +# define R300_ME_POWER_FUNC_FF_CLAMP_B1 14 +# define R300_ME_POWER_FUNC_FF_CLAMP_01 15 +# define R300_ME_SIN 16 +# define R300_ME_COS 17 +/* R500 additions */ +# define R500_ME_LOG_BASE2_IEEE 18 +# define R500_ME_RECIP_IEEE 19 +# define R500_ME_RECIP_SQRT_IEEE 20 +# define R500_ME_PRED_SET_EQ 21 +# define R500_ME_PRED_SET_GT 22 +# define R500_ME_PRED_SET_GTE 23 +# define R500_ME_PRED_SET_NEQ 24 +# define R500_ME_PRED_SET_CLR 25 +# define R500_ME_PRED_SET_INV 26 +# define R500_ME_PRED_SET_POP 27 +# define R500_ME_PRED_SET_RESTORE 28 +/* macro */ +# define R300_PVS_MACRO_OP_2CLK_MADD 0 +# define R300_PVS_MACRO_OP_2CLK_M2X_ADD 1 +#define R300_PVS_DST_MATH_INST (1 << 6) +#define R300_PVS_DST_MACRO_INST (1 << 7) +#define R300_PVS_DST_REG_TYPE(x) (x << 8) +# define R300_PVS_DST_REG_TEMPORARY 0 +# define R300_PVS_DST_REG_A0 1 +# define R300_PVS_DST_REG_OUT 2 +# define R500_PVS_DST_REG_OUT_REPL_X 3 +# define R300_PVS_DST_REG_ALT_TEMPORARY 4 +# define R300_PVS_DST_REG_INPUT 5 +#define R300_PVS_DST_ADDR_MODE_1 (1 << 12) +#define R300_PVS_DST_OFFSET(x) (x << 13) +#define R300_PVS_DST_WE_X (1 << 20) +#define R300_PVS_DST_WE_Y (1 << 21) +#define R300_PVS_DST_WE_Z (1 << 22) +#define R300_PVS_DST_WE_W (1 << 23) +#define R300_PVS_DST_VE_SAT (1 << 24) +#define R300_PVS_DST_ME_SAT (1 << 25) +#define R300_PVS_DST_PRED_ENABLE (1 << 26) +#define R300_PVS_DST_PRED_SENSE (1 << 27) +#define R300_PVS_DST_DUAL_MATH_OP (1 << 28) +#define R300_PVS_DST_ADDR_SEL(x) (x << 29) +#define R300_PVS_DST_ADDR_MODE_0 (1 << 31) +/* src operand instruction */ +#define R300_PVS_SRC_REG_TYPE(x) (x << 0) +# define R300_PVS_SRC_REG_TEMPORARY 0 +# define R300_PVS_SRC_REG_INPUT 1 +# define R300_PVS_SRC_REG_CONSTANT 2 +# define R300_PVS_SRC_REG_ALT_TEMPORARY 3 +#define R300_SPARE_0 (1 << 2) +#define R300_PVS_SRC_ABS_XYZW (1 << 3) +#define R300_PVS_SRC_ADDR_MODE_0 (1 << 4) +#define R300_PVS_SRC_OFFSET(x) (x << 5) +#define R300_PVS_SRC_SWIZZLE_X(x) (x << 13) +#define R300_PVS_SRC_SWIZZLE_Y(x) (x << 16) +#define R300_PVS_SRC_SWIZZLE_Z(x) (x << 19) +#define R300_PVS_SRC_SWIZZLE_W(x) (x << 22) +# define R300_PVS_SRC_SELECT_X 0 +# define R300_PVS_SRC_SELECT_Y 1 +# define R300_PVS_SRC_SELECT_Z 2 +# define R300_PVS_SRC_SELECT_W 3 +# define R300_PVS_SRC_SELECT_FORCE_0 4 +# define R300_PVS_SRC_SELECT_FORCE_1 5 +#define R300_PVS_SRC_NEG_X (1 << 25) +#define R300_PVS_SRC_NEG_Y (1 << 26) +#define R300_PVS_SRC_NEG_Z (1 << 27) +#define R300_PVS_SRC_NEG_W (1 << 28) +#define R300_PVS_SRC_ADDR_SEL(x) (x << 29) +#define R300_PVS_SRC_ADDR_MODE_1 (1 << 31) + +#define R300_VAP_PVS_FLOW_CNTL_OPC 0x22dc +#define R300_VAP_OUT_VTX_FMT_0 0x2090 +# define R300_VTX_POS_PRESENT (1 << 0) +# define R300_VTX_COLOR_0_PRESENT (1 << 1) +# define R300_VTX_COLOR_1_PRESENT (1 << 2) +# define R300_VTX_COLOR_2_PRESENT (1 << 3) +# define R300_VTX_COLOR_3_PRESENT (1 << 4) +# define R300_VTX_PT_SIZE_PRESENT (1 << 16) +#define R300_VAP_OUT_VTX_FMT_1 0x2094 +# define R300_TEX_0_COMP_CNT_SHIFT 0 +# define R300_TEX_1_COMP_CNT_SHIFT 3 +# define R300_TEX_2_COMP_CNT_SHIFT 6 +# define R300_TEX_3_COMP_CNT_SHIFT 9 +# define R300_TEX_4_COMP_CNT_SHIFT 12 +# define R300_TEX_5_COMP_CNT_SHIFT 15 +# define R300_TEX_6_COMP_CNT_SHIFT 18 +# define R300_TEX_7_COMP_CNT_SHIFT 21 +#define R300_VAP_VTX_SIZE 0x20b4 +#define R300_VAP_GB_VERT_CLIP_ADJ 0x2220 +#define R300_VAP_GB_VERT_DISC_ADJ 0x2224 +#define R300_VAP_GB_HORZ_CLIP_ADJ 0x2228 +#define R300_VAP_GB_HORZ_DISC_ADJ 0x222c +#define R300_VAP_CLIP_CNTL 0x221c +# define R300_UCP_ENA_0 (1 << 0) +# define R300_UCP_ENA_1 (1 << 1) +# define R300_UCP_ENA_2 (1 << 2) +# define R300_UCP_ENA_3 (1 << 3) +# define R300_UCP_ENA_4 (1 << 4) +# define R300_UCP_ENA_5 (1 << 5) +# define R300_PS_UCP_MODE_SHIFT 14 +# define R300_CLIP_DISABLE (1 << 16) +# define R300_UCP_CULL_ONLY_ENA (1 << 17) +# define R300_BOUNDARY_EDGE_FLAG_ENA (1 << 18) +#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 + +#define R500_VAP_INDEX_OFFSET 0x208c + +#define R300_SU_TEX_WRAP 0x42a0 +#define R300_SU_POLY_OFFSET_ENABLE 0x42b4 +#define R300_SU_CULL_MODE 0x42b8 +# define R300_CULL_FRONT (1 << 0) +# define R300_CULL_BACK (1 << 1) +# define R300_FACE_POS (0 << 2) +# define R300_FACE_NEG (1 << 2) +#define R300_SU_DEPTH_SCALE 0x42c0 +#define R300_SU_DEPTH_OFFSET 0x42c4 + +#define R300_RS_COUNT 0x4300 +# define R300_RS_COUNT_IT_COUNT_SHIFT 0 +# define R300_RS_COUNT_IC_COUNT_SHIFT 7 +# define R300_RS_COUNT_HIRES_EN (1 << 18) + +#define R300_RS_IP_0 0x4310 +#define R300_RS_IP_1 0x4314 +# define R300_RS_TEX_PTR(x) (x << 0) +# define R300_RS_COL_PTR(x) (x << 6) +# define R300_RS_COL_FMT(x) (x << 9) +# define R300_RS_COL_FMT_RGBA 0 +# define R300_RS_COL_FMT_RGB0 2 +# define R300_RS_COL_FMT_RGB1 3 +# define R300_RS_COL_FMT_000A 4 +# define R300_RS_COL_FMT_0000 5 +# define R300_RS_COL_FMT_0001 6 +# define R300_RS_COL_FMT_111A 8 +# define R300_RS_COL_FMT_1110 9 +# define R300_RS_COL_FMT_1111 10 +# define R300_RS_SEL_S(x) (x << 13) +# define R300_RS_SEL_T(x) (x << 16) +# define R300_RS_SEL_R(x) (x << 19) +# define R300_RS_SEL_Q(x) (x << 22) +# define R300_RS_SEL_C0 0 +# define R300_RS_SEL_C1 1 +# define R300_RS_SEL_C2 2 +# define R300_RS_SEL_C3 3 +# define R300_RS_SEL_K0 4 +# define R300_RS_SEL_K1 5 +#define R300_RS_INST_COUNT 0x4304 +# define R300_INST_COUNT_RS(x) (x << 0) +# define R300_RS_W_EN (1 << 4) +# define R300_TX_OFFSET_RS(x) (x << 5) +#define R300_RS_INST_0 0x4330 +#define R300_RS_INST_1 0x4334 +# define R300_INST_TEX_ID(x) (x << 0) +# define R300_RS_INST_TEX_CN_WRITE (1 << 3) +# define R300_INST_TEX_ADDR(x) (x << 6) + +#define R300_TX_INVALTAGS 0x4100 +#define R300_TX_FILTER0_0 0x4400 +#define R300_TX_FILTER0_1 0x4404 +# define R300_TX_CLAMP_S(x) (x << 0) +# define R300_TX_CLAMP_T(x) (x << 3) +# define R300_TX_CLAMP_R(x) (x << 6) +# define R300_TX_CLAMP_WRAP 0 +# define R300_TX_CLAMP_MIRROR 1 +# define R300_TX_CLAMP_CLAMP_LAST 2 +# define R300_TX_CLAMP_MIRROR_CLAMP_LAST 3 +# define R300_TX_CLAMP_CLAMP_BORDER 4 +# define R300_TX_CLAMP_MIRROR_CLAMP_BORDER 5 +# define R300_TX_CLAMP_CLAMP_GL 6 +# define R300_TX_CLAMP_MIRROR_CLAMP_GL 7 +# define R300_TX_MAG_FILTER_NEAREST (1 << 9) +# define R300_TX_MIN_FILTER_NEAREST (1 << 11) +# define R300_TX_MAG_FILTER_LINEAR (2 << 9) +# define R300_TX_MIN_FILTER_LINEAR (2 << 11) +# define R300_TX_ID_SHIFT 28 +#define R300_TX_FILTER1_0 0x4440 +#define R300_TX_FILTER1_1 0x4444 +#define R300_TX_FORMAT0_0 0x4480 +#define R300_TX_FORMAT0_1 0x4484 +# define R300_TXWIDTH_SHIFT 0 +# define R300_TXHEIGHT_SHIFT 11 +# define R300_NUM_LEVELS_SHIFT 26 +# define R300_NUM_LEVELS_MASK 0x +# define R300_TXPROJECTED (1 << 30) +# define R300_TXPITCH_EN (1 << 31) +#define R300_TX_FORMAT1_0 0x44c0 +#define R300_TX_FORMAT1_1 0x44c4 +# define R300_TX_FORMAT_X8 0x0 +# define R300_TX_FORMAT_X16 0x1 +# define R300_TX_FORMAT_Y4X4 0x2 +# define R300_TX_FORMAT_Y8X8 0x3 +# define R300_TX_FORMAT_Y16X16 0x4 +# define R300_TX_FORMAT_Z3Y3X2 0x5 +# define R300_TX_FORMAT_Z5Y6X5 0x6 +# define R300_TX_FORMAT_Z6Y5X5 0x7 +# define R300_TX_FORMAT_Z11Y11X10 0x8 +# define R300_TX_FORMAT_Z10Y11X11 0x9 +# define R300_TX_FORMAT_W4Z4Y4X4 0xA +# define R300_TX_FORMAT_W1Z5Y5X5 0xB +# define R300_TX_FORMAT_W8Z8Y8X8 0xC +# define R300_TX_FORMAT_W2Z10Y10X10 0xD +# define R300_TX_FORMAT_W16Z16Y16X16 0xE +# define R300_TX_FORMAT_DXT1 0xF +# define R300_TX_FORMAT_DXT3 0x10 +# define R300_TX_FORMAT_DXT5 0x11 +# define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */ +# define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */ +# define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */ +# define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */ +# define R300_TX_FORMAT_VYUY422 0x14 /* no swizzle */ +# define R300_TX_FORMAT_YVYU422 0x15 /* no swizzle */ +# define R300_TX_FORMAT_X24_Y8 0x1e +# define R300_TX_FORMAT_X32 0x1e + /* Floating point formats */ + /* Note - hardware supports both 16 and 32 bit floating point */ +# define R300_TX_FORMAT_FL_I16 0x18 +# define R300_TX_FORMAT_FL_I16A16 0x19 +# define R300_TX_FORMAT_FL_R16G16B16A16 0x1A +# define R300_TX_FORMAT_FL_I32 0x1B +# define R300_TX_FORMAT_FL_I32A32 0x1C +# define R300_TX_FORMAT_FL_R32G32B32A32 0x1D + /* alpha modes, convenience mostly */ + /* if you have alpha, pick constant appropriate to the + number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */ +# define R300_TX_FORMAT_ALPHA_1CH 0x000 +# define R300_TX_FORMAT_ALPHA_2CH 0x200 +# define R300_TX_FORMAT_ALPHA_4CH 0x600 +# define R300_TX_FORMAT_ALPHA_NONE 0xA00 + /* Swizzling */ + /* constants */ +# define R300_TX_FORMAT_X 0 +# define R300_TX_FORMAT_Y 1 +# define R300_TX_FORMAT_Z 2 +# define R300_TX_FORMAT_W 3 +# define R300_TX_FORMAT_ZERO 4 +# define R300_TX_FORMAT_ONE 5 + /* 2.0*Z, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_Z 6 + /* 2.0*W, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_W 7 + +# define R300_TX_FORMAT_B_SHIFT 18 +# define R300_TX_FORMAT_G_SHIFT 15 +# define R300_TX_FORMAT_R_SHIFT 12 +# define R300_TX_FORMAT_A_SHIFT 9 + + /* Convenience macro to take care of layout and swizzling */ +# define R300_EASY_TX_FORMAT(B, G, R, A, FMT) ( \ + ((R300_TX_FORMAT_##B)<pipe_winsys, + (struct amd_pipe_winsys*)amd_context->pipe_winsys); + } else { + pipe = amd_create_softpipe(amd_context); + } amd_context->st_context = st_create_context(pipe, visual, shared_st_context); driInitExtensions(amd_context->st_context->ctx, -- cgit v1.2.3 From e9b08e7373c00306bce398ea8d34f42e54f98c6d Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 21:28:23 -0800 Subject: Make r300 and amd build in scons. --- SConstruct | 4 ++-- src/gallium/drivers/r300/SConscript | 17 +++++++++++++++++ src/gallium/drivers/r300/r300_blit.h | 1 + src/gallium/winsys/drm/amd/SConscript | 29 +++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/gallium/drivers/r300/SConscript create mode 100644 src/gallium/winsys/drm/amd/SConscript (limited to 'src') diff --git a/SConstruct b/SConstruct index 88cdffa504..a22b9483da 100644 --- a/SConstruct +++ b/SConstruct @@ -46,9 +46,9 @@ common.AddOptions(opts) opts.Add(ListOption('statetrackers', 'state trackers to build', default_statetrackers, ['mesa', 'python'])) opts.Add(ListOption('drivers', 'pipe drivers to build', default_drivers, - ['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace'])) + ['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace', 'r300'])) opts.Add(ListOption('winsys', 'winsys drivers to build', default_winsys, - ['xlib', 'intel', 'gdi'])) + ['xlib', 'intel', 'gdi', 'amd'])) opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0'))) diff --git a/src/gallium/drivers/r300/SConscript b/src/gallium/drivers/r300/SConscript new file mode 100644 index 0000000000..18684c3e7f --- /dev/null +++ b/src/gallium/drivers/r300/SConscript @@ -0,0 +1,17 @@ +Import('*') + +env = env.Clone() + +r300 = env.ConvenienceLibrary( + target = 'r300', + source = [ + 'r300_blit.c', + 'r300_clear.c', + 'r300_context.c', + 'r300_screen.c', + 'r300_state.c', + 'r300_surface.c', + ]) + +Export('r300') + diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h index 09cb566b95..740cbcdea5 100644 --- a/src/gallium/drivers/r300/r300_blit.h +++ b/src/gallium/drivers/r300/r300_blit.h @@ -25,6 +25,7 @@ #include "pipe/p_state.h" +#include "r300_context.h" #include "r300_cs.h" /* Forward declarations. */ diff --git a/src/gallium/winsys/drm/amd/SConscript b/src/gallium/winsys/drm/amd/SConscript new file mode 100644 index 0000000000..a4856da23c --- /dev/null +++ b/src/gallium/winsys/drm/amd/SConscript @@ -0,0 +1,29 @@ +Import('*') + +if 'mesa' in env['statetrackers']: + + env = drienv.Clone() + + DRIVER_SOURCES = [ + 'amd_buffer.c', + 'amd_context.c', + 'amd_screen.c', + 'amd_winsys_softpipe.c', + ] + + sources = \ + COMMON_GALLIUM_SOURCES + \ + DRIVER_SOURCES + + drivers = [ + softpipe, + r300 + ] + + # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions + env.SharedLibrary( + target ='amd_dri.so', + source = sources, + LIBS = drivers + mesa + auxiliaries + env['LIBS'], + ) + -- cgit v1.2.3 From 4aaaecbfa6fa810899ef04de44f9f79ec4d8134f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 21:50:56 -0800 Subject: A bit of r300 cleanup. --- src/gallium/drivers/r300/r300_context.c | 7 +------ src/gallium/drivers/r300/r300_context.h | 11 +++++++++-- src/gallium/drivers/r300/r300_surface.h | 2 -- src/gallium/winsys/drm/amd/amd_context.c | 6 ++++-- 4 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 68751dae17..4050faa74a 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -41,12 +41,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->winsys = amd_winsys; r300->context.winsys = winsys; - if (screen) { - r300->context.screen = screen; - } else { - /* XXX second arg should be pciid, find a way to get it from winsys */ - r300->context.screen = r300_create_screen(winsys, 0x0); - } + r300->context.screen = screen; r300->context.destroy = r300_destroy_context; diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index ae2dab13ff..8393198200 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -23,9 +23,9 @@ #ifndef R300_CONTEXT_H #define R300_CONTEXT_H +#include "draw/draw_context.h" #include "pipe/p_context.h" - -#include "r300_surface.h" +#include "util/u_memory.h" struct r300_context { /* Parent class */ @@ -47,4 +47,11 @@ static struct r300_context* r300_context(struct pipe_context* context) { return (struct r300_context*)context; } +/* Context initialization. */ +void r300_init_surface_functions(struct r300_context* r300); + +struct pipe_context* r300_create_context(struct pipe_screen* screen, + struct pipe_winsys* winsys, + struct amd_winsys* amd_winsys); + #endif /* R300_CONTEXT_H */ \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index 29858eb541..0b2fd0b32b 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -31,6 +31,4 @@ #include "r300_blit.h" #include "r300_context.h" -void r300_init_surface_functions(struct r300_context* r300); - #endif /* R300_SURFACE_H */ diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index faca7d0c4b..5127cdf261 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -243,8 +243,10 @@ GLboolean amd_context_create(const __GLcontextModes *visual, } if (GL_TRUE) { - /* XXX "NULL" is a struct pipe_screen* just in case we ever need it... */ - pipe = r300_create_context(NULL, amd_context->pipe_winsys, + amd_context->pipe_screen = r300_create_screen(amd_context->pipe_winsys, + 0x0); + pipe = r300_create_context(amd_context->pipe_screen, + amd_context->pipe_winsys, (struct amd_pipe_winsys*)amd_context->pipe_winsys); } else { pipe = amd_create_softpipe(amd_context); -- cgit v1.2.3 From 0c59004fe3cc9f691c73da2b4a9321c7682410f4 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 9 Jan 2009 22:39:36 -0800 Subject: And unbreak traditional build. s/drm-radeon/drm_radeon/ --- src/gallium/winsys/drm/amd/Makefile | 2 +- src/gallium/winsys/drm/amd/amd_context.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/amd/Makefile b/src/gallium/winsys/drm/amd/Makefile index a1b5602c05..0f23e3446c 100644 --- a/src/gallium/winsys/drm/amd/Makefile +++ b/src/gallium/winsys/drm/amd/Makefile @@ -23,6 +23,6 @@ ASM_SOURCES = include ../Makefile.template -DRI_LIB_DEPS += -ldrm-radeon +DRI_LIB_DEPS += -ldrm_radeon symlinks: diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index 5127cdf261..632caec6a7 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -243,6 +243,7 @@ GLboolean amd_context_create(const __GLcontextModes *visual, } if (GL_TRUE) { + /* XXX second arg should be PCI ID, but damned if I know why */ amd_context->pipe_screen = r300_create_screen(amd_context->pipe_winsys, 0x0); pipe = r300_create_context(amd_context->pipe_screen, -- cgit v1.2.3 From fbeeb6675733f5b2da36d40b0142dadf8cc953b4 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 12 Jan 2009 01:40:50 -0800 Subject: r300, amd: Make everything build. (Not necessarily work, mind you.) Lots of structural work, especially in getting the two parts to talk nicely. Todo: - Get damn blitter working. - Add CS flush. - Reverse order of above two items. --- configs/default | 2 +- src/gallium/drivers/r300/r300_blit.c | 2 +- src/gallium/drivers/r300/r300_context.c | 6 +-- src/gallium/drivers/r300/r300_context.h | 13 ++--- src/gallium/drivers/r300/r300_cs.h | 30 ++++++----- src/gallium/drivers/r300/r300_screen.c | 4 +- src/gallium/drivers/r300/r300_winsys.h | 87 ++++++++++++++++++++++++++++++++ src/gallium/winsys/drm/amd/Makefile | 6 ++- src/gallium/winsys/drm/amd/amd_context.c | 8 ++- src/gallium/winsys/drm/amd/amd_context.h | 2 + src/gallium/winsys/drm/amd/amd_r300.c | 55 ++++++++++++++++++++ src/gallium/winsys/drm/amd/amd_r300.h | 29 +++++++++++ 12 files changed, 208 insertions(+), 36 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_winsys.h create mode 100644 src/gallium/winsys/drm/amd/amd_r300.c create mode 100644 src/gallium/winsys/drm/amd/amd_r300.h (limited to 'src') diff --git a/configs/default b/configs/default index 40f3a2a02d..333f0fe985 100644 --- a/configs/default +++ b/configs/default @@ -91,7 +91,7 @@ EGL_DRIVERS_DIRS = demo # Gallium directories and GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a) -GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv04 nv10 nv20 nv30 nv40 nv50 failover trace +GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv04 nv10 nv20 nv30 nv40 nv50 failover r300 GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) GALLIUM_WINSYS_DIRS = xlib egl_xlib diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index c404a667b1..b8ddf6677f 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -79,7 +79,7 @@ int r300_fill_blit(struct r300_context* r300, OUT_CS_REG(RADEON_DP_CNTL, RADEON_DST_X_LEFT_TO_RIGHT | RADEON_DST_Y_TOP_TO_BOTTOM); OUT_CS_REG(RADEON_DST_PITCH_OFFSET, 0x0); - /* XXX fix this shit -> OUT_RELOC(dst, 0, RADEON_GEM_DOMAIN_VRAM) */ + OUT_CS_RELOC(dst_buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); /* Do the actual paint. */ OUT_CS_REG(RADEON_DST_Y_X, (y << 16) | x); diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 4050faa74a..b9a9c2e21c 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -32,16 +32,16 @@ static void r300_destroy_context(struct pipe_context* context) { struct pipe_context* r300_create_context(struct pipe_screen* screen, struct pipe_winsys* winsys, - struct amd_winsys* amd_winsys) + struct r300_winsys* r300_winsys) { struct r300_context* r300 = CALLOC_STRUCT(r300_context); if (!r300) return NULL; - r300->winsys = amd_winsys; + r300->winsys = r300_winsys; r300->context.winsys = winsys; - r300->context.screen = screen; + r300->context.screen = r300_create_screen(winsys, 0x0); r300->context.destroy = r300_destroy_context; diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 8393198200..119d46af58 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -31,15 +31,10 @@ struct r300_context { /* Parent class */ struct pipe_context context; - struct amd_winsys* winsys; + /* The interface to the windowing system, etc. */ + struct r300_winsys* winsys; + /* Draw module. Used mostly for SW TCL. */ struct draw_context* draw; - - /* CS object. This is very much like Intel's batchbuffer. - * Fill it full of dwords and relocs and then submit. - * Repeat as needed. */ - /* Note: Unlike Mesa's version of this, we don't keep a copy of the CSM - * that was used to create this CS. Is this a good idea? */ - struct radeon_cs* cs; }; /* Convenience cast wrapper. */ @@ -52,6 +47,6 @@ void r300_init_surface_functions(struct r300_context* r300); struct pipe_context* r300_create_context(struct pipe_screen* screen, struct pipe_winsys* winsys, - struct amd_winsys* amd_winsys); + struct r300_winsys* r300_winsys); #endif /* R300_CONTEXT_H */ \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index ebd5324119..1422842e0c 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -23,48 +23,50 @@ #ifndef R300_CS_H #define R300_CS_H -#include "radeon_cs.h" #include "radeon_reg.h" +#include "r300_winsys.h" + /* Yes, I know macros are ugly. However, they are much prettier than the code * that they neatly hide away, and don't have the cost of function setup,so * we're going to use them. */ #define MAX_CS_SIZE 64 * 1024 / 4 +/* XXX stolen from radeon_drm.h */ +#define RADEON_GEM_DOMAIN_CPU 0x1 +#define RADEON_GEM_DOMAIN_GTT 0x2 +#define RADEON_GEM_DOMAIN_VRAM 0x4 + #define CP_PACKET0(register, count) \ (RADEON_CP_PACKET0 | ((count) << 16) | ((register) >> 2)) #define CS_LOCALS(context) \ - struct radeon_cs* cs = context->cs + struct r300_winsys* cs_winsys = context->winsys; \ + struct radeon_cs* cs = cs_winsys->cs -#define CHECK_CS(size) do { \ - if ((cs->cdw + (size) + 128) > MAX_CS_SIZE || radeon_cs_need_flush(cs)) { \ - /* XXX flush the CS */ \ - } } while (0) +#define CHECK_CS(size) \ + cs_winsys->check_cs(cs, (size)) -/* XXX radeon_cs_begin is currently unimplemented on the backend, but let's - * be future-proof, yeah? */ #define BEGIN_CS(size) do { \ CHECK_CS(size); \ - radeon_cs_begin(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ + cs_winsys->begin_cs(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ } while (0) #define OUT_CS(value) \ - radeon_cs_write_dword(cs, value) + cs_winsys->write_cs_dword(cs, value) #define OUT_CS_REG(register, value) do { \ OUT_CS(CP_PACKET0(register, 0)); \ OUT_CS(value); } while (0) #define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \ - radeon_cs_write_dword(cs, offset); \ - radeon_cs_write_reloc(cs, bo, rd, wd, flags); \ + OUT_CS(offset); \ + cs_winsys->write_cs_reloc(cs, bo, rd, wd, flags); \ } while (0) -/* XXX more future-proofing */ #define END_CS \ - radeon_cs_end(cs, __FILE__, __FUNCTION__, __LINE__) + cs_winsys->end_cs(cs, __FILE__, __FUNCTION__, __LINE__) #endif /* R300_CS_H */ \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 37a74b3c0a..dacde27888 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -144,13 +144,13 @@ struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint pci_id) if (!r300screen) return NULL; - /* XXX break this into its own function? */ + /* XXX break this into its own function? switch (pci_id) { default: debug_printf("%s: unknown PCI ID 0x%x, cannot create screen!\n", __FUNCTION__, pci_id); return NULL; - } + } */ r300screen->pci_id = pci_id; r300screen->screen.winsys = winsys; diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h new file mode 100644 index 0000000000..7048a9c88d --- /dev/null +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -0,0 +1,87 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_WINSYS_H +#define R300_WINSYS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* The public interface header for the r300 pipe driver. + * Any winsys hosting this pipe needs to implement r300_winsys and then + * call r300_create_context to start things. */ + +#include "pipe/p_defines.h" +#include "pipe/p_state.h" + +struct radeon_cs; + +struct r300_winsys { + + /* CS object. This is very much like Intel's batchbuffer. + * Fill it full of dwords and relocs and then submit. + * Repeat as needed. */ + /* Note: Unlike Mesa's version of this, we don't keep a copy of the CSM + * that was used to create this CS. Is this a good idea? */ + /* Note: The pipe driver doesn't know how to use this. This is purely + * for the winsys. */ + struct radeon_cs* cs; + + /* Check to see if there's room for commands. */ + boolean (*check_cs)(struct radeon_cs* cs, int size); + + /* Start a command emit. */ + void (*begin_cs)(struct radeon_cs* cs, + int size, + const char* file, + const char* function, + int line); + + /* Write a dword to the command buffer. */ + /* XXX is this an okay name for this handle? */ + void (*write_cs_dword)(struct radeon_cs* cs, uint32_t dword); + + /* Write a relocated dword to the command buffer. */ + void (*write_cs_reloc)(struct radeon_cs* cs, + struct pipe_buffer* bo, + uint32_t rd, + uint32_t wd, + uint32_t flags); + + /* Finish a command emit. */ + void (*end_cs)(struct radeon_cs* cs, + const char* file, + const char* function, + int line); + +}; + +struct pipe_context* r300_create_context(struct pipe_screen* screen, + struct pipe_winsys* winsys, + struct r300_winsys* r300_winsys); + +#ifdef __cplusplus +} +#endif + +#endif /* R300_WINSYS_H */ \ No newline at end of file diff --git a/src/gallium/winsys/drm/amd/Makefile b/src/gallium/winsys/drm/amd/Makefile index 0f23e3446c..fb77873404 100644 --- a/src/gallium/winsys/drm/amd/Makefile +++ b/src/gallium/winsys/drm/amd/Makefile @@ -7,11 +7,13 @@ LIBNAME = amd_dri.so MINIGLX_SOURCES = PIPE_DRIVERS = \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ + $(TOP)/src/gallium/drivers/r300/libr300.a DRIVER_SOURCES = \ amd_buffer.c \ amd_context.c \ + amd_r300.c \ amd_screen.c \ amd_winsys_softpipe.c @@ -21,6 +23,8 @@ C_SOURCES = \ ASM_SOURCES = +DRIVER_DEFINES = -I../../../drivers/r300 + include ../Makefile.template DRI_LIB_DEPS += -ldrm_radeon diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index 632caec6a7..7784964867 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -243,12 +243,10 @@ GLboolean amd_context_create(const __GLcontextModes *visual, } if (GL_TRUE) { - /* XXX second arg should be PCI ID, but damned if I know why */ - amd_context->pipe_screen = r300_create_screen(amd_context->pipe_winsys, - 0x0); - pipe = r300_create_context(amd_context->pipe_screen, + fprintf(stderr, "Creating r300 context..."); + pipe = r300_create_context(NULL, amd_context->pipe_winsys, - (struct amd_pipe_winsys*)amd_context->pipe_winsys); + amd_create_r300_winsys(amd_context->drm_fd)); } else { pipe = amd_create_softpipe(amd_context); } diff --git a/src/gallium/winsys/drm/amd/amd_context.h b/src/gallium/winsys/drm/amd/amd_context.h index 54a831f15a..12557c40c4 100644 --- a/src/gallium/winsys/drm/amd/amd_context.h +++ b/src/gallium/winsys/drm/amd/amd_context.h @@ -35,6 +35,8 @@ #include "state_tracker/st_context.h" #include "amd_screen.h" +#include "amd_r300.h" + struct amd_framebuffer { struct st_framebuffer *st_framebuffer; unsigned attachments; diff --git a/src/gallium/winsys/drm/amd/amd_r300.c b/src/gallium/winsys/drm/amd/amd_r300.c new file mode 100644 index 0000000000..0bc0a842c1 --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_r300.c @@ -0,0 +1,55 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "amd_r300.h" + +static boolean amd_r300_check_cs(struct radeon_cs* cs, int size) +{ + /* XXX check size here, lazy ass! */ + return TRUE; +} + +static void amd_r300_write_cs_reloc(struct radeon_cs* cs, + struct pipe_buffer* pbuffer, + uint32_t rd, + uint32_t wd, + uint32_t flags) +{ + radeon_cs_write_reloc(cs, ((struct amd_pipe_buffer*)pbuffer)->bo, rd, wd, flags); +} + +struct r300_winsys* amd_create_r300_winsys(int fd) +{ + struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys)); + + struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); + + winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4); + + winsys->check_cs = amd_r300_check_cs; + winsys->begin_cs = radeon_cs_begin; + winsys->write_cs_dword = radeon_cs_write_dword; + winsys->write_cs_reloc = amd_r300_write_cs_reloc; + winsys->end_cs = radeon_cs_end; + + return winsys; +} \ No newline at end of file diff --git a/src/gallium/winsys/drm/amd/amd_r300.h b/src/gallium/winsys/drm/amd/amd_r300.h new file mode 100644 index 0000000000..ef269454b3 --- /dev/null +++ b/src/gallium/winsys/drm/amd/amd_r300.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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_cs.h" + +#include "r300_winsys.h" + +#include "amd_buffer.h" + +struct r300_winsys* amd_create_r300_winsys(int fd); -- cgit v1.2.3 From 432ab001d042b816b5892398064e5735d0293955 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 13 Jan 2009 15:21:29 -0800 Subject: r300, amd: Add the ability to flush the CS. This is probably important, yeah? --- src/gallium/drivers/r300/r300_cs.h | 3 +++ src/gallium/drivers/r300/r300_winsys.h | 2 ++ src/gallium/winsys/drm/amd/amd_r300.c | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 1422842e0c..bd392afca3 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -69,4 +69,7 @@ #define END_CS \ cs_winsys->end_cs(cs, __FILE__, __FUNCTION__, __LINE__) +#define FLUSH_CS \ + cs_winsys->flush_cs(cs) + #endif /* R300_CS_H */ \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index 7048a9c88d..7711dc792d 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -74,6 +74,8 @@ struct r300_winsys { const char* function, int line); + /* Flush the CS. */ + void (*flush_cs)(struct radeon_cs* cs); }; struct pipe_context* r300_create_context(struct pipe_screen* screen, diff --git a/src/gallium/winsys/drm/amd/amd_r300.c b/src/gallium/winsys/drm/amd/amd_r300.c index 0bc0a842c1..0f543df9e1 100644 --- a/src/gallium/winsys/drm/amd/amd_r300.c +++ b/src/gallium/winsys/drm/amd/amd_r300.c @@ -37,6 +37,12 @@ static void amd_r300_write_cs_reloc(struct radeon_cs* cs, radeon_cs_write_reloc(cs, ((struct amd_pipe_buffer*)pbuffer)->bo, rd, wd, flags); } +static void amd_r300_flush_cs(struct radeon_cs* cs) +{ + radeon_cs_emit(cs); + radeon_cs_erase(cs); +} + struct r300_winsys* amd_create_r300_winsys(int fd) { struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys)); @@ -50,6 +56,7 @@ struct r300_winsys* amd_create_r300_winsys(int fd) winsys->write_cs_dword = radeon_cs_write_dword; winsys->write_cs_reloc = amd_r300_write_cs_reloc; winsys->end_cs = radeon_cs_end; + winsys->flush_cs = amd_r300_flush_cs; return winsys; -} \ No newline at end of file +} -- cgit v1.2.3 From 74288078eab1971cc6ce3ae00fa55eb917b5826a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 13 Jan 2009 19:11:19 -0800 Subject: r300: Add blend state. Also switched to r300_reg instead of radeon_reg. Yay? --- src/gallium/drivers/r300/r300_blit.c | 4 +- src/gallium/drivers/r300/r300_context.h | 16 + src/gallium/drivers/r300/r300_cs.h | 3 +- src/gallium/drivers/r300/r300_reg.h | 3259 +++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_state.c | 121 ++ src/gallium/drivers/r300/r300_state.h | 2 + 6 files changed, 3401 insertions(+), 4 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_reg.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index b8ddf6677f..6bcfbc0d79 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -35,7 +35,7 @@ int r300_fill_blit(struct r300_context* r300, { CS_LOCALS(r300); uint32_t dest_type; - +#if 0 /* Check for fallbacks. */ /* XXX we can do YUV surfaces, too, but only in 3D mode. Hmm... */ switch(cpp) { @@ -91,6 +91,6 @@ int r300_fill_blit(struct r300_context* r300, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_DMA_GUI_IDLE); END_CS; - +#endif return 1; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 119d46af58..b9fff0deab 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -27,6 +27,15 @@ #include "pipe/p_context.h" #include "util/u_memory.h" +struct r300_blend_state { + uint32_t blend_control; /* R300_RB3D_BLENDCNTL: 0x4e04 */ + uint32_t alpha_blend_control; /* R300_RB3D_ABLENDCNTL: 0x4e08 */ + uint32_t rop; /* R300_RB3D_ROPCNTL: 0x4e18 */ + uint32_t dither; /* R300_RB3D_DITHER_CTL: 0x4e50 */ +}; + +#define R300_NEW_BLEND 0x1 + struct r300_context { /* Parent class */ struct pipe_context context; @@ -35,6 +44,13 @@ struct r300_context { struct r300_winsys* winsys; /* Draw module. Used mostly for SW TCL. */ struct draw_context* draw; + + /* Various CSO state objects. */ + /* Blend state. */ + struct r300_blend_state* blend_state; + + /* Bitmask of dirty state objects. */ + uint32_t dirty_state; }; /* Convenience cast wrapper. */ diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index bd392afca3..92ed807657 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -23,8 +23,7 @@ #ifndef R300_CS_H #define R300_CS_H -#include "radeon_reg.h" - +#include "r300_reg.h" #include "r300_winsys.h" /* Yes, I know macros are ugly. However, they are much prettier than the code diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h new file mode 100644 index 0000000000..8b3fe431ab --- /dev/null +++ b/src/gallium/drivers/r300/r300_reg.h @@ -0,0 +1,3259 @@ +/************************************************************************** + +Copyright (C) 2004-2005 Nicolai Haehnle et al. + +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. + +**************************************************************************/ + +/* *INDENT-OFF* */ + +#ifndef _R300_REG_H +#define _R300_REG_H + +#define R300_MC_INIT_MISC_LAT_TIMER 0x180 +# define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0 +# define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4 +# define R300_MC_MISC__MC_DISP0R_INIT_LAT_SHIFT 8 +# define R300_MC_MISC__MC_DISP1R_INIT_LAT_SHIFT 12 +# define R300_MC_MISC__MC_FIXED_INIT_LAT_SHIFT 16 +# define R300_MC_MISC__MC_E2R_INIT_LAT_SHIFT 20 +# define R300_MC_MISC__MC_SAME_PAGE_PRIO_SHIFT 24 +# define R300_MC_MISC__MC_GLOBW_INIT_LAT_SHIFT 28 + + +#define R300_MC_INIT_GFX_LAT_TIMER 0x154 +# define R300_MC_MISC__MC_G3D0R_INIT_LAT_SHIFT 0 +# define R300_MC_MISC__MC_G3D1R_INIT_LAT_SHIFT 4 +# define R300_MC_MISC__MC_G3D2R_INIT_LAT_SHIFT 8 +# define R300_MC_MISC__MC_G3D3R_INIT_LAT_SHIFT 12 +# define R300_MC_MISC__MC_TX0R_INIT_LAT_SHIFT 16 +# define R300_MC_MISC__MC_TX1R_INIT_LAT_SHIFT 20 +# define R300_MC_MISC__MC_GLOBR_INIT_LAT_SHIFT 24 +# define R300_MC_MISC__MC_GLOBW_FULL_LAT_SHIFT 28 + +/* + * This file contains registers and constants for the R300. They have been + * found mostly by examining command buffers captured using glxtest, as well + * as by extrapolating some known registers and constants from the R200. + * I am fairly certain that they are correct unless stated otherwise + * in comments. + */ + +#define R300_SE_VPORT_XSCALE 0x1D98 +#define R300_SE_VPORT_XOFFSET 0x1D9C +#define R300_SE_VPORT_YSCALE 0x1DA0 +#define R300_SE_VPORT_YOFFSET 0x1DA4 +#define R300_SE_VPORT_ZSCALE 0x1DA8 +#define R300_SE_VPORT_ZOFFSET 0x1DAC + + +/* + * Vertex Array Processing (VAP) Control + */ +#define R300_VAP_CNTL 0x2080 +# define R300_PVS_NUM_SLOTS_SHIFT 0 +# define R300_PVS_NUM_CNTLRS_SHIFT 4 +# define R300_PVS_NUM_FPUS_SHIFT 8 +# define R300_VF_MAX_VTX_NUM_SHIFT 18 +# define R300_GL_CLIP_SPACE_DEF (0 << 22) +# define R300_DX_CLIP_SPACE_DEF (1 << 22) +# define R500_TCL_STATE_OPTIMIZATION (1 << 23) + +/* This register is written directly and also starts data section + * in many 3d CP_PACKET3's + */ +#define R300_VAP_VF_CNTL 0x2084 +# define R300_VAP_VF_CNTL__PRIM_TYPE__SHIFT 0 +# define R300_VAP_VF_CNTL__PRIM_NONE (0<<0) +# define R300_VAP_VF_CNTL__PRIM_POINTS (1<<0) +# define R300_VAP_VF_CNTL__PRIM_LINES (2<<0) +# define R300_VAP_VF_CNTL__PRIM_LINE_STRIP (3<<0) +# define R300_VAP_VF_CNTL__PRIM_TRIANGLES (4<<0) +# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN (5<<0) +# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP (6<<0) +# define R300_VAP_VF_CNTL__PRIM_LINE_LOOP (12<<0) +# define R300_VAP_VF_CNTL__PRIM_QUADS (13<<0) +# define R300_VAP_VF_CNTL__PRIM_QUAD_STRIP (14<<0) +# define R300_VAP_VF_CNTL__PRIM_POLYGON (15<<0) + +# define R300_VAP_VF_CNTL__PRIM_WALK__SHIFT 4 + /* State based - direct writes to registers trigger vertex + generation */ +# define R300_VAP_VF_CNTL__PRIM_WALK_STATE_BASED (0<<4) +# define R300_VAP_VF_CNTL__PRIM_WALK_INDICES (1<<4) +# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST (2<<4) +# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED (3<<4) + + /* I don't think I saw these three used.. */ +# define R300_VAP_VF_CNTL__COLOR_ORDER__SHIFT 6 +# define R300_VAP_VF_CNTL__TCL_OUTPUT_CTL_ENA__SHIFT 9 +# define R300_VAP_VF_CNTL__PROG_STREAM_ENA__SHIFT 10 + + /* index size - when not set the indices are assumed to be 16 bit */ +# define R300_VAP_VF_CNTL__INDEX_SIZE_32bit (1<<11) + /* number of vertices */ +# define R300_VAP_VF_CNTL__NUM_VERTICES__SHIFT 16 + +#define R500_VAP_INDEX_OFFSET 0x208c + +#define R300_VAP_OUTPUT_VTX_FMT_0 0x2090 +# define R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT (1<<0) +# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT (1<<1) +# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT (1<<2) +# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT (1<<3) +# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT (1<<4) +# define R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT (1<<16) + +#define R300_VAP_OUTPUT_VTX_FMT_1 0x2094 + /* each of the following is 3 bits wide, specifies number + of components */ +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0 +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3 +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6 +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9 +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12 +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15 +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18 +# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21 +# define R300_VAP_OUTPUT_VTX_FMT_1__NOT_PRESENT 0 +# define R300_VAP_OUTPUT_VTX_FMT_1__1_COMPONENT 1 +# define R300_VAP_OUTPUT_VTX_FMT_1__2_COMPONENTS 2 +# define R300_VAP_OUTPUT_VTX_FMT_1__3_COMPONENTS 3 +# define R300_VAP_OUTPUT_VTX_FMT_1__4_COMPONENTS 4 + +#define R300_SE_VTE_CNTL 0x20b0 +# define R300_VPORT_X_SCALE_ENA (1 << 0) +# define R300_VPORT_X_OFFSET_ENA (1 << 1) +# define R300_VPORT_Y_SCALE_ENA (1 << 2) +# define R300_VPORT_Y_OFFSET_ENA (1 << 3) +# define R300_VPORT_Z_SCALE_ENA (1 << 4) +# define R300_VPORT_Z_OFFSET_ENA (1 << 5) +# define R300_VTX_XY_FMT (1 << 8) +# define R300_VTX_Z_FMT (1 << 9) +# define R300_VTX_W0_FMT (1 << 10) +# define R300_SERIAL_PROC_ENA (1 << 11) + +/* BEGIN: Vertex data assembly - lots of uncertainties */ + +/* gap */ + +/* Maximum Vertex Indx Clamp */ +#define R300_VAP_VF_MAX_VTX_INDX 0x2134 +/* Minimum Vertex Indx Clamp */ +#define R300_VAP_VF_MIN_VTX_INDX 0x2138 + +/** Vertex assembler/processor control status */ +#define R300_VAP_CNTL_STATUS 0x2140 +/* No swap at all (default) */ +# define R300_VC_NO_SWAP (0 << 0) +/* 16-bit swap: 0xAABBCCDD becomes 0xBBAADDCC */ +# define R300_VC_16BIT_SWAP (1 << 0) +/* 32-bit swap: 0xAABBCCDD becomes 0xDDCCBBAA */ +# define R300_VC_32BIT_SWAP (2 << 0) +/* Half-dword swap: 0xAABBCCDD becomes 0xCCDDAABB */ +# define R300_VC_HALF_DWORD_SWAP (3 << 0) +/* The TCL engine will not be used (as it is logically or even physically removed) */ +# define R300_VAP_TCL_BYPASS (1 << 8) +/* Read only flag if TCL engine is busy. */ +# define R300_VAP_PVS_BUSY (1 << 11) +/* TODO: gap for MAX_MPS */ +/* Read only flag if the vertex store is busy. */ +# define R300_VAP_VS_BUSY (1 << 24) +/* Read only flag if the reciprocal engine is busy. */ +# define R300_VAP_RCP_BUSY (1 << 25) +/* Read only flag if the viewport transform engine is busy. */ +# define R300_VAP_VTE_BUSY (1 << 26) +/* Read only flag if the memory interface unit is busy. */ +# define R300_VAP_MUI_BUSY (1 << 27) +/* Read only flag if the vertex cache is busy. */ +# define R300_VAP_VC_BUSY (1 << 28) +/* Read only flag if the vertex fetcher is busy. */ +# define R300_VAP_VF_BUSY (1 << 29) +/* Read only flag if the register pipeline is busy. */ +# define R300_VAP_REGPIPE_BUSY (1 << 30) +/* Read only flag if the VAP engine is busy. */ +# define R300_VAP_VAP_BUSY (1 << 31) + +/* gap */ + +/* Where do we get our vertex data? + * + * Vertex data either comes either from immediate mode registers or from + * vertex arrays. + * There appears to be no mixed mode (though we can force the pitch of + * vertex arrays to 0, effectively reusing the same element over and over + * again). + * + * Immediate mode is controlled by the INPUT_CNTL registers. I am not sure + * if these registers influence vertex array processing. + * + * Vertex arrays are controlled via the 3D_LOAD_VBPNTR packet3. + * + * In both cases, vertex attributes are then passed through INPUT_ROUTE. + * + * Beginning with INPUT_ROUTE_0_0 is a list of WORDs that route vertex data + * into the vertex processor's input registers. + * The first word routes the first input, the second word the second, etc. + * The corresponding input is routed into the register with the given index. + * The list is ended by a word with INPUT_ROUTE_END set. + * + * Always set COMPONENTS_4 in immediate mode. + */ + +#define R300_VAP_PROG_STREAM_CNTL_0 0x2150 +# define R300_DATA_TYPE_0_SHIFT 0 +# define R300_DATA_TYPE_FLOAT_1 0 +# define R300_DATA_TYPE_FLOAT_2 1 +# define R300_DATA_TYPE_FLOAT_3 2 +# define R300_DATA_TYPE_FLOAT_4 3 +# define R300_DATA_TYPE_BYTE 4 +# define R300_DATA_TYPE_D3DCOLOR 5 +# define R300_DATA_TYPE_SHORT_2 6 +# define R300_DATA_TYPE_SHORT_4 7 +# define R300_DATA_TYPE_VECTOR_3_TTT 8 +# define R300_DATA_TYPE_VECTOR_3_EET 9 +# define R300_SKIP_DWORDS_SHIFT 4 +# define R300_DST_VEC_LOC_SHIFT 8 +# define R300_LAST_VEC (1 << 13) +# define R300_SIGNED (1 << 14) +# define R300_NORMALIZE (1 << 15) +# define R300_DATA_TYPE_1_SHIFT 16 +#define R300_VAP_PROG_STREAM_CNTL_1 0x2154 +#define R300_VAP_PROG_STREAM_CNTL_2 0x2158 +#define R300_VAP_PROG_STREAM_CNTL_3 0x215C +#define R300_VAP_PROG_STREAM_CNTL_4 0x2160 +#define R300_VAP_PROG_STREAM_CNTL_5 0x2164 +#define R300_VAP_PROG_STREAM_CNTL_6 0x2168 +#define R300_VAP_PROG_STREAM_CNTL_7 0x216C +/* gap */ + +/* Notes: + * - always set up to produce at least two attributes: + * if vertex program uses only position, fglrx will set normal, too + * - INPUT_CNTL_0_COLOR and INPUT_CNTL_COLOR bits are always equal. + */ +#define R300_VAP_VTX_STATE_CNTL 0x2180 +# define R300_COLOR_0_ASSEMBLY_SHIFT 0 +# define R300_SEL_COLOR 0 +# define R300_SEL_USER_COLOR_0 1 +# define R300_SEL_USER_COLOR_1 2 +# define R300_COLOR_1_ASSEMBLY_SHIFT 2 +# define R300_COLOR_2_ASSEMBLY_SHIFT 4 +# define R300_COLOR_3_ASSEMBLY_SHIFT 6 +# define R300_COLOR_4_ASSEMBLY_SHIFT 8 +# define R300_COLOR_5_ASSEMBLY_SHIFT 10 +# define R300_COLOR_6_ASSEMBLY_SHIFT 12 +# define R300_COLOR_7_ASSEMBLY_SHIFT 14 +# define R300_UPDATE_USER_COLOR_0_ENA (1 << 16) + +/* + * Each bit in this field applies to the corresponding vector in the VSM + * memory (i.e. Bit 0 applies to VECTOR_0 (POSITION), etc.). If the bit + * is set, then the corresponding 4-Dword Vector is output into the Vertex Stream. + */ +#define R300_VAP_VSM_VTX_ASSM 0x2184 +# define R300_INPUT_CNTL_POS 0x00000001 +# define R300_INPUT_CNTL_NORMAL 0x00000002 +# define R300_INPUT_CNTL_COLOR 0x00000004 +# define R300_INPUT_CNTL_TC0 0x00000400 +# define R300_INPUT_CNTL_TC1 0x00000800 +# define R300_INPUT_CNTL_TC2 0x00001000 /* GUESS */ +# define R300_INPUT_CNTL_TC3 0x00002000 /* GUESS */ +# define R300_INPUT_CNTL_TC4 0x00004000 /* GUESS */ +# define R300_INPUT_CNTL_TC5 0x00008000 /* GUESS */ +# define R300_INPUT_CNTL_TC6 0x00010000 /* GUESS */ +# define R300_INPUT_CNTL_TC7 0x00020000 /* GUESS */ + +/* Programmable Stream Control Signed Normalize Control */ +#define R300_VAP_PSC_SGN_NORM_CNTL 0x21dc +# define SGN_NORM_ZERO 0 +# define SGN_NORM_ZERO_CLAMP_MINUS_ONE 1 +# define SGN_NORM_NO_ZERO 2 + +/* gap */ + +/* Words parallel to INPUT_ROUTE_0; All words that are active in INPUT_ROUTE_0 + * are set to a swizzling bit pattern, other words are 0. + * + * In immediate mode, the pattern is always set to xyzw. In vertex array + * mode, the swizzling pattern is e.g. used to set zw components in texture + * coordinates with only tweo components. + */ +#define R300_VAP_PROG_STREAM_CNTL_EXT_0 0x21e0 +# define R300_SWIZZLE0_SHIFT 0 +# define R300_SWIZZLE_SELECT_X_SHIFT 0 +# define R300_SWIZZLE_SELECT_Y_SHIFT 3 +# define R300_SWIZZLE_SELECT_Z_SHIFT 6 +# define R300_SWIZZLE_SELECT_W_SHIFT 9 + +# define R300_SWIZZLE_SELECT_X 0 +# define R300_SWIZZLE_SELECT_Y 1 +# define R300_SWIZZLE_SELECT_Z 2 +# define R300_SWIZZLE_SELECT_W 3 +# define R300_SWIZZLE_SELECT_FP_ZERO 4 +# define R300_SWIZZLE_SELECT_FP_ONE 5 +/* alternate forms for r300_emit.c */ +# define R300_INPUT_ROUTE_SELECT_X 0 +# define R300_INPUT_ROUTE_SELECT_Y 1 +# define R300_INPUT_ROUTE_SELECT_Z 2 +# define R300_INPUT_ROUTE_SELECT_W 3 +# define R300_INPUT_ROUTE_SELECT_ZERO 4 +# define R300_INPUT_ROUTE_SELECT_ONE 5 + +# define R300_WRITE_ENA_SHIFT 12 +# define R300_WRITE_ENA_X 1 +# define R300_WRITE_ENA_Y 2 +# define R300_WRITE_ENA_Z 4 +# define R300_WRITE_ENA_W 8 +# define R300_SWIZZLE1_SHIFT 16 +#define R300_VAP_PROG_STREAM_CNTL_EXT_1 0x21e4 +#define R300_VAP_PROG_STREAM_CNTL_EXT_2 0x21e8 +#define R300_VAP_PROG_STREAM_CNTL_EXT_3 0x21ec +#define R300_VAP_PROG_STREAM_CNTL_EXT_4 0x21f0 +#define R300_VAP_PROG_STREAM_CNTL_EXT_5 0x21f4 +#define R300_VAP_PROG_STREAM_CNTL_EXT_6 0x21f8 +#define R300_VAP_PROG_STREAM_CNTL_EXT_7 0x21fc + +/* END: Vertex data assembly */ + +/* gap */ + +/* BEGIN: Upload vertex program and data */ + +/* + * The programmable vertex shader unit has a memory bank of unknown size + * that can be written to in 16 byte units by writing the address into + * UPLOAD_ADDRESS, followed by data in UPLOAD_DATA (multiples of 4 DWORDs). + * + * Pointers into the memory bank are always in multiples of 16 bytes. + * + * The memory bank is divided into areas with fixed meaning. + * + * Starting at address UPLOAD_PROGRAM: Vertex program instructions. + * Native limits reported by drivers from ATI suggest size 256 (i.e. 4KB), + * whereas the difference between known addresses suggests size 512. + * + * Starting at address UPLOAD_PARAMETERS: Vertex program parameters. + * Native reported limits and the VPI layout suggest size 256, whereas + * difference between known addresses suggests size 512. + * + * At address UPLOAD_POINTSIZE is a vector (0, 0, ps, 0), where ps is the + * floating point pointsize. The exact purpose of this state is uncertain, + * as there is also the R300_RE_POINTSIZE register. + * + * Multiple vertex programs and parameter sets can be loaded at once, + * which could explain the size discrepancy. + */ +#define R300_VAP_PVS_VECTOR_INDX_REG 0x2200 +# define R300_PVS_CODE_START 0 +# define R300_MAX_PVS_CODE_LINES 256 +# define R500_MAX_PVS_CODE_LINES 1024 +# define R300_PVS_CONST_START 512 +# define R500_PVS_CONST_START 1024 +# define R300_MAX_PVS_CONST_VECS 256 +# define R500_MAX_PVS_CONST_VECS 1024 +# define R300_PVS_UCP_START 1024 +# define R500_PVS_UCP_START 1536 +# define R300_POINT_VPORT_SCALE_OFFSET 1030 +# define R500_POINT_VPORT_SCALE_OFFSET 1542 +# define R300_POINT_GEN_TEX_OFFSET 1031 +# define R500_POINT_GEN_TEX_OFFSET 1543 + +/* + * These are obsolete defines form r300_context.h, but they might give some + * clues when investigating the addresses further... + */ +#if 0 +#define VSF_DEST_PROGRAM 0x0 +#define VSF_DEST_MATRIX0 0x200 +#define VSF_DEST_MATRIX1 0x204 +#define VSF_DEST_MATRIX2 0x208 +#define VSF_DEST_VECTOR0 0x20c +#define VSF_DEST_VECTOR1 0x20d +#define VSF_DEST_UNKNOWN1 0x400 +#define VSF_DEST_UNKNOWN2 0x406 +#endif + +/* gap */ + +#define R300_VAP_PVS_UPLOAD_DATA 0x2208 + +/* END: Upload vertex program and data */ + +/* gap */ + +/* I do not know the purpose of this register. However, I do know that + * it is set to 221C_CLEAR for clear operations and to 221C_NORMAL + * for normal rendering. + * + * 2007-11-05: This register is the user clip plane control register, but there + * also seems to be a rendering mode control; the NORMAL/CLEAR defines. + * + * See bug #9871. http://bugs.freedesktop.org/attachment.cgi?id=10672&action=view + */ +#define R300_VAP_CLIP_CNTL 0x221C +# define R300_VAP_UCP_ENABLE_0 (1 << 0) +# define R300_VAP_UCP_ENABLE_1 (1 << 1) +# define R300_VAP_UCP_ENABLE_2 (1 << 2) +# define R300_VAP_UCP_ENABLE_3 (1 << 3) +# define R300_VAP_UCP_ENABLE_4 (1 << 4) +# define R300_VAP_UCP_ENABLE_5 (1 << 5) +# define R300_PS_UCP_MODE_DIST_COP (0 << 14) +# define R300_PS_UCP_MODE_RADIUS_COP (1 << 14) +# define R300_PS_UCP_MODE_RADIUS_COP_CLIP (2 << 14) +# define R300_PS_UCP_MODE_CLIP_AS_TRIFAN (3 << 14) +# define R300_CLIP_DISABLE (1 << 16) +# define R300_UCP_CULL_ONLY_ENABLE (1 << 17) +# define R300_BOUNDARY_EDGE_FLAG_ENABLE (1 << 18) +# define R500_COLOR2_IS_TEXTURE (1 << 20) +# define R500_COLOR3_IS_TEXTURE (1 << 21) + +/* These seem to be per-pixel and per-vertex X and Y clipping planes. The first + * plane is per-pixel and the second plane is per-vertex. + * + * This was determined by experimentation alone but I believe it is correct. + * + * These registers are called X_QUAD0_1_FL to X_QUAD0_4_FL by glxtest. + */ +#define R300_VAP_GB_VERT_CLIP_ADJ 0x2220 +#define R300_VAP_GB_VERT_DISC_ADJ 0x2224 +#define R300_VAP_GB_HORZ_CLIP_ADJ 0x2228 +#define R300_VAP_GB_HORZ_DISC_ADJ 0x222c + +/* gap */ + +/* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between + * rendering commands and overwriting vertex program parameters. + * Therefore, I suspect writing zero to 0x2284 synchronizes the engine and + * avoids bugs caused by still running shaders reading bad data from memory. + */ +#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 + +/* This register is used to define the number of core clocks to wait for a + * vertex to be received by the VAP input controller (while the primitive + * path is backed up) before forcing any accumulated vertices to be submitted + * to the vertex processing path. + */ +#define VAP_PVS_VTX_TIMEOUT_REG 0x2288 +# define R300_2288_R300 0x00750000 /* -- nh */ +# define R300_2288_RV350 0x0000FFFF /* -- Vladimir */ + +/* gap */ + +/* Addresses are relative to the vertex program instruction area of the + * memory bank. PROGRAM_END points to the last instruction of the active + * program + * + * The meaning of the two UNKNOWN fields is obviously not known. However, + * experiments so far have shown that both *must* point to an instruction + * inside the vertex program, otherwise the GPU locks up. + * + * fglrx usually sets CNTL_3_UNKNOWN to the end of the program and + * R300_PVS_CNTL_1_POS_END_SHIFT points to instruction where last write to + * position takes place. + * + * Most likely this is used to ignore rest of the program in cases + * where group of verts arent visible. For some reason this "section" + * is sometimes accepted other instruction that have no relationship with + * position calculations. + */ +#define R300_VAP_PVS_CODE_CNTL_0 0x22D0 +# define R300_PVS_FIRST_INST_SHIFT 0 +# define R300_PVS_XYZW_VALID_INST_SHIFT 10 +# define R300_PVS_LAST_INST_SHIFT 20 +/* Addresses are relative the the vertex program parameters area. */ +#define R300_VAP_PVS_CONST_CNTL 0x22D4 +# define R300_PVS_CONST_BASE_OFFSET_SHIFT 0 +# define R300_PVS_MAX_CONST_ADDR_SHIFT 16 +#define R300_VAP_PVS_CODE_CNTL_1 0x22D8 +# define R300_PVS_LAST_VTX_SRC_INST_SHIFT 0 +#define R300_VAP_PVS_FLOW_CNTL_OPC 0x22DC + +/* The entire range from 0x2300 to 0x2AC inclusive seems to be used for + * immediate vertices + */ +#define R300_VAP_VTX_COLOR_R 0x2464 +#define R300_VAP_VTX_COLOR_G 0x2468 +#define R300_VAP_VTX_COLOR_B 0x246C +#define R300_VAP_VTX_POS_0_X_1 0x2490 /* used for glVertex2*() */ +#define R300_VAP_VTX_POS_0_Y_1 0x2494 +#define R300_VAP_VTX_COLOR_PKD 0x249C /* RGBA */ +#define R300_VAP_VTX_POS_0_X_2 0x24A0 /* used for glVertex3*() */ +#define R300_VAP_VTX_POS_0_Y_2 0x24A4 +#define R300_VAP_VTX_POS_0_Z_2 0x24A8 +/* write 0 to indicate end of packet? */ +#define R300_VAP_VTX_END_OF_PKT 0x24AC + +/* gap */ + +/* These are values from r300_reg/r300_reg.h - they are known to be correct + * and are here so we can use one register file instead of several + * - Vladimir + */ +#define R300_GB_VAP_RASTER_VTX_FMT_0 0x4000 +# define R300_GB_VAP_RASTER_VTX_FMT_0__POS_PRESENT (1<<0) +# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_0_PRESENT (1<<1) +# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_1_PRESENT (1<<2) +# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_2_PRESENT (1<<3) +# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_3_PRESENT (1<<4) +# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_SPACE (0xf<<5) +# define R300_GB_VAP_RASTER_VTX_FMT_0__PT_SIZE_PRESENT (0x1<<16) + +#define R300_GB_VAP_RASTER_VTX_FMT_1 0x4004 + /* each of the following is 3 bits wide, specifies number + of components */ +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0 +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3 +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6 +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9 +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12 +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15 +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18 +# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21 + +/* UNK30 seems to enables point to quad transformation on textures + * (or something closely related to that). + * This bit is rather fatal at the time being due to lackings at pixel + * shader side + * Specifies top of Raster pipe specific enable controls. + */ +#define R300_GB_ENABLE 0x4008 +# define R300_GB_POINT_STUFF_DISABLE (0 << 0) +# define R300_GB_POINT_STUFF_ENABLE (1 << 0) /* Specifies if points will have stuffed texture coordinates. */ +# define R300_GB_LINE_STUFF_DISABLE (0 << 1) +# define R300_GB_LINE_STUFF_ENABLE (1 << 1) /* Specifies if lines will have stuffed texture coordinates. */ +# define R300_GB_TRIANGLE_STUFF_DISABLE (0 << 2) +# define R300_GB_TRIANGLE_STUFF_ENABLE (1 << 2) /* Specifies if triangles will have stuffed texture coordinates. */ +# define R300_GB_STENCIL_AUTO_DISABLE (0 << 4) +# define R300_GB_STENCIL_AUTO_ENABLE (1 << 4) /* Enable stencil auto inc/dec based on triangle cw/ccw, force into dzy low bit. */ +# define R300_GB_STENCIL_AUTO_FORCE (2 << 4) /* Force 0 into dzy low bit. */ + + /* each of the following is 2 bits wide */ +#define R300_GB_TEX_REPLICATE 0 /* Replicate VAP source texture coordinates (S,T,[R,Q]). */ +#define R300_GB_TEX_ST 1 /* Stuff with source texture coordinates (S,T). */ +#define R300_GB_TEX_STR 2 /* Stuff with source texture coordinates (S,T,R). */ +# define R300_GB_TEX0_SOURCE_SHIFT 16 +# define R300_GB_TEX1_SOURCE_SHIFT 18 +# define R300_GB_TEX2_SOURCE_SHIFT 20 +# define R300_GB_TEX3_SOURCE_SHIFT 22 +# define R300_GB_TEX4_SOURCE_SHIFT 24 +# define R300_GB_TEX5_SOURCE_SHIFT 26 +# define R300_GB_TEX6_SOURCE_SHIFT 28 +# define R300_GB_TEX7_SOURCE_SHIFT 30 + +/* MSPOS - positions for multisample antialiasing (?) */ +#define R300_GB_MSPOS0 0x4010 + /* shifts - each of the fields is 4 bits */ +# define R300_GB_MSPOS0__MS_X0_SHIFT 0 +# define R300_GB_MSPOS0__MS_Y0_SHIFT 4 +# define R300_GB_MSPOS0__MS_X1_SHIFT 8 +# define R300_GB_MSPOS0__MS_Y1_SHIFT 12 +# define R300_GB_MSPOS0__MS_X2_SHIFT 16 +# define R300_GB_MSPOS0__MS_Y2_SHIFT 20 +# define R300_GB_MSPOS0__MSBD0_Y 24 +# define R300_GB_MSPOS0__MSBD0_X 28 + +#define R300_GB_MSPOS1 0x4014 +# define R300_GB_MSPOS1__MS_X3_SHIFT 0 +# define R300_GB_MSPOS1__MS_Y3_SHIFT 4 +# define R300_GB_MSPOS1__MS_X4_SHIFT 8 +# define R300_GB_MSPOS1__MS_Y4_SHIFT 12 +# define R300_GB_MSPOS1__MS_X5_SHIFT 16 +# define R300_GB_MSPOS1__MS_Y5_SHIFT 20 +# define R300_GB_MSPOS1__MSBD1 24 + +/* Specifies the graphics pipeline configuration for rasterization. */ +#define R300_GB_TILE_CONFIG 0x4018 +# define R300_GB_TILE_DISABLE (0 << 0) +# define R300_GB_TILE_ENABLE (1 << 0) +# define R300_GB_TILE_PIPE_COUNT_RV300 (0 << 1) /* RV350 (1 pipe, 1 ctx) */ +# define R300_GB_TILE_PIPE_COUNT_R300 (3 << 1) /* R300 (2 pipes, 1 ctx) */ +# define R300_GB_TILE_PIPE_COUNT_R420_3P (6 << 1) /* R420-3P (3 pipes, 1 ctx) */ +# define R300_GB_TILE_PIPE_COUNT_R420 (7 << 1) /* R420 (4 pipes, 1 ctx) */ +# define R300_GB_TILE_SIZE_8 (0 << 4) +# define R300_GB_TILE_SIZE_16 (1 << 4) +# define R300_GB_TILE_SIZE_32 (2 << 4) +# define R300_GB_SUPER_SIZE_1 (0 << 6) +# define R300_GB_SUPER_SIZE_2 (1 << 6) +# define R300_GB_SUPER_SIZE_4 (2 << 6) +# define R300_GB_SUPER_SIZE_8 (3 << 6) +# define R300_GB_SUPER_SIZE_16 (4 << 6) +# define R300_GB_SUPER_SIZE_32 (5 << 6) +# define R300_GB_SUPER_SIZE_64 (6 << 6) +# define R300_GB_SUPER_SIZE_128 (7 << 6) +# define R300_GB_SUPER_X_SHIFT 9 /* 3 bits wide */ +# define R300_GB_SUPER_Y_SHIFT 12 /* 3 bits wide */ +# define R300_GB_SUPER_TILE_A (0 << 15) +# define R300_GB_SUPER_TILE_B (1 << 15) +# define R300_GB_SUBPIXEL_1_12 (0 << 16) +# define R300_GB_SUBPIXEL_1_16 (1 << 16) +# define GB_TILE_CONFIG_QUADS_PER_RAS_4 (0 << 17) +# define GB_TILE_CONFIG_QUADS_PER_RAS_8 (1 << 17) +# define GB_TILE_CONFIG_QUADS_PER_RAS_16 (2 << 17) +# define GB_TILE_CONFIG_QUADS_PER_RAS_32 (3 << 17) +# define GB_TILE_CONFIG_BB_SCAN_INTERCEPT (0 << 19) +# define GB_TILE_CONFIG_BB_SCAN_BOUND_BOX (1 << 19) +# define GB_TILE_CONFIG_ALT_SCAN_EN_LR (0 << 20) +# define GB_TILE_CONFIG_ALT_SCAN_EN_LRL (1 << 20) +# define GB_TILE_CONFIG_ALT_OFFSET (0 << 21) +# define GB_TILE_CONFIG_SUBPRECISION (0 << 22) +# define GB_TILE_CONFIG_ALT_TILING_DEF (0 << 23) +# define GB_TILE_CONFIG_ALT_TILING_3_2 (1 << 23) +# define GB_TILE_CONFIG_Z_EXTENDED_24_1 (0 << 24) +# define GB_TILE_CONFIG_Z_EXTENDED_S25_1 (1 << 24) + +/* Specifies the sizes of the various FIFO`s in the sc/rs/us. This register must be the first one written */ +#define R300_GB_FIFO_SIZE 0x4024 + /* each of the following is 2 bits wide */ +#define R300_GB_FIFO_SIZE_32 0 +#define R300_GB_FIFO_SIZE_64 1 +#define R300_GB_FIFO_SIZE_128 2 +#define R300_GB_FIFO_SIZE_256 3 +# define R300_SC_IFIFO_SIZE_SHIFT 0 +# define R300_SC_TZFIFO_SIZE_SHIFT 2 +# define R300_SC_BFIFO_SIZE_SHIFT 4 + +# define R300_US_OFIFO_SIZE_SHIFT 12 +# define R300_US_WFIFO_SIZE_SHIFT 14 + /* the following use the same constants as above, but meaning is + is times 2 (i.e. instead of 32 words it means 64 */ +# define R300_RS_TFIFO_SIZE_SHIFT 6 +# define R300_RS_CFIFO_SIZE_SHIFT 8 +# define R300_US_RAM_SIZE_SHIFT 10 + /* watermarks, 3 bits wide */ +# define R300_RS_HIGHWATER_COL_SHIFT 16 +# define R300_RS_HIGHWATER_TEX_SHIFT 19 +# define R300_OFIFO_HIGHWATER_SHIFT 22 /* two bits only */ +# define R300_CUBE_FIFO_HIGHWATER_COL_SHIFT 24 + +#define GB_Z_PEQ_CONFIG 0x4028 +# define GB_Z_PEQ_CONFIG_Z_PEQ_SIZE_4_4 (0 << 0) +# define GB_Z_PEQ_CONFIG_Z_PEQ_SIZE_8_8 (1 << 0) + +/* Specifies various polygon specific selects (fog, depth, perspective). */ +#define R300_GB_SELECT 0x401c +# define R300_GB_FOG_SELECT_C0A (0 << 0) +# define R300_GB_FOG_SELECT_C1A (1 << 0) +# define R300_GB_FOG_SELECT_C2A (2 << 0) +# define R300_GB_FOG_SELECT_C3A (3 << 0) +# define R300_GB_FOG_SELECT_1_1_W (4 << 0) +# define R300_GB_FOG_SELECT_Z (5 << 0) +# define R300_GB_DEPTH_SELECT_Z (0 << 3 +# define R300_GB_DEPTH_SELECT_1_1_W (1 << 3) +# define R300_GB_W_SELECT_1_W (0 << 4) +# define R300_GB_W_SELECT_1 (1 << 4) +# define R300_GB_FOG_STUFF_DISABLE (0 << 5) +# define R300_GB_FOG_STUFF_ENABLE (1 << 5) +# define R300_GB_FOG_STUFF_TEX_SHIFT 6 +# define R300_GB_FOG_STUFF_TEX_MASK 0x000003c0 +# define R300_GB_FOG_STUFF_COMP_SHIFT 10 +# define R300_GB_FOG_STUFF_COMP_MASK 0x00000c00 + +/* Specifies the graphics pipeline configuration for antialiasing. */ +#define GB_AA_CONFIG 0x4020 +# define GB_AA_CONFIG_AA_DISABLE (0 << 0) +# define GB_AA_CONFIG_AA_ENABLE (1 << 0) +# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_2 (0 << 1) +# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_3 (1 << 1) +# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_4 (2 << 1) +# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_6 (3 << 1) + +/* Selects which of 4 pipes are active. */ +#define GB_PIPE_SELECT 0x402c +# define GB_PIPE_SELECT_PIPE0_ID_SHIFT 0 +# define GB_PIPE_SELECT_PIPE1_ID_SHIFT 2 +# define GB_PIPE_SELECT_PIPE2_ID_SHIFT 4 +# define GB_PIPE_SELECT_PIPE3_ID_SHIFT 6 +# define GB_PIPE_SELECT_PIPE_MASK_SHIFT 8 +# define GB_PIPE_SELECT_MAX_PIPE 12 +# define GB_PIPE_SELECT_BAD_PIPES 14 +# define GB_PIPE_SELECT_CONFIG_PIPES 18 + + +/* Specifies the sizes of the various FIFO`s in the sc/rs. */ +#define GB_FIFO_SIZE1 0x4070 +/* High water mark for SC input fifo */ +# define GB_FIFO_SIZE1_SC_HIGHWATER_IFIFO_SHIFT 0 +# define GB_FIFO_SIZE1_SC_HIGHWATER_IFIFO_MASK 0x0000003f +/* High water mark for SC input fifo (B) */ +# define GB_FIFO_SIZE1_SC_HIGHWATER_BFIFO_SHIFT 6 +# define GB_FIFO_SIZE1_SC_HIGHWATER_BFIFO_MASK 0x00000fc0 +/* High water mark for RS colors' fifo */ +# define GB_FIFO_SIZE1_SC_HIGHWATER_COL_SHIFT 12 +# define GB_FIFO_SIZE1_SC_HIGHWATER_COL_MASK 0x0003f000 +/* High water mark for RS textures' fifo */ +# define GB_FIFO_SIZE1_SC_HIGHWATER_TEX_SHIFT 18 +# define GB_FIFO_SIZE1_SC_HIGHWATER_TEX_MASK 0x00fc0000 + +/* This table specifies the source location and format for up to 16 texture + * addresses (i[0]:i[15]) and four colors (c[0]:c[3]) + */ +#define R500_RS_IP_0 0x4074 +#define R500_RS_IP_1 0x4078 +#define R500_RS_IP_2 0x407C +#define R500_RS_IP_3 0x4080 +#define R500_RS_IP_4 0x4084 +#define R500_RS_IP_5 0x4088 +#define R500_RS_IP_6 0x408C +#define R500_RS_IP_7 0x4090 +#define R500_RS_IP_8 0x4094 +#define R500_RS_IP_9 0x4098 +#define R500_RS_IP_10 0x409C +#define R500_RS_IP_11 0x40A0 +#define R500_RS_IP_12 0x40A4 +#define R500_RS_IP_13 0x40A8 +#define R500_RS_IP_14 0x40AC +#define R500_RS_IP_15 0x40B0 +#define R500_RS_IP_PTR_K0 62 +#define R500_RS_IP_PTR_K1 63 +#define R500_RS_IP_TEX_PTR_S_SHIFT 0 +#define R500_RS_IP_TEX_PTR_T_SHIFT 6 +#define R500_RS_IP_TEX_PTR_R_SHIFT 12 +#define R500_RS_IP_TEX_PTR_Q_SHIFT 18 +#define R500_RS_IP_COL_PTR_SHIFT 24 +#define R500_RS_IP_COL_FMT_SHIFT 27 +# define R500_RS_COL_PTR(x) (x << 24) +# define R500_RS_COL_FMT(x) (x << 27) +/* gap */ +#define R500_RS_IP_OFFSET_DIS (0 << 31) +#define R500_RS_IP_OFFSET_EN (1 << 31) + +/* gap */ + +/* Zero to flush caches. */ +#define R300_TX_INVALTAGS 0x4100 +#define R300_TX_FLUSH 0x0 + +/* The upper enable bits are guessed, based on fglrx reported limits. */ +#define R300_TX_ENABLE 0x4104 +# define R300_TX_ENABLE_0 (1 << 0) +# define R300_TX_ENABLE_1 (1 << 1) +# define R300_TX_ENABLE_2 (1 << 2) +# define R300_TX_ENABLE_3 (1 << 3) +# define R300_TX_ENABLE_4 (1 << 4) +# define R300_TX_ENABLE_5 (1 << 5) +# define R300_TX_ENABLE_6 (1 << 6) +# define R300_TX_ENABLE_7 (1 << 7) +# define R300_TX_ENABLE_8 (1 << 8) +# define R300_TX_ENABLE_9 (1 << 9) +# define R300_TX_ENABLE_10 (1 << 10) +# define R300_TX_ENABLE_11 (1 << 11) +# define R300_TX_ENABLE_12 (1 << 12) +# define R300_TX_ENABLE_13 (1 << 13) +# define R300_TX_ENABLE_14 (1 << 14) +# define R300_TX_ENABLE_15 (1 << 15) + +#define R500_TX_FILTER_4 0x4110 +# define R500_TX_WEIGHT_1_SHIFT (0) +# define R500_TX_WEIGHT_0_SHIFT (11) +# define R500_TX_WEIGHT_PAIR (1<<22) +# define R500_TX_PHASE_SHIFT (23) +# define R500_TX_DIRECTION_HORIZONTAL (0<<27) +# define R500_TX_DIRECTION_VERITCAL (1<<27) + +/* S Texture Coordinate of Vertex 0 for Point texture stuffing (LLC) */ +#define R300_GA_POINT_S0 0x4200 + +/* T Texture Coordinate of Vertex 0 for Point texture stuffing (LLC) */ +#define R300_GA_POINT_T0 0x4204 + +/* S Texture Coordinate of Vertex 2 for Point texture stuffing (URC) */ +#define R300_GA_POINT_S1 0x4208 + +/* T Texture Coordinate of Vertex 2 for Point texture stuffing (URC) */ +#define R300_GA_POINT_T1 0x420c + +/* Specifies amount to shift integer position of vertex (screen space) before + * converting to float for triangle stipple. + */ +#define R300_GA_TRIANGLE_STIPPLE 0x4214 +# define R300_GA_TRIANGLE_STIPPLE_X_SHIFT_SHIFT 0 +# define R300_GA_TRIANGLE_STIPPLE_X_SHIFT_MASK 0x0000000f +# define R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT 16 +# define R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_MASK 0x000f0000 + +/* The pointsize is given in multiples of 6. The pointsize can be enormous: + * Clear() renders a single point that fills the entire framebuffer. + * 1/2 Height of point; fixed (16.0), subpixel format (1/12 or 1/16, even if in + * 8b precision). + */ +#define R300_GA_POINT_SIZE 0x421C +# define R300_POINTSIZE_Y_SHIFT 0 +# define R300_POINTSIZE_Y_MASK 0x0000ffff +# define R300_POINTSIZE_X_SHIFT 16 +# define R300_POINTSIZE_X_MASK 0xffff0000 +# define R300_POINTSIZE_MAX (R300_POINTSIZE_Y_MASK / 6) + +/* Blue fill color */ +#define R500_GA_FILL_R 0x4220 + +/* Blue fill color */ +#define R500_GA_FILL_G 0x4224 + +/* Blue fill color */ +#define R500_GA_FILL_B 0x4228 + +/* Alpha fill color */ +#define R500_GA_FILL_A 0x422c + + +/* Specifies maximum and minimum point & sprite sizes for per vertex size + * specification. The lower part (15:0) is MIN and (31:16) is max. + */ +#define R300_GA_POINT_MINMAX 0x4230 +# define R300_GA_POINT_MINMAX_MIN_SHIFT 0 +# define R300_GA_POINT_MINMAX_MIN_MASK (0xFFFF << 0) +# define R300_GA_POINT_MINMAX_MAX_SHIFT 16 +# define R300_GA_POINT_MINMAX_MAX_MASK (0xFFFF << 16) + +/* 1/2 width of line, in subpixels (1/12 or 1/16 only, even in 8b + * subprecision); (16.0) fixed format. + * + * The line width is given in multiples of 6. + * In default mode lines are classified as vertical lines. + * HO: horizontal + * VE: vertical or horizontal + * HO & VE: no classification + */ +#define R300_GA_LINE_CNTL 0x4234 +# define R300_GA_LINE_CNTL_WIDTH_SHIFT 0 +# define R300_GA_LINE_CNTL_WIDTH_MASK 0x0000ffff +# define R300_GA_LINE_CNTL_END_TYPE_HOR (0 << 16) +# define R300_GA_LINE_CNTL_END_TYPE_VER (1 << 16) +# define R300_GA_LINE_CNTL_END_TYPE_SQR (2 << 16) /* horizontal or vertical depending upon slope */ +# define R300_GA_LINE_CNTL_END_TYPE_COMP (3 << 16) /* Computed (perpendicular to slope) */ +# define R500_GA_LINE_CNTL_SORT_NO (0 << 18) +# define R500_GA_LINE_CNTL_SORT_MINX_MINY (1 << 18) +/** TODO: looks wrong */ +# define R300_LINESIZE_MAX (R300_GA_LINE_CNTL_WIDTH_MASK / 6) +/** TODO: looks wrong */ +# define R300_LINE_CNT_HO (1 << 16) +/** TODO: looks wrong */ +# define R300_LINE_CNT_VE (1 << 17) + +/* Line Stipple configuration information. */ +#define R300_GA_LINE_STIPPLE_CONFIG 0x4238 +# define R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_NO (0 << 0) +# define R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_LINE (1 << 0) +# define R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_PACKET (2 << 0) +# define R300_GA_LINE_STIPPLE_CONFIG_STIPPLE_SCALE_SHIFT 2 +# define R300_GA_LINE_STIPPLE_CONFIG_STIPPLE_SCALE_MASK 0xfffffffc + +/* Used to load US instructions and constants */ +#define R500_GA_US_VECTOR_INDEX 0x4250 +# define R500_GA_US_VECTOR_INDEX_SHIFT 0 +# define R500_GA_US_VECTOR_INDEX_MASK 0x000000ff +# define R500_GA_US_VECTOR_INDEX_TYPE_INSTR (0 << 16) +# define R500_GA_US_VECTOR_INDEX_TYPE_CONST (1 << 16) +# define R500_GA_US_VECTOR_INDEX_CLAMP_NO (0 << 17) +# define R500_GA_US_VECTOR_INDEX_CLAMP_CONST (1 << 17) + +/* Data register for loading US instructions and constants */ +#define R500_GA_US_VECTOR_DATA 0x4254 + +/* Specifies color properties and mappings of textures. */ +#define R500_GA_COLOR_CONTROL_PS3 0x4258 +# define R500_TEX0_SHADING_PS3_SOLID (0 << 0) +# define R500_TEX0_SHADING_PS3_FLAT (1 << 0) +# define R500_TEX0_SHADING_PS3_GOURAUD (2 << 0) +# define R500_TEX1_SHADING_PS3_SOLID (0 << 2) +# define R500_TEX1_SHADING_PS3_FLAT (1 << 2) +# define R500_TEX1_SHADING_PS3_GOURAUD (2 << 2) +# define R500_TEX2_SHADING_PS3_SOLID (0 << 4) +# define R500_TEX2_SHADING_PS3_FLAT (1 << 4) +# define R500_TEX2_SHADING_PS3_GOURAUD (2 << 4) +# define R500_TEX3_SHADING_PS3_SOLID (0 << 6) +# define R500_TEX3_SHADING_PS3_FLAT (1 << 6) +# define R500_TEX3_SHADING_PS3_GOURAUD (2 << 6) +# define R500_TEX4_SHADING_PS3_SOLID (0 << 8) +# define R500_TEX4_SHADING_PS3_FLAT (1 << 8) +# define R500_TEX4_SHADING_PS3_GOURAUD (2 << 8) +# define R500_TEX5_SHADING_PS3_SOLID (0 << 10) +# define R500_TEX5_SHADING_PS3_FLAT (1 << 10) +# define R500_TEX5_SHADING_PS3_GOURAUD (2 << 10) +# define R500_TEX6_SHADING_PS3_SOLID (0 << 12) +# define R500_TEX6_SHADING_PS3_FLAT (1 << 12) +# define R500_TEX6_SHADING_PS3_GOURAUD (2 << 12) +# define R500_TEX7_SHADING_PS3_SOLID (0 << 14) +# define R500_TEX7_SHADING_PS3_FLAT (1 << 14) +# define R500_TEX7_SHADING_PS3_GOURAUD (2 << 14) +# define R500_TEX8_SHADING_PS3_SOLID (0 << 16) +# define R500_TEX8_SHADING_PS3_FLAT (1 << 16) +# define R500_TEX8_SHADING_PS3_GOURAUD (2 << 16) +# define R500_TEX9_SHADING_PS3_SOLID (0 << 18) +# define R500_TEX9_SHADING_PS3_FLAT (1 << 18) +# define R500_TEX9_SHADING_PS3_GOURAUD (2 << 18) +# define R500_TEX10_SHADING_PS3_SOLID (0 << 20) +# define R500_TEX10_SHADING_PS3_FLAT (1 << 20) +# define R500_TEX10_SHADING_PS3_GOURAUD (2 << 20) +# define R500_COLOR0_TEX_OVERRIDE_NO (0 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_0 (1 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_1 (2 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_2 (3 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_3 (4 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_4 (5 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_5 (6 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_6 (7 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_7 (8 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_8_C2 (9 << 22) +# define R500_COLOR0_TEX_OVERRIDE_TEX_9_C3 (10 << 22) +# define R500_COLOR1_TEX_OVERRIDE_NO (0 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_0 (1 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_1 (2 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_2 (3 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_3 (4 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_4 (5 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_5 (6 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_6 (7 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_7 (8 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_8_C2 (9 << 26) +# define R500_COLOR1_TEX_OVERRIDE_TEX_9_C3 (10 << 26) + +/* Returns idle status of various G3D block, captured when GA_IDLE written or + * when hard or soft reset asserted. + */ +#define R500_GA_IDLE 0x425c +# define R500_GA_IDLE_PIPE3_Z_IDLE (0 << 0) +# define R500_GA_IDLE_PIPE2_Z_IDLE (0 << 1) +# define R500_GA_IDLE_PIPE3_CD_IDLE (0 << 2) +# define R500_GA_IDLE_PIPE2_CD_IDLE (0 << 3) +# define R500_GA_IDLE_PIPE3_FG_IDLE (0 << 4) +# define R500_GA_IDLE_PIPE2_FG_IDLE (0 << 5) +# define R500_GA_IDLE_PIPE3_US_IDLE (0 << 6) +# define R500_GA_IDLE_PIPE2_US_IDLE (0 << 7) +# define R500_GA_IDLE_PIPE3_SC_IDLE (0 << 8) +# define R500_GA_IDLE_PIPE2_SC_IDLE (0 << 9) +# define R500_GA_IDLE_PIPE3_RS_IDLE (0 << 10) +# define R500_GA_IDLE_PIPE2_RS_IDLE (0 << 11) +# define R500_GA_IDLE_PIPE1_Z_IDLE (0 << 12) +# define R500_GA_IDLE_PIPE0_Z_IDLE (0 << 13) +# define R500_GA_IDLE_PIPE1_CD_IDLE (0 << 14) +# define R500_GA_IDLE_PIPE0_CD_IDLE (0 << 15) +# define R500_GA_IDLE_PIPE1_FG_IDLE (0 << 16) +# define R500_GA_IDLE_PIPE0_FG_IDLE (0 << 17) +# define R500_GA_IDLE_PIPE1_US_IDLE (0 << 18) +# define R500_GA_IDLE_PIPE0_US_IDLE (0 << 19) +# define R500_GA_IDLE_PIPE1_SC_IDLE (0 << 20) +# define R500_GA_IDLE_PIPE0_SC_IDLE (0 << 21) +# define R500_GA_IDLE_PIPE1_RS_IDLE (0 << 22) +# define R500_GA_IDLE_PIPE0_RS_IDLE (0 << 23) +# define R500_GA_IDLE_SU_IDLE (0 << 24) +# define R500_GA_IDLE_GA_IDLE (0 << 25) +# define R500_GA_IDLE_GA_UNIT2_IDLE (0 << 26) + +/* Current value of stipple accumulator. */ +#define R300_GA_LINE_STIPPLE_VALUE 0x4260 + +/* S Texture Coordinate Value for Vertex 0 of Line (stuff textures -- i.e. AA) */ +#define R300_GA_LINE_S0 0x4264 +/* S Texture Coordinate Value for Vertex 1 of Lines (V2 of parallelogram -- stuff textures -- i.e. AA) */ +#define R300_GA_LINE_S1 0x4268 + +/* GA Input fifo high water marks */ +#define R500_GA_FIFO_CNTL 0x4270 +# define R500_GA_FIFO_CNTL_VERTEX_FIFO_MASK 0x00000007 +# define R500_GA_FIFO_CNTL_VERTEX_FIFO_SHIFT 0 +# define R500_GA_FIFO_CNTL_VERTEX_INDEX_MASK 0x00000038 +# define R500_GA_FIFO_CNTL_VERTEX_INDEX_SHIFT 3 +# define R500_GA_FIFO_CNTL_VERTEX_REG_MASK 0x00003fc0 +# define R500_GA_FIFO_CNTL_VERTEX_REG_SHIFT 6 + +/* GA enhance/tweaks */ +#define R300_GA_ENHANCE 0x4274 +# define R300_GA_ENHANCE_DEADLOCK_CNTL_NO_EFFECT (0 << 0) +# define R300_GA_ENHANCE_DEADLOCK_CNTL_PREVENT_TCL (1 << 0) /* Prevents TCL interface from deadlocking on GA side. */ +# define R300_GA_ENHANCE_FASTSYNC_CNTL_NO_EFFECT (0 << 1) +# define R300_GA_ENHANCE_FASTSYNC_CNTL_ENABLE (1 << 1) /* Enables high-performance register/primitive switching. */ +# define R500_GA_ENHANCE_REG_READWRITE_NO_EFFECT (0 << 2) /* R520+ only */ +# define R500_GA_ENHANCE_REG_READWRITE_ENABLE (1 << 2) /* R520+ only, Enables GA support of simultaneous register reads and writes. */ +# define R500_GA_ENHANCE_REG_NOSTALL_NO_EFFECT (0 << 3) +# define R500_GA_ENHANCE_REG_NOSTALL_ENABLE (1 << 3) /* Enables GA support of no-stall reads for register read back. */ + +#define R300_GA_COLOR_CONTROL 0x4278 +# define R300_GA_COLOR_CONTROL_RGB0_SHADING_SOLID (0 << 0) +# define R300_GA_COLOR_CONTROL_RGB0_SHADING_FLAT (1 << 0) +# define R300_GA_COLOR_CONTROL_RGB0_SHADING_GOURAUD (2 << 0) +# define R300_GA_COLOR_CONTROL_ALPHA0_SHADING_SOLID (0 << 2) +# define R300_GA_COLOR_CONTROL_ALPHA0_SHADING_FLAT (1 << 2) +# define R300_GA_COLOR_CONTROL_ALPHA0_SHADING_GOURAUD (2 << 2) +# define R300_GA_COLOR_CONTROL_RGB1_SHADING_SOLID (0 << 4) +# define R300_GA_COLOR_CONTROL_RGB1_SHADING_FLAT (1 << 4) +# define R300_GA_COLOR_CONTROL_RGB1_SHADING_GOURAUD (2 << 4) +# define R300_GA_COLOR_CONTROL_ALPHA1_SHADING_SOLID (0 << 6) +# define R300_GA_COLOR_CONTROL_ALPHA1_SHADING_FLAT (1 << 6) +# define R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD (2 << 6) +# define R300_GA_COLOR_CONTROL_RGB2_SHADING_SOLID (0 << 8) +# define R300_GA_COLOR_CONTROL_RGB2_SHADING_FLAT (1 << 8) +# define R300_GA_COLOR_CONTROL_RGB2_SHADING_GOURAUD (2 << 8) +# define R300_GA_COLOR_CONTROL_ALPHA2_SHADING_SOLID (0 << 10) +# define R300_GA_COLOR_CONTROL_ALPHA2_SHADING_FLAT (1 << 10) +# define R300_GA_COLOR_CONTROL_ALPHA2_SHADING_GOURAUD (2 << 10) +# define R300_GA_COLOR_CONTROL_RGB3_SHADING_SOLID (0 << 12) +# define R300_GA_COLOR_CONTROL_RGB3_SHADING_FLAT (1 << 12) +# define R300_GA_COLOR_CONTROL_RGB3_SHADING_GOURAUD (2 << 12) +# define R300_GA_COLOR_CONTROL_ALPHA3_SHADING_SOLID (0 << 14) +# define R300_GA_COLOR_CONTROL_ALPHA3_SHADING_FLAT (1 << 14) +# define R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD (2 << 14) +# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_FIRST (0 << 16) +# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_SECOND (1 << 16) +# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_THIRD (2 << 16) +# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST (3 << 16) + +/** TODO: might be candidate for removal */ +# define R300_RE_SHADE_MODEL_SMOOTH ( \ + R300_GA_COLOR_CONTROL_RGB0_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA0_SHADING_GOURAUD | \ + R300_GA_COLOR_CONTROL_RGB1_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD | \ + R300_GA_COLOR_CONTROL_RGB2_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA2_SHADING_GOURAUD | \ + R300_GA_COLOR_CONTROL_RGB3_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD | \ + R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST ) +/** TODO: might be candidate for removal, the GOURAUD stuff also looks buggy to me */ +# define R300_RE_SHADE_MODEL_FLAT ( \ + R300_GA_COLOR_CONTROL_RGB0_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA0_SHADING_FLAT | \ + R300_GA_COLOR_CONTROL_RGB1_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD | \ + R300_GA_COLOR_CONTROL_RGB2_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA2_SHADING_FLAT | \ + R300_GA_COLOR_CONTROL_RGB3_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD | \ + R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST ) + +/* Specifies red & green components of fill color -- S312 format -- Backwards comp. */ +#define R300_GA_SOLID_RG 0x427c +# define GA_SOLID_RG_COLOR_GREEN_SHIFT 0 +# define GA_SOLID_RG_COLOR_GREEN_MASK 0x0000ffff +# define GA_SOLID_RG_COLOR_RED_SHIFT 16 +# define GA_SOLID_RG_COLOR_RED_MASK 0xffff0000 +/* Specifies blue & alpha components of fill color -- S312 format -- Backwards comp. */ +#define R300_GA_SOLID_BA 0x4280 +# define GA_SOLID_BA_COLOR_ALPHA_SHIFT 0 +# define GA_SOLID_BA_COLOR_ALPHA_MASK 0x0000ffff +# define GA_SOLID_BA_COLOR_BLUE_SHIFT 16 +# define GA_SOLID_BA_COLOR_BLUE_MASK 0xffff0000 + +/* Polygon Mode + * Dangerous + */ +#define R300_GA_POLY_MODE 0x4288 +# define R300_GA_POLY_MODE_DISABLE (0 << 0) +# define R300_GA_POLY_MODE_DUAL (1 << 0) /* send 2 sets of 3 polys with specified poly type */ +/* reserved */ +# define R300_GA_POLY_MODE_FRONT_PTYPE_POINT (0 << 4) +# define R300_GA_POLY_MODE_FRONT_PTYPE_LINE (1 << 4) +# define R300_GA_POLY_MODE_FRONT_PTYPE_TRI (2 << 4) +/* reserved */ +# define R300_GA_POLY_MODE_BACK_PTYPE_POINT (0 << 7) +# define R300_GA_POLY_MODE_BACK_PTYPE_LINE (1 << 7) +# define R300_GA_POLY_MODE_BACK_PTYPE_TRI (2 << 7) +/* reserved */ + +/* Specifies the rouding mode for geometry & color SPFP to FP conversions. */ +#define R300_GA_ROUND_MODE 0x428c +# define R300_GA_ROUND_MODE_GEOMETRY_ROUND_TRUNC (0 << 0) +# define R300_GA_ROUND_MODE_GEOMETRY_ROUND_NEAREST (1 << 0) +# define R300_GA_ROUND_MODE_COLOR_ROUND_TRUNC (0 << 2) +# define R300_GA_ROUND_MODE_COLOR_ROUND_NEAREST (1 << 2) +# define R300_GA_ROUND_MODE_RGB_CLAMP_RGB (0 << 4) +# define R300_GA_ROUND_MODE_RGB_CLAMP_FP20 (1 << 4) +# define R300_GA_ROUND_MODE_ALPHA_CLAMP_RGB (0 << 5) +# define R300_GA_ROUND_MODE_ALPHA_CLAMP_FP20 (1 << 5) +# define R500_GA_ROUND_MODE_GEOMETRY_MASK_SHIFT 6 +# define R500_GA_ROUND_MODE_GEOMETRY_MASK_MASK 0x000003c0 + +/* Specifies x & y offsets for vertex data after conversion to FP. + * Offsets are in S15 format (subpixels -- 1/12 or 1/16, even in 8b + * subprecision). + */ +#define R300_GA_OFFSET 0x4290 +# define R300_GA_OFFSET_X_OFFSET_SHIFT 0 +# define R300_GA_OFFSET_X_OFFSET_MASK 0x0000ffff +# define R300_GA_OFFSET_Y_OFFSET_SHIFT 16 +# define R300_GA_OFFSET_Y_OFFSET_MASK 0xffff0000 + +/* Specifies the scale to apply to fog. */ +#define R300_GA_FOG_SCALE 0x4294 +/* Specifies the offset to apply to fog. */ +#define R300_GA_FOG_OFFSET 0x4298 +/* Specifies number of cycles to assert reset, and also causes RB3D soft reset to assert. */ +#define R300_GA_SOFT_RESET 0x429c + +/* Not sure why there are duplicate of factor and constant values. + * My best guess so far is that there are seperate zbiases for test and write. + * Ordering might be wrong. + * Some of the tests indicate that fgl has a fallback implementation of zbias + * via pixel shaders. + */ +#define R300_SU_TEX_WRAP 0x42A0 +#define R300_SU_POLY_OFFSET_FRONT_SCALE 0x42A4 +#define R300_SU_POLY_OFFSET_FRONT_OFFSET 0x42A8 +#define R300_SU_POLY_OFFSET_BACK_SCALE 0x42AC +#define R300_SU_POLY_OFFSET_BACK_OFFSET 0x42B0 + +/* This register needs to be set to (1<<1) for RV350 to correctly + * perform depth test (see --vb-triangles in r300_demo) + * Don't know about other chips. - Vladimir + * This is set to 3 when GL_POLYGON_OFFSET_FILL is on. + * My guess is that there are two bits for each zbias primitive + * (FILL, LINE, POINT). + * One to enable depth test and one for depth write. + * Yet this doesnt explain why depth writes work ... + */ +#define R300_SU_POLY_OFFSET_ENABLE 0x42B4 +# define R300_FRONT_ENABLE (1 << 0) +# define R300_BACK_ENABLE (1 << 1) +# define R300_PARA_ENABLE (1 << 2) + +#define R300_SU_CULL_MODE 0x42B8 +# define R300_CULL_FRONT (1 << 0) +# define R300_CULL_BACK (1 << 1) +# define R300_FRONT_FACE_CCW (0 << 2) +# define R300_FRONT_FACE_CW (1 << 2) + +/* SU Depth Scale value */ +#define R300_SU_DEPTH_SCALE 0x42c0 +/* SU Depth Offset value */ +#define R300_SU_DEPTH_OFFSET 0x42c4 + + +/* BEGIN: Rasterization / Interpolators - many guesses */ + +/* + * TC_CNT is the number of incoming texture coordinate sets (i.e. it depends + * on the vertex program, *not* the fragment program) + */ +#define R300_RS_COUNT 0x4300 +# define R300_IT_COUNT_SHIFT 0 +# define R300_IT_COUNT_MASK 0x0000007f +# define R300_IC_COUNT_SHIFT 7 +# define R300_IC_COUNT_MASK 0x00000780 +# define R300_W_ADDR_SHIFT 12 +# define R300_W_ADDR_MASK 0x0003f000 +# define R300_HIRES_DIS (0 << 18) +# define R300_HIRES_EN (1 << 18) + +#define R300_RS_INST_COUNT 0x4304 +# define R300_RS_INST_COUNT_SHIFT 0 +# define R300_RS_INST_COUNT_MASK 0x0000000f +# define R300_RS_TX_OFFSET_SHIFT 5 +# define R300_RS_TX_OFFSET_MASK 0x000000e0 + +/* gap */ + +/* Only used for texture coordinates. + * Use the source field to route texture coordinate input from the + * vertex program to the desired interpolator. Note that the source + * field is relative to the outputs the vertex program *actually* + * writes. If a vertex program only writes texcoord[1], this will + * be source index 0. + * Set INTERP_USED on all interpolators that produce data used by + * the fragment program. INTERP_USED looks like a swizzling mask, + * but I haven't seen it used that way. + * + * Note: The _UNKNOWN constants are always set in their respective + * register. I don't know if this is necessary. + */ +#define R300_RS_IP_0 0x4310 +#define R300_RS_IP_1 0x4314 +#define R300_RS_IP_2 0x4318 +#define R300_RS_IP_3 0x431C +# define R300_RS_INTERP_SRC_SHIFT 2 /* TODO: check for removal */ +# define R300_RS_INTERP_SRC_MASK (7 << 2) /* TODO: check for removal */ +# define R300_RS_TEX_PTR(x) (x << 0) +# define R300_RS_COL_PTR(x) (x << 6) +# define R300_RS_COL_FMT(x) (x << 9) +# define R300_RS_COL_FMT_RGBA 0 +# define R300_RS_COL_FMT_RGB0 1 +# define R300_RS_COL_FMT_RGB1 2 +# define R300_RS_COL_FMT_000A 4 +# define R300_RS_COL_FMT_0000 5 +# define R300_RS_COL_FMT_0001 6 +# define R300_RS_COL_FMT_111A 8 +# define R300_RS_COL_FMT_1110 9 +# define R300_RS_COL_FMT_1111 10 +# define R300_RS_SEL_S(x) (x << 13) +# define R300_RS_SEL_T(x) (x << 16) +# define R300_RS_SEL_R(x) (x << 19) +# define R300_RS_SEL_Q(x) (x << 22) +# define R300_RS_SEL_C0 0 +# define R300_RS_SEL_C1 1 +# define R300_RS_SEL_C2 2 +# define R300_RS_SEL_C3 3 +# define R300_RS_SEL_K0 4 +# define R300_RS_SEL_K1 5 + + +/* */ +#define R500_RS_INST_0 0x4320 +#define R500_RS_INST_1 0x4324 +#define R500_RS_INST_2 0x4328 +#define R500_RS_INST_3 0x432c +#define R500_RS_INST_4 0x4330 +#define R500_RS_INST_5 0x4334 +#define R500_RS_INST_6 0x4338 +#define R500_RS_INST_7 0x433c +#define R500_RS_INST_8 0x4340 +#define R500_RS_INST_9 0x4344 +#define R500_RS_INST_10 0x4348 +#define R500_RS_INST_11 0x434c +#define R500_RS_INST_12 0x4350 +#define R500_RS_INST_13 0x4354 +#define R500_RS_INST_14 0x4358 +#define R500_RS_INST_15 0x435c +#define R500_RS_INST_TEX_ID_SHIFT 0 +#define R500_RS_INST_TEX_CN_WRITE (1 << 4) +#define R500_RS_INST_TEX_ADDR_SHIFT 5 +#define R500_RS_INST_COL_ID_SHIFT 12 +#define R500_RS_INST_COL_CN_NO_WRITE (0 << 16) +#define R500_RS_INST_COL_CN_WRITE (1 << 16) +#define R500_RS_INST_COL_CN_WRITE_FBUFFER (2 << 16) +#define R500_RS_INST_COL_CN_WRITE_BACKFACE (3 << 16) +#define R500_RS_INST_COL_ADDR_SHIFT 18 +#define R500_RS_INST_TEX_ADJ (1 << 25) +#define R500_RS_INST_W_CN (1 << 26) + +/* These DWORDs control how vertex data is routed into fragment program + * registers, after interpolators. + */ +#define R300_RS_INST_0 0x4330 +#define R300_RS_INST_1 0x4334 +#define R300_RS_INST_2 0x4338 +#define R300_RS_INST_3 0x433C /* GUESS */ +#define R300_RS_INST_4 0x4340 /* GUESS */ +#define R300_RS_INST_5 0x4344 /* GUESS */ +#define R300_RS_INST_6 0x4348 /* GUESS */ +#define R300_RS_INST_7 0x434C /* GUESS */ +# define R300_RS_INST_TEX_ID(x) ((x) << 0) +# define R300_RS_INST_TEX_CN_WRITE (1 << 3) +# define R300_RS_INST_TEX_ADDR_SHIFT 6 +# define R300_RS_INST_COL_ID(x) ((x) << 11) +# define R300_RS_INST_COL_CN_WRITE (1 << 14) +# define R300_RS_INST_COL_ADDR_SHIFT 17 +# define R300_RS_INST_TEX_ADJ (1 << 22) +# define R300_RS_COL_BIAS_UNUSED_SHIFT 23 + +/* END: Rasterization / Interpolators - many guesses */ + +/* Hierarchical Z Enable */ +#define R300_SC_HYPERZ 0x43a4 +# define R300_SC_HYPERZ_DISABLE (0 << 0) +# define R300_SC_HYPERZ_ENABLE (1 << 0) +# define R300_SC_HYPERZ_MIN (0 << 1) +# define R300_SC_HYPERZ_MAX (1 << 1) +# define R300_SC_HYPERZ_ADJ_256 (0 << 2) +# define R300_SC_HYPERZ_ADJ_128 (1 << 2) +# define R300_SC_HYPERZ_ADJ_64 (2 << 2) +# define R300_SC_HYPERZ_ADJ_32 (3 << 2) +# define R300_SC_HYPERZ_ADJ_16 (4 << 2) +# define R300_SC_HYPERZ_ADJ_8 (5 << 2) +# define R300_SC_HYPERZ_ADJ_4 (6 << 2) +# define R300_SC_HYPERZ_ADJ_2 (7 << 2) +# define R300_SC_HYPERZ_HZ_Z0MIN_NO (0 << 5) +# define R300_SC_HYPERZ_HZ_Z0MIN (1 << 5) +# define R300_SC_HYPERZ_HZ_Z0MAX_NO (0 << 6) +# define R300_SC_HYPERZ_HZ_Z0MAX (1 << 6) + +#define R300_SC_EDGERULE 0x43a8 + +/* BEGIN: Scissors and cliprects */ + +/* There are four clipping rectangles. Their corner coordinates are inclusive. + * Every pixel is assigned a number from 0 and 15 by setting bits 0-3 depending + * on whether the pixel is inside cliprects 0-3, respectively. For example, + * if a pixel is inside cliprects 0 and 1, but outside 2 and 3, it is assigned + * the number 3 (binary 0011). + * Iff the bit corresponding to the pixel's number in RE_CLIPRECT_CNTL is set, + * the pixel is rasterized. + * + * In addition to this, there is a scissors rectangle. Only pixels inside the + * scissors rectangle are drawn. (coordinates are inclusive) + * + * For some reason, the top-left corner of the framebuffer is at (1440, 1440) + * for the purpose of clipping and scissors. + */ +#define R300_SC_CLIPRECT_TL_0 0x43B0 +#define R300_SC_CLIPRECT_BR_0 0x43B4 +#define R300_SC_CLIPRECT_TL_1 0x43B8 +#define R300_SC_CLIPRECT_BR_1 0x43BC +#define R300_SC_CLIPRECT_TL_2 0x43C0 +#define R300_SC_CLIPRECT_BR_2 0x43C4 +#define R300_SC_CLIPRECT_TL_3 0x43C8 +#define R300_SC_CLIPRECT_BR_3 0x43CC +# define R300_CLIPRECT_OFFSET 1440 +# define R300_CLIPRECT_MASK 0x1FFF +# define R300_CLIPRECT_X_SHIFT 0 +# define R300_CLIPRECT_X_MASK (0x1FFF << 0) +# define R300_CLIPRECT_Y_SHIFT 13 +# define R300_CLIPRECT_Y_MASK (0x1FFF << 13) +#define R300_SC_CLIP_RULE 0x43D0 +# define R300_CLIP_OUT (1 << 0) +# define R300_CLIP_0 (1 << 1) +# define R300_CLIP_1 (1 << 2) +# define R300_CLIP_10 (1 << 3) +# define R300_CLIP_2 (1 << 4) +# define R300_CLIP_20 (1 << 5) +# define R300_CLIP_21 (1 << 6) +# define R300_CLIP_210 (1 << 7) +# define R300_CLIP_3 (1 << 8) +# define R300_CLIP_30 (1 << 9) +# define R300_CLIP_31 (1 << 10) +# define R300_CLIP_310 (1 << 11) +# define R300_CLIP_32 (1 << 12) +# define R300_CLIP_320 (1 << 13) +# define R300_CLIP_321 (1 << 14) +# define R300_CLIP_3210 (1 << 15) + +/* gap */ + +#define R300_SC_SCISSORS_TL 0x43E0 +#define R300_SC_SCISSORS_BR 0x43E4 +# define R300_SCISSORS_OFFSET 1440 +# define R300_SCISSORS_X_SHIFT 0 +# define R300_SCISSORS_X_MASK (0x1FFF << 0) +# define R300_SCISSORS_Y_SHIFT 13 +# define R300_SCISSORS_Y_MASK (0x1FFF << 13) + +/* Screen door sample mask */ +#define R300_SC_SCREENDOOR 0x43e8 + +/* END: Scissors and cliprects */ + +/* BEGIN: Texture specification */ + +/* + * The texture specification dwords are grouped by meaning and not by texture + * unit. This means that e.g. the offset for texture image unit N is found in + * register TX_OFFSET_0 + (4*N) + */ +#define R300_TX_FILTER0_0 0x4400 +#define R300_TX_FILTER0_1 0x4404 +#define R300_TX_FILTER0_2 0x4408 +#define R300_TX_FILTER0_3 0x440c +#define R300_TX_FILTER0_4 0x4410 +#define R300_TX_FILTER0_5 0x4414 +#define R300_TX_FILTER0_6 0x4418 +#define R300_TX_FILTER0_7 0x441c +#define R300_TX_FILTER0_8 0x4420 +#define R300_TX_FILTER0_9 0x4424 +#define R300_TX_FILTER0_10 0x4428 +#define R300_TX_FILTER0_11 0x442c +#define R300_TX_FILTER0_12 0x4430 +#define R300_TX_FILTER0_13 0x4434 +#define R300_TX_FILTER0_14 0x4438 +#define R300_TX_FILTER0_15 0x443c +# define R300_TX_REPEAT 0 +# define R300_TX_MIRRORED 1 +# define R300_TX_CLAMP_TO_EDGE 2 +# define R300_TX_MIRROR_ONCE_TO_EDGE 3 +# define R300_TX_CLAMP 4 +# define R300_TX_MIRROR_ONCE 5 +# define R300_TX_CLAMP_TO_BORDER 6 +# define R300_TX_MIRROR_ONCE_TO_BORDER 7 +# define R300_TX_WRAP_S_SHIFT 0 +# define R300_TX_WRAP_S_MASK (7 << 0) +# define R300_TX_WRAP_T_SHIFT 3 +# define R300_TX_WRAP_T_MASK (7 << 3) +# define R300_TX_WRAP_R_SHIFT 6 +# define R300_TX_WRAP_R_MASK (7 << 6) +# define R300_TX_MAG_FILTER_4 (0 << 9) +# define R300_TX_MAG_FILTER_NEAREST (1 << 9) +# define R300_TX_MAG_FILTER_LINEAR (2 << 9) +# define R300_TX_MAG_FILTER_ANISO (3 << 9) +# define R300_TX_MAG_FILTER_MASK (3 << 9) +# define R300_TX_MIN_FILTER_NEAREST (1 << 11) +# define R300_TX_MIN_FILTER_LINEAR (2 << 11) +# define R300_TX_MIN_FILTER_ANISO (3 << 11) +# define R300_TX_MIN_FILTER_MASK (3 << 11) +# define R300_TX_MIN_FILTER_MIP_NONE (0 << 13) +# define R300_TX_MIN_FILTER_MIP_NEAREST (1 << 13) +# define R300_TX_MIN_FILTER_MIP_LINEAR (2 << 13) +# define R300_TX_MIN_FILTER_MIP_MASK (3 << 13) +# define R300_TX_MAX_ANISO_1_TO_1 (0 << 21) +# define R300_TX_MAX_ANISO_2_TO_1 (1 << 21) +# define R300_TX_MAX_ANISO_4_TO_1 (2 << 21) +# define R300_TX_MAX_ANISO_8_TO_1 (3 << 21) +# define R300_TX_MAX_ANISO_16_TO_1 (4 << 21) +# define R300_TX_MAX_ANISO_MASK (7 << 21) + +#define R300_TX_FILTER1_0 0x4440 +# define R300_CHROMA_KEY_MODE_DISABLE 0 +# define R300_CHROMA_KEY_FORCE 1 +# define R300_CHROMA_KEY_BLEND 2 +# define R300_MC_ROUND_NORMAL (0<<2) +# define R300_MC_ROUND_MPEG4 (1<<2) +# define R300_LOD_BIAS_SHIFT 3 +# define R300_LOD_BIAS_MASK 0x1ff8 +# define R300_EDGE_ANISO_EDGE_DIAG (0<<13) +# define R300_EDGE_ANISO_EDGE_ONLY (1<<13) +# define R300_MC_COORD_TRUNCATE_DISABLE (0<<14) +# define R300_MC_COORD_TRUNCATE_MPEG (1<<14) +# define R300_TX_TRI_PERF_0_8 (0<<15) +# define R300_TX_TRI_PERF_1_8 (1<<15) +# define R300_TX_TRI_PERF_1_4 (2<<15) +# define R300_TX_TRI_PERF_3_8 (3<<15) +# define R300_ANISO_THRESHOLD_MASK (7<<17) + +# define R500_MACRO_SWITCH (1<<22) +# define R500_BORDER_FIX (1<<31) + +#define R300_TX_SIZE_0 0x4480 +# define R300_TX_WIDTHMASK_SHIFT 0 +# define R300_TX_WIDTHMASK_MASK (2047 << 0) +# define R300_TX_HEIGHTMASK_SHIFT 11 +# define R300_TX_HEIGHTMASK_MASK (2047 << 11) +# define R300_TX_DEPTHMASK_SHIFT 22 +# define R300_TX_DEPTHMASK_MASK (0xf << 22) +# define R300_TX_MAX_MIP_LEVEL_SHIFT 26 +# define R300_TX_MAX_MIP_LEVEL_MASK (0xf << 26) +# define R300_TX_SIZE_PROJECTED (1<<30) +# define R300_TX_SIZE_TXPITCH_EN (1<<31) +#define R300_TX_FORMAT_0 0x44C0 + /* The interpretation of the format word by Wladimir van der Laan */ + /* The X, Y, Z and W refer to the layout of the components. + They are given meanings as R, G, B and Alpha by the swizzle + specification */ +# define R300_TX_FORMAT_X8 0x0 +# define R500_TX_FORMAT_X1 0x0 // bit set in format 2 +# define R300_TX_FORMAT_X16 0x1 +# define R500_TX_FORMAT_X1_REV 0x0 // bit set in format 2 +# define R300_TX_FORMAT_Y4X4 0x2 +# define R300_TX_FORMAT_Y8X8 0x3 +# define R300_TX_FORMAT_Y16X16 0x4 +# define R300_TX_FORMAT_Z3Y3X2 0x5 +# define R300_TX_FORMAT_Z5Y6X5 0x6 +# define R300_TX_FORMAT_Z6Y5X5 0x7 +# define R300_TX_FORMAT_Z11Y11X10 0x8 +# define R300_TX_FORMAT_Z10Y11X11 0x9 +# define R300_TX_FORMAT_W4Z4Y4X4 0xA +# define R300_TX_FORMAT_W1Z5Y5X5 0xB +# define R300_TX_FORMAT_W8Z8Y8X8 0xC +# define R300_TX_FORMAT_W2Z10Y10X10 0xD +# define R300_TX_FORMAT_W16Z16Y16X16 0xE +# define R300_TX_FORMAT_DXT1 0xF +# define R300_TX_FORMAT_DXT3 0x10 +# define R300_TX_FORMAT_DXT5 0x11 +# define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */ +# define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */ +# define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */ +# define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */ + + /* These two values are wrong, but they're the only values that + * produce any even vaguely correct results. Can r300 only do 16-bit + * depth textures? + */ +# define R300_TX_FORMAT_X24_Y8 0x1e +# define R300_TX_FORMAT_X32 0x1e + + /* 0x16 - some 16 bit green format.. ?? */ +# define R300_TX_FORMAT_3D (1 << 25) +# define R300_TX_FORMAT_CUBIC_MAP (2 << 25) + + /* gap */ + /* Floating point formats */ + /* Note - hardware supports both 16 and 32 bit floating point */ +# define R300_TX_FORMAT_FL_I16 0x18 +# define R300_TX_FORMAT_FL_I16A16 0x19 +# define R300_TX_FORMAT_FL_R16G16B16A16 0x1A +# define R300_TX_FORMAT_FL_I32 0x1B +# define R300_TX_FORMAT_FL_I32A32 0x1C +# define R300_TX_FORMAT_FL_R32G32B32A32 0x1D + /* alpha modes, convenience mostly */ + /* if you have alpha, pick constant appropriate to the + number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */ +# define R300_TX_FORMAT_ALPHA_1CH 0x000 +# define R300_TX_FORMAT_ALPHA_2CH 0x200 +# define R300_TX_FORMAT_ALPHA_4CH 0x600 +# define R300_TX_FORMAT_ALPHA_NONE 0xA00 + /* Swizzling */ + /* constants */ +# define R300_TX_FORMAT_X 0 +# define R300_TX_FORMAT_Y 1 +# define R300_TX_FORMAT_Z 2 +# define R300_TX_FORMAT_W 3 +# define R300_TX_FORMAT_ZERO 4 +# define R300_TX_FORMAT_ONE 5 + /* 2.0*Z, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_Z 6 + /* 2.0*W, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_W 7 + +# define R300_TX_FORMAT_B_SHIFT 18 +# define R300_TX_FORMAT_G_SHIFT 15 +# define R300_TX_FORMAT_R_SHIFT 12 +# define R300_TX_FORMAT_A_SHIFT 9 + /* Convenience macro to take care of layout and swizzling */ +# define R300_EASY_TX_FORMAT(B, G, R, A, FMT) ( \ + ((R300_TX_FORMAT_##B)< 0.5, return ARG0, else return ARG1 + * - CMP: If ARG2 < 0, return ARG1, else return ARG0 + * - FLR: use FRC+MAD + * - XPD: use MAD+MAD + * - SGE, SLT: use MAD+CMP + * - RSQ: use ABS modifier for argument + * - Use OUTC_REPL_ALPHA to write results of an alpha-only operation + * (e.g. RCP) into color register + * - apparently, there's no quick DST operation + * - fglrx set FPI2_UNKNOWN_31 on a "MAD fragment.color, tmp0, tmp1, tmp2" + * - fglrx set FPI2_UNKNOWN_31 on a "MAX r2, r1, c0" + * - fglrx once set FPI0_UNKNOWN_31 on a "FRC r1, r1" + * + * Operand selection + * First stage selects three sources from the available registers and + * constant parameters. This is defined in INSTR1 (color) and INSTR3 (alpha). + * fglrx sorts the three source fields: Registers before constants, + * lower indices before higher indices; I do not know whether this is + * necessary. + * + * fglrx fills unused sources with "read constant 0" + * According to specs, you cannot select more than two different constants. + * + * Second stage selects the operands from the sources. This is defined in + * INSTR0 (color) and INSTR2 (alpha). You can also select the special constants + * zero and one. + * Swizzling and negation happens in this stage, as well. + * + * Important: Color and alpha seem to be mostly separate, i.e. their sources + * selection appears to be fully independent (the register storage is probably + * physically split into a color and an alpha section). + * However (because of the apparent physical split), there is some interaction + * WRT swizzling. If, for example, you want to load an R component into an + * Alpha operand, this R component is taken from a *color* source, not from + * an alpha source. The corresponding register doesn't even have to appear in + * the alpha sources list. (I hope this all makes sense to you) + * + * Destination selection + * The destination register index is in FPI1 (color) and FPI3 (alpha) + * together with enable bits. + * There are separate enable bits for writing into temporary registers + * (DSTC_REG_* /DSTA_REG) and and program output registers (DSTC_OUTPUT_* + * /DSTA_OUTPUT). You can write to both at once, or not write at all (the + * same index must be used for both). + * + * Note: There is a special form for LRP + * - Argument order is the same as in ARB_fragment_program. + * - Operation is MAD + * - ARG1 is set to ARGC_SRC1C_LRP/ARGC_SRC1A_LRP + * - Set FPI0/FPI2_SPECIAL_LRP + * Arbitrary LRP (including support for swizzling) requires vanilla MAD+MAD + */ +#define R300_US_ALU_RGB_ADDR_0 0x46C0 +# define R300_ALU_SRC0C_SHIFT 0 +# define R300_ALU_SRC0C_MASK (31 << 0) +# define R300_ALU_SRC0C_CONST (1 << 5) +# define R300_ALU_SRC1C_SHIFT 6 +# define R300_ALU_SRC1C_MASK (31 << 6) +# define R300_ALU_SRC1C_CONST (1 << 11) +# define R300_ALU_SRC2C_SHIFT 12 +# define R300_ALU_SRC2C_MASK (31 << 12) +# define R300_ALU_SRC2C_CONST (1 << 17) +# define R300_ALU_SRC_MASK 0x0003ffff +# define R300_ALU_DSTC_SHIFT 18 +# define R300_ALU_DSTC_MASK (31 << 18) +# define R300_ALU_DSTC_REG_MASK_SHIFT 23 +# define R300_ALU_DSTC_REG_X (1 << 23) +# define R300_ALU_DSTC_REG_Y (1 << 24) +# define R300_ALU_DSTC_REG_Z (1 << 25) +# define R300_ALU_DSTC_OUTPUT_MASK_SHIFT 26 +# 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_US_ALU_ALPHA_ADDR_0 0x47C0 +# define R300_ALU_SRC0A_SHIFT 0 +# define R300_ALU_SRC0A_MASK (31 << 0) +# define R300_ALU_SRC0A_CONST (1 << 5) +# define R300_ALU_SRC1A_SHIFT 6 +# define R300_ALU_SRC1A_MASK (31 << 6) +# define R300_ALU_SRC1A_CONST (1 << 11) +# define R300_ALU_SRC2A_SHIFT 12 +# define R300_ALU_SRC2A_MASK (31 << 12) +# define R300_ALU_SRC2A_CONST (1 << 17) +# define R300_ALU_SRC_MASK 0x0003ffff +# define R300_ALU_DSTA_SHIFT 18 +# define R300_ALU_DSTA_MASK (31 << 18) +# define R300_ALU_DSTA_REG (1 << 23) +# define R300_ALU_DSTA_OUTPUT (1 << 24) +# define R300_ALU_DSTA_DEPTH (1 << 27) + +#define R300_US_ALU_RGB_INST_0 0x48C0 +# define R300_ALU_ARGC_SRC0C_XYZ 0 +# define R300_ALU_ARGC_SRC0C_XXX 1 +# define R300_ALU_ARGC_SRC0C_YYY 2 +# define R300_ALU_ARGC_SRC0C_ZZZ 3 +# define R300_ALU_ARGC_SRC1C_XYZ 4 +# define R300_ALU_ARGC_SRC1C_XXX 5 +# define R300_ALU_ARGC_SRC1C_YYY 6 +# define R300_ALU_ARGC_SRC1C_ZZZ 7 +# define R300_ALU_ARGC_SRC2C_XYZ 8 +# define R300_ALU_ARGC_SRC2C_XXX 9 +# define R300_ALU_ARGC_SRC2C_YYY 10 +# define R300_ALU_ARGC_SRC2C_ZZZ 11 +# define R300_ALU_ARGC_SRC0A 12 +# define R300_ALU_ARGC_SRC1A 13 +# define R300_ALU_ARGC_SRC2A 14 +# define R300_ALU_ARGC_SRCP_XYZ 15 +# define R300_ALU_ARGC_SRCP_XXX 16 +# define R300_ALU_ARGC_SRCP_YYY 17 +# define R300_ALU_ARGC_SRCP_ZZZ 18 +# define R300_ALU_ARGC_SRCP_WWW 19 +# define R300_ALU_ARGC_ZERO 20 +# define R300_ALU_ARGC_ONE 21 +# define R300_ALU_ARGC_HALF 22 +# define R300_ALU_ARGC_SRC0C_YZX 23 +# define R300_ALU_ARGC_SRC1C_YZX 24 +# define R300_ALU_ARGC_SRC2C_YZX 25 +# define R300_ALU_ARGC_SRC0C_ZXY 26 +# define R300_ALU_ARGC_SRC1C_ZXY 27 +# define R300_ALU_ARGC_SRC2C_ZXY 28 +# define R300_ALU_ARGC_SRC0CA_WZY 29 +# define R300_ALU_ARGC_SRC1CA_WZY 30 +# define R300_ALU_ARGC_SRC2CA_WZY 31 + +# define R300_ALU_ARG0C_SHIFT 0 +# define R300_ALU_ARG0C_MASK (31 << 0) +# define R300_ALU_ARG0C_NOP (0 << 5) +# define R300_ALU_ARG0C_NEG (1 << 5) +# define R300_ALU_ARG0C_ABS (2 << 5) +# define R300_ALU_ARG0C_NAB (3 << 5) +# define R300_ALU_ARG1C_SHIFT 7 +# define R300_ALU_ARG1C_MASK (31 << 7) +# define R300_ALU_ARG1C_NOP (0 << 12) +# define R300_ALU_ARG1C_NEG (1 << 12) +# define R300_ALU_ARG1C_ABS (2 << 12) +# define R300_ALU_ARG1C_NAB (3 << 12) +# define R300_ALU_ARG2C_SHIFT 14 +# define R300_ALU_ARG2C_MASK (31 << 14) +# define R300_ALU_ARG2C_NOP (0 << 19) +# define R300_ALU_ARG2C_NEG (1 << 19) +# define R300_ALU_ARG2C_ABS (2 << 19) +# define R300_ALU_ARG2C_NAB (3 << 19) +# define R300_ALU_SRCP_1_MINUS_2_SRC0 (0 << 21) +# define R300_ALU_SRCP_SRC1_MINUS_SRC0 (1 << 21) +# define R300_ALU_SRCP_SRC1_PLUS_SRC0 (2 << 21) +# define R300_ALU_SRCP_1_MINUS_SRC0 (3 << 21) + +# define R300_ALU_OUTC_MAD (0 << 23) +# define R300_ALU_OUTC_DP3 (1 << 23) +# define R300_ALU_OUTC_DP4 (2 << 23) +# define R300_ALU_OUTC_D2A (3 << 23) +# define R300_ALU_OUTC_MIN (4 << 23) +# define R300_ALU_OUTC_MAX (5 << 23) +# define R300_ALU_OUTC_CMPH (7 << 23) +# define R300_ALU_OUTC_CMP (8 << 23) +# define R300_ALU_OUTC_FRC (9 << 23) +# define R300_ALU_OUTC_REPL_ALPHA (10 << 23) + +# define R300_ALU_OUTC_MOD_NOP (0 << 27) +# define R300_ALU_OUTC_MOD_MUL2 (1 << 27) +# define R300_ALU_OUTC_MOD_MUL4 (2 << 27) +# define R300_ALU_OUTC_MOD_MUL8 (3 << 27) +# define R300_ALU_OUTC_MOD_DIV2 (4 << 27) +# define R300_ALU_OUTC_MOD_DIV4 (5 << 27) +# define R300_ALU_OUTC_MOD_DIV8 (6 << 27) + +# define R300_ALU_OUTC_CLAMP (1 << 30) +# define R300_ALU_INSERT_NOP (1 << 31) + +#define R300_US_ALU_ALPHA_INST_0 0x49C0 +# define R300_ALU_ARGA_SRC0C_X 0 +# define R300_ALU_ARGA_SRC0C_Y 1 +# define R300_ALU_ARGA_SRC0C_Z 2 +# define R300_ALU_ARGA_SRC1C_X 3 +# define R300_ALU_ARGA_SRC1C_Y 4 +# define R300_ALU_ARGA_SRC1C_Z 5 +# define R300_ALU_ARGA_SRC2C_X 6 +# define R300_ALU_ARGA_SRC2C_Y 7 +# define R300_ALU_ARGA_SRC2C_Z 8 +# define R300_ALU_ARGA_SRC0A 9 +# define R300_ALU_ARGA_SRC1A 10 +# define R300_ALU_ARGA_SRC2A 11 +# define R300_ALU_ARGA_SRCP_X 12 +# define R300_ALU_ARGA_SRCP_Y 13 +# define R300_ALU_ARGA_SRCP_Z 14 +# define R300_ALU_ARGA_SRCP_W 15 + +# define R300_ALU_ARGA_ZERO 16 +# define R300_ALU_ARGA_ONE 17 +# define R300_ALU_ARGA_HALF 18 +# define R300_ALU_ARG0A_SHIFT 0 +# define R300_ALU_ARG0A_MASK (31 << 0) +# define R300_ALU_ARG0A_NOP (0 << 5) +# define R300_ALU_ARG0A_NEG (1 << 5) +# define R300_ALU_ARG0A_ABS (2 << 5) +# define R300_ALU_ARG0A_NAB (3 << 5) +# define R300_ALU_ARG1A_SHIFT 7 +# define R300_ALU_ARG1A_MASK (31 << 7) +# define R300_ALU_ARG1A_NOP (0 << 12) +# define R300_ALU_ARG1A_NEG (1 << 12) +# define R300_ALU_ARG1A_ABS (2 << 12) +# define R300_ALU_ARG1A_NAB (3 << 12) +# define R300_ALU_ARG2A_SHIFT 14 +# define R300_ALU_ARG2A_MASK (31 << 14) +# define R300_ALU_ARG2A_NOP (0 << 19) +# define R300_ALU_ARG2A_NEG (1 << 19) +# define R300_ALU_ARG2A_ABS (2 << 19) +# define R300_ALU_ARG2A_NAB (3 << 19) +# define R300_ALU_SRCP_1_MINUS_2_SRC0 (0 << 21) +# define R300_ALU_SRCP_SRC1_MINUS_SRC0 (1 << 21) +# define R300_ALU_SRCP_SRC1_PLUS_SRC0 (2 << 21) +# define R300_ALU_SRCP_1_MINUS_SRC0 (3 << 21) + +# define R300_ALU_OUTA_MAD (0 << 23) +# define R300_ALU_OUTA_DP4 (1 << 23) +# define R300_ALU_OUTA_MIN (2 << 23) +# define R300_ALU_OUTA_MAX (3 << 23) +# define R300_ALU_OUTA_CND (5 << 23) +# define R300_ALU_OUTA_CMP (6 << 23) +# define R300_ALU_OUTA_FRC (7 << 23) +# define R300_ALU_OUTA_EX2 (8 << 23) +# define R300_ALU_OUTA_LG2 (9 << 23) +# define R300_ALU_OUTA_RCP (10 << 23) +# define R300_ALU_OUTA_RSQ (11 << 23) + +# define R300_ALU_OUTA_MOD_NOP (0 << 27) +# define R300_ALU_OUTA_MOD_MUL2 (1 << 27) +# define R300_ALU_OUTA_MOD_MUL4 (2 << 27) +# define R300_ALU_OUTA_MOD_MUL8 (3 << 27) +# define R300_ALU_OUTA_MOD_DIV2 (4 << 27) +# define R300_ALU_OUTA_MOD_DIV4 (5 << 27) +# define R300_ALU_OUTA_MOD_DIV8 (6 << 27) + +# define R300_ALU_OUTA_CLAMP (1 << 30) +/* END: Fragment program instruction set */ + +/* Fog: Fog Blending Enable */ +#define R300_FG_FOG_BLEND 0x4bc0 +# define R300_FG_FOG_BLEND_DISABLE (0 << 0) +# define R300_FG_FOG_BLEND_ENABLE (1 << 0) +# define R300_FG_FOG_BLEND_FN_LINEAR (0 << 1) +# define R300_FG_FOG_BLEND_FN_EXP (1 << 1) +# define R300_FG_FOG_BLEND_FN_EXP2 (2 << 1) +# define R300_FG_FOG_BLEND_FN_CONSTANT (3 << 1) +# define R300_FG_FOG_BLEND_FN_MASK (3 << 1) + +/* Fog: Red Component of Fog Color */ +#define R300_FG_FOG_COLOR_R 0x4bc8 +/* Fog: Green Component of Fog Color */ +#define R300_FG_FOG_COLOR_G 0x4bcc +/* Fog: Blue Component of Fog Color */ +#define R300_FG_FOG_COLOR_B 0x4bd0 +# define R300_FG_FOG_COLOR_MASK 0x000003ff + +/* Fog: Constant Factor for Fog Blending */ +#define R300_FG_FOG_FACTOR 0x4bc4 +# define FG_FOG_FACTOR_MASK 0x000003ff + +/* Fog: Alpha function */ +#define R300_FG_ALPHA_FUNC 0x4bd4 +# define R300_FG_ALPHA_FUNC_VAL_MASK 0x000000ff +# define R300_FG_ALPHA_FUNC_NEVER (0 << 8) +# define R300_FG_ALPHA_FUNC_LESS (1 << 8) +# define R300_FG_ALPHA_FUNC_EQUAL (2 << 8) +# define R300_FG_ALPHA_FUNC_LE (3 << 8) +# define R300_FG_ALPHA_FUNC_GREATER (4 << 8) +# define R300_FG_ALPHA_FUNC_NOTEQUAL (5 << 8) +# define R300_FG_ALPHA_FUNC_GE (6 << 8) +# define R300_FG_ALPHA_FUNC_ALWAYS (7 << 8) +# define R300_ALPHA_TEST_OP_MASK (7 << 8) +# define R300_FG_ALPHA_FUNC_DISABLE (0 << 11) +# define R300_FG_ALPHA_FUNC_ENABLE (1 << 11) + +# define R500_FG_ALPHA_FUNC_10BIT (0 << 12) +# define R500_FG_ALPHA_FUNC_8BIT (1 << 12) + +# define R300_FG_ALPHA_FUNC_MASK_DISABLE (0 << 16) +# define R300_FG_ALPHA_FUNC_MASK_ENABLE (1 << 16) +# define R300_FG_ALPHA_FUNC_CFG_2_OF_4 (0 << 17) +# define R300_FG_ALPHA_FUNC_CFG_3_OF_6 (1 << 17) + +# define R300_FG_ALPHA_FUNC_DITH_DISABLE (0 << 20) +# define R300_FG_ALPHA_FUNC_DITH_ENABLE (1 << 20) + +# define R500_FG_ALPHA_FUNC_OFFSET_DISABLE (0 << 24) +# define R500_FG_ALPHA_FUNC_OFFSET_ENABLE (1 << 24) /* Not supported in R520 */ +# define R500_FG_ALPHA_FUNC_DISC_ZERO_MASK_DISABLE (0 << 25) +# define R500_FG_ALPHA_FUNC_DISC_ZERO_MASK_ENABLE (1 << 25) + +# define R500_FG_ALPHA_FUNC_FP16_DISABLE (0 << 28) +# define R500_FG_ALPHA_FUNC_FP16_ENABLE (1 << 28) + + +/* Fog: Where does the depth come from? */ +#define R300_FG_DEPTH_SRC 0x4bd8 +# define R300_FG_DEPTH_SRC_SCAN (0 << 0) +# define R300_FG_DEPTH_SRC_SHADER (1 << 0) + +/* Fog: Alpha Compare Value */ +#define R500_FG_ALPHA_VALUE 0x4be0 +# define R500_FG_ALPHA_VALUE_MASK 0x0000ffff + +/* gap */ + +/* Fragment program parameters in 7.16 floating point */ +#define R300_PFS_PARAM_0_X 0x4C00 +#define R300_PFS_PARAM_0_Y 0x4C04 +#define R300_PFS_PARAM_0_Z 0x4C08 +#define R300_PFS_PARAM_0_W 0x4C0C +/* last consts */ +#define R300_PFS_PARAM_31_X 0x4DF0 +#define R300_PFS_PARAM_31_Y 0x4DF4 +#define R300_PFS_PARAM_31_Z 0x4DF8 +#define R300_PFS_PARAM_31_W 0x4DFC + +/* Unpipelined. */ +#define R300_RB3D_CCTL 0x4e00 +# define R300_RB3D_CCTL_NUM_MULTIWRITES_1_BUFFER (0 << 5) +# define R300_RB3D_CCTL_NUM_MULTIWRITES_2_BUFFERS (1 << 5) +# define R300_RB3D_CCTL_NUM_MULTIWRITES_3_BUFFERS (2 << 5) +# define R300_RB3D_CCTL_NUM_MULTIWRITES_4_BUFFERS (3 << 5) +# define R300_RB3D_CCTL_CLRCMP_FLIPE_DISABLE (0 << 7) +# define R300_RB3D_CCTL_CLRCMP_FLIPE_ENABLE (1 << 7) +# define R300_RB3D_CCTL_AA_COMPRESSION_DISABLE (0 << 9) +# define R300_RB3D_CCTL_AA_COMPRESSION_ENABLE (1 << 9) +# define R300_RB3D_CCTL_CMASK_DISABLE (0 << 10) +# define R300_RB3D_CCTL_CMASK_ENABLE (1 << 10) +/* reserved */ +# define R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_DISABLE (0 << 12) +# define R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE (1 << 12) +# define R300_RB3D_CCTL_WRITE_COMPRESSION_ENABLE (0 << 13) +# define R300_RB3D_CCTL_WRITE_COMPRESSION_DISABLE (1 << 13) +# define R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_DISABLE (0 << 14) +# define R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE (1 << 14) + + +/* Notes: + * - AFAIK fglrx always sets BLEND_UNKNOWN when blending is used in + * the application + * - AFAIK fglrx always sets BLEND_NO_SEPARATE when CBLEND and ABLEND + * are set to the same + * function (both registers are always set up completely in any case) + * - Most blend flags are simply copied from R200 and not tested yet + */ +#define R300_RB3D_CBLEND 0x4E04 +#define R300_RB3D_ABLEND 0x4E08 +/* the following only appear in CBLEND */ +# define R300_ALPHA_BLEND_ENABLE (1 << 0) +# define R300_SEPARATE_ALPHA_ENABLE (1 << 1) +# define R300_READ_ENABLE (1 << 2) +# define R300_DISCARD_SRC_PIXELS_DIS (0 << 3) +# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_0 (1 << 3) +# define R300_DISCARD_SRC_PIXELS_SRC_COLOR_0 (2 << 3) +# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_COLOR_0 (3 << 3) +# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_1 (4 << 3) +# define R300_DISCARD_SRC_PIXELS_SRC_COLOR_1 (5 << 3) +# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_COLOR_1 (6 << 3) + +/* the following are shared between CBLEND and ABLEND */ +# define R300_FCN_MASK (3 << 12) +# define R300_COMB_FCN_ADD_CLAMP (0 << 12) +# define R300_COMB_FCN_ADD_NOCLAMP (1 << 12) +# define R300_COMB_FCN_SUB_CLAMP (2 << 12) +# define R300_COMB_FCN_SUB_NOCLAMP (3 << 12) +# define R300_COMB_FCN_MIN (4 << 12) +# define R300_COMB_FCN_MAX (5 << 12) +# define R300_COMB_FCN_RSUB_CLAMP (6 << 12) +# define R300_COMB_FCN_RSUB_NOCLAMP (7 << 12) +# define R300_BLEND_GL_ZERO (32) +# define R300_BLEND_GL_ONE (33) +# define R300_BLEND_GL_SRC_COLOR (34) +# define R300_BLEND_GL_ONE_MINUS_SRC_COLOR (35) +# define R300_BLEND_GL_DST_COLOR (36) +# define R300_BLEND_GL_ONE_MINUS_DST_COLOR (37) +# define R300_BLEND_GL_SRC_ALPHA (38) +# define R300_BLEND_GL_ONE_MINUS_SRC_ALPHA (39) +# define R300_BLEND_GL_DST_ALPHA (40) +# define R300_BLEND_GL_ONE_MINUS_DST_ALPHA (41) +# define R300_BLEND_GL_SRC_ALPHA_SATURATE (42) +# define R300_BLEND_GL_CONST_COLOR (43) +# define R300_BLEND_GL_ONE_MINUS_CONST_COLOR (44) +# define R300_BLEND_GL_CONST_ALPHA (45) +# define R300_BLEND_GL_ONE_MINUS_CONST_ALPHA (46) +# define R300_BLEND_MASK (63) +# define R300_SRC_BLEND_SHIFT (16) +# define R300_DST_BLEND_SHIFT (24) + +/* Constant color used by the blender. Pipelined through the blender. + * Note: For R520, this field is ignored, use RB3D_CONSTANT_COLOR_GB__BLUE, + * RB3D_CONSTANT_COLOR_GB__GREEN, etc. instead. + */ +#define R300_RB3D_BLEND_COLOR 0x4E10 + + +/* 3D Color Channel Mask. If all the channels used in the current color format + * are disabled, then the cb will discard all the incoming quads. Pipelined + * through the blender. + */ +#define RB3D_COLOR_CHANNEL_MASK 0x4E0C +# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK0 (1 << 0) +# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK0 (1 << 1) +# define RB3D_COLOR_CHANNEL_MASK_RED_MASK0 (1 << 2) +# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK0 (1 << 3) +# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK1 (1 << 4) +# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK1 (1 << 5) +# define RB3D_COLOR_CHANNEL_MASK_RED_MASK1 (1 << 6) +# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK1 (1 << 7) +# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK2 (1 << 8) +# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK2 (1 << 9) +# define RB3D_COLOR_CHANNEL_MASK_RED_MASK2 (1 << 10) +# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK2 (1 << 11) +# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK3 (1 << 12) +# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK3 (1 << 13) +# define RB3D_COLOR_CHANNEL_MASK_RED_MASK3 (1 << 14) +# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK3 (1 << 15) + +/* Clear color that is used when the color mask is set to 00. Unpipelined. + * Program this register with a 32-bit value in ARGB8888 or ARGB2101010 + * formats, ignoring the fields. + */ +#define RB3D_COLOR_CLEAR_VALUE 0x4e14 + +/* gap */ + +/* Color Compare Color. Stalls the 2d/3d datapath until it is idle. */ +#define RB3D_CLRCMP_CLR 0x4e20 + +/* Color Compare Mask. Stalls the 2d/3d datapath until it is idle. */ +#define RB3D_CLRCMP_MSK 0x4e24 + +/* Color Buffer Address Offset of multibuffer 0. Unpipelined. */ +#define R300_RB3D_COLOROFFSET0 0x4E28 +# define R300_COLOROFFSET_MASK 0xFFFFFFE0 +/* Color Buffer Address Offset of multibuffer 1. Unpipelined. */ +#define R300_RB3D_COLOROFFSET1 0x4E2C +/* Color Buffer Address Offset of multibuffer 2. Unpipelined. */ +#define R300_RB3D_COLOROFFSET2 0x4E30 +/* Color Buffer Address Offset of multibuffer 3. Unpipelined. */ +#define R300_RB3D_COLOROFFSET3 0x4E34 + +/* Color buffer format and tiling control for all the multibuffers and the + * pitch of multibuffer 0 to 3. Unpipelined. The cache must be empty before any + * of the registers are changed. + * + * Bit 16: Larger tiles + * Bit 17: 4x2 tiles + * Bit 18: Extremely weird tile like, but some pixels duplicated? + */ +#define R300_RB3D_COLORPITCH0 0x4E38 +# define R300_COLORPITCH_MASK 0x00003FFE +# define R300_COLOR_TILE_DISABLE (0 << 16) +# define R300_COLOR_TILE_ENABLE (1 << 16) +# define R300_COLOR_MICROTILE_DISABLE (0 << 17) +# define R300_COLOR_MICROTILE_ENABLE (1 << 17) +# define R300_COLOR_MICROTILE_ENABLE_SQUARE (2 << 17) /* Only available in 16-bit */ +# define R300_COLOR_ENDIAN_NO_SWAP (0 << 19) +# define R300_COLOR_ENDIAN_WORD_SWAP (1 << 19) +# define R300_COLOR_ENDIAN_DWORD_SWAP (2 << 19) +# define R300_COLOR_ENDIAN_HALF_DWORD_SWAP (3 << 19) +# define R500_COLOR_FORMAT_ARGB10101010 (0 << 21) +# define R500_COLOR_FORMAT_UV1010 (1 << 21) +# define R500_COLOR_FORMAT_CI8 (2 << 21) /* 2D only */ +# define R300_COLOR_FORMAT_ARGB1555 (3 << 21) +# define R300_COLOR_FORMAT_RGB565 (4 << 21) +# define R500_COLOR_FORMAT_ARGB2101010 (5 << 21) +# define R300_COLOR_FORMAT_ARGB8888 (6 << 21) +# define R300_COLOR_FORMAT_ARGB32323232 (7 << 21) +/* reserved */ +# define R300_COLOR_FORMAT_I8 (9 << 21) +# define R300_COLOR_FORMAT_ARGB16161616 (10 << 21) +# define R300_COLOR_FORMAT_VYUY (11 << 21) +# define R300_COLOR_FORMAT_YVYU (12 << 21) +# define R300_COLOR_FORMAT_UV88 (13 << 21) +# define R500_COLOR_FORMAT_I10 (14 << 21) +# define R300_COLOR_FORMAT_ARGB4444 (15 << 21) +#define R300_RB3D_COLORPITCH1 0x4E3C +#define R300_RB3D_COLORPITCH2 0x4E40 +#define R300_RB3D_COLORPITCH3 0x4E44 + +/* gap */ + +/* Destination Color Buffer Cache Control/Status. If the cb is in e2 mode, then + * a flush or free will not occur upon a write to this register, but a sync + * will be immediately sent if one is requested. If both DC_FLUSH and DC_FREE + * are zero but DC_FINISH is one, then a sync will be sent immediately -- the + * cb will not wait for all the previous operations to complete before sending + * the sync. Unpipelined except when DC_FINISH and DC_FREE are both set to + * zero. + * + * Set to 0A before 3D operations, set to 02 afterwards. + */ +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_NO_EFFECT (0 << 0) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_NO_EFFECT_1 (1 << 0) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D (2 << 0) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D_1 (3 << 0) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_NO_EFFECT (0 << 2) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_NO_EFFECT_1 (1 << 2) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS (2 << 2) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS_1 (3 << 2) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_NO_SIGNAL (0 << 4) +# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_SIGNAL (1 << 4) + +#define R300_RB3D_DITHER_CTL 0x4E50 +# define R300_RB3D_DITHER_CTL_DITHER_MODE_TRUNCATE (0 << 0) +# define R300_RB3D_DITHER_CTL_DITHER_MODE_ROUND (1 << 0) +# define R300_RB3D_DITHER_CTL_DITHER_MODE_LUT (2 << 0) +/* reserved */ +# define R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_TRUNCATE (0 << 2) +# define R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_ROUND (1 << 2) +# define R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_LUT (2 << 2) +/* reserved */ + +/* Resolve buffer destination address. The cache must be empty before changing + * this register if the cb is in resolve mode. Unpipelined + */ +#define R300_RB3D_AARESOLVE_OFFSET 0x4e80 +# define R300_RB3D_AARESOLVE_OFFSET_SHIFT 5 +# define R300_RB3D_AARESOLVE_OFFSET_MASK 0xffffffe0 /* At least according to the calculations of Christoph Brill */ + +/* Resolve Buffer Pitch and Tiling Control. The cache must be empty before + * changing this register if the cb is in resolve mode. Unpipelined + */ +#define R300_RB3D_AARESOLVE_PITCH 0x4e84 +# define R300_RB3D_AARESOLVE_PITCH_SHIFT 1 +# define R300_RB3D_AARESOLVE_PITCH_MASK 0x00003ffe /* At least according to the calculations of Christoph Brill */ + +/* Resolve Buffer Control. Unpipelined */ +#define R300_RB3D_AARESOLVE_CTL 0x4e88 +# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_NORMAL (0 << 0) +# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_RESOLVE (1 << 0) +# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_GAMMA_10 (0 << 1) +# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_GAMMA_22 (1 << 1) +# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_SAMPLE0 (0 << 2) +# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_AVERAGE (1 << 2) + + +/* Discard src pixels less than or equal to threshold. */ +#define R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD 0x4ea0 +/* Discard src pixels greater than or equal to threshold. */ +#define R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD 0x4ea4 +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_BLUE_SHIFT 0 +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_BLUE_MASK 0x000000ff +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_GREEN_SHIFT 8 +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_GREEN_MASK 0x0000ff00 +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_RED_SHIFT 16 +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_RED_MASK 0x00ff0000 +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_ALPHA_SHIFT 24 +# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_ALPHA_MASK 0xff000000 + +/* 3D ROP Control. Stalls the 2d/3d datapath until it is idle. */ +#define R300_RB3D_ROPCNTL 0x4e18 +# define R300_RB3D_ROPCNTL_ROP_ENABLE 0x00000004 +# define R300_RB3D_ROPCNTL_ROP_MASK (15 << 8) +# define R300_RB3D_ROPCNTL_ROP_SHIFT 8 + +/* Color Compare Flip. Stalls the 2d/3d datapath until it is idle. */ +#define R300_RB3D_CLRCMP_FLIPE 0x4e1c + +/* Sets the fifo sizes */ +#define R500_RB3D_FIFO_SIZE 0x4ef4 +# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_FULL (0 << 0) +# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_HALF (1 << 0) +# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_QUATER (2 << 0) +# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_EIGTHS (3 << 0) + +/* Constant color used by the blender. Pipelined through the blender. */ +#define R500_RB3D_CONSTANT_COLOR_AR 0x4ef8 +# define R500_RB3D_CONSTANT_COLOR_AR_RED_MASK 0x0000ffff +# define R500_RB3D_CONSTANT_COLOR_AR_RED_SHIFT 0 +# define R500_RB3D_CONSTANT_COLOR_AR_ALPHA_MASK 0xffff0000 +# define R500_RB3D_CONSTANT_COLOR_AR_ALPHA_SHIFT 16 + +/* Constant color used by the blender. Pipelined through the blender. */ +#define R500_RB3D_CONSTANT_COLOR_GB 0x4efc +# define R500_RB3D_CONSTANT_COLOR_AR_BLUE_MASK 0x0000ffff +# define R500_RB3D_CONSTANT_COLOR_AR_BLUE_SHIFT 0 +# define R500_RB3D_CONSTANT_COLOR_AR_GREEN_MASK 0xffff0000 +# define R500_RB3D_CONSTANT_COLOR_AR_GREEN_SHIFT 16 + +/* gap */ +/* There seems to be no "write only" setting, so use Z-test = ALWAYS + * for this. + * Bit (1<<8) is the "test" bit. so plain write is 6 - vd + */ +#define R300_ZB_CNTL 0x4F00 +# define R300_STENCIL_ENABLE (1 << 0) +# define R300_Z_ENABLE (1 << 1) +# define R300_Z_WRITE_ENABLE (1 << 2) +# define R300_Z_SIGNED_COMPARE (1 << 3) +# define R300_STENCIL_FRONT_BACK (1 << 4) + +#define R300_ZB_ZSTENCILCNTL 0x4f04 + /* functions */ +# define R300_ZS_NEVER 0 +# define R300_ZS_LESS 1 +# define R300_ZS_LEQUAL 2 +# define R300_ZS_EQUAL 3 +# define R300_ZS_GEQUAL 4 +# define R300_ZS_GREATER 5 +# define R300_ZS_NOTEQUAL 6 +# define R300_ZS_ALWAYS 7 +# define R300_ZS_MASK 7 + /* operations */ +# define R300_ZS_KEEP 0 +# define R300_ZS_ZERO 1 +# define R300_ZS_REPLACE 2 +# define R300_ZS_INCR 3 +# define R300_ZS_DECR 4 +# define R300_ZS_INVERT 5 +# define R300_ZS_INCR_WRAP 6 +# define R300_ZS_DECR_WRAP 7 +# define R300_Z_FUNC_SHIFT 0 + /* front and back refer to operations done for front + and back faces, i.e. separate stencil function support */ +# define R300_S_FRONT_FUNC_SHIFT 3 +# define R300_S_FRONT_SFAIL_OP_SHIFT 6 +# define R300_S_FRONT_ZPASS_OP_SHIFT 9 +# define R300_S_FRONT_ZFAIL_OP_SHIFT 12 +# define R300_S_BACK_FUNC_SHIFT 15 +# define R300_S_BACK_SFAIL_OP_SHIFT 18 +# define R300_S_BACK_ZPASS_OP_SHIFT 21 +# define R300_S_BACK_ZFAIL_OP_SHIFT 24 + +#define R300_ZB_STENCILREFMASK 0x4f08 +# define R300_STENCILREF_SHIFT 0 +# define R300_STENCILREF_MASK 0x000000ff +# define R300_STENCILMASK_SHIFT 8 +# define R300_STENCILMASK_MASK 0x0000ff00 +# define R300_STENCILWRITEMASK_SHIFT 16 +# define R300_STENCILWRITEMASK_MASK 0x00ff0000 + +/* gap */ + +#define R300_ZB_FORMAT 0x4f10 +# define R300_DEPTHFORMAT_16BIT_INT_Z (0 << 0) +# define R300_DEPTHFORMAT_16BIT_13E3 (1 << 0) +# define R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL (2 << 0) +/* reserved up to (15 << 0) */ +# define R300_INVERT_13E3_LEADING_ONES (0 << 4) +# define R300_INVERT_13E3_LEADING_ZEROS (1 << 4) + +#define R300_ZB_ZTOP 0x4F14 +# define R300_ZTOP_DISABLE (0 << 0) +# define R300_ZTOP_ENABLE (1 << 0) + +/* gap */ + +#define R300_ZB_ZCACHE_CTLSTAT 0x4f18 +# define R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_NO_EFFECT (0 << 0) +# define R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE (1 << 0) +# define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_NO_EFFECT (0 << 1) +# define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE (1 << 1) +# define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_IDLE (0 << 31) +# define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_BUSY (1 << 31) + +#define R300_ZB_BW_CNTL 0x4f1c +# define R300_HIZ_DISABLE (0 << 0) +# define R300_HIZ_ENABLE (1 << 0) +# define R300_HIZ_MIN (0 << 1) +# define R300_HIZ_MAX (1 << 1) +# define R300_FAST_FILL_DISABLE (0 << 2) +# define R300_FAST_FILL_ENABLE (1 << 2) +# define R300_RD_COMP_DISABLE (0 << 3) +# define R300_RD_COMP_ENABLE (1 << 3) +# define R300_WR_COMP_DISABLE (0 << 4) +# define R300_WR_COMP_ENABLE (1 << 4) +# define R300_ZB_CB_CLEAR_RMW (0 << 5) +# define R300_ZB_CB_CLEAR_CACHE_LINEAR (1 << 5) +# define R300_FORCE_COMPRESSED_STENCIL_VALUE_DISABLE (0 << 6) +# define R300_FORCE_COMPRESSED_STENCIL_VALUE_ENABLE (1 << 6) + +# define R500_ZEQUAL_OPTIMIZE_ENABLE (0 << 7) +# define R500_ZEQUAL_OPTIMIZE_DISABLE (1 << 7) +# define R500_SEQUAL_OPTIMIZE_ENABLE (0 << 8) +# define R500_SEQUAL_OPTIMIZE_DISABLE (1 << 8) + +# define R500_BMASK_ENABLE (0 << 10) +# define R500_BMASK_DISABLE (1 << 10) +# define R500_HIZ_EQUAL_REJECT_DISABLE (0 << 11) +# define R500_HIZ_EQUAL_REJECT_ENABLE (1 << 11) +# define R500_HIZ_FP_EXP_BITS_DISABLE (0 << 12) +# define R500_HIZ_FP_EXP_BITS_1 (1 << 12) +# define R500_HIZ_FP_EXP_BITS_2 (2 << 12) +# define R500_HIZ_FP_EXP_BITS_3 (3 << 12) +# define R500_HIZ_FP_EXP_BITS_4 (4 << 12) +# define R500_HIZ_FP_EXP_BITS_5 (5 << 12) +# define R500_HIZ_FP_INVERT_LEADING_ONES (0 << 15) +# define R500_HIZ_FP_INVERT_LEADING_ZEROS (1 << 15) +# define R500_TILE_OVERWRITE_RECOMPRESSION_ENABLE (0 << 16) +# define R500_TILE_OVERWRITE_RECOMPRESSION_DISABLE (1 << 16) +# define R500_CONTIGUOUS_6XAA_SAMPLES_ENABLE (0 << 17) +# define R500_CONTIGUOUS_6XAA_SAMPLES_DISABLE (1 << 17) +# define R500_PEQ_PACKING_DISABLE (0 << 18) +# define R500_PEQ_PACKING_ENABLE (1 << 18) +# define R500_COVERED_PTR_MASKING_DISABLE (0 << 18) +# define R500_COVERED_PTR_MASKING_ENABLE (1 << 18) + + +/* gap */ + +/* Z Buffer Address Offset. + * Bits 31 to 5 are used for aligned Z buffer address offset for macro tiles. + */ +#define R300_ZB_DEPTHOFFSET 0x4f20 + +/* Z Buffer Pitch and Endian Control */ +#define R300_ZB_DEPTHPITCH 0x4f24 +# define R300_DEPTHPITCH_MASK 0x00003FFC +# define R300_DEPTHMACROTILE_DISABLE (0 << 16) +# define R300_DEPTHMACROTILE_ENABLE (1 << 16) +# define R300_DEPTHMICROTILE_LINEAR (0 << 17) +# define R300_DEPTHMICROTILE_TILED (1 << 17) +# define R300_DEPTHMICROTILE_TILED_SQUARE (2 << 17) +# define R300_DEPTHENDIAN_NO_SWAP (0 << 18) +# define R300_DEPTHENDIAN_WORD_SWAP (1 << 18) +# define R300_DEPTHENDIAN_DWORD_SWAP (2 << 18) +# define R300_DEPTHENDIAN_HALF_DWORD_SWAP (3 << 18) + +/* Z Buffer Clear Value */ +#define R300_ZB_DEPTHCLEARVALUE 0x4f28 + +/* Hierarchical Z Memory Offset */ +#define R300_ZB_HIZ_OFFSET 0x4f44 + +/* Hierarchical Z Write Index */ +#define R300_ZB_HIZ_WRINDEX 0x4f48 + +/* Hierarchical Z Data */ +#define R300_ZB_HIZ_DWORD 0x4f4c + +/* Hierarchical Z Read Index */ +#define R300_ZB_HIZ_RDINDEX 0x4f50 + +/* Hierarchical Z Pitch */ +#define R300_ZB_HIZ_PITCH 0x4f54 + +/* Z Buffer Z Pass Counter Data */ +#define R300_ZB_ZPASS_DATA 0x4f58 + +/* Z Buffer Z Pass Counter Address */ +#define R300_ZB_ZPASS_ADDR 0x4f5c + +/* Depth buffer X and Y coordinate offset */ +#define R300_ZB_DEPTHXY_OFFSET 0x4f60 +# define R300_DEPTHX_OFFSET_SHIFT 1 +# define R300_DEPTHX_OFFSET_MASK 0x000007FE +# define R300_DEPTHY_OFFSET_SHIFT 17 +# define R300_DEPTHY_OFFSET_MASK 0x07FE0000 + +/* Sets the fifo sizes */ +#define R500_ZB_FIFO_SIZE 0x4fd0 +# define R500_OP_FIFO_SIZE_FULL (0 << 0) +# define R500_OP_FIFO_SIZE_HALF (1 << 0) +# define R500_OP_FIFO_SIZE_QUATER (2 << 0) +# define R500_OP_FIFO_SIZE_EIGTHS (4 << 0) + +/* Stencil Reference Value and Mask for backfacing quads */ +/* R300_ZB_STENCILREFMASK handles front face */ +#define R500_ZB_STENCILREFMASK_BF 0x4fd4 +# define R500_STENCILREF_SHIFT 0 +# define R500_STENCILREF_MASK 0x000000ff +# define R500_STENCILMASK_SHIFT 8 +# define R500_STENCILMASK_MASK 0x0000ff00 +# define R500_STENCILWRITEMASK_SHIFT 16 +# define R500_STENCILWRITEMASK_MASK 0x00ff0000 + +/** + * \defgroup R3XX_R5XX_PROGRAMMABLE_VERTEX_SHADER_DESCRIPTION R3XX-R5XX PROGRAMMABLE VERTEX SHADER DESCRIPTION + * + * The PVS_DST_MATH_INST is used to identify whether the instruction is a Vector + * Engine instruction or a Math Engine instruction. + */ + +/*\{*/ + +enum { + /* R3XX */ + VECTOR_NO_OP = 0, + VE_DOT_PRODUCT = 1, + VE_MULTIPLY = 2, + VE_ADD = 3, + VE_MULTIPLY_ADD = 4, + VE_DISTANCE_VECTOR = 5, + VE_FRACTION = 6, + VE_MAXIMUM = 7, + VE_MINIMUM = 8, + VE_SET_GREATER_THAN_EQUAL = 9, + VE_SET_LESS_THAN = 10, + VE_MULTIPLYX2_ADD = 11, + VE_MULTIPLY_CLAMP = 12, + VE_FLT2FIX_DX = 13, + VE_FLT2FIX_DX_RND = 14, + /* R5XX */ + VE_PRED_SET_EQ_PUSH = 15, + VE_PRED_SET_GT_PUSH = 16, + VE_PRED_SET_GTE_PUSH = 17, + VE_PRED_SET_NEQ_PUSH = 18, + VE_COND_WRITE_EQ = 19, + VE_COND_WRITE_GT = 20, + VE_COND_WRITE_GTE = 21, + VE_COND_WRITE_NEQ = 22, + VE_COND_MUX_EQ = 23, + VE_COND_MUX_GT = 24, + VE_COND_MUX_GTE = 25, + VE_SET_GREATER_THAN = 26, + VE_SET_EQUAL = 27, + VE_SET_NOT_EQUAL = 28, +}; + +enum { + /* R3XX */ + MATH_NO_OP = 0, + ME_EXP_BASE2_DX = 1, + ME_LOG_BASE2_DX = 2, + ME_EXP_BASEE_FF = 3, + ME_LIGHT_COEFF_DX = 4, + ME_POWER_FUNC_FF = 5, + ME_RECIP_DX = 6, + ME_RECIP_FF = 7, + ME_RECIP_SQRT_DX = 8, + ME_RECIP_SQRT_FF = 9, + ME_MULTIPLY = 10, + ME_EXP_BASE2_FULL_DX = 11, + ME_LOG_BASE2_FULL_DX = 12, + ME_POWER_FUNC_FF_CLAMP_B = 13, + ME_POWER_FUNC_FF_CLAMP_B1 = 14, + ME_POWER_FUNC_FF_CLAMP_01 = 15, + ME_SIN = 16, + ME_COS = 17, + /* R5XX */ + ME_LOG_BASE2_IEEE = 18, + ME_RECIP_IEEE = 19, + ME_RECIP_SQRT_IEEE = 20, + ME_PRED_SET_EQ = 21, + ME_PRED_SET_GT = 22, + ME_PRED_SET_GTE = 23, + ME_PRED_SET_NEQ = 24, + ME_PRED_SET_CLR = 25, + ME_PRED_SET_INV = 26, + ME_PRED_SET_POP = 27, + ME_PRED_SET_RESTORE = 28, +}; + +enum { + /* R3XX */ + PVS_MACRO_OP_2CLK_MADD = 0, + PVS_MACRO_OP_2CLK_M2X_ADD = 1, +}; + +enum { + PVS_SRC_REG_TEMPORARY = 0, /* Intermediate Storage */ + PVS_SRC_REG_INPUT = 1, /* Input Vertex Storage */ + PVS_SRC_REG_CONSTANT = 2, /* Constant State Storage */ + PVS_SRC_REG_ALT_TEMPORARY = 3, /* Alternate Intermediate Storage */ +}; + +enum { + PVS_DST_REG_TEMPORARY = 0, /* Intermediate Storage */ + PVS_DST_REG_A0 = 1, /* Address Register Storage */ + PVS_DST_REG_OUT = 2, /* Output Memory. Used for all outputs */ + PVS_DST_REG_OUT_REPL_X = 3, /* Output Memory & Replicate X to all channels */ + PVS_DST_REG_ALT_TEMPORARY = 4, /* Alternate Intermediate Storage */ + PVS_DST_REG_INPUT = 5, /* Output Memory & Replicate X to all channels */ +}; + +enum { + PVS_SRC_SELECT_X = 0, /* Select X Component */ + PVS_SRC_SELECT_Y = 1, /* Select Y Component */ + PVS_SRC_SELECT_Z = 2, /* Select Z Component */ + PVS_SRC_SELECT_W = 3, /* Select W Component */ + PVS_SRC_SELECT_FORCE_0 = 4, /* Force Component to 0.0 */ + PVS_SRC_SELECT_FORCE_1 = 5, /* Force Component to 1.0 */ +}; + +/* PVS Opcode & Destination Operand Description */ + +enum { + PVS_DST_OPCODE_MASK = 0x3f, + PVS_DST_OPCODE_SHIFT = 0, + PVS_DST_MATH_INST_MASK = 0x1, + PVS_DST_MATH_INST_SHIFT = 6, + PVS_DST_MACRO_INST_MASK = 0x1, + PVS_DST_MACRO_INST_SHIFT = 7, + PVS_DST_REG_TYPE_MASK = 0xf, + PVS_DST_REG_TYPE_SHIFT = 8, + PVS_DST_ADDR_MODE_1_MASK = 0x1, + PVS_DST_ADDR_MODE_1_SHIFT = 12, + PVS_DST_OFFSET_MASK = 0x7f, + PVS_DST_OFFSET_SHIFT = 13, + PVS_DST_WE_X_MASK = 0x1, + PVS_DST_WE_X_SHIFT = 20, + PVS_DST_WE_Y_MASK = 0x1, + PVS_DST_WE_Y_SHIFT = 21, + PVS_DST_WE_Z_MASK = 0x1, + PVS_DST_WE_Z_SHIFT = 22, + PVS_DST_WE_W_MASK = 0x1, + PVS_DST_WE_W_SHIFT = 23, + PVS_DST_VE_SAT_MASK = 0x1, + PVS_DST_VE_SAT_SHIFT = 24, + PVS_DST_ME_SAT_MASK = 0x1, + PVS_DST_ME_SAT_SHIFT = 25, + PVS_DST_PRED_ENABLE_MASK = 0x1, + PVS_DST_PRED_ENABLE_SHIFT = 26, + PVS_DST_PRED_SENSE_MASK = 0x1, + PVS_DST_PRED_SENSE_SHIFT = 27, + PVS_DST_DUAL_MATH_OP_MASK = 0x3, + PVS_DST_DUAL_MATH_OP_SHIFT = 27, + PVS_DST_ADDR_SEL_MASK = 0x3, + PVS_DST_ADDR_SEL_SHIFT = 29, + PVS_DST_ADDR_MODE_0_MASK = 0x1, + PVS_DST_ADDR_MODE_0_SHIFT = 31, +}; + +/* PVS Source Operand Description */ + +enum { + PVS_SRC_REG_TYPE_MASK = 0x3, + PVS_SRC_REG_TYPE_SHIFT = 0, + SPARE_0_MASK = 0x1, + SPARE_0_SHIFT = 2, + PVS_SRC_ABS_XYZW_MASK = 0x1, + PVS_SRC_ABS_XYZW_SHIFT = 3, + PVS_SRC_ADDR_MODE_0_MASK = 0x1, + PVS_SRC_ADDR_MODE_0_SHIFT = 4, + PVS_SRC_OFFSET_MASK = 0xff, + PVS_SRC_OFFSET_SHIFT = 5, + PVS_SRC_SWIZZLE_X_MASK = 0x7, + PVS_SRC_SWIZZLE_X_SHIFT = 13, + PVS_SRC_SWIZZLE_Y_MASK = 0x7, + PVS_SRC_SWIZZLE_Y_SHIFT = 16, + PVS_SRC_SWIZZLE_Z_MASK = 0x7, + PVS_SRC_SWIZZLE_Z_SHIFT = 19, + PVS_SRC_SWIZZLE_W_MASK = 0x7, + PVS_SRC_SWIZZLE_W_SHIFT = 22, + PVS_SRC_MODIFIER_X_MASK = 0x1, + PVS_SRC_MODIFIER_X_SHIFT = 25, + PVS_SRC_MODIFIER_Y_MASK = 0x1, + PVS_SRC_MODIFIER_Y_SHIFT = 26, + PVS_SRC_MODIFIER_Z_MASK = 0x1, + PVS_SRC_MODIFIER_Z_SHIFT = 27, + PVS_SRC_MODIFIER_W_MASK = 0x1, + PVS_SRC_MODIFIER_W_SHIFT = 28, + PVS_SRC_ADDR_SEL_MASK = 0x3, + PVS_SRC_ADDR_SEL_SHIFT = 29, + PVS_SRC_ADDR_MODE_1_MASK = 0x0, + PVS_SRC_ADDR_MODE_1_SHIFT = 32, +}; + +/*\}*/ + +/* BEGIN: Packet 3 commands */ + +/* A primitive emission dword. */ +#define R300_PRIM_TYPE_NONE (0 << 0) +#define R300_PRIM_TYPE_POINT (1 << 0) +#define R300_PRIM_TYPE_LINE (2 << 0) +#define R300_PRIM_TYPE_LINE_STRIP (3 << 0) +#define R300_PRIM_TYPE_TRI_LIST (4 << 0) +#define R300_PRIM_TYPE_TRI_FAN (5 << 0) +#define R300_PRIM_TYPE_TRI_STRIP (6 << 0) +#define R300_PRIM_TYPE_TRI_TYPE2 (7 << 0) +#define R300_PRIM_TYPE_RECT_LIST (8 << 0) +#define R300_PRIM_TYPE_3VRT_POINT_LIST (9 << 0) +#define R300_PRIM_TYPE_3VRT_LINE_LIST (10 << 0) + /* GUESS (based on r200) */ +#define R300_PRIM_TYPE_POINT_SPRITES (11 << 0) +#define R300_PRIM_TYPE_LINE_LOOP (12 << 0) +#define R300_PRIM_TYPE_QUADS (13 << 0) +#define R300_PRIM_TYPE_QUAD_STRIP (14 << 0) +#define R300_PRIM_TYPE_POLYGON (15 << 0) +#define R300_PRIM_TYPE_MASK 0xF +#define R300_PRIM_WALK_IND (1 << 4) +#define R300_PRIM_WALK_LIST (2 << 4) +#define R300_PRIM_WALK_RING (3 << 4) +#define R300_PRIM_WALK_MASK (3 << 4) + /* GUESS (based on r200) */ +#define R300_PRIM_COLOR_ORDER_BGRA (0 << 6) +#define R300_PRIM_COLOR_ORDER_RGBA (1 << 6) +#define R300_PRIM_NUM_VERTICES_SHIFT 16 +#define R300_PRIM_NUM_VERTICES_MASK 0xffff + + + +/* + * The R500 unified shader (US) registers come in banks of 512 each, one + * for each instruction slot in the shader. You can't touch them directly. + * R500_US_VECTOR_INDEX() sets the base instruction to modify; successive + * writes to R500_GA_US_VECTOR_DATA autoincrement the index after the + * instruction is fully specified. + */ +#define R500_US_ALU_ALPHA_INST_0 0xa800 +# define R500_ALPHA_OP_MAD 0 +# define R500_ALPHA_OP_DP 1 +# define R500_ALPHA_OP_MIN 2 +# define R500_ALPHA_OP_MAX 3 +/* #define R500_ALPHA_OP_RESERVED 4 */ +# define R500_ALPHA_OP_CND 5 +# define R500_ALPHA_OP_CMP 6 +# define R500_ALPHA_OP_FRC 7 +# define R500_ALPHA_OP_EX2 8 +# define R500_ALPHA_OP_LN2 9 +# define R500_ALPHA_OP_RCP 10 +# define R500_ALPHA_OP_RSQ 11 +# define R500_ALPHA_OP_SIN 12 +# define R500_ALPHA_OP_COS 13 +# define R500_ALPHA_OP_MDH 14 +# define R500_ALPHA_OP_MDV 15 +# define R500_ALPHA_ADDRD(x) (x << 4) +# define R500_ALPHA_ADDRD_REL (1 << 11) +# define R500_ALPHA_SEL_A_SHIFT 12 +# define R500_ALPHA_SEL_A_SRC0 (0 << 12) +# define R500_ALPHA_SEL_A_SRC1 (1 << 12) +# define R500_ALPHA_SEL_A_SRC2 (2 << 12) +# define R500_ALPHA_SEL_A_SRCP (3 << 12) +# define R500_ALPHA_SWIZ_A_R (0 << 14) +# define R500_ALPHA_SWIZ_A_G (1 << 14) +# define R500_ALPHA_SWIZ_A_B (2 << 14) +# define R500_ALPHA_SWIZ_A_A (3 << 14) +# define R500_ALPHA_SWIZ_A_0 (4 << 14) +# define R500_ALPHA_SWIZ_A_HALF (5 << 14) +# define R500_ALPHA_SWIZ_A_1 (6 << 14) +/* #define R500_ALPHA_SWIZ_A_UNUSED (7 << 14) */ +# define R500_ALPHA_MOD_A_NOP (0 << 17) +# define R500_ALPHA_MOD_A_NEG (1 << 17) +# define R500_ALPHA_MOD_A_ABS (2 << 17) +# define R500_ALPHA_MOD_A_NAB (3 << 17) +# define R500_ALPHA_SEL_B_SHIFT 19 +# define R500_ALPHA_SEL_B_SRC0 (0 << 19) +# define R500_ALPHA_SEL_B_SRC1 (1 << 19) +# define R500_ALPHA_SEL_B_SRC2 (2 << 19) +# define R500_ALPHA_SEL_B_SRCP (3 << 19) +# define R500_ALPHA_SWIZ_B_R (0 << 21) +# define R500_ALPHA_SWIZ_B_G (1 << 21) +# define R500_ALPHA_SWIZ_B_B (2 << 21) +# define R500_ALPHA_SWIZ_B_A (3 << 21) +# define R500_ALPHA_SWIZ_B_0 (4 << 21) +# define R500_ALPHA_SWIZ_B_HALF (5 << 21) +# define R500_ALPHA_SWIZ_B_1 (6 << 21) +/* #define R500_ALPHA_SWIZ_B_UNUSED (7 << 21) */ +# define R500_ALPHA_MOD_B_NOP (0 << 24) +# define R500_ALPHA_MOD_B_NEG (1 << 24) +# define R500_ALPHA_MOD_B_ABS (2 << 24) +# define R500_ALPHA_MOD_B_NAB (3 << 24) +# define R500_ALPHA_OMOD_IDENTITY (0 << 26) +# define R500_ALPHA_OMOD_MUL_2 (1 << 26) +# define R500_ALPHA_OMOD_MUL_4 (2 << 26) +# define R500_ALPHA_OMOD_MUL_8 (3 << 26) +# define R500_ALPHA_OMOD_DIV_2 (4 << 26) +# define R500_ALPHA_OMOD_DIV_4 (5 << 26) +# define R500_ALPHA_OMOD_DIV_8 (6 << 26) +# define R500_ALPHA_OMOD_DISABLE (7 << 26) +# define R500_ALPHA_TARGET(x) (x << 29) +# define R500_ALPHA_W_OMASK (1 << 31) +#define R500_US_ALU_ALPHA_ADDR_0 0x9800 +# define R500_ALPHA_ADDR0(x) (x << 0) +# define R500_ALPHA_ADDR0_CONST (1 << 8) +# define R500_ALPHA_ADDR0_REL (1 << 9) +# define R500_ALPHA_ADDR1(x) (x << 10) +# define R500_ALPHA_ADDR1_CONST (1 << 18) +# define R500_ALPHA_ADDR1_REL (1 << 19) +# define R500_ALPHA_ADDR2(x) (x << 20) +# define R500_ALPHA_ADDR2_CONST (1 << 28) +# define R500_ALPHA_ADDR2_REL (1 << 29) +# define R500_ALPHA_SRCP_OP_1_MINUS_2A0 (0 << 30) +# define R500_ALPHA_SRCP_OP_A1_MINUS_A0 (1 << 30) +# define R500_ALPHA_SRCP_OP_A1_PLUS_A0 (2 << 30) +# define R500_ALPHA_SRCP_OP_1_MINUS_A0 (3 << 30) +#define R500_US_ALU_RGBA_INST_0 0xb000 +# define R500_ALU_RGBA_OP_MAD (0 << 0) +# define R500_ALU_RGBA_OP_DP3 (1 << 0) +# define R500_ALU_RGBA_OP_DP4 (2 << 0) +# define R500_ALU_RGBA_OP_D2A (3 << 0) +# define R500_ALU_RGBA_OP_MIN (4 << 0) +# define R500_ALU_RGBA_OP_MAX (5 << 0) +/* #define R500_ALU_RGBA_OP_RESERVED (6 << 0) */ +# define R500_ALU_RGBA_OP_CND (7 << 0) +# define R500_ALU_RGBA_OP_CMP (8 << 0) +# define R500_ALU_RGBA_OP_FRC (9 << 0) +# define R500_ALU_RGBA_OP_SOP (10 << 0) +# define R500_ALU_RGBA_OP_MDH (11 << 0) +# define R500_ALU_RGBA_OP_MDV (12 << 0) +# define R500_ALU_RGBA_ADDRD(x) (x << 4) +# define R500_ALU_RGBA_ADDRD_REL (1 << 11) +# define R500_ALU_RGBA_SEL_C_SHIFT 12 +# define R500_ALU_RGBA_SEL_C_SRC0 (0 << 12) +# define R500_ALU_RGBA_SEL_C_SRC1 (1 << 12) +# define R500_ALU_RGBA_SEL_C_SRC2 (2 << 12) +# define R500_ALU_RGBA_SEL_C_SRCP (3 << 12) +# define R500_ALU_RGBA_R_SWIZ_R (0 << 14) +# define R500_ALU_RGBA_R_SWIZ_G (1 << 14) +# define R500_ALU_RGBA_R_SWIZ_B (2 << 14) +# define R500_ALU_RGBA_R_SWIZ_A (3 << 14) +# define R500_ALU_RGBA_R_SWIZ_0 (4 << 14) +# define R500_ALU_RGBA_R_SWIZ_HALF (5 << 14) +# define R500_ALU_RGBA_R_SWIZ_1 (6 << 14) +/* #define R500_ALU_RGBA_R_SWIZ_UNUSED (7 << 14) */ +# define R500_ALU_RGBA_G_SWIZ_R (0 << 17) +# define R500_ALU_RGBA_G_SWIZ_G (1 << 17) +# define R500_ALU_RGBA_G_SWIZ_B (2 << 17) +# define R500_ALU_RGBA_G_SWIZ_A (3 << 17) +# define R500_ALU_RGBA_G_SWIZ_0 (4 << 17) +# define R500_ALU_RGBA_G_SWIZ_HALF (5 << 17) +# define R500_ALU_RGBA_G_SWIZ_1 (6 << 17) +/* #define R500_ALU_RGBA_G_SWIZ_UNUSED (7 << 17) */ +# define R500_ALU_RGBA_B_SWIZ_R (0 << 20) +# define R500_ALU_RGBA_B_SWIZ_G (1 << 20) +# define R500_ALU_RGBA_B_SWIZ_B (2 << 20) +# define R500_ALU_RGBA_B_SWIZ_A (3 << 20) +# define R500_ALU_RGBA_B_SWIZ_0 (4 << 20) +# define R500_ALU_RGBA_B_SWIZ_HALF (5 << 20) +# define R500_ALU_RGBA_B_SWIZ_1 (6 << 20) +/* #define R500_ALU_RGBA_B_SWIZ_UNUSED (7 << 20) */ +# define R500_ALU_RGBA_MOD_C_NOP (0 << 23) +# define R500_ALU_RGBA_MOD_C_NEG (1 << 23) +# define R500_ALU_RGBA_MOD_C_ABS (2 << 23) +# define R500_ALU_RGBA_MOD_C_NAB (3 << 23) +# define R500_ALU_RGBA_ALPHA_SEL_C_SHIFT 25 +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC0 (0 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC1 (1 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC2 (2 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRCP (3 << 25) +# define R500_ALU_RGBA_A_SWIZ_R (0 << 27) +# define R500_ALU_RGBA_A_SWIZ_G (1 << 27) +# define R500_ALU_RGBA_A_SWIZ_B (2 << 27) +# define R500_ALU_RGBA_A_SWIZ_A (3 << 27) +# define R500_ALU_RGBA_A_SWIZ_0 (4 << 27) +# define R500_ALU_RGBA_A_SWIZ_HALF (5 << 27) +# define R500_ALU_RGBA_A_SWIZ_1 (6 << 27) +/* #define R500_ALU_RGBA_A_SWIZ_UNUSED (7 << 27) */ +# define R500_ALU_RGBA_ALPHA_MOD_C_NOP (0 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_NEG (1 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_ABS (2 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_NAB (3 << 30) +#define R500_US_ALU_RGB_INST_0 0xa000 +# define R500_ALU_RGB_SEL_A_SHIFT 0 +# define R500_ALU_RGB_SEL_A_SRC0 (0 << 0) +# define R500_ALU_RGB_SEL_A_SRC1 (1 << 0) +# define R500_ALU_RGB_SEL_A_SRC2 (2 << 0) +# define R500_ALU_RGB_SEL_A_SRCP (3 << 0) +# define R500_ALU_RGB_R_SWIZ_A_R (0 << 2) +# define R500_ALU_RGB_R_SWIZ_A_G (1 << 2) +# define R500_ALU_RGB_R_SWIZ_A_B (2 << 2) +# define R500_ALU_RGB_R_SWIZ_A_A (3 << 2) +# define R500_ALU_RGB_R_SWIZ_A_0 (4 << 2) +# define R500_ALU_RGB_R_SWIZ_A_HALF (5 << 2) +# define R500_ALU_RGB_R_SWIZ_A_1 (6 << 2) +/* #define R500_ALU_RGB_R_SWIZ_A_UNUSED (7 << 2) */ +# define R500_ALU_RGB_G_SWIZ_A_R (0 << 5) +# define R500_ALU_RGB_G_SWIZ_A_G (1 << 5) +# define R500_ALU_RGB_G_SWIZ_A_B (2 << 5) +# define R500_ALU_RGB_G_SWIZ_A_A (3 << 5) +# define R500_ALU_RGB_G_SWIZ_A_0 (4 << 5) +# define R500_ALU_RGB_G_SWIZ_A_HALF (5 << 5) +# define R500_ALU_RGB_G_SWIZ_A_1 (6 << 5) +/* #define R500_ALU_RGB_G_SWIZ_A_UNUSED (7 << 5) */ +# define R500_ALU_RGB_B_SWIZ_A_R (0 << 8) +# define R500_ALU_RGB_B_SWIZ_A_G (1 << 8) +# define R500_ALU_RGB_B_SWIZ_A_B (2 << 8) +# define R500_ALU_RGB_B_SWIZ_A_A (3 << 8) +# define R500_ALU_RGB_B_SWIZ_A_0 (4 << 8) +# define R500_ALU_RGB_B_SWIZ_A_HALF (5 << 8) +# define R500_ALU_RGB_B_SWIZ_A_1 (6 << 8) +/* #define R500_ALU_RGB_B_SWIZ_A_UNUSED (7 << 8) */ +# define R500_ALU_RGB_MOD_A_NOP (0 << 11) +# define R500_ALU_RGB_MOD_A_NEG (1 << 11) +# define R500_ALU_RGB_MOD_A_ABS (2 << 11) +# define R500_ALU_RGB_MOD_A_NAB (3 << 11) +# define R500_ALU_RGB_SEL_B_SHIFT 13 +# define R500_ALU_RGB_SEL_B_SRC0 (0 << 13) +# define R500_ALU_RGB_SEL_B_SRC1 (1 << 13) +# define R500_ALU_RGB_SEL_B_SRC2 (2 << 13) +# define R500_ALU_RGB_SEL_B_SRCP (3 << 13) +# define R500_ALU_RGB_R_SWIZ_B_R (0 << 15) +# define R500_ALU_RGB_R_SWIZ_B_G (1 << 15) +# define R500_ALU_RGB_R_SWIZ_B_B (2 << 15) +# define R500_ALU_RGB_R_SWIZ_B_A (3 << 15) +# define R500_ALU_RGB_R_SWIZ_B_0 (4 << 15) +# define R500_ALU_RGB_R_SWIZ_B_HALF (5 << 15) +# define R500_ALU_RGB_R_SWIZ_B_1 (6 << 15) +/* #define R500_ALU_RGB_R_SWIZ_B_UNUSED (7 << 15) */ +# define R500_ALU_RGB_G_SWIZ_B_R (0 << 18) +# define R500_ALU_RGB_G_SWIZ_B_G (1 << 18) +# define R500_ALU_RGB_G_SWIZ_B_B (2 << 18) +# define R500_ALU_RGB_G_SWIZ_B_A (3 << 18) +# define R500_ALU_RGB_G_SWIZ_B_0 (4 << 18) +# define R500_ALU_RGB_G_SWIZ_B_HALF (5 << 18) +# define R500_ALU_RGB_G_SWIZ_B_1 (6 << 18) +/* #define R500_ALU_RGB_G_SWIZ_B_UNUSED (7 << 18) */ +# define R500_ALU_RGB_B_SWIZ_B_R (0 << 21) +# define R500_ALU_RGB_B_SWIZ_B_G (1 << 21) +# define R500_ALU_RGB_B_SWIZ_B_B (2 << 21) +# define R500_ALU_RGB_B_SWIZ_B_A (3 << 21) +# define R500_ALU_RGB_B_SWIZ_B_0 (4 << 21) +# define R500_ALU_RGB_B_SWIZ_B_HALF (5 << 21) +# define R500_ALU_RGB_B_SWIZ_B_1 (6 << 21) +/* #define R500_ALU_RGB_B_SWIZ_B_UNUSED (7 << 21) */ +# define R500_ALU_RGB_MOD_B_NOP (0 << 24) +# define R500_ALU_RGB_MOD_B_NEG (1 << 24) +# define R500_ALU_RGB_MOD_B_ABS (2 << 24) +# define R500_ALU_RGB_MOD_B_NAB (3 << 24) +# define R500_ALU_RGB_OMOD_IDENTITY (0 << 26) +# define R500_ALU_RGB_OMOD_MUL_2 (1 << 26) +# define R500_ALU_RGB_OMOD_MUL_4 (2 << 26) +# define R500_ALU_RGB_OMOD_MUL_8 (3 << 26) +# define R500_ALU_RGB_OMOD_DIV_2 (4 << 26) +# define R500_ALU_RGB_OMOD_DIV_4 (5 << 26) +# define R500_ALU_RGB_OMOD_DIV_8 (6 << 26) +# define R500_ALU_RGB_OMOD_DISABLE (7 << 26) +# define R500_ALU_RGB_TARGET(x) (x << 29) +# define R500_ALU_RGB_WMASK (1 << 31) +#define R500_US_ALU_RGB_ADDR_0 0x9000 +# define R500_RGB_ADDR0(x) (x << 0) +# define R500_RGB_ADDR0_CONST (1 << 8) +# define R500_RGB_ADDR0_REL (1 << 9) +# define R500_RGB_ADDR1(x) (x << 10) +# define R500_RGB_ADDR1_CONST (1 << 18) +# define R500_RGB_ADDR1_REL (1 << 19) +# define R500_RGB_ADDR2(x) (x << 20) +# define R500_RGB_ADDR2_CONST (1 << 28) +# define R500_RGB_ADDR2_REL (1 << 29) +# define R500_RGB_SRCP_OP_1_MINUS_2RGB0 (0 << 30) +# define R500_RGB_SRCP_OP_RGB1_MINUS_RGB0 (1 << 30) +# define R500_RGB_SRCP_OP_RGB1_PLUS_RGB0 (2 << 30) +# define R500_RGB_SRCP_OP_1_MINUS_RGB0 (3 << 30) +#define R500_US_CMN_INST_0 0xb800 +# define R500_INST_TYPE_MASK (3 << 0) +# define R500_INST_TYPE_ALU (0 << 0) +# define R500_INST_TYPE_OUT (1 << 0) +# define R500_INST_TYPE_FC (2 << 0) +# define R500_INST_TYPE_TEX (3 << 0) +# define R500_INST_TEX_SEM_WAIT (1 << 2) +# define R500_INST_RGB_PRED_SEL_NONE (0 << 3) +# define R500_INST_RGB_PRED_SEL_RGBA (1 << 3) +# define R500_INST_RGB_PRED_SEL_RRRR (2 << 3) +# define R500_INST_RGB_PRED_SEL_GGGG (3 << 3) +# define R500_INST_RGB_PRED_SEL_BBBB (4 << 3) +# define R500_INST_RGB_PRED_SEL_AAAA (5 << 3) +# define R500_INST_RGB_PRED_INV (1 << 6) +# define R500_INST_WRITE_INACTIVE (1 << 7) +# define R500_INST_LAST (1 << 8) +# define R500_INST_NOP (1 << 9) +# define R500_INST_ALU_WAIT (1 << 10) +# define R500_INST_RGB_WMASK_R (1 << 11) +# define R500_INST_RGB_WMASK_G (1 << 12) +# define R500_INST_RGB_WMASK_B (1 << 13) +# define R500_INST_ALPHA_WMASK (1 << 14) +# define R500_INST_RGB_OMASK_R (1 << 15) +# define R500_INST_RGB_OMASK_G (1 << 16) +# define R500_INST_RGB_OMASK_B (1 << 17) +# define R500_INST_ALPHA_OMASK (1 << 18) +# 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_ALPHA_PRED_INV (1 << 22) +# define R500_INST_ALU_RESULT_OP_EQ (0 << 23) +# define R500_INST_ALU_RESULT_OP_LT (1 << 23) +# define R500_INST_ALU_RESULT_OP_GE (2 << 23) +# define R500_INST_ALU_RESULT_OP_NE (3 << 23) +# define R500_INST_ALPHA_PRED_SEL_NONE (0 << 25) +# define R500_INST_ALPHA_PRED_SEL_RGBA (1 << 25) +# define R500_INST_ALPHA_PRED_SEL_RRRR (2 << 25) +# define R500_INST_ALPHA_PRED_SEL_GGGG (3 << 25) +# define R500_INST_ALPHA_PRED_SEL_BBBB (4 << 25) +# define R500_INST_ALPHA_PRED_SEL_AAAA (5 << 25) +/* XXX next four are kind of guessed */ +# define R500_INST_STAT_WE_R (1 << 28) +# define R500_INST_STAT_WE_G (1 << 29) +# define R500_INST_STAT_WE_B (1 << 30) +# define R500_INST_STAT_WE_A (1 << 31) + +/* note that these are 8 bit lengths, despite the offsets, at least for R500 */ +#define R500_US_CODE_ADDR 0x4630 +# define R500_US_CODE_START_ADDR(x) (x << 0) +# define R500_US_CODE_END_ADDR(x) (x << 16) +#define R500_US_CODE_OFFSET 0x4638 +# define R500_US_CODE_OFFSET_ADDR(x) (x << 0) +#define R500_US_CODE_RANGE 0x4634 +# define R500_US_CODE_RANGE_ADDR(x) (x << 0) +# define R500_US_CODE_RANGE_SIZE(x) (x << 16) +#define R500_US_CONFIG 0x4600 +# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) +#define R500_US_FC_ADDR_0 0xa000 +# define R500_FC_BOOL_ADDR(x) (x << 0) +# define R500_FC_INT_ADDR(x) (x << 8) +# define R500_FC_JUMP_ADDR(x) (x << 16) +# define R500_FC_JUMP_GLOBAL (1 << 31) +#define R500_US_FC_BOOL_CONST 0x4620 +# define R500_FC_KBOOL(x) (x) +#define R500_US_FC_CTRL 0x4624 +# define R500_FC_TEST_EN (1 << 30) +# define R500_FC_FULL_FC_EN (1 << 31) +#define R500_US_FC_INST_0 0x9800 +# define R500_FC_OP_JUMP (0 << 0) +# define R500_FC_OP_LOOP (1 << 0) +# define R500_FC_OP_ENDLOOP (2 << 0) +# define R500_FC_OP_REP (3 << 0) +# define R500_FC_OP_ENDREP (4 << 0) +# define R500_FC_OP_BREAKLOOP (5 << 0) +# define R500_FC_OP_BREAKREP (6 << 0) +# define R500_FC_OP_CONTINUE (7 << 0) +# define R500_FC_B_ELSE (1 << 4) +# define R500_FC_JUMP_ANY (1 << 5) +# define R500_FC_A_OP_NONE (0 << 6) +# define R500_FC_A_OP_POP (1 << 6) +# define R500_FC_A_OP_PUSH (2 << 6) +# define R500_FC_JUMP_FUNC(x) (x << 8) +# define R500_FC_B_POP_CNT(x) (x << 16) +# define R500_FC_B_OP0_NONE (0 << 24) +# define R500_FC_B_OP0_DECR (1 << 24) +# define R500_FC_B_OP0_INCR (2 << 24) +# define R500_FC_B_OP1_DECR (0 << 26) +# define R500_FC_B_OP1_NONE (1 << 26) +# define R500_FC_B_OP1_INCR (2 << 26) +# define R500_FC_IGNORE_UNCOVERED (1 << 28) +#define R500_US_FC_INT_CONST_0 0x4c00 +# define R500_FC_INT_CONST_KR(x) (x << 0) +# define R500_FC_INT_CONST_KG(x) (x << 8) +# define R500_FC_INT_CONST_KB(x) (x << 16) +/* _0 through _15 */ +#define R500_US_FORMAT0_0 0x4640 +# define R500_FORMAT_TXWIDTH(x) (x << 0) +# define R500_FORMAT_TXHEIGHT(x) (x << 11) +# define R500_FORMAT_TXDEPTH(x) (x << 22) +/* _0 through _3 */ +#define R500_US_OUT_FMT_0 0x46a4 +# define R500_OUT_FMT_C4_8 (0 << 0) +# define R500_OUT_FMT_C4_10 (1 << 0) +# define R500_OUT_FMT_C4_10_GAMMA (2 << 0) +# define R500_OUT_FMT_C_16 (3 << 0) +# define R500_OUT_FMT_C2_16 (4 << 0) +# define R500_OUT_FMT_C4_16 (5 << 0) +# define R500_OUT_FMT_C_16_MPEG (6 << 0) +# define R500_OUT_FMT_C2_16_MPEG (7 << 0) +# define R500_OUT_FMT_C2_4 (8 << 0) +# define R500_OUT_FMT_C_3_3_2 (9 << 0) +# define R500_OUT_FMT_C_6_5_6 (10 << 0) +# define R500_OUT_FMT_C_11_11_10 (11 << 0) +# define R500_OUT_FMT_C_10_11_11 (12 << 0) +# define R500_OUT_FMT_C_2_10_10_10 (13 << 0) +/* #define R500_OUT_FMT_RESERVED (14 << 0) */ +# define R500_OUT_FMT_UNUSED (15 << 0) +# define R500_OUT_FMT_C_16_FP (16 << 0) +# define R500_OUT_FMT_C2_16_FP (17 << 0) +# define R500_OUT_FMT_C4_16_FP (18 << 0) +# define R500_OUT_FMT_C_32_FP (19 << 0) +# define R500_OUT_FMT_C2_32_FP (20 << 0) +# define R500_OUT_FMT_C4_32_FP (21 << 0) +# define R500_C0_SEL_A (0 << 8) +# define R500_C0_SEL_R (1 << 8) +# define R500_C0_SEL_G (2 << 8) +# define R500_C0_SEL_B (3 << 8) +# define R500_C1_SEL_A (0 << 10) +# define R500_C1_SEL_R (1 << 10) +# define R500_C1_SEL_G (2 << 10) +# define R500_C1_SEL_B (3 << 10) +# define R500_C2_SEL_A (0 << 12) +# define R500_C2_SEL_R (1 << 12) +# define R500_C2_SEL_G (2 << 12) +# define R500_C2_SEL_B (3 << 12) +# define R500_C3_SEL_A (0 << 14) +# define R500_C3_SEL_R (1 << 14) +# define R500_C3_SEL_G (2 << 14) +# define R500_C3_SEL_B (3 << 14) +# define R500_OUT_SIGN(x) (x << 16) +# define R500_ROUND_ADJ (1 << 20) +#define R500_US_PIXSIZE 0x4604 +# define R500_PIX_SIZE(x) (x) +#define R500_US_TEX_ADDR_0 0x9800 +# define R500_TEX_SRC_ADDR(x) (x << 0) +# define R500_TEX_SRC_ADDR_REL (1 << 7) +# define R500_TEX_SRC_S_SWIZ_R (0 << 8) +# define R500_TEX_SRC_S_SWIZ_G (1 << 8) +# define R500_TEX_SRC_S_SWIZ_B (2 << 8) +# define R500_TEX_SRC_S_SWIZ_A (3 << 8) +# define R500_TEX_SRC_T_SWIZ_R (0 << 10) +# define R500_TEX_SRC_T_SWIZ_G (1 << 10) +# define R500_TEX_SRC_T_SWIZ_B (2 << 10) +# define R500_TEX_SRC_T_SWIZ_A (3 << 10) +# define R500_TEX_SRC_R_SWIZ_R (0 << 12) +# define R500_TEX_SRC_R_SWIZ_G (1 << 12) +# define R500_TEX_SRC_R_SWIZ_B (2 << 12) +# define R500_TEX_SRC_R_SWIZ_A (3 << 12) +# define R500_TEX_SRC_Q_SWIZ_R (0 << 14) +# define R500_TEX_SRC_Q_SWIZ_G (1 << 14) +# define R500_TEX_SRC_Q_SWIZ_B (2 << 14) +# define R500_TEX_SRC_Q_SWIZ_A (3 << 14) +# define R500_TEX_DST_ADDR(x) (x << 16) +# define R500_TEX_DST_ADDR_REL (1 << 23) +# define R500_TEX_DST_R_SWIZ_R (0 << 24) +# define R500_TEX_DST_R_SWIZ_G (1 << 24) +# define R500_TEX_DST_R_SWIZ_B (2 << 24) +# define R500_TEX_DST_R_SWIZ_A (3 << 24) +# define R500_TEX_DST_G_SWIZ_R (0 << 26) +# define R500_TEX_DST_G_SWIZ_G (1 << 26) +# define R500_TEX_DST_G_SWIZ_B (2 << 26) +# define R500_TEX_DST_G_SWIZ_A (3 << 26) +# define R500_TEX_DST_B_SWIZ_R (0 << 28) +# define R500_TEX_DST_B_SWIZ_G (1 << 28) +# define R500_TEX_DST_B_SWIZ_B (2 << 28) +# define R500_TEX_DST_B_SWIZ_A (3 << 28) +# define R500_TEX_DST_A_SWIZ_R (0 << 30) +# define R500_TEX_DST_A_SWIZ_G (1 << 30) +# define R500_TEX_DST_A_SWIZ_B (2 << 30) +# define R500_TEX_DST_A_SWIZ_A (3 << 30) +#define R500_US_TEX_ADDR_DXDY_0 0xa000 +# define R500_DX_ADDR(x) (x << 0) +# define R500_DX_ADDR_REL (1 << 7) +# define R500_DX_S_SWIZ_R (0 << 8) +# define R500_DX_S_SWIZ_G (1 << 8) +# define R500_DX_S_SWIZ_B (2 << 8) +# define R500_DX_S_SWIZ_A (3 << 8) +# define R500_DX_T_SWIZ_R (0 << 10) +# define R500_DX_T_SWIZ_G (1 << 10) +# define R500_DX_T_SWIZ_B (2 << 10) +# define R500_DX_T_SWIZ_A (3 << 10) +# define R500_DX_R_SWIZ_R (0 << 12) +# define R500_DX_R_SWIZ_G (1 << 12) +# define R500_DX_R_SWIZ_B (2 << 12) +# define R500_DX_R_SWIZ_A (3 << 12) +# define R500_DX_Q_SWIZ_R (0 << 14) +# define R500_DX_Q_SWIZ_G (1 << 14) +# define R500_DX_Q_SWIZ_B (2 << 14) +# define R500_DX_Q_SWIZ_A (3 << 14) +# define R500_DY_ADDR(x) (x << 16) +# define R500_DY_ADDR_REL (1 << 17) +# define R500_DY_S_SWIZ_R (0 << 24) +# define R500_DY_S_SWIZ_G (1 << 24) +# define R500_DY_S_SWIZ_B (2 << 24) +# define R500_DY_S_SWIZ_A (3 << 24) +# define R500_DY_T_SWIZ_R (0 << 26) +# define R500_DY_T_SWIZ_G (1 << 26) +# define R500_DY_T_SWIZ_B (2 << 26) +# define R500_DY_T_SWIZ_A (3 << 26) +# define R500_DY_R_SWIZ_R (0 << 28) +# define R500_DY_R_SWIZ_G (1 << 28) +# define R500_DY_R_SWIZ_B (2 << 28) +# define R500_DY_R_SWIZ_A (3 << 28) +# define R500_DY_Q_SWIZ_R (0 << 30) +# define R500_DY_Q_SWIZ_G (1 << 30) +# define R500_DY_Q_SWIZ_B (2 << 30) +# define R500_DY_Q_SWIZ_A (3 << 30) +#define R500_US_TEX_INST_0 0x9000 +# define R500_TEX_ID(x) (x << 16) +# define R500_TEX_INST_NOP (0 << 22) +# define R500_TEX_INST_LD (1 << 22) +# define R500_TEX_INST_TEXKILL (2 << 22) +# define R500_TEX_INST_PROJ (3 << 22) +# define R500_TEX_INST_LODBIAS (4 << 22) +# define R500_TEX_INST_LOD (5 << 22) +# define R500_TEX_INST_DXDY (6 << 22) +# define R500_TEX_SEM_ACQUIRE (1 << 25) +# define R500_TEX_IGNORE_UNCOVERED (1 << 26) +# define R500_TEX_UNSCALED (1 << 27) +#define R300_US_W_FMT 0x46b4 +# define R300_W_FMT_W0 (0 << 0) +# define R300_W_FMT_W24 (1 << 0) +# define R300_W_FMT_W24FP (2 << 0) +# define R300_W_SRC_US (0 << 2) +# define R300_W_SRC_RAS (1 << 2) + + +/* Draw a primitive from vertex data in arrays loaded via 3D_LOAD_VBPNTR. + * Two parameter dwords: + * 0. VAP_VTX_FMT: The first parameter is not written to hardware + * 1. VAP_VF_CTL: The second parameter is a standard primitive emission dword. + */ +#define R300_PACKET3_3D_DRAW_VBUF 0x00002800 + +/* Draw a primitive from immediate vertices in this packet + * Up to 16382 dwords: + * 0. VAP_VTX_FMT: The first parameter is not written to hardware + * 1. VAP_VF_CTL: The second parameter is a standard primitive emission dword. + * 2 to end: Up to 16380 dwords of vertex data. + */ +#define R300_PACKET3_3D_DRAW_IMMD 0x00002900 + +/* Draw a primitive from vertex data in arrays loaded via 3D_LOAD_VBPNTR and + * immediate vertices in this packet + * Up to 16382 dwords: + * 0. VAP_VTX_FMT: The first parameter is not written to hardware + * 1. VAP_VF_CTL: The second parameter is a standard primitive emission dword. + * 2 to end: Up to 16380 dwords of vertex data. + */ +#define R300_PACKET3_3D_DRAW_INDX 0x00002A00 + + +/* Specify the full set of vertex arrays as (address, stride). + * The first parameter is the number of vertex arrays specified. + * The rest of the command is a variable length list of blocks, where + * each block is three dwords long and specifies two arrays. + * The first dword of a block is split into two words, the lower significant + * word refers to the first array, the more significant word to the second + * array in the block. + * The low byte of each word contains the size of an array entry in dwords, + * the high byte contains the stride of the array. + * The second dword of a block contains the pointer to the first array, + * the third dword of a block contains the pointer to the second array. + * Note that if the total number of arrays is odd, the third dword of + * the last block is omitted. + */ +#define R300_PACKET3_3D_LOAD_VBPNTR 0x00002F00 + +#define R300_PACKET3_INDX_BUFFER 0x00003300 +# define R300_EB_UNK1_SHIFT 24 +# define R300_EB_UNK1 (0x80<<24) +# define R300_EB_UNK2 0x0810 + +/* Same as R300_PACKET3_3D_DRAW_VBUF but without VAP_VTX_FMT */ +#define R300_PACKET3_3D_DRAW_VBUF_2 0x00003400 +/* Same as R300_PACKET3_3D_DRAW_IMMD but without VAP_VTX_FMT */ +#define R300_PACKET3_3D_DRAW_IMMD_2 0x00003500 +/* Same as R300_PACKET3_3D_DRAW_INDX but without VAP_VTX_FMT */ +#define R300_PACKET3_3D_DRAW_INDX_2 0x00003600 + +/* Clears a portion of hierachical Z RAM + * 3 dword parameters + * 0. START + * 1. COUNT: 13:0 (max is 0x3FFF) + * 2. CLEAR_VALUE: Value to write into HIZ RAM. + */ +#define R300_PACKET3_3D_CLEAR_HIZ 0x00003700 + +/* Draws a set of primitives using vertex buffers pointed by the state data. + * At least 2 Parameters: + * 0. VAP_VF_CNTL: The first parameter is a standard primitive emission dword. + * 2 to end: Data or indices (see other 3D_DRAW_* packets for details) + */ +#define R300_PACKET3_3D_DRAW_128 0x00003900 + +/* END: Packet 3 commands */ + + +/* Color formats for 2d packets + */ +#define R300_CP_COLOR_FORMAT_CI8 2 +#define R300_CP_COLOR_FORMAT_ARGB1555 3 +#define R300_CP_COLOR_FORMAT_RGB565 4 +#define R300_CP_COLOR_FORMAT_ARGB8888 6 +#define R300_CP_COLOR_FORMAT_RGB332 7 +#define R300_CP_COLOR_FORMAT_RGB8 9 +#define R300_CP_COLOR_FORMAT_ARGB4444 15 + +/* + * CP type-3 packets + */ +#define R300_CP_CMD_BITBLT_MULTI 0xC0009B00 + +#endif /* _R300_REG_H */ + +/* *INDENT-ON* */ + +/* vim: set foldenable foldmarker=\\{,\\} foldmethod=marker : */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index a853507fea..93441f624e 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -21,6 +21,127 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "r300_context.h" +#include "r300_state.h" + +static uint32_t translate_blend_function(int blend_func) { + switch (blend_func) { + case PIPE_BLEND_ADD: + return R300_COMB_FCN_ADD_CLAMP; + case PIPE_BLEND_SUBTRACT: + return R300_COMB_FCN_SUB_CLAMP; + case PIPE_BLEND_REVERSE_SUBTRACT: + return R300_COMB_FCN_RSUB_CLAMP; + case PIPE_BLEND_MIN: + return R300_COMB_FCN_MIN; + case PIPE_BLEND_MAX: + return R300_COMB_FCN_MAX; + default: + /* XXX should be unreachable, handle this */ + break; + } + return 0; +} + +/* XXX we can also offer the D3D versions of some of these... */ +static uint32_t translate_blend_factor(int blend_fact) { + switch (blend_fact) { + case PIPE_BLENDFACTOR_ONE: + return R300_BLEND_GL_ONE; + case PIPE_BLENDFACTOR_SRC_COLOR: + return R300_BLEND_GL_SRC_COLOR; + case PIPE_BLENDFACTOR_SRC_ALPHA: + return R300_BLEND_GL_SRC_ALPHA; + case PIPE_BLENDFACTOR_DST_ALPHA: + return R300_BLEND_GL_DST_ALPHA; + case PIPE_BLENDFACTOR_DST_COLOR: + return R300_BLEND_GL_DST_COLOR; + case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: + return R300_BLEND_GL_SRC_ALPHA_SATURATE; + case PIPE_BLENDFACTOR_CONST_COLOR: + return R300_BLEND_GL_CONST_COLOR; + case PIPE_BLENDFACTOR_CONST_ALPHA: + return R300_BLEND_GL_CONST_ALPHA; + /* XXX WTF are these? + case PIPE_BLENDFACTOR_SRC1_COLOR: + case PIPE_BLENDFACTOR_SRC1_ALPHA: */ + case PIPE_BLENDFACTOR_ZERO: + return R300_BLEND_GL_ZERO; + case PIPE_BLENDFACTOR_INV_SRC_COLOR: + return R300_BLEND_GL_ONE_MINUS_SRC_COLOR; + case PIPE_BLENDFACTOR_INV_SRC_ALPHA: + return R300_BLEND_GL_ONE_MINUS_SRC_ALPHA; + case PIPE_BLENDFACTOR_INV_DST_ALPHA: + return R300_BLEND_GL_ONE_MINUS_DST_ALPHA; + case PIPE_BLENDFACTOR_INV_DST_COLOR: + return R300_BLEND_GL_ONE_MINUS_DST_COLOR; + case PIPE_BLENDFACTOR_INV_CONST_COLOR: + return R300_BLEND_GL_ONE_MINUS_CONST_COLOR; + case PIPE_BLENDFACTOR_INV_CONST_ALPHA: + return R300_BLEND_GL_ONE_MINUS_CONST_ALPHA; + /* XXX see above + case PIPE_BLENDFACTOR_INV_SRC1_COLOR: + case PIPE_BLENDFACTOR_INV_SRC1_ALPHA: */ + default: + /* XXX the mythical 0x16 blend factor! */ + break; + } + return 0; +} + +static void* r300_create_blend_state(struct pipe_context* pipe, + struct pipe_blend_state* state) +{ + struct r300_blend_state* blend = CALLOC_STRUCT(r300_blend_state); + + if (state->blend_enable) { + /* XXX for now, always do separate alpha... + * is it faster to do it with one reg? */ + blend->blend_control = R300_ALPHA_BLEND_ENABLE | + R300_SEPARATE_ALPHA_ENABLE | + R300_READ_ENABLE | + translate_blend_function(state->rgb_func) | + (translate_blend_factor(state->rgb_src_factor) << + R300_SRC_BLEND_SHIFT) | + (translate_blend_factor(state->rgb_dst_factor) << + R300_DST_BLEND_SHIFT); + blend->alpha_blend_control = + translate_blend_function(state->alpha_func) | + (translate_blend_factor(state->alpha_src_factor) << + R300_SRC_BLEND_SHIFT) | + (translate_blend_factor(state->alpha_dst_factor) << + R300_DST_BLEND_SHIFT); + } + + /* PIPE_LOGICOP_* don't need to be translated, fortunately. */ + /* XXX are logicops still allowed if blending's disabled? + * Does Gallium take care of it for us? */ + if (state->logicop_enable) { + blend->rop = R300_RB3D_ROPCNTL_ROP_ENABLE | + (state->logicop_func) << R300_RB3D_ROPCNTL_ROP_SHIFT; + } + + if (state->dither) { + blend->dither = R300_RB3D_DITHER_CTL_DITHER_MODE_LUT | + R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_LUT; + } + + return (void*)blend; +} + +static void r300_bind_blend_state(struct pipe_context* pipe, + void* state) +{ + struct r300_context* r300 = r300_context(pipe); + + r300->blend_state = (struct r300_blend_state*)state; + r300->dirty_state |= R300_NEW_BLEND; +} + +static void r300_delete_blend_state(struct pipe_context* pipe, + void* state) +{ + FREE(state); +} static void* r300_create_vs_state(struct pipe_context* pipe, struct pipe_shader_state* state) diff --git a/src/gallium/drivers/r300/r300_state.h b/src/gallium/drivers/r300/r300_state.h index 861425936a..ad363bf2af 100644 --- a/src/gallium/drivers/r300/r300_state.h +++ b/src/gallium/drivers/r300/r300_state.h @@ -23,4 +23,6 @@ #ifndef R300_STATE_H #define R300_STATE_H +#include "r300_reg.h" + #endif /* R300_STATE_H */ \ No newline at end of file -- cgit v1.2.3 From 28bb7f3206f023a9d3cfa020da344a57118a2efb Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 14 Jan 2009 00:49:48 -0800 Subject: r300: Add scissor state, fix build. --- src/gallium/drivers/r300/r300_context.h | 10 ++++++- src/gallium/drivers/r300/r300_state.c | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index b9fff0deab..6c64c9fa83 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -34,7 +34,13 @@ struct r300_blend_state { uint32_t dither; /* R300_RB3D_DITHER_CTL: 0x4e50 */ }; -#define R300_NEW_BLEND 0x1 +struct r300_scissor_state { + uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ + uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ +}; + +#define R300_NEW_BLEND 0x1 +#define R300_NEW_SCISSOR 0x2 struct r300_context { /* Parent class */ @@ -48,6 +54,8 @@ struct r300_context { /* Various CSO state objects. */ /* Blend state. */ struct r300_blend_state* blend_state; + /* Scissor state. */ + struct r300_scissor_state* scissor_state; /* Bitmask of dirty state objects. */ uint32_t dirty_state; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 93441f624e..2e19955454 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -88,6 +88,9 @@ static uint32_t translate_blend_factor(int blend_fact) { return 0; } +/* Create a new blend state based on the CSO blend state. + * + * This encompasses alpha blending, logic/raster ops, and blend dithering. */ static void* r300_create_blend_state(struct pipe_context* pipe, struct pipe_blend_state* state) { @@ -128,6 +131,7 @@ static void* r300_create_blend_state(struct pipe_context* pipe, return (void*)blend; } +/* Bind blend state. */ static void r300_bind_blend_state(struct pipe_context* pipe, void* state) { @@ -137,12 +141,55 @@ static void r300_bind_blend_state(struct pipe_context* pipe, r300->dirty_state |= R300_NEW_BLEND; } +/* Free blend state. */ static void r300_delete_blend_state(struct pipe_context* pipe, void* state) { FREE(state); } +/* Create a new scissor state based on the CSO scissor state. + * + * This is only for the fragment scissors. */ +static void* r300_create_scissor_state(struct pipe_context* pipe, + struct pipe_scissor_state* state) +{ + uint32_t left, top, right, bottom; + struct r300_scissor_state* scissor = CALLOC_STRUCT(r300_scissor_state); + + /* So, a bit of info. The scissors are offset by R300_SCISSORS_OFFSET in + * both directions for all values, and can only be 13 bits wide. Why? + * We may never know. */ + left = (state->minx + R300_SCISSORS_OFFSET) & 0x1fff; + top = (state->miny + R300_SCISSORS_OFFSET) & 0x1fff; + right = (state->maxx + R300_SCISSORS_OFFSET) & 0x1fff; + bottom = (state->maxy + R300_SCISSORS_OFFSET) & 0x1fff; + + scissor->scissor_top_left = (left << R300_SCISSORS_X_SHIFT) | + (top << R300_SCISSORS_Y_SHIFT); + scissor->scissor_bottom_right = (right << R300_SCISSORS_X_SHIFT) | + (bottom << R300_SCISSORS_Y_SHIFT); + + return (void*)scissor; +} + +/* Bind scissor state.*/ +static void r300_bind_scissor_state(struct pipe_context* pipe, + void* state) +{ + struct r300_context* r300 = r300_context(pipe); + + r300->scissor_state = (struct r300_scissor_state*)state; + r300->dirty_state |= R300_NEW_SCISSOR; +} + +/* Delete scissor state. */ +static void r300_delete_scissor_state(struct pipe_context* pipe, + void* state) +{ + FREE(state); +} + static void* r300_create_vs_state(struct pipe_context* pipe, struct pipe_shader_state* state) { -- cgit v1.2.3 From bbb1c6f6298fcb1125a8170f22646f326b0ca74c Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 14 Jan 2009 04:37:36 -0800 Subject: r300: Add DSA state. That's it for now. Just the "easy" stuff. Todo: - Rasterizer state, which is a lot more than just the RS. - Miscellaneous state which doesn't currently belong to any state object. - Shader assemblers? - Fix dynamic loading bugs. --- src/gallium/drivers/r300/r300_context.h | 15 ++- src/gallium/drivers/r300/r300_state.c | 162 ++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_state.h | 2 + 3 files changed, 178 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 6c64c9fa83..81c559cedf 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -34,13 +34,24 @@ struct r300_blend_state { uint32_t dither; /* R300_RB3D_DITHER_CTL: 0x4e50 */ }; +struct r300_dsa_state { + uint32_t alpha_function; /* R300_FG_ALPHA_FUNC: 0x4bd4 */ + uint32_t alpha_reference; /* R500_FG_ALPHA_VALUE: 0x4be0 */ + uint32_t z_buffer_control; /* R300_ZB_CNTL: 0x4f00 */ + uint32_t z_stencil_control; /* R300_ZB_ZSTENCILCNTL: 0x4f04 */ + uint32_t stencil_ref_mask; /* R300_ZB_STENCILREFMASK: 0x4f08 */ + uint32_t z_buffer_top; /* R300_ZB_ZTOP: 0x4f14 */ + uint32_t stencil_ref_bf; /* R300_ZB_STENCILREFMASK_BF: 0x4fd4 */ +}; + struct r300_scissor_state { uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ }; #define R300_NEW_BLEND 0x1 -#define R300_NEW_SCISSOR 0x2 +#define R300_NEW_DSA 0x2 +#define R300_NEW_SCISSOR 0x4 struct r300_context { /* Parent class */ @@ -54,6 +65,8 @@ struct r300_context { /* Various CSO state objects. */ /* Blend state. */ struct r300_blend_state* blend_state; + /* Depth, stencil, and alpha state. */ + struct r300_dsa_state* dsa_state; /* Scissor state. */ struct r300_scissor_state* scissor_state; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 2e19955454..0f0660c403 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -148,6 +148,168 @@ static void r300_delete_blend_state(struct pipe_context* pipe, FREE(state); } +static uint32_t translate_depth_stencil_function(int zs_func) { + switch (zs_func) { + case PIPE_FUNC_NEVER: + return R300_ZS_NEVER; + case PIPE_FUNC_LESS: + return R300_ZS_LESS; + case PIPE_FUNC_EQUAL: + return R300_ZS_EQUAL; + case PIPE_FUNC_LEQUAL: + return R300_ZS_LEQUAL; + case PIPE_FUNC_GREATER: + return R300_ZS_GREATER; + case PIPE_FUNC_NOTEQUAL: + return R300_ZS_NOTEQUAL; + case PIPE_FUNC_GEQUAL: + return R300_ZS_GEQUAL; + case PIPE_FUNC_ALWAYS: + return R300_ZS_ALWAYS; + default: + /* XXX shouldn't be reachable */ + break; + } + return 0; +} + +static uint32_t translate_stencil_op(int s_op) { + switch (s_op) { + case PIPE_STENCIL_OP_KEEP: + return R300_ZS_KEEP; + case PIPE_STENCIL_OP_ZERO: + return R300_ZS_ZERO; + case PIPE_STENCIL_OP_REPLACE: + return R300_ZS_REPLACE; + case PIPE_STENCIL_OP_INCR: + return R300_ZS_INCR; + case PIPE_STENCIL_OP_DECR: + return R300_ZS_DECR; + case PIPE_STENCIL_OP_INCR_WRAP: + return R300_ZS_INCR_WRAP; + case PIPE_STENCIL_OP_DECR_WRAP: + return R300_ZS_DECR_WRAP; + case PIPE_STENCIL_OP_INVERT: + return R300_ZS_INVERT; + default: + /* XXX shouldn't be reachable */ + break; + } + return 0; +} + +static uint32_t translate_alpha_function(int alpha_func) { + switch (alpha_func) { + case PIPE_FUNC_NEVER: + return R300_FG_ALPHA_FUNC_NEVER; + case PIPE_FUNC_LESS: + return R300_FG_ALPHA_FUNC_LESS; + case PIPE_FUNC_EQUAL: + return R300_FG_ALPHA_FUNC_EQUAL; + case PIPE_FUNC_LEQUAL: + return R300_FG_ALPHA_FUNC_LE; + case PIPE_FUNC_GREATER: + return R300_FG_ALPHA_FUNC_GREATER; + case PIPE_FUNC_NOTEQUAL: + return R300_FG_ALPHA_FUNC_NOTEQUAL; + case PIPE_FUNC_GEQUAL: + return R300_FG_ALPHA_FUNC_GE; + case PIPE_FUNC_ALWAYS: + return R300_FG_ALPHA_FUNC_ALWAYS; + default: + /* XXX shouldn't be reachable */ + break; + } + return 0; +} + +/* Create a new depth, stencil, and alpha state based on the CSO dsa state. + * + * This contains the depth buffer, stencil buffer, alpha test, and such. + * On the Radeon, depth and stencil buffer setup are intertwined, which is + * the reason for some of the strange-looking assignments across registers. */ +static void* r300_create_dsa_state(struct pipe_context* pipe, + struct pipe_depth_stencil_alpha_state* state) +{ + struct r300_dsa_state* dsa = CALLOC_STRUCT(r300_dsa_state); + + /* Depth test setup. */ + if (state->depth.enabled) { + dsa->z_buffer_control |= R300_Z_ENABLE; + + if (state->depth.writemask) { + dsa->z_buffer_control |= R300_Z_WRITE_ENABLE; + } + + dsa->z_stencil_control |= + (translate_depth_stencil_function(state->depth.func) << + R300_Z_FUNC_SHIFT); + } + + /* Stencil buffer setup. */ + if (state->stencil[0].enabled) { + dsa->z_buffer_control |= R300_STENCIL_ENABLE; + dsa->z_stencil_control |= + (translate_depth_stencil_function(state->stencil[0].func) << + R300_S_FRONT_FUNC_SHIFT) | + (translate_stencil_op(state->stencil[0].fail_op) << + R300_S_FRONT_SFAIL_OP_SHIFT) | + (translate_stencil_op(state->stencil[0].zpass_op) << + R300_S_FRONT_ZPASS_OP_SHIFT) | + (translate_stencil_op(state->stencil[0].zfail_op) << + R300_S_FRONT_ZFAIL_OP_SHIFT); + + dsa->stencil_ref_mask = (state->stencil[0].ref_value) | + (state->stencil[0].value_mask << R300_STENCILMASK_SHIFT) | + (state->stencil[0].write_mask << R300_STENCILWRITEMASK_SHIFT); + + if (state->stencil[1].enabled) { + dsa->z_buffer_control |= R300_STENCIL_FRONT_BACK; + dsa->z_stencil_control |= + (translate_depth_stencil_function(state->stencil[1].func) << + R300_S_BACK_FUNC_SHIFT) | + (translate_stencil_op(state->stencil[1].fail_op) << + R300_S_BACK_SFAIL_OP_SHIFT) | + (translate_stencil_op(state->stencil[1].zpass_op) << + R300_S_BACK_ZPASS_OP_SHIFT) | + (translate_stencil_op(state->stencil[1].zfail_op) << + R300_S_BACK_ZFAIL_OP_SHIFT); + + dsa->stencil_ref_bf = (state->stencil[1].ref_value) | + (state->stencil[1].value_mask << R300_STENCILMASK_SHIFT) | + (state->stencil[1].write_mask << R300_STENCILWRITEMASK_SHIFT); + } + } + + /* Alpha test setup. */ + if (state->alpha.enabled) { + dsa->alpha_function = translate_alpha_function(state->alpha.func) | + R300_FG_ALPHA_FUNC_ENABLE; + dsa->alpha_reference = CLAMP(state->alpha.ref * 1023.0f, 0, 1023); + } else { + dsa->z_buffer_top = R300_ZTOP_ENABLE; + } + + return (void*)dsa; +} + +/* Bind DSA state. */ +static void r300_bind_dsa_state(struct pipe_context* pipe, + void* state) +{ + struct r300_context* r300 = r300_context(pipe); + + r300->dsa_state = (struct r300_dsa_state*)state; + r300->dirty_state |= R300_NEW_DSA; +} + +/* Free DSA state. */ +static void r300_delete_dsa_state(struct pipe_context* pipe, + void* state) +{ + FREE(state); +} + /* Create a new scissor state based on the CSO scissor state. * * This is only for the fragment scissors. */ diff --git a/src/gallium/drivers/r300/r300_state.h b/src/gallium/drivers/r300/r300_state.h index ad363bf2af..c8b742281e 100644 --- a/src/gallium/drivers/r300/r300_state.h +++ b/src/gallium/drivers/r300/r300_state.h @@ -25,4 +25,6 @@ #include "r300_reg.h" +#include "util/u_math.h" + #endif /* R300_STATE_H */ \ No newline at end of file -- cgit v1.2.3 From 21a5a133fff3ab1a068a11a32144dcb63f1d5020 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 14 Jan 2009 05:00:22 -0800 Subject: r300: Hook up state functions. Haha, should not have attempted the scissors. --- src/gallium/drivers/r300/r300_context.c | 2 ++ src/gallium/drivers/r300/r300_context.h | 8 ++--- src/gallium/drivers/r300/r300_state.c | 60 +++++++++++++-------------------- 3 files changed, 27 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index b9a9c2e21c..67cc1e4586 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -54,5 +54,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300_init_surface_functions(r300); + r300_init_state_functions(r300); + return &r300->context; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 81c559cedf..40c310abca 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -44,11 +44,6 @@ struct r300_dsa_state { uint32_t stencil_ref_bf; /* R300_ZB_STENCILREFMASK_BF: 0x4fd4 */ }; -struct r300_scissor_state { - uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ - uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ -}; - #define R300_NEW_BLEND 0x1 #define R300_NEW_DSA 0x2 #define R300_NEW_SCISSOR 0x4 @@ -68,7 +63,7 @@ struct r300_context { /* Depth, stencil, and alpha state. */ struct r300_dsa_state* dsa_state; /* Scissor state. */ - struct r300_scissor_state* scissor_state; + struct pipe_scissor_state* scissor_state; /* Bitmask of dirty state objects. */ uint32_t dirty_state; @@ -80,6 +75,7 @@ static struct r300_context* r300_context(struct pipe_context* context) { } /* Context initialization. */ +void r300_init_state_functions(struct r300_context* r300); void r300_init_surface_functions(struct r300_context* r300); struct pipe_context* r300_create_context(struct pipe_screen* screen, diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 0f0660c403..122e06c6e6 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -92,7 +92,7 @@ static uint32_t translate_blend_factor(int blend_fact) { * * This encompasses alpha blending, logic/raster ops, and blend dithering. */ static void* r300_create_blend_state(struct pipe_context* pipe, - struct pipe_blend_state* state) + const struct pipe_blend_state* state) { struct r300_blend_state* blend = CALLOC_STRUCT(r300_blend_state); @@ -310,48 +310,17 @@ static void r300_delete_dsa_state(struct pipe_context* pipe, FREE(state); } -/* Create a new scissor state based on the CSO scissor state. - * - * This is only for the fragment scissors. */ -static void* r300_create_scissor_state(struct pipe_context* pipe, - struct pipe_scissor_state* state) -{ - uint32_t left, top, right, bottom; - struct r300_scissor_state* scissor = CALLOC_STRUCT(r300_scissor_state); - - /* So, a bit of info. The scissors are offset by R300_SCISSORS_OFFSET in - * both directions for all values, and can only be 13 bits wide. Why? - * We may never know. */ - left = (state->minx + R300_SCISSORS_OFFSET) & 0x1fff; - top = (state->miny + R300_SCISSORS_OFFSET) & 0x1fff; - right = (state->maxx + R300_SCISSORS_OFFSET) & 0x1fff; - bottom = (state->maxy + R300_SCISSORS_OFFSET) & 0x1fff; - - scissor->scissor_top_left = (left << R300_SCISSORS_X_SHIFT) | - (top << R300_SCISSORS_Y_SHIFT); - scissor->scissor_bottom_right = (right << R300_SCISSORS_X_SHIFT) | - (bottom << R300_SCISSORS_Y_SHIFT); - - return (void*)scissor; -} - -/* Bind scissor state.*/ -static void r300_bind_scissor_state(struct pipe_context* pipe, - void* state) +static void r300_set_scissor_state(struct pipe_context* pipe, + struct pipe_scissor_state* state) { struct r300_context* r300 = r300_context(pipe); + draw_flush(r300->draw); - r300->scissor_state = (struct r300_scissor_state*)state; + /* XXX figure out how this memory doesn't get lost in space + memcpy(r300->scissor, scissor, sizeof(struct pipe_scissor_state)); */ r300->dirty_state |= R300_NEW_SCISSOR; } -/* Delete scissor state. */ -static void r300_delete_scissor_state(struct pipe_context* pipe, - void* state) -{ - FREE(state); -} - static void* r300_create_vs_state(struct pipe_context* pipe, struct pipe_shader_state* state) { @@ -371,4 +340,21 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* state) struct r300_context* context = r300_context(pipe); /* XXX handing this off to Draw for now */ draw_delete_vertex_shader(context->draw, (struct draw_vertex_shader*)state); +} + +void r300_init_state_functions(struct r300_context* r300) { + + r300->context.create_blend_state = r300_create_blend_state; + r300->context.bind_blend_state = r300_bind_blend_state; + r300->context.delete_blend_state = r300_delete_blend_state; + + r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; + r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; + r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; + + r300->context.set_scissor_state = r300_set_scissor_state; + + r300->context.create_vs_state = r300_create_vs_state; + r300->context.bind_vs_state = r300_bind_vs_state; + r300->context.delete_vs_state = r300_delete_vs_state; } \ No newline at end of file -- cgit v1.2.3 From 4ce81294943177eed99d7418f1a2f88573b578fe Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 14 Jan 2009 12:51:47 -0800 Subject: r300: Fix errant inlines. This should unbreak dynamic loading. --- src/gallium/drivers/r300/r300_context.h | 4 +++- src/gallium/drivers/r300/r300_screen.h | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 40c310abca..0551275dcc 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -27,6 +27,8 @@ #include "pipe/p_context.h" #include "util/u_memory.h" +#include "r300_screen.h" + struct r300_blend_state { uint32_t blend_control; /* R300_RB3D_BLENDCNTL: 0x4e04 */ uint32_t alpha_blend_control; /* R300_RB3D_ABLENDCNTL: 0x4e08 */ @@ -82,4 +84,4 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, struct pipe_winsys* winsys, struct r300_winsys* r300_winsys); -#endif /* R300_CONTEXT_H */ \ No newline at end of file +#endif /* R300_CONTEXT_H */ diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index 36fc5aa67d..a1b97f218e 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -23,11 +23,10 @@ #ifndef R300_SCREEN_H #define R300_SCREEN_H +#include "pipe/p_inlines.h" #include "pipe/p_screen.h" #include "util/u_memory.h" -#include "r300_context.h" - struct r300_screen { /* Parent class */ struct pipe_screen screen; -- cgit v1.2.3 From a08a830fd3c22bdbad1ee840e4e56302152375f1 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 17 Jan 2009 01:41:52 -0800 Subject: r300: Add more state. pipe_rasterizer_state is big, and I'm still processing it. Todo: - LOL EVERYTHING - Moar cough syrup. - Even moar cough syrup. --- src/gallium/drivers/r300/r300_context.c | 8 +- src/gallium/drivers/r300/r300_context.h | 21 ++++- src/gallium/drivers/r300/r300_state.c | 136 +++++++++++++++++++++++++++++++- 3 files changed, 155 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 67cc1e4586..6dfc9ed624 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -27,7 +27,8 @@ static void r300_destroy_context(struct pipe_context* context) { draw_destroy(r300->draw); - FREE(context); + FREE(r300->scissor_state); + FREE(r300); } struct pipe_context* r300_create_context(struct pipe_screen* screen, @@ -47,10 +48,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->draw = draw_create(); - /* XXX this is almost certainly wrong - * put this all in winsys, where we can get an FD - struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); - r300->cs = cs_gem_create(csm, 64 * 1024 / 4); */ + r300->scissor_state = CALLOC_STRUCT(r300_scissor_state); r300_init_surface_functions(r300); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 0551275dcc..ea057bcab7 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -46,9 +46,24 @@ struct r300_dsa_state { uint32_t stencil_ref_bf; /* R300_ZB_STENCILREFMASK_BF: 0x4fd4 */ }; +struct r300_rs_state { + uint32_t polygon_offset_enable; /* R300_SU_POLY_OFFSET_ENABLE: 0x42b4 */ + uint32_t cull_mode; /* R300_SU_CULL_MODE: 0x42b8 */ + uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ + uint32_t depth_offset_front; /* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */ + uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */ + uint32_t depth_offset_back; /* R300_SU_POLY_OFFSET_BACK_OFFSET: 0x42b0 */ +}; + +struct r300_scissor_state { + uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ + uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ +}; + #define R300_NEW_BLEND 0x1 #define R300_NEW_DSA 0x2 -#define R300_NEW_SCISSOR 0x4 +#define R300_NEW_RS 0x4 +#define R300_NEW_SCISSOR 0x8 struct r300_context { /* Parent class */ @@ -64,8 +79,10 @@ struct r300_context { struct r300_blend_state* blend_state; /* Depth, stencil, and alpha state. */ struct r300_dsa_state* dsa_state; + /* Rasterizer state. */ + struct r300_rs_state* rs_state; /* Scissor state. */ - struct pipe_scissor_state* scissor_state; + struct r300_scissor_state* scissor_state; /* Bitmask of dirty state objects. */ uint32_t dirty_state; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 122e06c6e6..7668b14c63 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -23,6 +23,23 @@ #include "r300_context.h" #include "r300_state.h" +/* r300_state: Functions used to intialize state context by translating + * Gallium state objects into semi-native r300 state objects. + * + * XXX break this file up into pieces if it gets too big! */ + +/* Pack a float into a dword. */ +static uint32_t pack_float_32(float f) +{ + union { + float f; + uint32_t u; + } u; + + u.f = f; + return u.u; +} + static uint32_t translate_blend_function(int blend_func) { switch (blend_func) { case PIPE_BLEND_ADD: @@ -229,7 +246,7 @@ static uint32_t translate_alpha_function(int alpha_func) { * On the Radeon, depth and stencil buffer setup are intertwined, which is * the reason for some of the strange-looking assignments across registers. */ static void* r300_create_dsa_state(struct pipe_context* pipe, - struct pipe_depth_stencil_alpha_state* state) + struct pipe_depth_stencil_alpha_state* state) { struct r300_dsa_state* dsa = CALLOC_STRUCT(r300_dsa_state); @@ -309,6 +326,102 @@ static void r300_delete_dsa_state(struct pipe_context* pipe, { FREE(state); } +#if 0 +struct pipe_rasterizer_state +{ + unsigned flatshade:1; + unsigned light_twoside:1; + unsigned fill_cw:2; /**< PIPE_POLYGON_MODE_x */ + unsigned fill_ccw:2; /**< PIPE_POLYGON_MODE_x */ + unsigned scissor:1; + unsigned poly_smooth:1; + unsigned poly_stipple_enable:1; + unsigned point_smooth:1; + unsigned point_sprite:1; + unsigned point_size_per_vertex:1; /**< size computed in vertex shader */ + unsigned multisample:1; /* XXX maybe more ms state in future */ + unsigned line_smooth:1; + unsigned line_stipple_enable:1; + unsigned line_stipple_factor:8; /**< [1..256] actually */ + unsigned line_stipple_pattern:16; + unsigned line_last_pixel:1; + unsigned bypass_clipping:1; + unsigned bypass_vs:1; /**< Skip the vertex shader. Note that the shader is + still needed though, to indicate inputs/outputs */ + unsigned origin_lower_left:1; /**< Is (0,0) the lower-left corner? */ + unsigned flatshade_first:1; /**< take color attribute from the first vertex of a primitive */ + unsigned gl_rasterization_rules:1; /**< enable tweaks for GL rasterization? */ + + float line_width; + float point_size; /**< used when no per-vertex size */ + float point_size_min; /* XXX - temporary, will go away */ + float point_size_max; /* XXX - temporary, will go away */ + ubyte sprite_coord_mode[PIPE_MAX_SHADER_OUTPUTS]; /**< PIPE_SPRITE_COORD_ */ +}; +#endif +/* Create a new rasterizer state based on the CSO rasterizer state. + * + * This is a very large chunk of state, and covers most of the graphics + * backend (GB), geometry assembly (GA), and setup unit (SU) blocks. + * + * In a not entirely unironic sidenote, this state has nearly nothing to do + * with the actual block on the Radeon called the rasterizer (RS). */ +static void* r300_create_rs_state(struct pipe_context* pipe, + struct pipe_rasterizer_state* state) +{ + struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state); + + /* Radeons don't think in "CW/CCW", they think in "front/back". */ + if (state->front_winding == PIPE_WINDING_CW) { + rs->cull_mode = R300_FRONT_FACE_CW; + + if (state->offset_cw) { + rs->polygon_offset_enable |= R300_FRONT_ENABLE; + } + if (state->offset_ccw) { + rs->polygon_offset_enable |= R300_BACK_ENABLE; + } + } else { + rs->cull_mode = R300_FRONT_FACE_CCW; + + if (state->offset_ccw) { + rs->polygon_offset_enable |= R300_FRONT_ENABLE; + } + if (state->offset_cw) { + rs->polygon_offset_enable |= R300_BACK_ENABLE; + } + } + if (state->front_winding & state->cull_mode) { + rs->cull_mode |= R300_CULL_FRONT; + } + if (~(state->front_winding) & state->cull_mode) { + rs->cull_mode |= R300_CULL_BACK; + } + + if (rs->polygon_offset_enable) { + rs->depth_offset_front = rs->depth_offset_back = + pack_float_32(state->offset_units); + rs->depth_scale_front = rs->depth_scale_back = + pack_float_32(state->offset_scale); + } + + return (void*)rs; +} + +/* Bind rasterizer state. */ +static void r300_bind_rs_state(struct pipe_context* pipe, void* state) +{ + struct r300_context* r300 = r300_context(pipe); + + r300->rs_state = (struct r300_rs_state*)state; + r300->dirty_state |= R300_NEW_RS; +} + +/* Free rasterizer state. */ +static void r300_delete_rs_state(struct pipe_context* pipe, void* state) +{ + FREE(state); +} static void r300_set_scissor_state(struct pipe_context* pipe, struct pipe_scissor_state* state) @@ -316,8 +429,21 @@ static void r300_set_scissor_state(struct pipe_context* pipe, struct r300_context* r300 = r300_context(pipe); draw_flush(r300->draw); - /* XXX figure out how this memory doesn't get lost in space - memcpy(r300->scissor, scissor, sizeof(struct pipe_scissor_state)); */ + uint32_t left, top, right, bottom; + + /* So, a bit of info. The scissors are offset by R300_SCISSORS_OFFSET in + * both directions for all values, and can only be 13 bits wide. Why? + * We may never know. */ + left = (state->minx + R300_SCISSORS_OFFSET) & 0x1fff; + top = (state->miny + R300_SCISSORS_OFFSET) & 0x1fff; + right = (state->maxx + R300_SCISSORS_OFFSET) & 0x1fff; + bottom = (state->maxy + R300_SCISSORS_OFFSET) & 0x1fff; + + r300->scissor_state->scissor_top_left = (left << R300_SCISSORS_X_SHIFT) | + (top << R300_SCISSORS_Y_SHIFT); + r300->scissor_state->scissor_bottom_right = (right << R300_SCISSORS_X_SHIFT) | + (bottom << R300_SCISSORS_Y_SHIFT); + r300->dirty_state |= R300_NEW_SCISSOR; } @@ -348,6 +474,10 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.bind_blend_state = r300_bind_blend_state; r300->context.delete_blend_state = r300_delete_blend_state; + r300->context.create_rasterizer_state = r300_create_rs_state; + r300->context.bind_rasterizer_state = r300_bind_rs_state; + r300->context.delete_rasterizer_state = r300_delete_rs_state; + r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; -- cgit v1.2.3 From f3b53a5cb6a04b86ccd75cc38c73c8e3dd117894 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 17 Jan 2009 02:25:52 -0800 Subject: r300: Add blend color. --- src/gallium/drivers/r300/r300_context.c | 2 ++ src/gallium/drivers/r300/r300_context.h | 19 +++++++++++++++---- src/gallium/drivers/r300/r300_state.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 6dfc9ed624..b072179f5b 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -27,6 +27,7 @@ static void r300_destroy_context(struct pipe_context* context) { draw_destroy(r300->draw); + FREE(r300->blend_color_state); FREE(r300->scissor_state); FREE(r300); } @@ -48,6 +49,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->draw = draw_create(); + r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state); r300->scissor_state = CALLOC_STRUCT(r300_scissor_state); r300_init_surface_functions(r300); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index ea057bcab7..4cbbf96fb1 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -36,6 +36,14 @@ struct r300_blend_state { uint32_t dither; /* R300_RB3D_DITHER_CTL: 0x4e50 */ }; +struct r300_blend_color_state { + /* RV515 and earlier */ + uint32_t blend_color; /* R300_RB3D_BLEND_COLOR: 0x4e10 */ + /* R520 and newer */ + uint32_t blend_color_red_alpha; /* R500_RB3D_CONSTANT_COLOR_AR: 0x4ef8 */ + uint32_t blend_color_green_blue; /* R500_RB3D_CONSTANT_COLOR_GB: 0x4efc */ +}; + struct r300_dsa_state { uint32_t alpha_function; /* R300_FG_ALPHA_FUNC: 0x4bd4 */ uint32_t alpha_reference; /* R500_FG_ALPHA_VALUE: 0x4be0 */ @@ -60,10 +68,11 @@ struct r300_scissor_state { uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ }; -#define R300_NEW_BLEND 0x1 -#define R300_NEW_DSA 0x2 -#define R300_NEW_RS 0x4 -#define R300_NEW_SCISSOR 0x8 +#define R300_NEW_BLEND 0x01 +#define R300_NEW_BLEND_COLOR 0x02 +#define R300_NEW_DSA 0x04 +#define R300_NEW_RS 0x08 +#define R300_NEW_SCISSOR 0x10 struct r300_context { /* Parent class */ @@ -77,6 +86,8 @@ struct r300_context { /* Various CSO state objects. */ /* Blend state. */ struct r300_blend_state* blend_state; + /* Blend color state. */ + struct r300_blend_color_state* blend_color_state; /* Depth, stencil, and alpha state. */ struct r300_dsa_state* dsa_state; /* Rasterizer state. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 7668b14c63..4392078e74 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -165,6 +165,33 @@ static void r300_delete_blend_state(struct pipe_context* pipe, FREE(state); } +/* Set blend color. + * Setup both R300 and R500 registers, figure out later which one to write. */ +static void r300_set_blend_color(struct pipe_context* pipe, + const struct pipe_blend_color* color) +{ + struct r300_context* r300 = r300_context(pipe); + uint32_t r, g, b, a; + ubyte ur, ug, ub, ua; + + r = util_iround(color->color[0] * 1023.0f); + g = util_iround(color->color[1] * 1023.0f); + b = util_iround(color->color[2] * 1023.0f); + a = util_iround(color->color[3] * 1023.0f); + + ur = float_to_ubyte(color->color[0]); + ug = float_to_ubyte(color->color[1]); + ub = float_to_ubyte(color->color[2]); + ua = float_to_ubyte(color->color[3]); + + r300->blend_color_state->blend_color = (a << 24) | (r << 16) | (g << 8) | b; + + r300->blend_color_state->blend_color_red_alpha = ur | (ua << 16); + r300->blend_color_state->blend_color_green_blue = ub | (ug << 16); + + r300->dirty_state |= R300_NEW_BLEND_COLOR; +} + static uint32_t translate_depth_stencil_function(int zs_func) { switch (zs_func) { case PIPE_FUNC_NEVER: @@ -474,6 +501,8 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.bind_blend_state = r300_bind_blend_state; r300->context.delete_blend_state = r300_delete_blend_state; + r300->context.set_blend_color = r300_set_blend_color; + r300->context.create_rasterizer_state = r300_create_rs_state; r300->context.bind_rasterizer_state = r300_bind_rs_state; r300->context.delete_rasterizer_state = r300_delete_rs_state; -- cgit v1.2.3 From 4ea17301c60a805394b8938174d8f436dc3deb6d Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 17 Jan 2009 02:27:33 -0800 Subject: r300: Remove r300_state.h --- src/gallium/drivers/r300/r300_state.c | 4 +++- src/gallium/drivers/r300/r300_state.h | 30 ------------------------------ 2 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 src/gallium/drivers/r300/r300_state.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 4392078e74..cff4b30d16 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -20,8 +20,10 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "util/u_math.h" + #include "r300_context.h" -#include "r300_state.h" +#include "r300_reg.h" /* r300_state: Functions used to intialize state context by translating * Gallium state objects into semi-native r300 state objects. diff --git a/src/gallium/drivers/r300/r300_state.h b/src/gallium/drivers/r300/r300_state.h deleted file mode 100644 index c8b742281e..0000000000 --- a/src/gallium/drivers/r300/r300_state.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2008 Corbin Simpson - * - * 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. */ - -#ifndef R300_STATE_H -#define R300_STATE_H - -#include "r300_reg.h" - -#include "util/u_math.h" - -#endif /* R300_STATE_H */ \ No newline at end of file -- cgit v1.2.3 From 7961974fc28257b293961d35f15c0ce7a85f2669 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 17 Jan 2009 03:20:48 -0800 Subject: r300: Add a basic dirty state emit. I feel strangely unproductive. Must be the cold. --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_context.h | 11 ++-- src/gallium/drivers/r300/r300_cs.h | 3 ++ src/gallium/drivers/r300/r300_emit.c | 92 +++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_screen.c | 7 ++- 5 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_emit.c (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index bce7dcbf3a..644e6d0ba3 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -7,6 +7,7 @@ C_SOURCES = \ r300_blit.c \ r300_clear.c \ r300_context.c \ + r300_emit.c \ r300_screen.c \ r300_state.c \ r300_surface.c diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 4cbbf96fb1..ad1e4fc7c4 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -30,8 +30,8 @@ #include "r300_screen.h" struct r300_blend_state { - uint32_t blend_control; /* R300_RB3D_BLENDCNTL: 0x4e04 */ - uint32_t alpha_blend_control; /* R300_RB3D_ABLENDCNTL: 0x4e08 */ + uint32_t blend_control; /* R300_RB3D_CBLEND: 0x4e04 */ + uint32_t alpha_blend_control; /* R300_RB3D_ABLEND: 0x4e08 */ uint32_t rop; /* R300_RB3D_ROPCNTL: 0x4e18 */ uint32_t dither; /* R300_RB3D_DITHER_CTL: 0x4e50 */ }; @@ -51,16 +51,16 @@ struct r300_dsa_state { uint32_t z_stencil_control; /* R300_ZB_ZSTENCILCNTL: 0x4f04 */ uint32_t stencil_ref_mask; /* R300_ZB_STENCILREFMASK: 0x4f08 */ uint32_t z_buffer_top; /* R300_ZB_ZTOP: 0x4f14 */ - uint32_t stencil_ref_bf; /* R300_ZB_STENCILREFMASK_BF: 0x4fd4 */ + uint32_t stencil_ref_bf; /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */ }; struct r300_rs_state { - uint32_t polygon_offset_enable; /* R300_SU_POLY_OFFSET_ENABLE: 0x42b4 */ - uint32_t cull_mode; /* R300_SU_CULL_MODE: 0x42b8 */ uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ uint32_t depth_offset_front; /* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */ uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */ uint32_t depth_offset_back; /* R300_SU_POLY_OFFSET_BACK_OFFSET: 0x42b0 */ + uint32_t polygon_offset_enable; /* R300_SU_POLY_OFFSET_ENABLE: 0x42b4 */ + uint32_t cull_mode; /* R300_SU_CULL_MODE: 0x42b8 */ }; struct r300_scissor_state { @@ -73,6 +73,7 @@ struct r300_scissor_state { #define R300_NEW_DSA 0x04 #define R300_NEW_RS 0x08 #define R300_NEW_SCISSOR 0x10 +#define R300_NEW_KITCHEN_SINK 0x1f struct r300_context { /* Parent class */ diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 92ed807657..3dacf25380 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -37,6 +37,9 @@ #define RADEON_GEM_DOMAIN_GTT 0x2 #define RADEON_GEM_DOMAIN_VRAM 0x4 +/* XXX stolen from radeon_reg.h */ +#define RADEON_CP_PACKET0 0x0 + #define CP_PACKET0(register, count) \ (RADEON_CP_PACKET0 | ((count) << 16) | ((register) >> 2)) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c new file mode 100644 index 0000000000..8662830ee2 --- /dev/null +++ b/src/gallium/drivers/r300/r300_emit.c @@ -0,0 +1,92 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +/* r300_emit: Functions for emitting state. */ + +#include "r300_context.h" +#include "r300_cs.h" +#include "r300_screen.h" + +static void r300_emit_dirty_state(struct r300_context* r300) +{ + struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; + CS_LOCALS(r300); + + /* XXX check size */ + + if (r300->dirty_state & R300_NEW_BLEND) { + struct r300_blend_state* blend = r300->blend_state; + /* XXX next two are contiguous regs */ + OUT_CS_REG(R300_RB3D_CBLEND, blend->blend_control); + OUT_CS_REG(R300_RB3D_ABLEND, blend->alpha_blend_control); + OUT_CS_REG(R300_RB3D_ROPCNTL, blend->rop); + OUT_CS_REG(R300_RB3D_DITHER_CTL, blend->dither); + } + + if (r300->dirty_state & R300_NEW_BLEND_COLOR) { + struct r300_blend_color_state* blend_color = r300->blend_color_state; + if (r300screen->is_r500) { + /* XXX next two are contiguous regs */ + OUT_CS_REG(R500_RB3D_CONSTANT_COLOR_AR, + blend_color->blend_color_red_alpha); + OUT_CS_REG(R500_RB3D_CONSTANT_COLOR_GB, + blend_color->blend_color_green_blue); + } else { + OUT_CS_REG(R300_RB3D_BLEND_COLOR, + blend_color->blend_color); + } + } + + if (r300->dirty_state & R300_NEW_DSA) { + struct r300_dsa_state* dsa = r300->dsa_state; + OUT_CS_REG(R300_FG_ALPHA_FUNC, dsa->alpha_function); + OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); + /* XXX next three are contiguous regs */ + OUT_CS_REG(R300_ZB_CNTL, dsa->z_buffer_control); + OUT_CS_REG(R300_ZB_ZSTENCILCNTL, dsa->z_stencil_control); + OUT_CS_REG(R300_ZB_STENCILREFMASK, dsa->stencil_ref_mask); + OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top); + if (r300screen->is_r500) { + OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); + } + } + + if (r300->dirty_state & R300_NEW_RS) { + struct r300_rs_state* rs = r300->rs_state; + /* XXX next six are contiguous regs */ + OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, rs->depth_scale_front); + OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, rs->depth_offset_front); + OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_SCALE, rs->depth_scale_back); + OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_OFFSET, rs->depth_offset_back); + OUT_CS_REG(R300_SU_POLY_OFFSET_ENABLE, rs->polygon_offset_enable); + OUT_CS_REG(R300_SU_CULL_MODE, rs->cull_mode); + } + + if (r300->dirty_state & R300_NEW_SCISSOR) { + struct r300_scissor_state* scissor = r300->scissor_state; + /* XXX next two are contiguous regs */ + OUT_CS_REG(R300_SC_SCISSORS_TL, scissor->scissor_top_left); + OUT_CS_REG(R300_SC_SCISSORS_BR, scissor->scissor_bottom_right); + } + + r300->dirty_state = 0; +} diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index dacde27888..5074e3e6fa 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -35,7 +35,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) { struct r300_screen* r300screen = r300_screen(pscreen); switch (param) { - /* Cases marked "IN THEORY" are possible on the hardware, + /* XXX cases marked "IN THEORY" are possible on the hardware, * but haven't been implemented yet. */ case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: /* XXX I'm told this goes up to 16 */ @@ -48,6 +48,11 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) { return 0; case PIPE_CAP_TWO_SIDED_STENCIL: /* IN THEORY */ + /* if (r300screen->is_r500) { + * return 1; + * } else { + * return 0; + * } */ return 0; case PIPE_CAP_ANISOTROPIC_FILTER: /* IN THEORY */ -- cgit v1.2.3 From 2e09845277ce75fa7d29020c5b119ad749522592 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 19 Jan 2009 21:03:24 -0800 Subject: r300: Various flags, small state tracking things. Getting these out of the way so more stuff can be put in. --- src/gallium/drivers/r300/r300_context.c | 3 +++ src/gallium/drivers/r300/r300_context.h | 3 +++ src/gallium/drivers/r300/r300_emit.c | 5 +++++ src/gallium/drivers/r300/r300_screen.c | 1 - src/gallium/drivers/r300/r300_state.c | 4 ++++ 5 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index b072179f5b..798d6bdc6f 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -56,5 +56,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300_init_state_functions(r300); + r300->dirty_state = R300_NEW_KITCHEN_SINK; + r300->dirty_hw++; + return &r300->context; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index ad1e4fc7c4..be6214b7ae 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -55,6 +55,7 @@ struct r300_dsa_state { }; struct r300_rs_state { + uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */ uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ uint32_t depth_offset_front; /* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */ uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */ @@ -98,6 +99,8 @@ struct r300_context { /* Bitmask of dirty state objects. */ uint32_t dirty_state; + /* Flag indicating whether or not the HW is dirty. */ + uint32_t dirty_hw; }; /* Convenience cast wrapper. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 8662830ee2..3c59a270b3 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -31,6 +31,10 @@ static void r300_emit_dirty_state(struct r300_context* r300) struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; CS_LOCALS(r300); + if (!(r300->dirty_state) && !(r300->dirty_hw)) { + return; + } + /* XXX check size */ if (r300->dirty_state & R300_NEW_BLEND) { @@ -72,6 +76,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) if (r300->dirty_state & R300_NEW_RS) { struct r300_rs_state* rs = r300->rs_state; + OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status); /* XXX next six are contiguous regs */ OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, rs->depth_scale_front); OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, rs->depth_offset_front); diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 5074e3e6fa..5c1bab386f 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -123,7 +123,6 @@ static void* r300_surface_map(struct pipe_screen* screen, struct pipe_surface* surface, unsigned flags) { - /* XXX this is not quite right */ char* map = pipe_buffer_map(screen, surface->buffer, flags); if (!map) { diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index cff4b30d16..d73f4483db 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -434,6 +434,10 @@ static void* r300_create_rs_state(struct pipe_context* pipe, pack_float_32(state->offset_scale); } + /* XXX this is part of HW TCL */ + /* XXX endian control */ + rs->vap_control_status = R300_VAP_TCL_BYPASS; + return (void*)rs; } -- cgit v1.2.3 From 538a8149af3fc773a3d1e15d113cb4e3fadc57cd Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 20 Jan 2009 00:31:43 -0800 Subject: r300: Add chipset sorting and capabilities. Part one: Capabilities from classic Mesa. Damn, if only we didn't have so many fucking Radeons! --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_chipset.c | 391 ++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_chipset.h | 100 ++++++++ src/gallium/drivers/r300/r300_emit.c | 4 +- src/gallium/drivers/r300/r300_screen.c | 23 +- src/gallium/drivers/r300/r300_screen.h | 7 +- 6 files changed, 505 insertions(+), 21 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_chipset.c create mode 100644 src/gallium/drivers/r300/r300_chipset.h (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 644e6d0ba3..ad792e9aa8 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -5,6 +5,7 @@ LIBNAME = r300 C_SOURCES = \ r300_blit.c \ + r300_chipset.c \ r300_clear.c \ r300_context.c \ r300_emit.c \ diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c new file mode 100644 index 0000000000..926a9dda50 --- /dev/null +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -0,0 +1,391 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_chipset.h" + +/* r300_chipset: A file all to itself for deducing the various properties of + * Radeons. */ + +/* Parse a PCI ID and fill an r300_capabilities struct with information. */ +void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) +{ + caps->pci_id = pci_id; + + /* Note: These are not ordered by PCI ID. I leave that task to GCC, + * which will perform the ordering while collating jump tables. Instead, + * I've tried to group them according to capabilities and age. */ + switch (pci_id) { + case 0x4144: + caps->family = CHIP_FAMILY_R300; + caps->num_pipes = 1; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x4145: + case 0x4146: + case 0x4147: + case 0x4E44: + case 0x4E45: + case 0x4E46: + case 0x4E47: + caps->family = CHIP_FAMILY_R300; + caps->num_pipes = 2; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x4150: + case 0x4151: + case 0x4152: + case 0x4153: + case 0x4154: + case 0x4155: + case 0x4156: + case 0x4E50: + case 0x4E51: + case 0x4E52: + case 0x4E53: + case 0x4E54: + case 0x4E56: + caps->family = CHIP_FAMILY_RV350; + caps->num_pipes = 1; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x4148: + case 0x4149: + case 0x414A: + case 0x414B: + case 0x4E48: + case 0x4E49: + case 0x4E4B: + caps->family = CHIP_FAMILY_R350; + caps->num_pipes = 2; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x4E4A: + caps->family = CHIP_FAMILY_R360; + caps->num_pipes = 2; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x5460: + case 0x5462: + case 0x5464: + case 0x5B60: + case 0x5B62: + case 0x5B63: + case 0x5B64: + case 0x5B65: + caps->family = CHIP_FAMILY_RV370; + caps->num_pipes = 1; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x3150: + case 0x3152: + case 0x3154: + case 0x3E50: + case 0x3E54: + caps->family = CHIP_FAMILY_RV380; + caps->num_pipes = 1; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x4A48: + case 0x4A49: + case 0x4A4A: + case 0x4A4B: + case 0x4A4C: + case 0x4A4D: + case 0x4A4E: + case 0x4A4F: + case 0x4A50: + case 0x4A54: + caps->family = CHIP_FAMILY_R420; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x5548: + case 0x5549: + case 0x554A: + case 0x554B: + case 0x5550: + case 0x5551: + case 0x5552: + case 0x5554: + case 0x5D57: + caps->family = CHIP_FAMILY_R423; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x554C: + case 0x554D: + case 0x554E: + case 0x554F: + case 0x5D48: + case 0x5D49: + case 0x5D4A: + caps->family = CHIP_FAMILY_R430; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x5D4C: + case 0x5D4D: + case 0x5D4E: + case 0x5D4F: + case 0x5D50: + case 0x5D52: + caps->family = CHIP_FAMILY_R480; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x4B49: + case 0x4B4A: + case 0x4B4B: + case 0x4B4C: + caps->family = CHIP_FAMILY_R481; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x5E4C: + case 0x5E4F: + case 0x564A: + case 0x564B: + case 0x564F: + case 0x5652: + case 0x5653: + case 0x5657: + case 0x5E48: + case 0x5E4A: + case 0x5E4B: + case 0x5E4D: + caps->family = CHIP_FAMILY_RV410; + caps->num_pipes = 1; + caps->has_tcl = TRUE; + caps->has_us = FALSE; + break; + + case 0x5954: + case 0x5955: + caps->family = CHIP_FAMILY_RS480; + caps->num_pipes = 1; /* CHECK ME */ + caps->has_tcl = FALSE; + caps->has_us = FALSE; + break; + + case 0x5974: + case 0x5975: + caps->family = CHIP_FAMILY_RS482; + caps->num_pipes = 1; /* CHECK ME */ + caps->has_tcl = FALSE; + caps->has_us = FALSE; + break; + + case 0x5A41: + case 0x5A42: + caps->family = CHIP_FAMILY_RS400; + caps->num_pipes = 1; /* CHECK ME */ + caps->has_tcl = FALSE; + caps->has_us = FALSE; + break; + + case 0x5A61: + case 0x5A62: + caps->family = CHIP_FAMILY_RC410; + caps->num_pipes = 1; /* CHECK ME */ + caps->has_tcl = FALSE; + caps->has_us = FALSE; + break; + + case 0x791E: + case 0x791F: + caps->family = CHIP_FAMILY_RS690; + caps->num_pipes = 1; /* CHECK ME */ + caps->has_tcl = FALSE; + caps->has_us = FALSE; /* CHECK ME */ + break; + + case 0x796C: + case 0x796D: + case 0x796E: + case 0x796F: + caps->family = CHIP_FAMILY_RS740; + caps->num_pipes = 1; /* CHECK ME */ + caps->has_tcl = FALSE; + caps->has_us = FALSE; /* CHECK ME */ + break; + + case 0x7100: + case 0x7101: + case 0x7102: + case 0x7103: + case 0x7104: + case 0x7105: + case 0x7106: + case 0x7108: + case 0x7109: + case 0x710A: + case 0x710B: + case 0x710C: + case 0x710E: + case 0x710F: + caps->family = CHIP_FAMILY_R520; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = TRUE; + break; + + case 0x7140: + case 0x7141: + case 0x7142: + case 0x7143: + case 0x7144: + case 0x7145: + case 0x7146: + case 0x7147: + case 0x7149: + case 0x714A: + case 0x714B: + case 0x714C: + case 0x714D: + case 0x714E: + case 0x714F: + case 0x7151: + case 0x7152: + case 0x7153: + case 0x715E: + case 0x715F: + case 0x7180: + case 0x7181: + case 0x7183: + case 0x7186: + case 0x7187: + case 0x7188: + case 0x718A: + case 0x718B: + case 0x718C: + case 0x718D: + case 0x718F: + case 0x7193: + case 0x7196: + case 0x719B: + case 0x719F: + case 0x7200: + case 0x7210: + case 0x7211: + caps->family = CHIP_FAMILY_RV515; + caps->num_pipes = 1; + caps->has_tcl = TRUE; + caps->has_us = TRUE; + break; + + case 0x71C0: + case 0x71C1: + case 0x71C2: + case 0x71C3: + case 0x71C4: + case 0x71C5: + case 0x71C6: + case 0x71C7: + case 0x71CD: + case 0x71CE: + case 0x71D2: + case 0x71D4: + case 0x71D5: + case 0x71D6: + case 0x71DA: + case 0x71DE: + caps->family = CHIP_FAMILY_RV530; + caps->num_pipes = 1; + caps->has_tcl = TRUE; + caps->has_us = TRUE; + break; + + case 0x7240: + case 0x7243: + case 0x7244: + case 0x7245: + case 0x7246: + case 0x7247: + case 0x7248: + case 0x7249: + case 0x724A: + case 0x724B: + case 0x724C: + case 0x724D: + case 0x724E: + case 0x724F: + case 0x7284: + caps->family = CHIP_FAMILY_R580; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = TRUE; + break; + + case 0x7280: + caps->family = CHIP_FAMILY_RV570; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = TRUE; + break; + + case 0x7281: + case 0x7283: + case 0x7287: + case 0x7288: + case 0x7289: + case 0x728B: + case 0x728C: + case 0x7290: + case 0x7291: + case 0x7293: + case 0x7297: + caps->family = CHIP_FAMILY_RV560; + caps->num_pipes = 4; + caps->has_tcl = TRUE; + caps->has_us = TRUE; + break; + + default: + /* XXX not an r300?! */ + assert(0); + break; + } +} diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h new file mode 100644 index 0000000000..98963db17e --- /dev/null +++ b/src/gallium/drivers/r300/r300_chipset.h @@ -0,0 +1,100 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_CHIPSET_H +#define R300_CHIPSET_H + +#include "pipe/p_compiler.h" + +/* Structure containing all the possible information about a specific Radeon + * in the R3xx, R4xx, and R5xx families. */ +struct r300_capabilities { + /* PCI ID */ + uint32_t pci_id; + /* Chipset family */ + int family; + /* The number of Graphics Backend (GB) pipes */ + int num_pipes; + /* Whether or not TCL is physically present */ + boolean has_tcl; + /* Whether or not Universal Shaders (US) are used for fragment shaders */ + boolean has_us; +}; + +/* Enumeration for legibility and also telling which card we're running on. */ +enum { + CHIP_FAMILY_R300 = 0, + CHIP_FAMILY_R350, + CHIP_FAMILY_R360, + CHIP_FAMILY_RV350, + CHIP_FAMILY_RV370, + CHIP_FAMILY_RV380, + CHIP_FAMILY_R420, + CHIP_FAMILY_R423, + CHIP_FAMILY_R430, + CHIP_FAMILY_R480, + CHIP_FAMILY_R481, + CHIP_FAMILY_RV410, + CHIP_FAMILY_RS400, + CHIP_FAMILY_RC410, + CHIP_FAMILY_RS480, + CHIP_FAMILY_RS482, + CHIP_FAMILY_RS690, + CHIP_FAMILY_RS740, + CHIP_FAMILY_RV515, + CHIP_FAMILY_R520, + CHIP_FAMILY_RV530, + CHIP_FAMILY_R580, + CHIP_FAMILY_RV560, + CHIP_FAMILY_RV570 +}; + +static const char* chip_families[] = { + "R300", + "R350", + "R360", + "RV350", + "RV370", + "RV380", + "R420", + "R423", + "R430", + "R480", + "R481", + "RV410", + "RS400", + "RC410", + "RS480", + "RS482", + "RS690", + "RS740", + "RV515", + "R520", + "RV530", + "R580", + "RV560", + "RV570" +}; + +void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps); + +#endif /* R300_CHIPSET_H */ \ No newline at end of file diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 3c59a270b3..42096a9235 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -48,7 +48,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) if (r300->dirty_state & R300_NEW_BLEND_COLOR) { struct r300_blend_color_state* blend_color = r300->blend_color_state; - if (r300screen->is_r500) { + if (FALSE /*XXX*/) { /* XXX next two are contiguous regs */ OUT_CS_REG(R500_RB3D_CONSTANT_COLOR_AR, blend_color->blend_color_red_alpha); @@ -69,7 +69,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) OUT_CS_REG(R300_ZB_ZSTENCILCNTL, dsa->z_stencil_control); OUT_CS_REG(R300_ZB_STENCILREFMASK, dsa->stencil_ref_mask); OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top); - if (r300screen->is_r500) { + if (FALSE /*XXX*/) { OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); } } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 5c1bab386f..c75ff9414b 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -71,12 +71,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) { return 0; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: /* 12 == 2048x2048 */ - if (r300screen->is_r500) { - /* R500 can do 4096x4096 */ - return 13; - } else { - return 12; - } + return 12; case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: /* XXX educated guess */ return 8; @@ -142,21 +137,17 @@ static void r300_destroy_screen(struct pipe_screen* pscreen) { FREE(pscreen); } -struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint pci_id) { +struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint32_t pci_id) +{ struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen); + struct r300_capabilities* caps = CALLOC_STRUCT(r300_capabilities); - if (!r300screen) + if (!r300screen || !caps) return NULL; - /* XXX break this into its own function? - switch (pci_id) { - default: - debug_printf("%s: unknown PCI ID 0x%x, cannot create screen!\n", - __FUNCTION__, pci_id); - return NULL; - } */ + r300_parse_chipset(pci_id, caps); - r300screen->pci_id = pci_id; + r300screen->caps = caps; r300screen->screen.winsys = winsys; r300screen->screen.destroy = r300_destroy_screen; r300screen->screen.get_name = r300_get_name; diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index a1b97f218e..b6c3d1f462 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -27,13 +27,14 @@ #include "pipe/p_screen.h" #include "util/u_memory.h" +#include "r300_chipset.h" + struct r300_screen { /* Parent class */ struct pipe_screen screen; - boolean is_r400; - boolean is_r500; - int pci_id; + /* Chipset capabilities */ + struct r300_capabilities* caps; }; /* Convenience cast wrapper. */ -- cgit v1.2.3 From 43f20357c8db2c90ae1f8360dbc2c71762a0478e Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 20 Jan 2009 01:11:08 -0800 Subject: r300: Use chip caps for something. Step two: Integration. Yay? Time to stop messing around with this and actually go do things. --- src/gallium/drivers/r300/r300_chipset.c | 54 ++++++--------------------------- src/gallium/drivers/r300/r300_chipset.h | 9 ++++-- src/gallium/drivers/r300/r300_emit.c | 4 +-- src/gallium/drivers/r300/r300_screen.c | 5 +-- 4 files changed, 20 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index 926a9dda50..1dc9b8cf3c 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -28,7 +28,10 @@ /* Parse a PCI ID and fill an r300_capabilities struct with information. */ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) { + /* Reasonable defaults */ caps->pci_id = pci_id; + caps->has_tcl = TRUE; + caps->is_r500 = FALSE; /* Note: These are not ordered by PCI ID. I leave that task to GCC, * which will perform the ordering while collating jump tables. Instead, @@ -37,8 +40,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4144: caps->family = CHIP_FAMILY_R300; caps->num_pipes = 1; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x4145: @@ -50,8 +51,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4E47: caps->family = CHIP_FAMILY_R300; caps->num_pipes = 2; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x4150: @@ -69,8 +68,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4E56: caps->family = CHIP_FAMILY_RV350; caps->num_pipes = 1; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x4148: @@ -82,15 +79,11 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4E4B: caps->family = CHIP_FAMILY_R350; caps->num_pipes = 2; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x4E4A: caps->family = CHIP_FAMILY_R360; caps->num_pipes = 2; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x5460: @@ -103,8 +96,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5B65: caps->family = CHIP_FAMILY_RV370; caps->num_pipes = 1; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x3150: @@ -114,8 +105,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x3E54: caps->family = CHIP_FAMILY_RV380; caps->num_pipes = 1; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x4A48: @@ -130,8 +119,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4A54: caps->family = CHIP_FAMILY_R420; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x5548: @@ -145,8 +132,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5D57: caps->family = CHIP_FAMILY_R423; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x554C: @@ -158,8 +143,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5D4A: caps->family = CHIP_FAMILY_R430; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x5D4C: @@ -170,8 +153,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5D52: caps->family = CHIP_FAMILY_R480; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x4B49: @@ -180,8 +161,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4B4C: caps->family = CHIP_FAMILY_R481; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x5E4C: @@ -198,8 +177,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5E4D: caps->family = CHIP_FAMILY_RV410; caps->num_pipes = 1; - caps->has_tcl = TRUE; - caps->has_us = FALSE; break; case 0x5954: @@ -207,7 +184,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) caps->family = CHIP_FAMILY_RS480; caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; - caps->has_us = FALSE; break; case 0x5974: @@ -215,7 +191,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) caps->family = CHIP_FAMILY_RS482; caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; - caps->has_us = FALSE; break; case 0x5A41: @@ -223,7 +198,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) caps->family = CHIP_FAMILY_RS400; caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; - caps->has_us = FALSE; break; case 0x5A61: @@ -231,7 +205,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) caps->family = CHIP_FAMILY_RC410; caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; - caps->has_us = FALSE; break; case 0x791E: @@ -239,7 +212,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) caps->family = CHIP_FAMILY_RS690; caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; - caps->has_us = FALSE; /* CHECK ME */ break; case 0x796C: @@ -249,7 +221,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) caps->family = CHIP_FAMILY_RS740; caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; - caps->has_us = FALSE; /* CHECK ME */ break; case 0x7100: @@ -268,8 +239,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x710F: caps->family = CHIP_FAMILY_R520; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = TRUE; + caps->is_r500 = TRUE; break; case 0x7140: @@ -312,8 +282,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x7211: caps->family = CHIP_FAMILY_RV515; caps->num_pipes = 1; - caps->has_tcl = TRUE; - caps->has_us = TRUE; + caps->is_r500 = TRUE; break; case 0x71C0: @@ -334,8 +303,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x71DE: caps->family = CHIP_FAMILY_RV530; caps->num_pipes = 1; - caps->has_tcl = TRUE; - caps->has_us = TRUE; + caps->is_r500 = TRUE; break; case 0x7240: @@ -355,15 +323,13 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x7284: caps->family = CHIP_FAMILY_R580; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = TRUE; + caps->is_r500 = TRUE; break; case 0x7280: caps->family = CHIP_FAMILY_RV570; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = TRUE; + caps->is_r500 = TRUE; break; case 0x7281: @@ -379,13 +345,11 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x7297: caps->family = CHIP_FAMILY_RV560; caps->num_pipes = 4; - caps->has_tcl = TRUE; - caps->has_us = TRUE; + caps->is_r500 = TRUE; break; default: /* XXX not an r300?! */ - assert(0); break; } } diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h index 98963db17e..c2d7ad3414 100644 --- a/src/gallium/drivers/r300/r300_chipset.h +++ b/src/gallium/drivers/r300/r300_chipset.h @@ -36,11 +36,14 @@ struct r300_capabilities { int num_pipes; /* Whether or not TCL is physically present */ boolean has_tcl; - /* Whether or not Universal Shaders (US) are used for fragment shaders */ - boolean has_us; + /* Whether or not this is an RV515 or newer; R500s have many features: + * - Extra bit on texture sizes + * - Blend color is split across two registers + * - Universal Shader (US) block used for fragment shaders */ + boolean is_r500; }; -/* Enumeration for legibility and also telling which card we're running on. */ +/* Enumerations for legibility and telling which card we're running on. */ enum { CHIP_FAMILY_R300 = 0, CHIP_FAMILY_R350, diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 42096a9235..bf6fd3224e 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -48,7 +48,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) if (r300->dirty_state & R300_NEW_BLEND_COLOR) { struct r300_blend_color_state* blend_color = r300->blend_color_state; - if (FALSE /*XXX*/) { + if (r300screen->caps->is_r500) { /* XXX next two are contiguous regs */ OUT_CS_REG(R500_RB3D_CONSTANT_COLOR_AR, blend_color->blend_color_red_alpha); @@ -69,7 +69,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) OUT_CS_REG(R300_ZB_ZSTENCILCNTL, dsa->z_stencil_control); OUT_CS_REG(R300_ZB_STENCILREFMASK, dsa->stencil_ref_mask); OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top); - if (FALSE /*XXX*/) { + if (r300screen->caps->is_r500) { OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); } } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index c75ff9414b..7bba567e83 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -27,8 +27,9 @@ static const char* r300_get_vendor(struct pipe_screen* pscreen) { } static const char* r300_get_name(struct pipe_screen* pscreen) { - /* XXX lazy */ - return "unknown"; + struct r300_screen* r300screen = r300_screen(pscreen); + + return chip_families[r300screen->caps->family]; } static int r300_get_param(struct pipe_screen* pscreen, int param) { -- cgit v1.2.3 From 502ddfcd57ff7ed1f2dac9171f51c45893ea3d92 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 20 Jan 2009 01:49:34 -0800 Subject: r300: Add path for pci_id in winsys. Needs to be hooked up to the getparam from the kernel. --- src/gallium/drivers/r300/r300_context.c | 2 +- src/gallium/drivers/r300/r300_context.h | 1 + src/gallium/drivers/r300/r300_winsys.h | 3 +++ src/gallium/winsys/drm/amd/amd_context.c | 4 +++- src/gallium/winsys/drm/amd/amd_r300.c | 4 +++- src/gallium/winsys/drm/amd/amd_r300.h | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 798d6bdc6f..467594ec9b 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -43,7 +43,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->winsys = r300_winsys; r300->context.winsys = winsys; - r300->context.screen = r300_create_screen(winsys, 0x0); + r300->context.screen = r300_create_screen(winsys, r300_winsys->pci_id); r300->context.destroy = r300_destroy_context; diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index be6214b7ae..f4d801480a 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -28,6 +28,7 @@ #include "util/u_memory.h" #include "r300_screen.h" +#include "r300_winsys.h" struct r300_blend_state { uint32_t blend_control; /* R300_RB3D_CBLEND: 0x4e04 */ diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index 7711dc792d..319152c853 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -38,6 +38,9 @@ struct radeon_cs; struct r300_winsys { + /* PCI ID */ + uint32_t pci_id; + /* CS object. This is very much like Intel's batchbuffer. * Fill it full of dwords and relocs and then submit. * Repeat as needed. */ diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index 7784964867..53311684de 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -244,9 +244,11 @@ GLboolean amd_context_create(const __GLcontextModes *visual, if (GL_TRUE) { fprintf(stderr, "Creating r300 context..."); + /* XXX today we pretend to be a very lame R300 vvvvvv */ pipe = r300_create_context(NULL, amd_context->pipe_winsys, - amd_create_r300_winsys(amd_context->drm_fd)); + amd_create_r300_winsys(amd_context->drm_fd, + 0x4144)); } else { pipe = amd_create_softpipe(amd_context); } diff --git a/src/gallium/winsys/drm/amd/amd_r300.c b/src/gallium/winsys/drm/amd/amd_r300.c index 0f543df9e1..a7a70fdd7f 100644 --- a/src/gallium/winsys/drm/amd/amd_r300.c +++ b/src/gallium/winsys/drm/amd/amd_r300.c @@ -43,12 +43,14 @@ static void amd_r300_flush_cs(struct radeon_cs* cs) radeon_cs_erase(cs); } -struct r300_winsys* amd_create_r300_winsys(int fd) +struct r300_winsys* amd_create_r300_winsys(int fd, uint32_t pci_id) { struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys)); struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); + winsys->pci_id = pci_id; + winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4); winsys->check_cs = amd_r300_check_cs; diff --git a/src/gallium/winsys/drm/amd/amd_r300.h b/src/gallium/winsys/drm/amd/amd_r300.h index ef269454b3..0d229fe0c4 100644 --- a/src/gallium/winsys/drm/amd/amd_r300.h +++ b/src/gallium/winsys/drm/amd/amd_r300.h @@ -26,4 +26,4 @@ #include "amd_buffer.h" -struct r300_winsys* amd_create_r300_winsys(int fd); +struct r300_winsys* amd_create_r300_winsys(int fd, uint32_t pci_id); -- cgit v1.2.3 From 2b9ecaa6dd7d4282f1f8796d151bdda0390ab51f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 20 Jan 2009 15:26:41 -0800 Subject: r300: Fix missing free(). --- src/gallium/drivers/r300/r300_screen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 7bba567e83..04b5a7772b 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -135,7 +135,10 @@ static void r300_surface_unmap(struct pipe_screen* screen, } static void r300_destroy_screen(struct pipe_screen* pscreen) { - FREE(pscreen); + struct r300_screen* r300screen = r300_screen(pscreen); + + FREE(r300screen->caps); + FREE(r300screen); } struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint32_t pci_id) -- cgit v1.2.3 From 54d137e079b9420e8aca55f37307ece45e9b71d8 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 20 Jan 2009 15:27:46 -0800 Subject: r300: Fix indenting. --- src/gallium/drivers/r300/r300_screen.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 04b5a7772b..3cb61b4c4e 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -22,17 +22,20 @@ #include "r300_screen.h" -static const char* r300_get_vendor(struct pipe_screen* pscreen) { +static const char* r300_get_vendor(struct pipe_screen* pscreen) +{ return "X.Org R300 Project"; } -static const char* r300_get_name(struct pipe_screen* pscreen) { +static const char* r300_get_name(struct pipe_screen* pscreen) +{ struct r300_screen* r300screen = r300_screen(pscreen); return chip_families[r300screen->caps->family]; } -static int r300_get_param(struct pipe_screen* pscreen, int param) { +static int r300_get_param(struct pipe_screen* pscreen, int param) +{ struct r300_screen* r300screen = r300_screen(pscreen); switch (param) { @@ -87,7 +90,8 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) { } } -static float r300_get_paramf(struct pipe_screen* pscreen, int param) { +static float r300_get_paramf(struct pipe_screen* pscreen, int param) +{ switch (param) { case PIPE_CAP_MAX_LINE_WIDTH: case PIPE_CAP_MAX_LINE_WIDTH_AA: @@ -134,7 +138,8 @@ static void r300_surface_unmap(struct pipe_screen* screen, pipe_buffer_unmap(screen, surface->buffer); } -static void r300_destroy_screen(struct pipe_screen* pscreen) { +static void r300_destroy_screen(struct pipe_screen* pscreen) +{ struct r300_screen* r300screen = r300_screen(pscreen); FREE(r300screen->caps); -- cgit v1.2.3 From 8d1f386dcbdabaa4edf0301267f881e3831ad18a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 20 Jan 2009 15:38:43 -0800 Subject: r300: Set floating-point params. Note: I took those numbers from classic Mesa. I know that points are routinely used to clear buffers, but line width is probably wrong. --- src/gallium/drivers/r300/r300_screen.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 3cb61b4c4e..a241d606c0 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -95,18 +95,21 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) switch (param) { case PIPE_CAP_MAX_LINE_WIDTH: case PIPE_CAP_MAX_LINE_WIDTH_AA: - /* XXX look this up, lazy ass! */ - return 0.0; + /* XXX this is the biggest thing that will fit in that register. + * Perhaps the actual rendering limits are less? */ + return 10922.0f; case PIPE_CAP_MAX_POINT_WIDTH: case PIPE_CAP_MAX_POINT_WIDTH_AA: - /* XXX see above */ - return 255.0; + /* XXX this is the biggest thing that will fit in that register. + * Perhaps the actual rendering limits are less? */ + return 10922.0f; case PIPE_CAP_MAX_TEXTURE_ANISOTROPY: - return 16.0; + return 16.0f; case PIPE_CAP_MAX_TEXTURE_LOD_BIAS: - return 16.0; + return 16.0f; default: - return 0.0; + /* XXX implementation error? */ + return 0.0f; } } -- cgit v1.2.3 From 6885560de54db26683eb813756e09fa3822c3492 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 20 Jan 2009 15:42:11 -0800 Subject: r300: Fix constness, compile warnings, indentation in r300_state. --- src/gallium/drivers/r300/r300_state.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index d73f4483db..3978ca12b3 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -274,8 +274,9 @@ static uint32_t translate_alpha_function(int alpha_func) { * This contains the depth buffer, stencil buffer, alpha test, and such. * On the Radeon, depth and stencil buffer setup are intertwined, which is * the reason for some of the strange-looking assignments across registers. */ -static void* r300_create_dsa_state(struct pipe_context* pipe, - struct pipe_depth_stencil_alpha_state* state) +static void* + r300_create_dsa_state(struct pipe_context* pipe, + const struct pipe_depth_stencil_alpha_state* state) { struct r300_dsa_state* dsa = CALLOC_STRUCT(r300_dsa_state); @@ -341,7 +342,7 @@ static void* r300_create_dsa_state(struct pipe_context* pipe, /* Bind DSA state. */ static void r300_bind_dsa_state(struct pipe_context* pipe, - void* state) + void* state) { struct r300_context* r300 = r300_context(pipe); @@ -351,7 +352,7 @@ static void r300_bind_dsa_state(struct pipe_context* pipe, /* Free DSA state. */ static void r300_delete_dsa_state(struct pipe_context* pipe, - void* state) + void* state) { FREE(state); } @@ -396,7 +397,7 @@ struct pipe_rasterizer_state * In a not entirely unironic sidenote, this state has nearly nothing to do * with the actual block on the Radeon called the rasterizer (RS). */ static void* r300_create_rs_state(struct pipe_context* pipe, - struct pipe_rasterizer_state* state) + const struct pipe_rasterizer_state* state) { struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state); @@ -457,7 +458,7 @@ static void r300_delete_rs_state(struct pipe_context* pipe, void* state) } static void r300_set_scissor_state(struct pipe_context* pipe, - struct pipe_scissor_state* state) + const struct pipe_scissor_state* state) { struct r300_context* r300 = r300_context(pipe); draw_flush(r300->draw); @@ -481,7 +482,7 @@ static void r300_set_scissor_state(struct pipe_context* pipe, } static void* r300_create_vs_state(struct pipe_context* pipe, - struct pipe_shader_state* state) + const struct pipe_shader_state* state) { struct r300_context* context = r300_context(pipe); /* XXX handing this off to Draw for now */ -- cgit v1.2.3 From 22877265f4fdf66c75df391d6de95bd5c1584ea3 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 21 Jan 2009 02:21:09 -0800 Subject: [BROKEN] r300: Add initial clear/fill code. Copied from mesa and still broken. Gimme a few to clean it up. --- src/gallium/drivers/r300/r300_cs.h | 24 ++- src/gallium/drivers/r300/r300_surface.c | 357 ++++++++++++++++++++++++++++++-- src/gallium/drivers/r300/r300_surface.h | 2 +- 3 files changed, 364 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 3dacf25380..59ca985f40 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -26,6 +26,18 @@ #include "r300_reg.h" #include "r300_winsys.h" +/* Pack a 32-bit float into a dword. */ +static uint32_t pack_float_32(float f) +{ + union { + float f; + uint32_t u; + } u; + + u.f = f; + return u.u; +} + /* Yes, I know macros are ugly. However, they are much prettier than the code * that they neatly hide away, and don't have the cost of function setup,so * we're going to use them. */ @@ -47,7 +59,6 @@ struct r300_winsys* cs_winsys = context->winsys; \ struct radeon_cs* cs = cs_winsys->cs - #define CHECK_CS(size) \ cs_winsys->check_cs(cs, (size)) @@ -59,10 +70,19 @@ #define OUT_CS(value) \ cs_winsys->write_cs_dword(cs, value) +#define OUT_CS_32F(value) \ + cs_winsys->write_cs_dword(cs, pack_float_32(value)) + #define OUT_CS_REG(register, value) do { \ OUT_CS(CP_PACKET0(register, 0)); \ OUT_CS(value); } while (0) +/* Note: This expects count to be the number of registers, + * not the actual packet0 count! */ +#define OUT_CS_REG_SEQ(register, count) do { \ + OUT_CS(CP_PACKET0(register, ((count) - 1))); \ +} while (0) + #define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \ OUT_CS(offset); \ cs_winsys->write_cs_reloc(cs, bo, rd, wd, flags); \ @@ -74,4 +94,4 @@ #define FLUSH_CS \ cs_winsys->flush_cs(cs) -#endif /* R300_CS_H */ \ No newline at end of file +#endif /* R300_CS_H */ diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 4aa469b97e..60efe78c0b 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -22,29 +22,354 @@ #include "r300_surface.h" -/* Provides pipe_context's "surface_fill". */ -static void r300_surface_fill(struct pipe_context* context, +/* Provides pipe_context's "surface_fill". Commonly used for clearing + * buffers. */ +static void r300_surface_fill(struct pipe_context* pipe, struct pipe_surface* dest, unsigned x, unsigned y, unsigned w, unsigned h, unsigned color) { - /* Try accelerated fill first. */ - if (!r300_fill_blit(r300_context(context), - dest->block.size, - (short)dest->stride, - dest->buffer, - dest->offset, - (short)x, (short)y, - (short)w, (short)h, - color)) + struct r300_context* context = r300_context(pipe); + CS_LOCALS(context); + boolean has_tcl = FALSE; + boolean is_r500 = FALSE; + /* Emit a shitload of state, and then draw a point to clear the buffer. + * XXX it goes without saying that this needs to be cleaned up and + * shifted around to work with the rest of the driver's state handling. + */ + /* Sequence starting at R300_VAP_PROG_STREAM_CNTL_0 */ + OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, 1); + if (has_tcl) { + OUT_CS(((((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))); + } else { + OUT_CS(((((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))); + } + + /* Disable fog */ + OUT_CS_REG(R300_FG_FOG_BLEND, 0); + OUT_CS_REG(R300_FG_ALPHA_FUNC, 0); + + OUT_CS_REG(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_CS_REG_SEQ(R300_VAP_VTX_STATE_CNTL, 2); + OUT_CS((R300_SEL_USER_COLOR_0 << R300_COLOR_0_ASSEMBLY_SHIFT)); + OUT_CS(R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR | R300_INPUT_CNTL_TC0); + + /* comes from fglrx startup of clear */ + OUT_CS_REG_SEQ(R300_SE_VTE_CNTL, 2); + OUT_CS(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_CS(0x8); + + OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); + + OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); + OUT_CS(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | + R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT); + OUT_CS(0); /* no textures */ + + OUT_CS_REG(R300_TX_ENABLE, 0); + + OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); + OUT_CS_32F(1.0); + OUT_CS_32F(x); + OUT_CS_32F(1.0); + OUT_CS_32F(y); + OUT_CS_32F(1.0); + OUT_CS_32F(0.0); + + OUT_CS_REG_SEQ(R300_RB3D_CBLEND, 2); + OUT_CS(0x0); + OUT_CS(0x0); + + OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_PS_UCP_MODE_CLIP_AS_TRIFAN | R300_CLIP_DISABLE); + + OUT_CS_REG(R300_GA_POINT_SIZE, ((w * 6) << R300_POINTSIZE_X_SHIFT) | + ((h * 6) << R300_POINTSIZE_Y_SHIFT)); + + if (is_r500) { + OUT_CS_REG_SEQ(R500_RS_IP_0, 8); + for (i = 0; i < 8; ++i) { + OUT_CS((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_CS_REG_SEQ(R300_RS_COUNT, 2); + /* XXX could hires be disabled for a speed boost? */ + OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); + OUT_CS(0x0); + + OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); + } else { + OUT_CS_REG(R300_RS_IP_0, 8); + for (i = 0; i < 8; ++i) { + OUT_CS(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); + } + + OUT_CS_REG_SEQ(R300_RS_COUNT, 2); + /* XXX could hires be disabled for a speed boost? */ + OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); + OUT_CS(0x0); + + OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); + } + + if (is_r500) { + OUT_CS_REG_SEQ(R500_US_CONFIG, 2); + OUT_CS(R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); + OUT_CS(0x0); + OUT_CS_REG_SEQ(R500_US_CODE_ADDR, 3); + OUT_CS(R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(1)); + OUT_CS(R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(1)); + OUT_CS(R500_US_CODE_OFFSET_ADDR(0)); + + OUT_CS_REG(R500_GA_US_VECTOR_INDEX, 0x0); + + OUT_CS_REG(R500_GA_US_VECTOR_DATA, 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); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, R500_RGB_ADDR0(0) | + R500_RGB_ADDR1(0) | + R500_RGB_ADDR1_CONST | + R500_RGB_ADDR2(0) | + R500_RGB_ADDR2_CONST); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, R500_ALPHA_ADDR0(0) | + R500_ALPHA_ADDR1(0) | + R500_ALPHA_ADDR1_CONST | + R500_ALPHA_ADDR2(0) | + R500_ALPHA_ADDR2_CONST); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, 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); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, R500_ALPHA_OP_CMP | + R500_ALPHA_SWIZ_A_A | + R500_ALPHA_SWIZ_B_A); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, 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); + + } else { + OUT_CS_REG_SEQ(R300_US_CONFIG, 3); + OUT_CS(0x0); + OUT_CS(0x0); + OUT_CS(0x0); + OUT_CS_REG_SEQ(R300_US_CODE_ADDR_0, 4); + OUT_CS(0x0); + OUT_CS(0x0); + OUT_CS(0x0); + OUT_CS(R300_RGBA_OUT); + + OUT_CS_REG(R300_US_ALU_RGB_INST_0, + FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); + OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, + FP_SELC(0, NO, XYZ, FP_TMP(0), 0, 0)); + OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, + FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO))); + OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, + FP_SELA(0, NO, W, FP_TMP(0), 0, 0)); + } + + /* XXX */ + uint32_t vap_cntl; + OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0); + 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 (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 (CHIP_FAMILY_RV515) + vap_cntl |= (2 << R300_PVS_NUM_FPUS_SHIFT); + else if ((CHIP_FAMILY_RV530) || + (CHIP_FAMILY_RV560) || + (CHIP_FAMILY_RV570)) + vap_cntl |= (5 << R300_PVS_NUM_FPUS_SHIFT); + else if ((CHIP_FAMILY_RV410) || + (CHIP_FAMILY_R420)) + vap_cntl |= (6 << R300_PVS_NUM_FPUS_SHIFT); + else if ((CHIP_FAMILY_R520) || + (CHIP_FAMILY_R580)) + vap_cntl |= (8 << R300_PVS_NUM_FPUS_SHIFT); + else + vap_cntl |= (4 << R300_PVS_NUM_FPUS_SHIFT); + + OUT_CS_REG(R300_VAP_CNTL, vap_cntl); + + if (has_tcl) { + OUT_CS_REG_SEQ(R300_VAP_PVS_CODE_CNTL_0, 3); + OUT_CS((0 << R300_PVS_FIRST_INST_SHIFT) | + (0 << R300_PVS_XYZW_VALID_INST_SHIFT) | + (1 << R300_PVS_LAST_INST_SHIFT)); + OUT_CS((0 << R300_PVS_CONST_BASE_OFFSET_SHIFT) | + (0 << R300_PVS_MAX_CONST_ADDR_SHIFT)); + OUT_CS(1 << R300_PVS_LAST_VTX_SRC_INST_SHIFT); + + OUT_CS_REG(R300_SC_SCREENDOOR, 0x0); + OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 28)); + OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); + OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_ADDRESS, 0x0); + + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, + 0, 0xf, PVS_DST_REG_OUT)); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_SRC_OPERAND(0, PVS_SRC_SELECT_X, PVS_SRC_SELECT_Y, + PVS_SRC_SELECT_Z, PVS_SRC_SELECT_W, + PVS_SRC_REG_INPUT, VSF_FLAG_NONE)); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 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, VSF_FLAG_NONE)); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); + + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, 1, 0xf, + PVS_DST_REG_OUT)); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_SRC_OPERAND(1, PVS_SRC_SELECT_X, + PVS_SRC_SELECT_Y, PVS_SRC_SELECT_Z, + PVS_SRC_SELECT_W, PVS_SRC_REG_INPUT, + VSF_FLAG_NONE)); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 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, VSF_FLAG_NONE)); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); + } + /* Do the actual emit. */ + 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, R300_WAIT_3D | R300_WAIT_3D_CLEAN); + end_3d(rmesa); + + if (flags & CLEARBUFFER_COLOR) { + assert(rrb != 0); + BEGIN_BATCH_NO_AUTOSTATE(4); + 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 0 + if (flags & (CLEARBUFFER_DEPTH | CLEARBUFFER_STENCIL)) { + assert(rrbd != 0); + cbpitch = (rrbd->pitch / rrbd->cpp); + if (rrbd->bo->flags & RADEON_BO_FLAGS_MACRO_TILE){ + cbpitch |= R300_DEPTHMACROTILE_ENABLE; + } + if (rrbd->bo->flags & RADEON_BO_FLAGS_MICRO_TILE){ + cbpitch |= R300_DEPTHMICROTILE_TILED; + } + BEGIN_BATCH_NO_AUTOSTATE(4); + OUT_BATCH_REGSEQ(R300_ZB_DEPTHOFFSET, 1); + OUT_BATCH_RELOC(0, rrbd->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_BATCH_REGVAL(R300_ZB_DEPTHPITCH, cbpitch); + END_BATCH(); + } + { - /* Fallback. */ - void* dest_map = context->screen->surface_map(context->screen, dest, - PIPE_BUFFER_USAGE_CPU_WRITE); - pipe_fill_rect(dest_map, &dest->block, dest->stride, x, y, w, h, color); - context->screen->surface_unmap(context->screen, dest); + 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(); } +#endif + + OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); + OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | + (1 << R300_PRIM_NUM_VERTICES_SHIFT)); + OUT_CS_32F(w / 2.0); + OUT_CS_32F(h / 2.0); + /* XXX this should be the depth value to clear to */ + OUT_CS_32F(1.0); + OUT_CS_32F(1.0); + OUT_CS_32F(color); + OUT_CS_32F(color); + OUT_CS_32F(color); + OUT_CS_32F(color); + + /* XXX cp_wait(rmesa, R300_WAIT_3D | R300_WAIT_3D_CLEAN); */ } void r300_init_surface_functions(struct r300_context* r300) diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index 0b2fd0b32b..e807edd0e3 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -28,7 +28,7 @@ #include "util/u_rect.h" -#include "r300_blit.h" #include "r300_context.h" +#include "r300_cs.h" #endif /* R300_SURFACE_H */ -- cgit v1.2.3 From 7d63ff93cbf0f342c3736f4c8fae75157a62f0ea Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 21 Jan 2009 23:12:40 -0800 Subject: r300: Unbreak build, finish clear state. Completely untested, of course. --- src/gallium/drivers/r300/r300_reg.h | 12 +++++++++ src/gallium/drivers/r300/r300_surface.c | 43 +++++++++++++-------------------- src/gallium/drivers/r300/r300_surface.h | 3 +++ 3 files changed, 32 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index 8b3fe431ab..7f4a508b1b 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -3252,6 +3252,18 @@ enum { */ #define R300_CP_CMD_BITBLT_MULTI 0xC0009B00 +/* XXX Corbin's stuff from radeon and r200 */ + +#define RADEON_WAIT_UNTIL 0x1720 +# define RADEON_WAIT_CRTC_PFLIP (1 << 0) +# define RADEON_WAIT_2D_IDLECLEAN (1 << 16) +# define RADEON_WAIT_3D_IDLECLEAN (1 << 17) +# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18) + +#define RADEON_CP_PACKET3 0xC0000000 + +#define R200_3D_DRAW_IMMD_2 0xC0003500 + #endif /* _R300_REG_H */ /* *INDENT-ON* */ diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 60efe78c0b..8a507d56e6 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -34,6 +34,8 @@ static void r300_surface_fill(struct pipe_context* pipe, CS_LOCALS(context); boolean has_tcl = FALSE; boolean is_r500 = FALSE; + /* For the for loops. */ + int i; /* Emit a shitload of state, and then draw a point to clear the buffer. * XXX it goes without saying that this needs to be cleaned up and * shifted around to work with the rest of the driver's state handling. @@ -239,6 +241,7 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(R300_VAP_CNTL, vap_cntl); + /* XXX unbreak this if (has_tcl) { OUT_CS_REG_SEQ(R300_VAP_PVS_CODE_CNTL_0, 3); OUT_CS((0 << R300_PVS_FIRST_INST_SHIFT) | @@ -252,7 +255,7 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 28)); OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_ADDRESS, 0x0); + OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, R300_PVS_CODE_START); OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, 0, 0xf, PVS_DST_REG_OUT)); @@ -278,32 +281,17 @@ static void r300_surface_fill(struct pipe_context* pipe, PVS_SRC_SELECT_FORCE_0, PVS_SRC_REG_INPUT, VSF_FLAG_NONE)); OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); - } - /* Do the actual emit. */ - 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, R300_WAIT_3D | R300_WAIT_3D_CLEAN); - end_3d(rmesa); - - if (flags & CLEARBUFFER_COLOR) { - assert(rrb != 0); - BEGIN_BATCH_NO_AUTOSTATE(4); - 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(); - } + /* XXX this should be split off, also figure out WTF with the numbers */ + OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); + /* XXX might have to switch to 2D */ + + OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); + OUT_CS_RELOC(0, dest->buffer, 0, RADEON_GEM_DOMAIN_VRAM, 0); + /* XXX this needs more TLC (or TCL, as it were) */ + OUT_CS_REG(R300_RB3D_COLORPITCH0, R300_COLOR_FORMAT_ARGB8888); #if 0 if (flags & (CLEARBUFFER_DEPTH | CLEARBUFFER_STENCIL)) { assert(rrbd != 0); @@ -369,7 +357,10 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_32F(color); OUT_CS_32F(color); - /* XXX cp_wait(rmesa, R300_WAIT_3D | R300_WAIT_3D_CLEAN); */ + /* XXX this should be split off, also figure out WTF with the numbers */ + OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); + + FLUSH_CS; } void r300_init_surface_functions(struct r300_context* r300) diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index e807edd0e3..2d64a95412 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -31,4 +31,7 @@ #include "r300_context.h" #include "r300_cs.h" +/* XXX integrate this into r300_reg */ +#include "r300_fragprog.h" + #endif /* R300_SURFACE_H */ -- cgit v1.2.3 From 0ff7cb7c89f0c9ac4e363296e53eada008717252 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 21 Jan 2009 23:48:47 -0800 Subject: r300: Add num_vert_pipes (and remove busted num_pipes.) --- src/gallium/drivers/r300/r300_chipset.c | 39 ++++++++++++--------------------- src/gallium/drivers/r300/r300_chipset.h | 8 ++++--- src/gallium/drivers/r300/r300_cs.h | 3 +++ src/gallium/drivers/r300/r300_surface.c | 27 ++++++++--------------- 4 files changed, 31 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index 1dc9b8cf3c..b7de2359cb 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -32,6 +32,8 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) caps->pci_id = pci_id; caps->has_tcl = TRUE; caps->is_r500 = FALSE; + caps->num_vert_pipes = 4; + /* Note: These are not ordered by PCI ID. I leave that task to GCC, * which will perform the ordering while collating jump tables. Instead, @@ -39,7 +41,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) switch (pci_id) { case 0x4144: caps->family = CHIP_FAMILY_R300; - caps->num_pipes = 1; break; case 0x4145: @@ -50,7 +51,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4E46: case 0x4E47: caps->family = CHIP_FAMILY_R300; - caps->num_pipes = 2; break; case 0x4150: @@ -67,7 +67,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4E54: case 0x4E56: caps->family = CHIP_FAMILY_RV350; - caps->num_pipes = 1; break; case 0x4148: @@ -78,12 +77,10 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4E49: case 0x4E4B: caps->family = CHIP_FAMILY_R350; - caps->num_pipes = 2; break; case 0x4E4A: caps->family = CHIP_FAMILY_R360; - caps->num_pipes = 2; break; case 0x5460: @@ -95,7 +92,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5B64: case 0x5B65: caps->family = CHIP_FAMILY_RV370; - caps->num_pipes = 1; break; case 0x3150: @@ -104,7 +100,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x3E50: case 0x3E54: caps->family = CHIP_FAMILY_RV380; - caps->num_pipes = 1; break; case 0x4A48: @@ -118,7 +113,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4A50: case 0x4A54: caps->family = CHIP_FAMILY_R420; - caps->num_pipes = 4; + caps->num_vert_pipes = 6; break; case 0x5548: @@ -131,7 +126,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5554: case 0x5D57: caps->family = CHIP_FAMILY_R423; - caps->num_pipes = 4; + caps->num_vert_pipes = 6; break; case 0x554C: @@ -142,7 +137,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5D49: case 0x5D4A: caps->family = CHIP_FAMILY_R430; - caps->num_pipes = 4; + caps->num_vert_pipes = 6; break; case 0x5D4C: @@ -152,7 +147,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5D50: case 0x5D52: caps->family = CHIP_FAMILY_R480; - caps->num_pipes = 4; + caps->num_vert_pipes = 6; break; case 0x4B49: @@ -160,7 +155,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x4B4B: case 0x4B4C: caps->family = CHIP_FAMILY_R481; - caps->num_pipes = 4; + caps->num_vert_pipes = 6; break; case 0x5E4C: @@ -176,41 +171,36 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x5E4B: case 0x5E4D: caps->family = CHIP_FAMILY_RV410; - caps->num_pipes = 1; + caps->num_vert_pipes = 6; break; case 0x5954: case 0x5955: caps->family = CHIP_FAMILY_RS480; - caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; break; case 0x5974: case 0x5975: caps->family = CHIP_FAMILY_RS482; - caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; break; case 0x5A41: case 0x5A42: caps->family = CHIP_FAMILY_RS400; - caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; break; case 0x5A61: case 0x5A62: caps->family = CHIP_FAMILY_RC410; - caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; break; case 0x791E: case 0x791F: caps->family = CHIP_FAMILY_RS690; - caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; break; @@ -219,7 +209,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x796E: case 0x796F: caps->family = CHIP_FAMILY_RS740; - caps->num_pipes = 1; /* CHECK ME */ caps->has_tcl = FALSE; break; @@ -238,7 +227,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x710E: case 0x710F: caps->family = CHIP_FAMILY_R520; - caps->num_pipes = 4; + caps->num_vert_pipes = 8; caps->is_r500 = TRUE; break; @@ -281,7 +270,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x7210: case 0x7211: caps->family = CHIP_FAMILY_RV515; - caps->num_pipes = 1; + caps->num_vert_pipes = 2; caps->is_r500 = TRUE; break; @@ -302,7 +291,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x71DA: case 0x71DE: caps->family = CHIP_FAMILY_RV530; - caps->num_pipes = 1; + caps->num_vert_pipes = 5; caps->is_r500 = TRUE; break; @@ -322,13 +311,13 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x724F: case 0x7284: caps->family = CHIP_FAMILY_R580; - caps->num_pipes = 4; + caps->num_vert_pipes = 8; caps->is_r500 = TRUE; break; case 0x7280: caps->family = CHIP_FAMILY_RV570; - caps->num_pipes = 4; + caps->num_vert_pipes = 5; caps->is_r500 = TRUE; break; @@ -344,7 +333,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) case 0x7293: case 0x7297: caps->family = CHIP_FAMILY_RV560; - caps->num_pipes = 4; + caps->num_vert_pipes = 5; caps->is_r500 = TRUE; break; diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h index c2d7ad3414..548d7a6c50 100644 --- a/src/gallium/drivers/r300/r300_chipset.h +++ b/src/gallium/drivers/r300/r300_chipset.h @@ -32,8 +32,10 @@ struct r300_capabilities { uint32_t pci_id; /* Chipset family */ int family; - /* The number of Graphics Backend (GB) pipes */ - int num_pipes; + /* The number of vertex pipes */ + int num_vert_pipes; + /* The number of fragment pipes */ + int num_frag_pipes; /* Whether or not TCL is physically present */ boolean has_tcl; /* Whether or not this is an RV515 or newer; R500s have many features: @@ -100,4 +102,4 @@ static const char* chip_families[] = { void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps); -#endif /* R300_CHIPSET_H */ \ No newline at end of file +#endif /* R300_CHIPSET_H */ diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 59ca985f40..67cb5ee7d1 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -55,6 +55,9 @@ static uint32_t pack_float_32(float f) #define CP_PACKET0(register, count) \ (RADEON_CP_PACKET0 | ((count) << 16) | ((register) >> 2)) +#define CP_PACKET3(op, count) \ + (RADEON_CP_PACKET3 | (op) | ((count) << 16)) + #define CS_LOCALS(context) \ struct r300_winsys* cs_winsys = context->winsys; \ struct radeon_cs* cs = cs_winsys->cs diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 8a507d56e6..dd1c8862a7 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -30,10 +30,11 @@ static void r300_surface_fill(struct pipe_context* pipe, unsigned w, unsigned h, unsigned color) { - struct r300_context* context = r300_context(pipe); - CS_LOCALS(context); - boolean has_tcl = FALSE; - boolean is_r500 = FALSE; + struct r300_context* r300 = r300_context(pipe); + CS_LOCALS(r300); + struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps; + boolean has_tcl = caps->has_tcl; + boolean is_r500 = caps->is_r500; /* For the for loops. */ int i; /* Emit a shitload of state, and then draw a point to clear the buffer. @@ -224,20 +225,8 @@ static void r300_surface_fill(struct pipe_context* pipe, (5 << R300_VF_MAX_VTX_NUM_SHIFT)); } - if (CHIP_FAMILY_RV515) - vap_cntl |= (2 << R300_PVS_NUM_FPUS_SHIFT); - else if ((CHIP_FAMILY_RV530) || - (CHIP_FAMILY_RV560) || - (CHIP_FAMILY_RV570)) - vap_cntl |= (5 << R300_PVS_NUM_FPUS_SHIFT); - else if ((CHIP_FAMILY_RV410) || - (CHIP_FAMILY_R420)) - vap_cntl |= (6 << R300_PVS_NUM_FPUS_SHIFT); - else if ((CHIP_FAMILY_R520) || - (CHIP_FAMILY_R580)) - vap_cntl |= (8 << R300_PVS_NUM_FPUS_SHIFT); - else - vap_cntl |= (4 << R300_PVS_NUM_FPUS_SHIFT); + vap_cntl |= (caps->num_vert_pipes << + R300_PVS_NUM_FPUS_SHIFT); OUT_CS_REG(R300_VAP_CNTL, vap_cntl); @@ -361,6 +350,8 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); FLUSH_CS; + + r300->dirty_state = R300_NEW_KITCHEN_SINK; } void r300_init_surface_functions(struct r300_context* r300) -- cgit v1.2.3 From 90a96cb2addf48b3b48c039a8dc6de9e53bfb6df Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 22 Jan 2009 03:45:14 -0800 Subject: r300: Add sampler state skeleton. Heh, serendipitous sibilance. Anyway, need to flesh this out. --- src/gallium/drivers/r300/r300_context.h | 20 +++++++++----- src/gallium/drivers/r300/r300_state.c | 47 ++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index f4d801480a..3877c9855d 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -65,17 +65,21 @@ struct r300_rs_state { uint32_t cull_mode; /* R300_SU_CULL_MODE: 0x42b8 */ }; +struct r300_sampler_state { +}; + struct r300_scissor_state { uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ }; -#define R300_NEW_BLEND 0x01 -#define R300_NEW_BLEND_COLOR 0x02 -#define R300_NEW_DSA 0x04 -#define R300_NEW_RS 0x08 -#define R300_NEW_SCISSOR 0x10 -#define R300_NEW_KITCHEN_SINK 0x1f +#define R300_NEW_BLEND 0x0001 +#define R300_NEW_BLEND_COLOR 0x0002 +#define R300_NEW_DSA 0x0004 +#define R300_NEW_RS 0x0008 +#define R300_NEW_SAMPLER 0x0010 +#define R300_NEW_SCISSOR 0x1000 +#define R300_NEW_KITCHEN_SINK 0x1fff struct r300_context { /* Parent class */ @@ -95,9 +99,11 @@ struct r300_context { struct r300_dsa_state* dsa_state; /* Rasterizer state. */ struct r300_rs_state* rs_state; + /* Sampler states. */ + struct r300_sampler_state* sampler_states[8]; + int sampler_count; /* Scissor state. */ struct r300_scissor_state* scissor_state; - /* Bitmask of dirty state objects. */ uint32_t dirty_state; /* Flag indicating whether or not the HW is dirty. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 3978ca12b3..7fb0fc2eba 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -457,6 +457,41 @@ static void r300_delete_rs_state(struct pipe_context* pipe, void* state) FREE(state); } +static void* + r300_create_sampler_state(struct pipe_context* pipe, + const struct pipe_sampler_state* state) +{ + struct r300_sampler_state* sampler = CALLOC_STRUCT(r300_sampler_state); + + return (void*)sampler; +} + +static void r300_bind_sampler_states(struct pipe_context* pipe, + unsigned count, + void** states) +{ + struct r300_context* r300 = r300_context(pipe); + int i = 0; + + if (count > 8) { + return; + } + + for (i; i < count; i++) { + if (r300->sampler_states[i] != states[i]) { + r300->sampler_states[i] = states[i]; + r300->dirty_state |= (R300_NEW_SAMPLER << i); + } + } + + r300->sampler_count = count; +} + +static void r300_delete_sampler_state(struct pipe_context* pipe, void* state) +{ + FREE(state); +} + static void r300_set_scissor_state(struct pipe_context* pipe, const struct pipe_scissor_state* state) { @@ -510,17 +545,21 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.set_blend_color = r300_set_blend_color; + r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; + r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; + r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; + r300->context.create_rasterizer_state = r300_create_rs_state; r300->context.bind_rasterizer_state = r300_bind_rs_state; r300->context.delete_rasterizer_state = r300_delete_rs_state; - r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; - r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; - r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; + r300->context.create_sampler_state = r300_create_sampler_state; + r300->context.bind_sampler_states = r300_bind_sampler_states; + r300->context.delete_sampler_state = r300_delete_sampler_state; r300->context.set_scissor_state = r300_set_scissor_state; r300->context.create_vs_state = r300_create_vs_state; r300->context.bind_vs_state = r300_bind_vs_state; r300->context.delete_vs_state = r300_delete_vs_state; -} \ No newline at end of file +} -- cgit v1.2.3 From ecb7f29f74c8f7456302267fe31b1de4bcc103c5 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 22 Jan 2009 13:34:21 -0800 Subject: amd/r300: Wire up GETPARAM ioctls. Whoo, stuff is starting to look cleaner and cleaner. --- src/gallium/drivers/r300/r300_chipset.c | 5 ++--- src/gallium/drivers/r300/r300_chipset.h | 2 +- src/gallium/drivers/r300/r300_context.c | 2 +- src/gallium/drivers/r300/r300_screen.c | 8 +++++-- src/gallium/drivers/r300/r300_screen.h | 4 +++- src/gallium/drivers/r300/r300_winsys.h | 5 ++++- src/gallium/winsys/drm/amd/amd_context.c | 9 ++++---- src/gallium/winsys/drm/amd/amd_r300.c | 38 +++++++++++++++++++++++++++++--- src/gallium/winsys/drm/amd/amd_r300.h | 7 +++++- 9 files changed, 62 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index b7de2359cb..f2dc8aedaa 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -26,10 +26,9 @@ * Radeons. */ /* Parse a PCI ID and fill an r300_capabilities struct with information. */ -void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) +void r300_parse_chipset(struct r300_capabilities* caps) { /* Reasonable defaults */ - caps->pci_id = pci_id; caps->has_tcl = TRUE; caps->is_r500 = FALSE; caps->num_vert_pipes = 4; @@ -38,7 +37,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps) /* Note: These are not ordered by PCI ID. I leave that task to GCC, * which will perform the ordering while collating jump tables. Instead, * I've tried to group them according to capabilities and age. */ - switch (pci_id) { + switch (caps->pci_id) { case 0x4144: caps->family = CHIP_FAMILY_R300; break; diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h index 548d7a6c50..f1502ff76c 100644 --- a/src/gallium/drivers/r300/r300_chipset.h +++ b/src/gallium/drivers/r300/r300_chipset.h @@ -100,6 +100,6 @@ static const char* chip_families[] = { "RV570" }; -void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps); +void r300_parse_chipset(struct r300_capabilities* caps); #endif /* R300_CHIPSET_H */ diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 467594ec9b..f254b2f2a3 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -43,7 +43,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->winsys = r300_winsys; r300->context.winsys = winsys; - r300->context.screen = r300_create_screen(winsys, r300_winsys->pci_id); + r300->context.screen = r300_create_screen(winsys, r300_winsys); r300->context.destroy = r300_destroy_context; diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index a241d606c0..63ddd3b6a6 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -149,7 +149,8 @@ static void r300_destroy_screen(struct pipe_screen* pscreen) FREE(r300screen); } -struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint32_t pci_id) +struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, + struct r300_winsys* r300_winsys) { struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen); struct r300_capabilities* caps = CALLOC_STRUCT(r300_capabilities); @@ -157,7 +158,10 @@ struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint32_t pci_ if (!r300screen || !caps) return NULL; - r300_parse_chipset(pci_id, caps); + caps->pci_id = r300_winsys->pci_id; + caps->num_frag_pipes = r300_winsys->gb_pipes; + + r300_parse_chipset(caps); r300screen->caps = caps; r300screen->screen.winsys = winsys; diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index b6c3d1f462..83d5a75d0a 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -28,6 +28,7 @@ #include "util/u_memory.h" #include "r300_chipset.h" +#include "r300_winsys.h" struct r300_screen { /* Parent class */ @@ -43,6 +44,7 @@ static struct r300_screen* r300_screen(struct pipe_screen* screen) { } /* Creates a new r300 screen. */ -struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, uint pci_id); +struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, + struct r300_winsys* r300_winsys); #endif /* R300_SCREEN_H */ diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index 319152c853..867d65b7de 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -41,6 +41,9 @@ struct r300_winsys { /* PCI ID */ uint32_t pci_id; + /* GB pipe count */ + uint32_t gb_pipes; + /* CS object. This is very much like Intel's batchbuffer. * Fill it full of dwords and relocs and then submit. * Repeat as needed. */ @@ -89,4 +92,4 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, } #endif -#endif /* R300_WINSYS_H */ \ No newline at end of file +#endif /* R300_WINSYS_H */ diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index 53311684de..7a486c93a5 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -244,11 +244,10 @@ GLboolean amd_context_create(const __GLcontextModes *visual, if (GL_TRUE) { fprintf(stderr, "Creating r300 context..."); - /* XXX today we pretend to be a very lame R300 vvvvvv */ - pipe = r300_create_context(NULL, - amd_context->pipe_winsys, - amd_create_r300_winsys(amd_context->drm_fd, - 0x4144)); + pipe = + r300_create_context(NULL, + amd_context->pipe_winsys, + amd_create_r300_winsys(amd_context->drm_fd)); } else { pipe = amd_create_softpipe(amd_context); } diff --git a/src/gallium/winsys/drm/amd/amd_r300.c b/src/gallium/winsys/drm/amd/amd_r300.c index a7a70fdd7f..04295e8281 100644 --- a/src/gallium/winsys/drm/amd/amd_r300.c +++ b/src/gallium/winsys/drm/amd/amd_r300.c @@ -43,13 +43,45 @@ static void amd_r300_flush_cs(struct radeon_cs* cs) radeon_cs_erase(cs); } -struct r300_winsys* amd_create_r300_winsys(int fd, uint32_t pci_id) +/* Helper function to do the ioctls needed for setup and init. */ +static void do_ioctls(struct r300_winsys* winsys, int fd) +{ + drm_radeon_getparam_t gp; + uint32_t target; + int retval; + + /* XXX is this cast safe? */ + gp.value = (int*)⌖ + + /* First, get PCI ID */ + gp.param = RADEON_PARAM_DEVICE_ID; + retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); + if (retval) { + fprintf(stderr, "%s: Failed to get PCI ID, error number %d", + __FUNCTION__, retval); + exit(1); + } + winsys->pci_id = target; + + /* Then, get the number of pixel pipes */ + gp.param = RADEON_PARAM_NUM_GB_PIPES; + retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); + if (retval) { + fprintf(stderr, "%s: Failed to get GB pipe count, error number %d", + __FUNCTION__, retval); + exit(1); + } + winsys->gb_pipes = target; + +} + +struct r300_winsys* amd_create_r300_winsys(int fd) { struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys)); - struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); + do_ioctls(winsys, fd); - winsys->pci_id = pci_id; + struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4); diff --git a/src/gallium/winsys/drm/amd/amd_r300.h b/src/gallium/winsys/drm/amd/amd_r300.h index 0d229fe0c4..d80c23594c 100644 --- a/src/gallium/winsys/drm/amd/amd_r300.h +++ b/src/gallium/winsys/drm/amd/amd_r300.h @@ -20,10 +20,15 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/* XXX WTF is this! I shouldn't have to include those first three! FUCK! */ +#include +#include +#include "drm.h" +#include "radeon_drm.h" #include "radeon_cs.h" #include "r300_winsys.h" #include "amd_buffer.h" -struct r300_winsys* amd_create_r300_winsys(int fd, uint32_t pci_id); +struct r300_winsys* amd_create_r300_winsys(int fd); -- cgit v1.2.3 From 0648bc9f65f1c6700b442e57ac0e82404fb60c2d Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 22 Jan 2009 16:51:34 -0800 Subject: r300: Add texture stubs. --- src/gallium/drivers/r300/Makefile | 3 ++- src/gallium/drivers/r300/r300_screen.c | 23 ++++++++++++++++++++++ src/gallium/drivers/r300/r300_screen.h | 1 + src/gallium/drivers/r300/r300_texture.c | 35 +++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_texture.h | 33 +++++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 src/gallium/drivers/r300/r300_texture.c create mode 100644 src/gallium/drivers/r300/r300_texture.h (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index ad792e9aa8..f1b1a615b8 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -11,7 +11,8 @@ C_SOURCES = \ r300_emit.c \ r300_screen.c \ r300_state.c \ - r300_surface.c + r300_surface.c \ + r300_texture.c include ../../Makefile.template diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 63ddd3b6a6..2b83ae060c 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -113,12 +113,33 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) } } +/* XXX moar formats */ +static boolean check_tex_2d_format(enum pipe_format format) +{ + switch (format) { + case PIPE_FORMAT_I8_UNORM: + return TRUE; + default: + break; + } + + return FALSE; +} + +/* XXX moar targets */ static boolean r300_is_format_supported(struct pipe_screen* pscreen, enum pipe_format format, enum pipe_texture_target target, unsigned tex_usage, unsigned geom_flags) { + switch (target) { + case PIPE_TEXTURE_2D: + return check_tex_2d_format(format); + default: + break; + } + return FALSE; } @@ -174,5 +195,7 @@ struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, r300screen->screen.surface_map = r300_surface_map; r300screen->screen.surface_unmap = r300_surface_unmap; + r300_init_screen_texture_functions(&r300screen->screen); + return &r300screen->screen; } diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index 83d5a75d0a..b45ce5e8c6 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -28,6 +28,7 @@ #include "util/u_memory.h" #include "r300_chipset.h" +#include "r300_texture.h" #include "r300_winsys.h" struct r300_screen { diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c new file mode 100644 index 0000000000..30d9e64b4c --- /dev/null +++ b/src/gallium/drivers/r300/r300_texture.c @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_texture.h" + +/* Create a new texture. */ +static struct pipe_texture* + r300_texture_create(struct pipe_screen* screen, + const struct pipe_texture* template) +{ +} + +void r300_init_screen_texture_functions(struct pipe_screen* screen) +{ + screen->texture_create = r300_texture_create; +} diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h new file mode 100644 index 0000000000..9d14cf81a6 --- /dev/null +++ b/src/gallium/drivers/r300/r300_texture.h @@ -0,0 +1,33 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_TEXTURE_H +#define R300_TEXTURE_H + +#include "pipe/p_screen.h" + +struct r300_texture { +}; + +void r300_init_screen_texture_functions(struct pipe_screen* screen); + +#endif /* R300_TEXTURE_H */ -- cgit v1.2.3 From 2f37387786f1d0d6beded5afc29d36f744f1c948 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 22 Jan 2009 21:47:05 -0800 Subject: r300: Add texture sampler state. Easy compared to the actual texture handling code. --- src/gallium/drivers/r300/r300_context.h | 3 + src/gallium/drivers/r300/r300_state.c | 113 ++++++++++++++++++++++++++++++-- 2 files changed, 111 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 3877c9855d..3cb5df4e20 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -66,6 +66,9 @@ struct r300_rs_state { }; struct r300_sampler_state { + uint32_t filter0; /* R300_TX_FILTER0: 0x4400 */ + uint32_t filter1; /* R300_TX_FILTER1: 0x4440 */ + uint32_t border_color; /* R300_TX_BORDER_COLOR: 0x45c0 */ }; struct r300_scissor_state { diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 7fb0fc2eba..8e15a429fb 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -21,6 +21,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "util/u_math.h" +#include "util/u_pack_color.h" #include "r300_context.h" #include "r300_reg.h" @@ -457,11 +458,113 @@ static void r300_delete_rs_state(struct pipe_context* pipe, void* state) FREE(state); } +static uint32_t translate_wrap(int wrap) { + switch (wrap) { + case PIPE_TEX_WRAP_REPEAT: + return R300_TX_REPEAT; + case PIPE_TEX_WRAP_CLAMP: + return R300_TX_CLAMP; + case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + return R300_TX_CLAMP_TO_EDGE; + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + return R300_TX_CLAMP_TO_BORDER; + case PIPE_TEX_WRAP_MIRROR_REPEAT: + return R300_TX_REPEAT | R300_TX_MIRRORED; + case PIPE_TEX_WRAP_MIRROR_CLAMP: + return R300_TX_CLAMP | R300_TX_MIRRORED; + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + return R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED; + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + return R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED; + default: + /* XXX handle this? */ + return 0; + } +} + +static uint32_t translate_tex_filters(int min, int mag, int mip) { + uint32_t retval = 0; + switch (min) { + case PIPE_TEX_FILTER_NEAREST: + retval |= R300_TX_MIN_FILTER_NEAREST; + case PIPE_TEX_FILTER_LINEAR: + retval |= R300_TX_MIN_FILTER_LINEAR; + case PIPE_TEX_FILTER_ANISO: + retval |= R300_TX_MIN_FILTER_ANISO; + default: + /* XXX WTF?! */ + break; + } + switch (mag) { + case PIPE_TEX_FILTER_NEAREST: + retval |= R300_TX_MAG_FILTER_NEAREST; + case PIPE_TEX_FILTER_LINEAR: + retval |= R300_TX_MAG_FILTER_LINEAR; + case PIPE_TEX_FILTER_ANISO: + retval |= R300_TX_MAG_FILTER_ANISO; + default: + /* XXX WTF?! */ + break; + } + switch (mip) { + case PIPE_TEX_MIPFILTER_NONE: + retval |= R300_TX_MIN_FILTER_MIP_NONE; + case PIPE_TEX_MIPFILTER_NEAREST: + retval |= R300_TX_MIN_FILTER_MIP_NEAREST; + case PIPE_TEX_MIPFILTER_LINEAR: + retval |= R300_TX_MIN_FILTER_MIP_LINEAR; + default: + /* XXX WTF?! */ + break; + } + + return retval; +} + +static uint32_t anisotropy(float max_aniso) { + if (max_aniso >= 16.0f) { + return R300_TX_MAX_ANISO_16_TO_1; + } else if (max_aniso >= 8.0f) { + return R300_TX_MAX_ANISO_8_TO_1; + } else if (max_aniso >= 4.0f) { + return R300_TX_MAX_ANISO_4_TO_1; + } else if (max_aniso >= 2.0f) { + return R300_TX_MAX_ANISO_2_TO_1; + } else { + return R300_TX_MAX_ANISO_1_TO_1; + } +} + static void* r300_create_sampler_state(struct pipe_context* pipe, const struct pipe_sampler_state* state) { + struct r300_context* r300 = r300_context(pipe); struct r300_sampler_state* sampler = CALLOC_STRUCT(r300_sampler_state); + int lod_bias; + + sampler->filter0 |= + (translate_wrap(state->wrap_s) << R300_TX_WRAP_S_SHIFT) | + (translate_wrap(state->wrap_t) << R300_TX_WRAP_T_SHIFT) | + (translate_wrap(state->wrap_r) << R300_TX_WRAP_R_SHIFT); + + sampler->filter0 |= translate_tex_filters(state->min_img_filter, + state->mag_img_filter, + state->min_mip_filter); + + lod_bias = CLAMP((int)(state->lod_bias * 32), -(1 << 9), (1 << 9) - 1); + + sampler->filter1 |= lod_bias << R300_LOD_BIAS_SHIFT; + + sampler->filter1 |= anisotropy(state->max_anisotropy); + + util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM, + &sampler->border_color); + + /* R500-specific fixups and optimizations */ + if (r300_screen(r300->context.screen)->caps->is_r500) { + sampler->filter1 |= R500_BORDER_FIX; + } return (void*)sampler; } @@ -471,15 +574,15 @@ static void r300_bind_sampler_states(struct pipe_context* pipe, void** states) { struct r300_context* r300 = r300_context(pipe); - int i = 0; + int i; if (count > 8) { return; } - for (i; i < count; i++) { + for (i = 0; i < count; i++) { if (r300->sampler_states[i] != states[i]) { - r300->sampler_states[i] = states[i]; + r300->sampler_states[i] = (struct r300_sampler_state*)states[i]; r300->dirty_state |= (R300_NEW_SAMPLER << i); } } @@ -510,8 +613,8 @@ static void r300_set_scissor_state(struct pipe_context* pipe, r300->scissor_state->scissor_top_left = (left << R300_SCISSORS_X_SHIFT) | (top << R300_SCISSORS_Y_SHIFT); - r300->scissor_state->scissor_bottom_right = (right << R300_SCISSORS_X_SHIFT) | - (bottom << R300_SCISSORS_Y_SHIFT); + r300->scissor_state->scissor_bottom_right = + (right << R300_SCISSORS_X_SHIFT) | (bottom << R300_SCISSORS_Y_SHIFT); r300->dirty_state |= R300_NEW_SCISSOR; } -- cgit v1.2.3 From 8e11e0121466efa34cfc14d299b43455a30b198c Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 23 Jan 2009 02:46:52 -0800 Subject: r300: Add initial pipe_texture handling. Still primitive and needing to be fleshed out, but it's a start. --- src/gallium/drivers/r300/r300_context.h | 14 ++++++ src/gallium/drivers/r300/r300_texture.c | 76 +++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_texture.h | 5 ++- 3 files changed, 93 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 3cb5df4e20..f162aa4b64 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -84,6 +84,20 @@ struct r300_scissor_state { #define R300_NEW_SCISSOR 0x1000 #define R300_NEW_KITCHEN_SINK 0x1fff +struct r300_texture { + /* Parent class */ + struct pipe_texture tex; + + /* Offsets into the buffer. */ + unsigned offset[PIPE_MAX_TEXTURE_LEVELS]; + + /* Total size of this texture, in bytes. */ + unsigned size; + + /* Pipe buffer backing this texture. */ + struct pipe_buffer* buffer; +}; + struct r300_context { /* Parent class */ struct pipe_context context; diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 30d9e64b4c..2f6c52b137 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -22,14 +22,90 @@ #include "r300_texture.h" +static int minify(int i) +{ + return MAX2(1, i >> 1); +} + +static void r300_setup_miptree(struct r300_texture* tex) +{ + struct pipe_texture* base = &tex->tex; + int stride, size, offset; + + for (int i = 0; i <= base->last_level; i++) { + if (i > 0) { + base->width[i] = minify(base->width[i-1]); + base->height[i] = minify(base->height[i-1]); + base->depth[i] = minify(base->depth[i-1]); + } + + base->nblocksx[i] = pf_get_nblocksx(&base->block, base->width[i]); + base->nblocksy[i] = pf_get_nblocksy(&base->block, base->width[i]); + + /* Radeons enjoy things in multiples of 32. */ + /* XXX NPOT -> 64, not 32 */ + stride = (base->nblocksx[i] * base->block.size + 31) & ~31; + size = stride * base->nblocksy[i] * base->depth[i]; + + /* XXX 64 for NPOT */ + tex->offset[i] = (tex->size + 31) & ~31; + tex->size = tex->offset[i] + size; + } +} + /* Create a new texture. */ static struct pipe_texture* r300_texture_create(struct pipe_screen* screen, const struct pipe_texture* template) { + struct r300_screen* r300screen = r300_screen(screen); + + struct r300_texture* tex = CALLOC_STRUCT(r300_texture); + + if (!tex) { + return NULL; + } + + tex->tex = *template; + tex->tex.refcount = 1; + tex->tex.screen = screen; + + r300_setup_miptree(tex); + + tex->buffer = screen->winsys->buffer_create(screen->winsys, 32, + PIPE_BUFFER_USAGE_PIXEL, + tex->size); + + if (!tex->buffer) { + FREE(tex); + return NULL; + } + + return (struct pipe_texture*)tex; +} + +static void r300_texture_release(struct pipe_screen* screen, + struct pipe_texture** texture) +{ + if (!*texture) { + return; + } + + (*texture)->refcount--; + + if ((*texture)->refcount <= 0) { + struct r300_texture* tex = (struct r300_texture*)*texture; + + pipe_buffer_reference(screen, &tex->buffer, NULL); + + FREE(tex); + } + + *texture = NULL; } void r300_init_screen_texture_functions(struct pipe_screen* screen) { screen->texture_create = r300_texture_create; + screen->texture_release = r300_texture_release; } diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 9d14cf81a6..7964229a94 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -25,8 +25,9 @@ #include "pipe/p_screen.h" -struct r300_texture { -}; +#include "util/u_math.h" + +#include "r300_context.h" void r300_init_screen_texture_functions(struct pipe_screen* screen); -- cgit v1.2.3 From 471129c7a14fb585ede198970e59270c4afa5310 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 23 Jan 2009 03:09:15 -0800 Subject: r300: Add more pipe_texture stuff. This is enough to sate glxinfo, for now. --- src/gallium/drivers/r300/r300_texture.c | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 2f6c52b137..c1df905033 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -104,8 +104,62 @@ static void r300_texture_release(struct pipe_screen* screen, *texture = NULL; } +static struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen, + struct pipe_texture* texture, + unsigned face, + unsigned level, + unsigned zslice, + unsigned flags) +{ + struct r300_texture* tex = (struct r300_texture*)texture; + struct pipe_surface* surface = CALLOC_STRUCT(pipe_surface); + unsigned offset; + + /* XXX this is certainly dependent on tex target */ + offset = tex->offset[level]; + + if (surface) { + surface->refcount = 1; + surface->winsys = screen->winsys; + pipe_texture_reference(&surface->texture, texture); + pipe_buffer_reference(screen, &surface->buffer, tex->buffer); + surface->format = texture->format; + surface->width = texture->width[level]; + surface->height = texture->height[level]; + surface->block = texture->block; + surface->nblocksx = texture->nblocksx[level]; + surface->nblocksy = texture->nblocksy[level]; + /* XXX save the actual stride instead plz kthnxbai */ + surface->stride = + (texture->nblocksx[level] * texture->block.size + 31) & ~31; + surface->offset = offset; + surface->usage = flags; + surface->status = PIPE_SURFACE_STATUS_DEFINED; + } + + return surface; +} + +static void r300_tex_surface_release(struct pipe_screen* screen, + struct pipe_surface** surface) +{ + struct pipe_surface* s = *surface; + + s->refcount--; + + if (s->refcount <= 0) { + pipe_texture_reference(&s->texture, NULL); + pipe_buffer_reference(screen, &s->buffer, NULL); + FREE(s); + } + + *surface = NULL; +} + void r300_init_screen_texture_functions(struct pipe_screen* screen) { screen->texture_create = r300_texture_create; screen->texture_release = r300_texture_release; + screen->get_tex_surface = r300_get_tex_surface; + screen->tex_surface_release = r300_tex_surface_release; } -- cgit v1.2.3 From 45cb94217ebd55a4d38264ce83806062ba25a478 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 23 Jan 2009 15:08:27 -0800 Subject: r300: Add fragment shader stubs. Not looking forward to filling these out at all. --- src/gallium/drivers/r300/r300_context.h | 21 ++++++++++++++------- src/gallium/drivers/r300/r300_emit.c | 2 +- src/gallium/drivers/r300/r300_state.c | 32 +++++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index f162aa4b64..0d7ba581cc 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -55,6 +55,9 @@ struct r300_dsa_state { uint32_t stencil_ref_bf; /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */ }; +struct r300_fs_state { +}; + struct r300_rs_state { uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */ uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ @@ -76,13 +79,15 @@ struct r300_scissor_state { uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ }; -#define R300_NEW_BLEND 0x0001 -#define R300_NEW_BLEND_COLOR 0x0002 -#define R300_NEW_DSA 0x0004 -#define R300_NEW_RS 0x0008 -#define R300_NEW_SAMPLER 0x0010 -#define R300_NEW_SCISSOR 0x1000 -#define R300_NEW_KITCHEN_SINK 0x1fff +#define R300_NEW_BLEND 0x0001 +#define R300_NEW_BLEND_COLOR 0x0002 +#define R300_NEW_DSA 0x0004 +#define R300_NEW_FRAGMENT_SHADER 0x0008 +#define R300_NEW_RASTERIZER 0x0010 +#define R300_NEW_SAMPLER 0x0020 +#define R300_NEW_SCISSOR 0x2000 +#define R300_NEW_VERTEX_SHADER 0x4000 +#define R300_NEW_KITCHEN_SINK 0x7fff struct r300_texture { /* Parent class */ @@ -114,6 +119,8 @@ struct r300_context { struct r300_blend_color_state* blend_color_state; /* Depth, stencil, and alpha state. */ struct r300_dsa_state* dsa_state; + /* Fragment shader state. */ + struct r300_fs_state* fs_state; /* Rasterizer state. */ struct r300_rs_state* rs_state; /* Sampler states. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index bf6fd3224e..19bfcbdd5b 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -74,7 +74,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) } } - if (r300->dirty_state & R300_NEW_RS) { + if (r300->dirty_state & R300_NEW_RASTERIZER) { struct r300_rs_state* rs = r300->rs_state; OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status); /* XXX next six are contiguous regs */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 8e15a429fb..9d9a4ec202 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -357,6 +357,32 @@ static void r300_delete_dsa_state(struct pipe_context* pipe, { FREE(state); } + +/* Create fragment shader state. */ +static void* r300_create_fs_state(struct pipe_context* pipe, + const struct pipe_shader_state* state) +{ + struct r300_fs_state* fs = CALLOC_STRUCT(r300_fs_state); + + return (void*)fs; +} + +/* Bind fragment shader state. */ +static void r300_bind_fs_state(struct pipe_context* pipe, void* state) +{ + struct r300_context* r300 = r300_context(pipe); + + r300->fs_state = (struct r300_fs_state*)state; + + r300->dirty_state |= R300_NEW_FRAGMENT_SHADER; +} + +/* Delect fragment shader state. */ +static void r300_delete_fs_state(struct pipe_context* pipe, void* state) +{ + FREE(state); +} + #if 0 struct pipe_rasterizer_state { @@ -449,7 +475,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) struct r300_context* r300 = r300_context(pipe); r300->rs_state = (struct r300_rs_state*)state; - r300->dirty_state |= R300_NEW_RS; + r300->dirty_state |= R300_NEW_RASTERIZER; } /* Free rasterizer state. */ @@ -652,6 +678,10 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; + r300->context.create_fs_state = r300_create_fs_state; + r300->context.bind_fs_state = r300_bind_fs_state; + r300->context.delete_fs_state = r300_delete_fs_state; + r300->context.create_rasterizer_state = r300_create_rs_state; r300->context.bind_rasterizer_state = r300_bind_rs_state; r300->context.delete_rasterizer_state = r300_delete_rs_state; -- cgit v1.2.3 From 5f95f0538e5a354431cc3bbed662c4983e6d0614 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 23 Jan 2009 16:00:33 -0800 Subject: amd: Fix missing break statement. --- src/gallium/winsys/drm/amd/amd_screen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/amd/amd_screen.c b/src/gallium/winsys/drm/amd/amd_screen.c index 22d8973eb7..fcf8524525 100644 --- a/src/gallium/winsys/drm/amd/amd_screen.c +++ b/src/gallium/winsys/drm/amd/amd_screen.c @@ -187,11 +187,12 @@ static boolean amd_buffer_create(__DRIscreenPrivate *dri_screen, } switch (visual->depthBits) { + case 24: + depth_format = PIPE_FORMAT_S8Z24_UNORM; + break; case 16: depth_format = PIPE_FORMAT_Z16_UNORM; break; - case 24: - depth_format = PIPE_FORMAT_S8Z24_UNORM; default: depth_format = PIPE_FORMAT_NONE; break; -- cgit v1.2.3 From 02c6e523305de017b49d6851034fcea6c568e94c Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 23 Jan 2009 16:34:00 -0800 Subject: amd: Fix uninitialized pipe_screen. --- src/gallium/winsys/drm/amd/amd_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index 7a486c93a5..df8eb850c8 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -243,11 +243,12 @@ GLboolean amd_context_create(const __GLcontextModes *visual, } if (GL_TRUE) { - fprintf(stderr, "Creating r300 context..."); + fprintf(stderr, "Creating r300 context...\n"); pipe = r300_create_context(NULL, amd_context->pipe_winsys, amd_create_r300_winsys(amd_context->drm_fd)); + amd_context->pipe_screen = pipe->screen; } else { pipe = amd_create_softpipe(amd_context); } -- cgit v1.2.3 From 1a5eea0c1e9ce6162ed6b07c337bffe62cb3c221 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 23 Jan 2009 17:01:04 -0800 Subject: r300: Finish basic state setup. I have successfully fooled glxinfo into believing that I am a competent writer of code. Next step is to trick trivial/clear. --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_context.c | 2 ++ src/gallium/drivers/r300/r300_screen.c | 1 + src/gallium/drivers/r300/r300_texture.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index f1b1a615b8..1f67692166 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -9,6 +9,7 @@ C_SOURCES = \ r300_clear.c \ r300_context.c \ r300_emit.c \ + r300_flush.c \ r300_screen.c \ r300_state.c \ r300_surface.c \ diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index f254b2f2a3..314b2f0a11 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -52,6 +52,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state); r300->scissor_state = CALLOC_STRUCT(r300_scissor_state); + r300_init_flush_functions(r300); + r300_init_surface_functions(r300); r300_init_state_functions(r300); diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 2b83ae060c..bd5aa4f466 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -117,6 +117,7 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) static boolean check_tex_2d_format(enum pipe_format format) { switch (format) { + case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_I8_UNORM: return TRUE; default: diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index c1df905033..4adfe478c3 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -156,10 +156,41 @@ static void r300_tex_surface_release(struct pipe_screen* screen, *surface = NULL; } +static struct pipe_texture* + r300_texture_blanket(struct pipe_screen* screen, + const struct pipe_texture* base, + const unsigned* stride, + struct pipe_buffer* buffer) +{ + struct r300_texture* tex; + + if (base->target != PIPE_TEXTURE_2D || + base->last_level != 0 || + base->depth[0] != 1) { + return NULL; + } + + tex = CALLOC_STRUCT(r300_texture); + if (!tex) { + return NULL; + } + + tex->tex = *base; + tex->tex.refcount = 1; + tex->tex.screen = screen; + + /* XXX tex->stride = *stride; */ + + pipe_buffer_reference(screen, &tex->buffer, buffer); + + return (struct pipe_texture*)tex; +} + void r300_init_screen_texture_functions(struct pipe_screen* screen) { screen->texture_create = r300_texture_create; screen->texture_release = r300_texture_release; screen->get_tex_surface = r300_get_tex_surface; screen->tex_surface_release = r300_tex_surface_release; + screen->texture_blanket = r300_texture_blanket; } -- cgit v1.2.3 From 1a503019d73701ed311b15107f314bc84968bdb7 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 01:32:14 -0800 Subject: r300: Moar state handlers. Ah, my code's so bad. It's amazing. --- src/gallium/drivers/r300/r300_chipset.c | 3 ++ src/gallium/drivers/r300/r300_context.h | 9 ++++ src/gallium/drivers/r300/r300_state.c | 76 +++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index f2dc8aedaa..494c9e54c0 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -340,4 +340,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) /* XXX not an r300?! */ break; } + + /* Force off TCL for now */ + caps->has_tcl = FALSE; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 0d7ba581cc..52ddfa1df9 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -79,6 +79,9 @@ struct r300_scissor_state { uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ }; +struct r300_texture_state { +}; + #define R300_NEW_BLEND 0x0001 #define R300_NEW_BLEND_COLOR 0x0002 #define R300_NEW_DSA 0x0004 @@ -121,6 +124,8 @@ struct r300_context { struct r300_dsa_state* dsa_state; /* Fragment shader state. */ struct r300_fs_state* fs_state; + /* Framebuffer state. We currently don't need our own version of this. */ + struct pipe_framebuffer_state framebuffer_state; /* Rasterizer state. */ struct r300_rs_state* rs_state; /* Sampler states. */ @@ -128,6 +133,10 @@ struct r300_context { int sampler_count; /* Scissor state. */ struct r300_scissor_state* scissor_state; + /* Texture states. */ + struct r300_texture* textures[8]; + struct r300_texture_state* texture_states[8]; + int texture_count; /* Bitmask of dirty state objects. */ uint32_t dirty_state; /* Flag indicating whether or not the HW is dirty. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 9d9a4ec202..4f9d44bbfd 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -195,6 +195,15 @@ static void r300_set_blend_color(struct pipe_context* pipe, r300->dirty_state |= R300_NEW_BLEND_COLOR; } +static void r300_set_clip_state(struct pipe_context* pipe, + const struct pipe_clip_state* state) +{ + struct r300_context* r300 = r300_context(pipe); + /* XXX Draw */ + draw_flush(r300->draw); + draw_set_clip_state(r300->draw, state); +} + static uint32_t translate_depth_stencil_function(int zs_func) { switch (zs_func) { case PIPE_FUNC_NEVER: @@ -358,6 +367,19 @@ static void r300_delete_dsa_state(struct pipe_context* pipe, FREE(state); } +static void + r300_set_framebuffer_state(struct pipe_context* pipe, + const struct pipe_framebuffer_state* state) +{ + struct r300_context* r300 = r300_context(pipe); + + draw_flush(r300->draw); + + r300->framebuffer_state = *state; + + /* XXX do we need to mark dirty state? */ +} + /* Create fragment shader state. */ static void* r300_create_fs_state(struct pipe_context* pipe, const struct pipe_shader_state* state) @@ -383,6 +405,12 @@ static void r300_delete_fs_state(struct pipe_context* pipe, void* state) FREE(state); } +static void r300_set_polygon_stipple(struct pipe_context* pipe, + const struct pipe_poly_stipple* state) +{ + /* XXX */ +} + #if 0 struct pipe_rasterizer_state { @@ -621,6 +649,36 @@ static void r300_delete_sampler_state(struct pipe_context* pipe, void* state) FREE(state); } +static void r300_set_sampler_textures(struct pipe_context* pipe, + unsigned count, + struct pipe_texture** texture) +{ + struct r300_context* r300 = r300_context(pipe); + int i; + + /* XXX magic num */ + if (count > 8) { + return; + } + + for (i = 0; i < count; i++) { + if (r300->textures[i] != (struct r300_texture*)texture[i]) { + pipe_texture_reference((struct pipe_texture**)&r300->textures[i], + texture[i]); + /* XXX NEW_TEXTURE instead? */ + r300->dirty_state |= (R300_NEW_SAMPLER << i); + } + } + + for (i = count; i < 8; i++) { + /* XXX also state change? */ + pipe_texture_reference((struct pipe_texture**)&r300->textures[i], + NULL); + } + + r300->texture_count = count; +} + static void r300_set_scissor_state(struct pipe_context* pipe, const struct pipe_scissor_state* state) { @@ -645,6 +703,14 @@ static void r300_set_scissor_state(struct pipe_context* pipe, r300->dirty_state |= R300_NEW_SCISSOR; } +static void r300_set_viewport_state(struct pipe_context* pipe, + const struct pipe_viewport_state* state) +{ + struct r300_context* r300 = r300_context(pipe); + /* XXX handing this off to Draw for now */ + draw_set_viewport_state(r300->draw, state); +} + static void* r300_create_vs_state(struct pipe_context* pipe, const struct pipe_shader_state* state) { @@ -674,14 +740,20 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.set_blend_color = r300_set_blend_color; + r300->context.set_clip_state = r300_set_clip_state; + r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; + r300->context.set_framebuffer_state = r300_set_framebuffer_state; + r300->context.create_fs_state = r300_create_fs_state; r300->context.bind_fs_state = r300_bind_fs_state; r300->context.delete_fs_state = r300_delete_fs_state; + r300->context.set_polygon_stipple = r300_set_polygon_stipple; + r300->context.create_rasterizer_state = r300_create_rs_state; r300->context.bind_rasterizer_state = r300_bind_rs_state; r300->context.delete_rasterizer_state = r300_delete_rs_state; @@ -690,8 +762,12 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.bind_sampler_states = r300_bind_sampler_states; r300->context.delete_sampler_state = r300_delete_sampler_state; + r300->context.set_sampler_textures = r300_set_sampler_textures; + r300->context.set_scissor_state = r300_set_scissor_state; + r300->context.set_viewport_state = r300_set_viewport_state; + r300->context.create_vs_state = r300_create_vs_state; r300->context.bind_vs_state = r300_bind_vs_state; r300->context.delete_vs_state = r300_delete_vs_state; -- cgit v1.2.3 From 7d3d3c75cc1bade8eeb7cbbabd290e2b30dc3100 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 01:49:57 -0800 Subject: r300: Plan for the next state setters. --- src/gallium/drivers/r300/r300_state.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 4f9d44bbfd..e52d8ec9c2 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -732,8 +732,8 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* state) draw_delete_vertex_shader(context->draw, (struct draw_vertex_shader*)state); } -void r300_init_state_functions(struct r300_context* r300) { - +void r300_init_state_functions(struct r300_context* r300) +{ r300->context.create_blend_state = r300_create_blend_state; r300->context.bind_blend_state = r300_bind_blend_state; r300->context.delete_blend_state = r300_delete_blend_state; @@ -742,10 +742,14 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.set_clip_state = r300_set_clip_state; + /* XXX r300->context.set_constant_buffer = r300_set_constant_buffer; */ + r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; + /* XXX r300->context.set_edgeflags = r300_set_edgeflags; */ + r300->context.set_framebuffer_state = r300_set_framebuffer_state; r300->context.create_fs_state = r300_create_fs_state; @@ -768,6 +772,9 @@ void r300_init_state_functions(struct r300_context* r300) { r300->context.set_viewport_state = r300_set_viewport_state; + /* XXX r300->context.set_vertex_buffers = r300_set_vertex_buffers; + * XXX r300->context.set_vertex_elements = r300_set_vertex_elements; */ + r300->context.create_vs_state = r300_create_vs_state; r300->context.bind_vs_state = r300_bind_vs_state; r300->context.delete_vs_state = r300_delete_vs_state; -- cgit v1.2.3 From 1aa2ecf3533154337947dbac2ace54fadf031692 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 02:03:35 -0800 Subject: r300: Put r300_blit to bed. Not going to be using the blitter. Period. --- src/gallium/drivers/r300/Makefile | 1 - src/gallium/drivers/r300/r300_blit.c | 96 ------------------------------------ src/gallium/drivers/r300/r300_blit.h | 43 ---------------- 3 files changed, 140 deletions(-) delete mode 100644 src/gallium/drivers/r300/r300_blit.c delete mode 100644 src/gallium/drivers/r300/r300_blit.h (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 1f67692166..1d61b31605 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -4,7 +4,6 @@ include $(TOP)/configs/current LIBNAME = r300 C_SOURCES = \ - r300_blit.c \ r300_chipset.c \ r300_clear.c \ r300_context.c \ diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c deleted file mode 100644 index 6bcfbc0d79..0000000000 --- a/src/gallium/drivers/r300/r300_blit.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2008 Corbin Simpson - * - * 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 "r300_blit.h" - -/* Does a "paint" into the specified rectangle. - * Returns 1 on success, 0 on error. */ -int r300_fill_blit(struct r300_context* r300, - unsigned cpp, - short dst_pitch, - struct pipe_buffer* dst_buffer, - unsigned dst_offset, - short x, short y, - short w, short h, - unsigned color) -{ - CS_LOCALS(r300); - uint32_t dest_type; -#if 0 - /* Check for fallbacks. */ - /* XXX we can do YUV surfaces, too, but only in 3D mode. Hmm... */ - switch(cpp) { - case 2: - case 6: - dest_type = ATI_DATATYPE_CI8; - break; - case 4: - dest_type = ATI_DATATYPE_RGB565; - break; - case 8: - dest_type = ATI_DATATYPE_ARGB8888; - break; - default: - /* Whatever this is, we can't fill it. (Yet.) */ - return 0; - } - - /* XXX odds are *incredibly* good that we were in 3D just a bit ago, - * so flush here first. */ - - BEGIN_CS(10 + 2 + 2); - - /* Set up the 2D engine. */ - OUT_CS_REG(RADEON_DEFAULT_SC_BOTTOM_RIGHT, - RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX); - OUT_CS_REG(RADEON_DP_GUI_MASTER_CNTL, - RADEON_GMC_DST_PITCH_OFFSET_CNTL | - RADEON_GMC_BRUSH_SOLID_COLOR | - (dest_type << 8) | - RADEON_GMC_SRC_DATATYPE_COLOR | - RADEON_ROP3_P | - RADEON_GMC_CLR_CMP_CNTL_DIS); - /* XXX pack this? */ - OUT_CS_REG(RADEON_DP_BRUSH_FRGD_CLR, color); - OUT_CS_REG(RADEON_DP_BRUSH_BKGD_CLR, 0x00000000); - OUT_CS_REG(RADEON_DP_SRC_FRGD_CLR, 0xffffffff); - OUT_CS_REG(RADEON_DP_SRC_BKGD_CLR, 0x00000000); - /* XXX what should this be? */ - OUT_CS_REG(RADEON_DP_WRITE_MASK, 0x00000000); - OUT_CS_REG(RADEON_DP_CNTL, - RADEON_DST_X_LEFT_TO_RIGHT | RADEON_DST_Y_TOP_TO_BOTTOM); - OUT_CS_REG(RADEON_DST_PITCH_OFFSET, 0x0); - OUT_CS_RELOC(dst_buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); - - /* Do the actual paint. */ - OUT_CS_REG(RADEON_DST_Y_X, (y << 16) | x); - OUT_CS_REG(RADEON_DST_HEIGHT_WIDTH, (h << 16) | w); - - /* Let the 2D engine settle. */ - OUT_CS_REG(RADEON_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL); - OUT_CS_REG(RADEON_WAIT_UNTIL, - RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_DMA_GUI_IDLE); - - END_CS; -#endif - return 1; -} diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h deleted file mode 100644 index 740cbcdea5..0000000000 --- a/src/gallium/drivers/r300/r300_blit.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2008 Corbin Simpson - * - * 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. */ - -#ifndef R300_BLIT_H -#define R300_BLIT_H - -#include "pipe/p_state.h" - -#include "r300_context.h" -#include "r300_cs.h" - -/* Forward declarations. */ -struct r300_context; - -extern int r300_fill_blit(struct r300_context* r300, - unsigned cpp, - short dst_pitch, - struct pipe_buffer* dst_buffer, - unsigned dst_offset, - short x, short y, - short w, short h, - unsigned color); - -#endif /* R300_BLIT_H */ \ No newline at end of file -- cgit v1.2.3 From e54732eb3db8452a99fcc2ad68fb644cecba6a20 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 02:12:55 -0800 Subject: r300: Remove radeon_reg. Wonder why this was ever committed... --- src/gallium/drivers/r300/radeon_reg.h | 5324 --------------------------------- 1 file changed, 5324 deletions(-) delete mode 100644 src/gallium/drivers/r300/radeon_reg.h (limited to 'src') diff --git a/src/gallium/drivers/r300/radeon_reg.h b/src/gallium/drivers/r300/radeon_reg.h deleted file mode 100644 index e2fcb70a95..0000000000 --- a/src/gallium/drivers/r300/radeon_reg.h +++ /dev/null @@ -1,5324 +0,0 @@ -/* - * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and - * VA Linux Systems Inc., Fremont, California. - * - * 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 on 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS 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. - */ - -/* - * Authors: - * Kevin E. Martin - * Rickard E. Faith - * Alan Hourihane - * - * References: - * - * !!!! FIXME !!!! - * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical - * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April - * 1999. - * - * !!!! FIXME !!!! - * RAGE 128 Software Development Manual (Technical Reference Manual P/N - * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999. - * - */ - -/* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h - * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT - * ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */ - -/* XXX clean this bitch up */ - -#ifndef _RADEON_REG_H_ -#define _RADEON_REG_H_ - -#define ATI_DATATYPE_VQ 0 -#define ATI_DATATYPE_CI4 1 -#define ATI_DATATYPE_CI8 2 -#define ATI_DATATYPE_ARGB1555 3 -#define ATI_DATATYPE_RGB565 4 -#define ATI_DATATYPE_RGB888 5 -#define ATI_DATATYPE_ARGB8888 6 -#define ATI_DATATYPE_RGB332 7 -#define ATI_DATATYPE_Y8 8 -#define ATI_DATATYPE_RGB8 9 -#define ATI_DATATYPE_CI16 10 -#define ATI_DATATYPE_VYUY_422 11 -#define ATI_DATATYPE_YVYU_422 12 -#define ATI_DATATYPE_AYUV_444 14 -#define ATI_DATATYPE_ARGB4444 15 - - /* Registers for 2D/Video/Overlay */ -#define RADEON_ADAPTER_ID 0x0f2c /* PCI */ -#define RADEON_AGP_BASE 0x0170 -#define RADEON_AGP_CNTL 0x0174 -# define RADEON_AGP_APER_SIZE_256MB (0x00 << 0) -# define RADEON_AGP_APER_SIZE_128MB (0x20 << 0) -# define RADEON_AGP_APER_SIZE_64MB (0x30 << 0) -# define RADEON_AGP_APER_SIZE_32MB (0x38 << 0) -# define RADEON_AGP_APER_SIZE_16MB (0x3c << 0) -# define RADEON_AGP_APER_SIZE_8MB (0x3e << 0) -# define RADEON_AGP_APER_SIZE_4MB (0x3f << 0) -# define RADEON_AGP_APER_SIZE_MASK (0x3f << 0) -#define RADEON_STATUS_PCI_CONFIG 0x06 -# define RADEON_CAP_LIST 0x100000 -#define RADEON_CAPABILITIES_PTR_PCI_CONFIG 0x34 /* offset in PCI config*/ -# define RADEON_CAP_PTR_MASK 0xfc /* mask off reserved bits of CAP_PTR */ -# define RADEON_CAP_ID_NULL 0x00 /* End of capability list */ -# define RADEON_CAP_ID_AGP 0x02 /* AGP capability ID */ -# define RADEON_CAP_ID_EXP 0x10 /* PCI Express */ -#define RADEON_AGP_COMMAND 0x0f60 /* PCI */ -#define RADEON_AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/ -# define RADEON_AGP_ENABLE (1<<8) -#define RADEON_AGP_PLL_CNTL 0x000b /* PLL */ -#define RADEON_AGP_STATUS 0x0f5c /* PCI */ -# define RADEON_AGP_1X_MODE 0x01 -# define RADEON_AGP_2X_MODE 0x02 -# define RADEON_AGP_4X_MODE 0x04 -# define RADEON_AGP_FW_MODE 0x10 -# define RADEON_AGP_MODE_MASK 0x17 -# define RADEON_AGPv3_MODE 0x08 -# define RADEON_AGPv3_4X_MODE 0x01 -# define RADEON_AGPv3_8X_MODE 0x02 -#define RADEON_ATTRDR 0x03c1 /* VGA */ -#define RADEON_ATTRDW 0x03c0 /* VGA */ -#define RADEON_ATTRX 0x03c0 /* VGA */ -#define RADEON_AUX_SC_CNTL 0x1660 -# define RADEON_AUX1_SC_EN (1 << 0) -# define RADEON_AUX1_SC_MODE_OR (0 << 1) -# define RADEON_AUX1_SC_MODE_NAND (1 << 1) -# define RADEON_AUX2_SC_EN (1 << 2) -# define RADEON_AUX2_SC_MODE_OR (0 << 3) -# define RADEON_AUX2_SC_MODE_NAND (1 << 3) -# define RADEON_AUX3_SC_EN (1 << 4) -# define RADEON_AUX3_SC_MODE_OR (0 << 5) -# define RADEON_AUX3_SC_MODE_NAND (1 << 5) -#define RADEON_AUX1_SC_BOTTOM 0x1670 -#define RADEON_AUX1_SC_LEFT 0x1664 -#define RADEON_AUX1_SC_RIGHT 0x1668 -#define RADEON_AUX1_SC_TOP 0x166c -#define RADEON_AUX2_SC_BOTTOM 0x1680 -#define RADEON_AUX2_SC_LEFT 0x1674 -#define RADEON_AUX2_SC_RIGHT 0x1678 -#define RADEON_AUX2_SC_TOP 0x167c -#define RADEON_AUX3_SC_BOTTOM 0x1690 -#define RADEON_AUX3_SC_LEFT 0x1684 -#define RADEON_AUX3_SC_RIGHT 0x1688 -#define RADEON_AUX3_SC_TOP 0x168c -#define RADEON_AUX_WINDOW_HORZ_CNTL 0x02d8 -#define RADEON_AUX_WINDOW_VERT_CNTL 0x02dc - -#define RADEON_BASE_CODE 0x0f0b -#define RADEON_BIOS_0_SCRATCH 0x0010 -# define RADEON_FP_PANEL_SCALABLE (1 << 16) -# define RADEON_FP_PANEL_SCALE_EN (1 << 17) -# define RADEON_FP_CHIP_SCALE_EN (1 << 18) -# define RADEON_DRIVER_BRIGHTNESS_EN (1 << 26) -# define RADEON_DISPLAY_ROT_MASK (3 << 28) -# define RADEON_DISPLAY_ROT_00 (0 << 28) -# define RADEON_DISPLAY_ROT_90 (1 << 28) -# define RADEON_DISPLAY_ROT_180 (2 << 28) -# define RADEON_DISPLAY_ROT_270 (3 << 28) -#define RADEON_BIOS_1_SCRATCH 0x0014 -#define RADEON_BIOS_2_SCRATCH 0x0018 -#define RADEON_BIOS_3_SCRATCH 0x001c -#define RADEON_BIOS_4_SCRATCH 0x0020 -# define RADEON_CRT1_ATTACHED_MASK (3 << 0) -# define RADEON_CRT1_ATTACHED_MONO (1 << 0) -# define RADEON_CRT1_ATTACHED_COLOR (2 << 0) -# define RADEON_LCD1_ATTACHED (1 << 2) -# define RADEON_DFP1_ATTACHED (1 << 3) -# define RADEON_TV1_ATTACHED_MASK (3 << 4) -# define RADEON_TV1_ATTACHED_COMP (1 << 4) -# define RADEON_TV1_ATTACHED_SVIDEO (2 << 4) -# define RADEON_CRT2_ATTACHED_MASK (3 << 8) -# define RADEON_CRT2_ATTACHED_MONO (1 << 8) -# define RADEON_CRT2_ATTACHED_COLOR (2 << 8) -# define RADEON_DFP2_ATTACHED (1 << 11) -#define RADEON_BIOS_5_SCRATCH 0x0024 -# define RADEON_LCD1_ON (1 << 0) -# define RADEON_CRT1_ON (1 << 1) -# define RADEON_TV1_ON (1 << 2) -# define RADEON_DFP1_ON (1 << 3) -# define RADEON_CRT2_ON (1 << 5) -# define RADEON_CV1_ON (1 << 6) -# define RADEON_DFP2_ON (1 << 7) -# define RADEON_LCD1_CRTC_MASK (1 << 8) -# define RADEON_LCD1_CRTC_SHIFT 8 -# define RADEON_CRT1_CRTC_MASK (1 << 9) -# define RADEON_CRT1_CRTC_SHIFT 9 -# define RADEON_TV1_CRTC_MASK (1 << 10) -# define RADEON_TV1_CRTC_SHIFT 10 -# define RADEON_DFP1_CRTC_MASK (1 << 11) -# define RADEON_DFP1_CRTC_SHIFT 11 -# define RADEON_CRT2_CRTC_MASK (1 << 12) -# define RADEON_CRT2_CRTC_SHIFT 12 -# define RADEON_CV1_CRTC_MASK (1 << 13) -# define RADEON_CV1_CRTC_SHIFT 13 -# define RADEON_DFP2_CRTC_MASK (1 << 14) -# define RADEON_DFP2_CRTC_SHIFT 14 -#define RADEON_BIOS_6_SCRATCH 0x0028 -# define RADEON_ACC_MODE_CHANGE (1 << 2) -# define RADEON_EXT_DESKTOP_MODE (1 << 3) -# define RADEON_LCD_DPMS_ON (1 << 20) -# define RADEON_CRT_DPMS_ON (1 << 21) -# define RADEON_TV_DPMS_ON (1 << 22) -# define RADEON_DFP_DPMS_ON (1 << 23) -# define RADEON_DPMS_MASK (3 << 24) -# define RADEON_DPMS_ON (0 << 24) -# define RADEON_DPMS_STANDBY (1 << 24) -# define RADEON_DPMS_SUSPEND (2 << 24) -# define RADEON_DPMS_OFF (3 << 24) -# define RADEON_SCREEN_BLANKING (1 << 26) -# define RADEON_DRIVER_CRITICAL (1 << 27) -# define RADEON_DISPLAY_SWITCHING_DIS (1 << 30) -#define RADEON_BIOS_7_SCRATCH 0x002c -# define RADEON_SYS_HOTKEY (1 << 10) -# define RADEON_DRV_LOADED (1 << 12) -#define RADEON_BIOS_ROM 0x0f30 /* PCI */ -#define RADEON_BIST 0x0f0f /* PCI */ -#define RADEON_BRUSH_DATA0 0x1480 -#define RADEON_BRUSH_DATA1 0x1484 -#define RADEON_BRUSH_DATA10 0x14a8 -#define RADEON_BRUSH_DATA11 0x14ac -#define RADEON_BRUSH_DATA12 0x14b0 -#define RADEON_BRUSH_DATA13 0x14b4 -#define RADEON_BRUSH_DATA14 0x14b8 -#define RADEON_BRUSH_DATA15 0x14bc -#define RADEON_BRUSH_DATA16 0x14c0 -#define RADEON_BRUSH_DATA17 0x14c4 -#define RADEON_BRUSH_DATA18 0x14c8 -#define RADEON_BRUSH_DATA19 0x14cc -#define RADEON_BRUSH_DATA2 0x1488 -#define RADEON_BRUSH_DATA20 0x14d0 -#define RADEON_BRUSH_DATA21 0x14d4 -#define RADEON_BRUSH_DATA22 0x14d8 -#define RADEON_BRUSH_DATA23 0x14dc -#define RADEON_BRUSH_DATA24 0x14e0 -#define RADEON_BRUSH_DATA25 0x14e4 -#define RADEON_BRUSH_DATA26 0x14e8 -#define RADEON_BRUSH_DATA27 0x14ec -#define RADEON_BRUSH_DATA28 0x14f0 -#define RADEON_BRUSH_DATA29 0x14f4 -#define RADEON_BRUSH_DATA3 0x148c -#define RADEON_BRUSH_DATA30 0x14f8 -#define RADEON_BRUSH_DATA31 0x14fc -#define RADEON_BRUSH_DATA32 0x1500 -#define RADEON_BRUSH_DATA33 0x1504 -#define RADEON_BRUSH_DATA34 0x1508 -#define RADEON_BRUSH_DATA35 0x150c -#define RADEON_BRUSH_DATA36 0x1510 -#define RADEON_BRUSH_DATA37 0x1514 -#define RADEON_BRUSH_DATA38 0x1518 -#define RADEON_BRUSH_DATA39 0x151c -#define RADEON_BRUSH_DATA4 0x1490 -#define RADEON_BRUSH_DATA40 0x1520 -#define RADEON_BRUSH_DATA41 0x1524 -#define RADEON_BRUSH_DATA42 0x1528 -#define RADEON_BRUSH_DATA43 0x152c -#define RADEON_BRUSH_DATA44 0x1530 -#define RADEON_BRUSH_DATA45 0x1534 -#define RADEON_BRUSH_DATA46 0x1538 -#define RADEON_BRUSH_DATA47 0x153c -#define RADEON_BRUSH_DATA48 0x1540 -#define RADEON_BRUSH_DATA49 0x1544 -#define RADEON_BRUSH_DATA5 0x1494 -#define RADEON_BRUSH_DATA50 0x1548 -#define RADEON_BRUSH_DATA51 0x154c -#define RADEON_BRUSH_DATA52 0x1550 -#define RADEON_BRUSH_DATA53 0x1554 -#define RADEON_BRUSH_DATA54 0x1558 -#define RADEON_BRUSH_DATA55 0x155c -#define RADEON_BRUSH_DATA56 0x1560 -#define RADEON_BRUSH_DATA57 0x1564 -#define RADEON_BRUSH_DATA58 0x1568 -#define RADEON_BRUSH_DATA59 0x156c -#define RADEON_BRUSH_DATA6 0x1498 -#define RADEON_BRUSH_DATA60 0x1570 -#define RADEON_BRUSH_DATA61 0x1574 -#define RADEON_BRUSH_DATA62 0x1578 -#define RADEON_BRUSH_DATA63 0x157c -#define RADEON_BRUSH_DATA7 0x149c -#define RADEON_BRUSH_DATA8 0x14a0 -#define RADEON_BRUSH_DATA9 0x14a4 -#define RADEON_BRUSH_SCALE 0x1470 -#define RADEON_BRUSH_Y_X 0x1474 -#define RADEON_BUS_CNTL 0x0030 -# define RADEON_BUS_MASTER_DIS (1 << 6) -# define RADEON_BUS_BIOS_DIS_ROM (1 << 12) -# define RADEON_BUS_RD_DISCARD_EN (1 << 24) -# define RADEON_BUS_RD_ABORT_EN (1 << 25) -# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28) -# define RADEON_BUS_WRT_BURST (1 << 29) -# define RADEON_BUS_READ_BURST (1 << 30) -#define RADEON_BUS_CNTL1 0x0034 -# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4) - -#define RADEON_CACHE_CNTL 0x1724 -#define RADEON_CACHE_LINE 0x0f0c /* PCI */ -#define RADEON_CAPABILITIES_ID 0x0f50 /* PCI */ -#define RADEON_CAPABILITIES_PTR 0x0f34 /* PCI */ -#define RADEON_CLK_PIN_CNTL 0x0001 /* PLL */ -# define RADEON_SCLK_DYN_START_CNTL (1 << 15) -#define RADEON_CLOCK_CNTL_DATA 0x000c -#define RADEON_CLOCK_CNTL_INDEX 0x0008 -# define RADEON_PLL_WR_EN (1 << 7) -# define RADEON_PLL_DIV_SEL (3 << 8) -# define RADEON_PLL2_DIV_SEL_MASK ~(3 << 8) -#define RADEON_CLK_PWRMGT_CNTL 0x0014 -# define RADEON_ENGIN_DYNCLK_MODE (1 << 12) -# define RADEON_ACTIVE_HILO_LAT_MASK (3 << 13) -# define RADEON_ACTIVE_HILO_LAT_SHIFT 13 -# define RADEON_DISP_DYN_STOP_LAT_MASK (1 << 12) -# define RADEON_MC_BUSY (1 << 16) -# define RADEON_DLL_READY (1 << 19) -# define RADEON_CG_NO1_DEBUG_0 (1 << 24) -# define RADEON_CG_NO1_DEBUG_MASK (0x1f << 24) -# define RADEON_DYN_STOP_MODE_MASK (7 << 21) -# define RADEON_TVPLL_PWRMGT_OFF (1 << 30) -# define RADEON_TVCLK_TURNOFF (1 << 31) -#define RADEON_PLL_PWRMGT_CNTL 0x0015 -# define RADEON_TCL_BYPASS_DISABLE (1 << 20) -#define RADEON_CLR_CMP_CLR_3D 0x1a24 -#define RADEON_CLR_CMP_CLR_DST 0x15c8 -#define RADEON_CLR_CMP_CLR_SRC 0x15c4 -#define RADEON_CLR_CMP_CNTL 0x15c0 -# define RADEON_SRC_CMP_EQ_COLOR (4 << 0) -# define RADEON_SRC_CMP_NEQ_COLOR (5 << 0) -# define RADEON_CLR_CMP_SRC_SOURCE (1 << 24) -#define RADEON_CLR_CMP_MASK 0x15cc -# define RADEON_CLR_CMP_MSK 0xffffffff -#define RADEON_CLR_CMP_MASK_3D 0x1A28 -#define RADEON_COMMAND 0x0f04 /* PCI */ -#define RADEON_COMPOSITE_SHADOW_ID 0x1a0c -#define RADEON_CONFIG_APER_0_BASE 0x0100 -#define RADEON_CONFIG_APER_1_BASE 0x0104 -#define RADEON_CONFIG_APER_SIZE 0x0108 -#define RADEON_CONFIG_BONDS 0x00e8 -#define RADEON_CONFIG_CNTL 0x00e0 -# define RADEON_CFG_ATI_REV_A11 (0 << 16) -# define RADEON_CFG_ATI_REV_A12 (1 << 16) -# define RADEON_CFG_ATI_REV_A13 (2 << 16) -# define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16) -#define RADEON_CONFIG_MEMSIZE 0x00f8 -#define RADEON_CONFIG_MEMSIZE_EMBEDDED 0x0114 -#define RADEON_CONFIG_REG_1_BASE 0x010c -#define RADEON_CONFIG_REG_APER_SIZE 0x0110 -#define RADEON_CONFIG_XSTRAP 0x00e4 -#define RADEON_CONSTANT_COLOR_C 0x1d34 -# define RADEON_CONSTANT_COLOR_MASK 0x00ffffff -# define RADEON_CONSTANT_COLOR_ONE 0x00ffffff -# define RADEON_CONSTANT_COLOR_ZERO 0x00000000 -#define RADEON_CRC_CMDFIFO_ADDR 0x0740 -#define RADEON_CRC_CMDFIFO_DOUT 0x0744 -#define RADEON_GRPH_BUFFER_CNTL 0x02f0 -# define RADEON_GRPH_START_REQ_MASK (0x7f) -# define RADEON_GRPH_START_REQ_SHIFT 0 -# define RADEON_GRPH_STOP_REQ_MASK (0x7f<<8) -# define RADEON_GRPH_STOP_REQ_SHIFT 8 -# define RADEON_GRPH_CRITICAL_POINT_MASK (0x7f<<16) -# define RADEON_GRPH_CRITICAL_POINT_SHIFT 16 -# define RADEON_GRPH_CRITICAL_CNTL (1<<28) -# define RADEON_GRPH_BUFFER_SIZE (1<<29) -# define RADEON_GRPH_CRITICAL_AT_SOF (1<<30) -# define RADEON_GRPH_STOP_CNTL (1<<31) -#define RADEON_GRPH2_BUFFER_CNTL 0x03f0 -# define RADEON_GRPH2_START_REQ_MASK (0x7f) -# define RADEON_GRPH2_START_REQ_SHIFT 0 -# define RADEON_GRPH2_STOP_REQ_MASK (0x7f<<8) -# define RADEON_GRPH2_STOP_REQ_SHIFT 8 -# define RADEON_GRPH2_CRITICAL_POINT_MASK (0x7f<<16) -# define RADEON_GRPH2_CRITICAL_POINT_SHIFT 16 -# define RADEON_GRPH2_CRITICAL_CNTL (1<<28) -# define RADEON_GRPH2_BUFFER_SIZE (1<<29) -# define RADEON_GRPH2_CRITICAL_AT_SOF (1<<30) -# define RADEON_GRPH2_STOP_CNTL (1<<31) -#define RADEON_CRTC_CRNT_FRAME 0x0214 -#define RADEON_CRTC_EXT_CNTL 0x0054 -# define RADEON_CRTC_VGA_XOVERSCAN (1 << 0) -# define RADEON_VGA_ATI_LINEAR (1 << 3) -# define RADEON_XCRT_CNT_EN (1 << 6) -# define RADEON_CRTC_HSYNC_DIS (1 << 8) -# define RADEON_CRTC_VSYNC_DIS (1 << 9) -# define RADEON_CRTC_DISPLAY_DIS (1 << 10) -# define RADEON_CRTC_SYNC_TRISTAT (1 << 11) -# define RADEON_CRTC_CRT_ON (1 << 15) -#define RADEON_CRTC_EXT_CNTL_DPMS_BYTE 0x0055 -# define RADEON_CRTC_HSYNC_DIS_BYTE (1 << 0) -# define RADEON_CRTC_VSYNC_DIS_BYTE (1 << 1) -# define RADEON_CRTC_DISPLAY_DIS_BYTE (1 << 2) -#define RADEON_CRTC_GEN_CNTL 0x0050 -# define RADEON_CRTC_DBL_SCAN_EN (1 << 0) -# define RADEON_CRTC_INTERLACE_EN (1 << 1) -# define RADEON_CRTC_CSYNC_EN (1 << 4) -# define RADEON_CRTC_ICON_EN (1 << 15) -# define RADEON_CRTC_CUR_EN (1 << 16) -# define RADEON_CRTC_CUR_MODE_MASK (7 << 20) -# define RADEON_CRTC_EXT_DISP_EN (1 << 24) -# define RADEON_CRTC_EN (1 << 25) -# define RADEON_CRTC_DISP_REQ_EN_B (1 << 26) -#define RADEON_CRTC2_GEN_CNTL 0x03f8 -# define RADEON_CRTC2_DBL_SCAN_EN (1 << 0) -# define RADEON_CRTC2_INTERLACE_EN (1 << 1) -# define RADEON_CRTC2_SYNC_TRISTAT (1 << 4) -# define RADEON_CRTC2_HSYNC_TRISTAT (1 << 5) -# define RADEON_CRTC2_VSYNC_TRISTAT (1 << 6) -# define RADEON_CRTC2_CRT2_ON (1 << 7) -# define RADEON_CRTC2_PIX_WIDTH_SHIFT 8 -# define RADEON_CRTC2_PIX_WIDTH_MASK (0xf << 8) -# define RADEON_CRTC2_ICON_EN (1 << 15) -# define RADEON_CRTC2_CUR_EN (1 << 16) -# define RADEON_CRTC2_CUR_MODE_MASK (7 << 20) -# define RADEON_CRTC2_DISP_DIS (1 << 23) -# define RADEON_CRTC2_EN (1 << 25) -# define RADEON_CRTC2_DISP_REQ_EN_B (1 << 26) -# define RADEON_CRTC2_CSYNC_EN (1 << 27) -# define RADEON_CRTC2_HSYNC_DIS (1 << 28) -# define RADEON_CRTC2_VSYNC_DIS (1 << 29) -#define RADEON_CRTC_MORE_CNTL 0x27c -# define RADEON_CRTC_AUTO_HORZ_CENTER_EN (1<<2) -# define RADEON_CRTC_AUTO_VERT_CENTER_EN (1<<3) -# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4) -# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5) -#define RADEON_CRTC_GUI_TRIG_VLINE 0x0218 -#define RADEON_CRTC_H_SYNC_STRT_WID 0x0204 -# define RADEON_CRTC_H_SYNC_STRT_PIX (0x07 << 0) -# define RADEON_CRTC_H_SYNC_STRT_CHAR (0x3ff << 3) -# define RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT 3 -# define RADEON_CRTC_H_SYNC_WID (0x3f << 16) -# define RADEON_CRTC_H_SYNC_WID_SHIFT 16 -# define RADEON_CRTC_H_SYNC_POL (1 << 23) -#define RADEON_CRTC2_H_SYNC_STRT_WID 0x0304 -# define RADEON_CRTC2_H_SYNC_STRT_PIX (0x07 << 0) -# define RADEON_CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3) -# define RADEON_CRTC2_H_SYNC_STRT_CHAR_SHIFT 3 -# define RADEON_CRTC2_H_SYNC_WID (0x3f << 16) -# define RADEON_CRTC2_H_SYNC_WID_SHIFT 16 -# define RADEON_CRTC2_H_SYNC_POL (1 << 23) -#define RADEON_CRTC_H_TOTAL_DISP 0x0200 -# define RADEON_CRTC_H_TOTAL (0x03ff << 0) -# define RADEON_CRTC_H_TOTAL_SHIFT 0 -# define RADEON_CRTC_H_DISP (0x01ff << 16) -# define RADEON_CRTC_H_DISP_SHIFT 16 -#define RADEON_CRTC2_H_TOTAL_DISP 0x0300 -# define RADEON_CRTC2_H_TOTAL (0x03ff << 0) -# define RADEON_CRTC2_H_TOTAL_SHIFT 0 -# define RADEON_CRTC2_H_DISP (0x01ff << 16) -# define RADEON_CRTC2_H_DISP_SHIFT 16 - -#define RADEON_CRTC_OFFSET_RIGHT 0x0220 -#define RADEON_CRTC_OFFSET 0x0224 -# define RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET (1<<30) -# define RADEON_CRTC_OFFSET__OFFSET_LOCK (1<<31) - -#define RADEON_CRTC2_OFFSET 0x0324 -# define RADEON_CRTC2_OFFSET__GUI_TRIG_OFFSET (1<<30) -# define RADEON_CRTC2_OFFSET__OFFSET_LOCK (1<<31) -#define RADEON_CRTC_OFFSET_CNTL 0x0228 -# define RADEON_CRTC_TILE_LINE_SHIFT 0 -# define RADEON_CRTC_TILE_LINE_RIGHT_SHIFT 4 -# define R300_CRTC_X_Y_MODE_EN_RIGHT (1 << 6) -# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_MASK (3 << 7) -# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_AUTO (0 << 7) -# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_SINGLE (1 << 7) -# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DOUBLE (2 << 7) -# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DIS (3 << 7) -# define R300_CRTC_X_Y_MODE_EN (1 << 9) -# define R300_CRTC_MICRO_TILE_BUFFER_MASK (3 << 10) -# define R300_CRTC_MICRO_TILE_BUFFER_AUTO (0 << 10) -# define R300_CRTC_MICRO_TILE_BUFFER_SINGLE (1 << 10) -# define R300_CRTC_MICRO_TILE_BUFFER_DOUBLE (2 << 10) -# define R300_CRTC_MICRO_TILE_BUFFER_DIS (3 << 10) -# define R300_CRTC_MICRO_TILE_EN_RIGHT (1 << 12) -# define R300_CRTC_MICRO_TILE_EN (1 << 13) -# define R300_CRTC_MACRO_TILE_EN_RIGHT (1 << 14) -# define R300_CRTC_MACRO_TILE_EN (1 << 15) -# define RADEON_CRTC_TILE_EN_RIGHT (1 << 14) -# define RADEON_CRTC_TILE_EN (1 << 15) -# define RADEON_CRTC_OFFSET_FLIP_CNTL (1 << 16) -# define RADEON_CRTC_STEREO_OFFSET_EN (1 << 17) - -#define R300_CRTC_TILE_X0_Y0 0x0350 -#define R300_CRTC2_TILE_X0_Y0 0x0358 - -#define RADEON_CRTC2_OFFSET_CNTL 0x0328 -# define RADEON_CRTC2_OFFSET_FLIP_CNTL (1 << 16) -# define RADEON_CRTC2_TILE_EN (1 << 15) -#define RADEON_CRTC_PITCH 0x022c -# define RADEON_CRTC_PITCH__SHIFT 0 -# define RADEON_CRTC_PITCH__RIGHT_SHIFT 16 - -#define RADEON_CRTC2_PITCH 0x032c -#define RADEON_CRTC_STATUS 0x005c -# define RADEON_CRTC_VBLANK_SAVE (1 << 1) -# define RADEON_CRTC_VBLANK_SAVE_CLEAR (1 << 1) -#define RADEON_CRTC2_STATUS 0x03fc -# define RADEON_CRTC2_VBLANK_SAVE (1 << 1) -# define RADEON_CRTC2_VBLANK_SAVE_CLEAR (1 << 1) -#define RADEON_CRTC_V_SYNC_STRT_WID 0x020c -# define RADEON_CRTC_V_SYNC_STRT (0x7ff << 0) -# define RADEON_CRTC_V_SYNC_STRT_SHIFT 0 -# define RADEON_CRTC_V_SYNC_WID (0x1f << 16) -# define RADEON_CRTC_V_SYNC_WID_SHIFT 16 -# define RADEON_CRTC_V_SYNC_POL (1 << 23) -#define RADEON_CRTC2_V_SYNC_STRT_WID 0x030c -# define RADEON_CRTC2_V_SYNC_STRT (0x7ff << 0) -# define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0 -# define RADEON_CRTC2_V_SYNC_WID (0x1f << 16) -# define RADEON_CRTC2_V_SYNC_WID_SHIFT 16 -# define RADEON_CRTC2_V_SYNC_POL (1 << 23) -#define RADEON_CRTC_V_TOTAL_DISP 0x0208 -# define RADEON_CRTC_V_TOTAL (0x07ff << 0) -# define RADEON_CRTC_V_TOTAL_SHIFT 0 -# define RADEON_CRTC_V_DISP (0x07ff << 16) -# define RADEON_CRTC_V_DISP_SHIFT 16 -#define RADEON_CRTC2_V_TOTAL_DISP 0x0308 -# define RADEON_CRTC2_V_TOTAL (0x07ff << 0) -# define RADEON_CRTC2_V_TOTAL_SHIFT 0 -# define RADEON_CRTC2_V_DISP (0x07ff << 16) -# define RADEON_CRTC2_V_DISP_SHIFT 16 -#define RADEON_CRTC_VLINE_CRNT_VLINE 0x0210 -# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16) -#define RADEON_CRTC2_CRNT_FRAME 0x0314 -#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318 -#define RADEON_CRTC2_STATUS 0x03fc -#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310 -#define RADEON_CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */ -#define RADEON_CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */ -#define RADEON_CUR_CLR0 0x026c -#define RADEON_CUR_CLR1 0x0270 -#define RADEON_CUR_HORZ_VERT_OFF 0x0268 -#define RADEON_CUR_HORZ_VERT_POSN 0x0264 -#define RADEON_CUR_OFFSET 0x0260 -# define RADEON_CUR_LOCK (1 << 31) -#define RADEON_CUR2_CLR0 0x036c -#define RADEON_CUR2_CLR1 0x0370 -#define RADEON_CUR2_HORZ_VERT_OFF 0x0368 -#define RADEON_CUR2_HORZ_VERT_POSN 0x0364 -#define RADEON_CUR2_OFFSET 0x0360 -# define RADEON_CUR2_LOCK (1 << 31) - -#define RADEON_DAC_CNTL 0x0058 -# define RADEON_DAC_RANGE_CNTL (3 << 0) -# define RADEON_DAC_RANGE_CNTL_PS2 (2 << 0) -# define RADEON_DAC_RANGE_CNTL_MASK 0x03 -# define RADEON_DAC_BLANKING (1 << 2) -# define RADEON_DAC_CMP_EN (1 << 3) -# define RADEON_DAC_CMP_OUTPUT (1 << 7) -# define RADEON_DAC_8BIT_EN (1 << 8) -# define RADEON_DAC_TVO_EN (1 << 10) -# define RADEON_DAC_VGA_ADR_EN (1 << 13) -# define RADEON_DAC_PDWN (1 << 15) -# define RADEON_DAC_MASK_ALL (0xff << 24) -#define RADEON_DAC_CNTL2 0x007c -# define RADEON_DAC2_TV_CLK_SEL (0 << 1) -# define RADEON_DAC2_DAC_CLK_SEL (1 << 0) -# define RADEON_DAC2_DAC2_CLK_SEL (1 << 1) -# define RADEON_DAC2_PALETTE_ACC_CTL (1 << 5) -# define RADEON_DAC2_CMP_EN (1 << 7) -# define RADEON_DAC2_CMP_OUT_R (1 << 8) -# define RADEON_DAC2_CMP_OUT_G (1 << 9) -# define RADEON_DAC2_CMP_OUT_B (1 << 10) -# define RADEON_DAC2_CMP_OUTPUT (1 << 11) -#define RADEON_DAC_EXT_CNTL 0x0280 -# define RADEON_DAC2_FORCE_BLANK_OFF_EN (1 << 0) -# define RADEON_DAC2_FORCE_DATA_EN (1 << 1) -# define RADEON_DAC_FORCE_BLANK_OFF_EN (1 << 4) -# define RADEON_DAC_FORCE_DATA_EN (1 << 5) -# define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6) -# define RADEON_DAC_FORCE_DATA_SEL_R (0 << 6) -# define RADEON_DAC_FORCE_DATA_SEL_G (1 << 6) -# define RADEON_DAC_FORCE_DATA_SEL_B (2 << 6) -# define RADEON_DAC_FORCE_DATA_SEL_RGB (3 << 6) -# define RADEON_DAC_FORCE_DATA_MASK 0x0003ff00 -# define RADEON_DAC_FORCE_DATA_SHIFT 8 -#define RADEON_DAC_MACRO_CNTL 0x0d04 -# define RADEON_DAC_PDWN_R (1 << 16) -# define RADEON_DAC_PDWN_G (1 << 17) -# define RADEON_DAC_PDWN_B (1 << 18) -#define RADEON_TV_DAC_CNTL 0x088c -# define RADEON_TV_DAC_NBLANK (1 << 0) -# define RADEON_TV_DAC_NHOLD (1 << 1) -# define RADEON_TV_DAC_PEDESTAL (1 << 2) -# define RADEON_TV_MONITOR_DETECT_EN (1 << 4) -# define RADEON_TV_DAC_CMPOUT (1 << 5) -# define RADEON_TV_DAC_STD_MASK (3 << 8) -# define RADEON_TV_DAC_STD_PAL (0 << 8) -# define RADEON_TV_DAC_STD_NTSC (1 << 8) -# define RADEON_TV_DAC_STD_PS2 (2 << 8) -# define RADEON_TV_DAC_STD_RS343 (3 << 8) -# define RADEON_TV_DAC_BGSLEEP (1 << 6) -# define RADEON_TV_DAC_BGADJ_MASK (0xf << 16) -# define RADEON_TV_DAC_BGADJ_SHIFT 16 -# define RADEON_TV_DAC_DACADJ_MASK (0xf << 20) -# define RADEON_TV_DAC_DACADJ_SHIFT 20 -# define RADEON_TV_DAC_RDACPD (1 << 24) -# define RADEON_TV_DAC_GDACPD (1 << 25) -# define RADEON_TV_DAC_BDACPD (1 << 26) -# define RADEON_TV_DAC_RDACDET (1 << 29) -# define RADEON_TV_DAC_GDACDET (1 << 30) -# define RADEON_TV_DAC_BDACDET (1 << 31) -# define R420_TV_DAC_DACADJ_MASK (0x1f << 20) -# define R420_TV_DAC_RDACPD (1 << 25) -# define R420_TV_DAC_GDACPD (1 << 26) -# define R420_TV_DAC_BDACPD (1 << 27) -# define R420_TV_DAC_TVENABLE (1 << 28) -#define RADEON_DISP_HW_DEBUG 0x0d14 -# define RADEON_CRT2_DISP1_SEL (1 << 5) -#define RADEON_DISP_OUTPUT_CNTL 0x0d64 -# define RADEON_DISP_DAC_SOURCE_MASK 0x03 -# define RADEON_DISP_DAC2_SOURCE_MASK 0x0c -# define RADEON_DISP_DAC_SOURCE_CRTC2 0x01 -# define RADEON_DISP_DAC_SOURCE_RMX 0x02 -# define RADEON_DISP_DAC_SOURCE_LTU 0x03 -# define RADEON_DISP_DAC2_SOURCE_CRTC2 0x04 -# define RADEON_DISP_TVDAC_SOURCE_MASK (0x03 << 2) -# define RADEON_DISP_TVDAC_SOURCE_CRTC 0x0 -# define RADEON_DISP_TVDAC_SOURCE_CRTC2 (0x01 << 2) -# define RADEON_DISP_TVDAC_SOURCE_RMX (0x02 << 2) -# define RADEON_DISP_TVDAC_SOURCE_LTU (0x03 << 2) -# define RADEON_DISP_TRANS_MATRIX_MASK (0x03 << 4) -# define RADEON_DISP_TRANS_MATRIX_ALPHA_MSB (0x00 << 4) -# define RADEON_DISP_TRANS_MATRIX_GRAPHICS (0x01 << 4) -# define RADEON_DISP_TRANS_MATRIX_VIDEO (0x02 << 4) -# define RADEON_DISP_TV_SOURCE_CRTC (1 << 16) /* crtc1 or crtc2 */ -# define RADEON_DISP_TV_SOURCE_LTU (0 << 16) /* linear transform unit */ -#define RADEON_DISP_TV_OUT_CNTL 0x0d6c -# define RADEON_DISP_TV_PATH_SRC_CRTC2 (1 << 16) -# define RADEON_DISP_TV_PATH_SRC_CRTC1 (0 << 16) -#define RADEON_DAC_CRC_SIG 0x02cc -#define RADEON_DAC_DATA 0x03c9 /* VGA */ -#define RADEON_DAC_MASK 0x03c6 /* VGA */ -#define RADEON_DAC_R_INDEX 0x03c7 /* VGA */ -#define RADEON_DAC_W_INDEX 0x03c8 /* VGA */ -#define RADEON_DDA_CONFIG 0x02e0 -#define RADEON_DDA_ON_OFF 0x02e4 -#define RADEON_DEFAULT_OFFSET 0x16e0 -#define RADEON_DEFAULT_PITCH 0x16e4 -#define RADEON_DEFAULT_SC_BOTTOM_RIGHT 0x16e8 -# define RADEON_DEFAULT_SC_RIGHT_MAX (0x1fff << 0) -# define RADEON_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16) -#define RADEON_DESTINATION_3D_CLR_CMP_VAL 0x1820 -#define RADEON_DESTINATION_3D_CLR_CMP_MSK 0x1824 -#define RADEON_DEVICE_ID 0x0f02 /* PCI */ -#define RADEON_DISP_MISC_CNTL 0x0d00 -# define RADEON_SOFT_RESET_GRPH_PP (1 << 0) -#define RADEON_DISP_MERGE_CNTL 0x0d60 -# define RADEON_DISP_ALPHA_MODE_MASK 0x03 -# define RADEON_DISP_ALPHA_MODE_KEY 0 -# define RADEON_DISP_ALPHA_MODE_PER_PIXEL 1 -# define RADEON_DISP_ALPHA_MODE_GLOBAL 2 -# define RADEON_DISP_RGB_OFFSET_EN (1 << 8) -# define RADEON_DISP_GRPH_ALPHA_MASK (0xff << 16) -# define RADEON_DISP_OV0_ALPHA_MASK (0xff << 24) -# define RADEON_DISP_LIN_TRANS_BYPASS (0x01 << 9) -#define RADEON_DISP2_MERGE_CNTL 0x0d68 -# define RADEON_DISP2_RGB_OFFSET_EN (1 << 8) -#define RADEON_DISP_LIN_TRANS_GRPH_A 0x0d80 -#define RADEON_DISP_LIN_TRANS_GRPH_B 0x0d84 -#define RADEON_DISP_LIN_TRANS_GRPH_C 0x0d88 -#define RADEON_DISP_LIN_TRANS_GRPH_D 0x0d8c -#define RADEON_DISP_LIN_TRANS_GRPH_E 0x0d90 -#define RADEON_DISP_LIN_TRANS_GRPH_F 0x0d98 -#define RADEON_DP_BRUSH_BKGD_CLR 0x1478 -#define RADEON_DP_BRUSH_FRGD_CLR 0x147c -#define RADEON_DP_CNTL 0x16c0 -# define RADEON_DST_X_LEFT_TO_RIGHT (1 << 0) -# define RADEON_DST_Y_TOP_TO_BOTTOM (1 << 1) -# define RADEON_DP_DST_TILE_LINEAR (0 << 3) -# define RADEON_DP_DST_TILE_MACRO (1 << 3) -# define RADEON_DP_DST_TILE_MICRO (2 << 3) -# define RADEON_DP_DST_TILE_BOTH (3 << 3) -#define RADEON_DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0 -# define RADEON_DST_Y_MAJOR (1 << 2) -# define RADEON_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15) -# define RADEON_DST_X_DIR_LEFT_TO_RIGHT (1 << 31) -#define RADEON_DP_DATATYPE 0x16c4 -# define RADEON_HOST_BIG_ENDIAN_EN (1 << 29) -#define RADEON_DP_GUI_MASTER_CNTL 0x146c -# define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0) -# define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1) -# define RADEON_GMC_SRC_CLIPPING (1 << 2) -# define RADEON_GMC_DST_CLIPPING (1 << 3) -# define RADEON_GMC_BRUSH_DATATYPE_MASK (0x0f << 4) -# define RADEON_GMC_BRUSH_8X8_MONO_FG_BG (0 << 4) -# define RADEON_GMC_BRUSH_8X8_MONO_FG_LA (1 << 4) -# define RADEON_GMC_BRUSH_1X8_MONO_FG_BG (4 << 4) -# define RADEON_GMC_BRUSH_1X8_MONO_FG_LA (5 << 4) -# define RADEON_GMC_BRUSH_32x1_MONO_FG_BG (6 << 4) -# define RADEON_GMC_BRUSH_32x1_MONO_FG_LA (7 << 4) -# define RADEON_GMC_BRUSH_32x32_MONO_FG_BG (8 << 4) -# define RADEON_GMC_BRUSH_32x32_MONO_FG_LA (9 << 4) -# define RADEON_GMC_BRUSH_8x8_COLOR (10 << 4) -# define RADEON_GMC_BRUSH_1X8_COLOR (12 << 4) -# define RADEON_GMC_BRUSH_SOLID_COLOR (13 << 4) -# define RADEON_GMC_BRUSH_NONE (15 << 4) -# define RADEON_GMC_DST_8BPP_CI (2 << 8) -# define RADEON_GMC_DST_15BPP (3 << 8) -# define RADEON_GMC_DST_16BPP (4 << 8) -# define RADEON_GMC_DST_24BPP (5 << 8) -# define RADEON_GMC_DST_32BPP (6 << 8) -# define RADEON_GMC_DST_8BPP_RGB (7 << 8) -# define RADEON_GMC_DST_Y8 (8 << 8) -# define RADEON_GMC_DST_RGB8 (9 << 8) -# define RADEON_GMC_DST_VYUY (11 << 8) -# define RADEON_GMC_DST_YVYU (12 << 8) -# define RADEON_GMC_DST_AYUV444 (14 << 8) -# define RADEON_GMC_DST_ARGB4444 (15 << 8) -# define RADEON_GMC_DST_DATATYPE_MASK (0x0f << 8) -# define RADEON_GMC_DST_DATATYPE_SHIFT 8 -# define RADEON_GMC_SRC_DATATYPE_MASK (3 << 12) -# define RADEON_GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12) -# define RADEON_GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12) -# define RADEON_GMC_SRC_DATATYPE_COLOR (3 << 12) -# define RADEON_GMC_BYTE_PIX_ORDER (1 << 14) -# define RADEON_GMC_BYTE_MSB_TO_LSB (0 << 14) -# define RADEON_GMC_BYTE_LSB_TO_MSB (1 << 14) -# define RADEON_GMC_CONVERSION_TEMP (1 << 15) -# define RADEON_GMC_CONVERSION_TEMP_6500 (0 << 15) -# define RADEON_GMC_CONVERSION_TEMP_9300 (1 << 15) -# define RADEON_GMC_ROP3_MASK (0xff << 16) -# define RADEON_DP_SRC_SOURCE_MASK (7 << 24) -# define RADEON_DP_SRC_SOURCE_MEMORY (2 << 24) -# define RADEON_DP_SRC_SOURCE_HOST_DATA (3 << 24) -# define RADEON_GMC_3D_FCN_EN (1 << 27) -# define RADEON_GMC_CLR_CMP_CNTL_DIS (1 << 28) -# define RADEON_GMC_AUX_CLIP_DIS (1 << 29) -# define RADEON_GMC_WR_MSK_DIS (1 << 30) -# define RADEON_GMC_LD_BRUSH_Y_X (1 << 31) -# define RADEON_ROP3_ZERO 0x00000000 -# define RADEON_ROP3_DSa 0x00880000 -# define RADEON_ROP3_SDna 0x00440000 -# define RADEON_ROP3_S 0x00cc0000 -# define RADEON_ROP3_DSna 0x00220000 -# define RADEON_ROP3_D 0x00aa0000 -# define RADEON_ROP3_DSx 0x00660000 -# define RADEON_ROP3_DSo 0x00ee0000 -# define RADEON_ROP3_DSon 0x00110000 -# define RADEON_ROP3_DSxn 0x00990000 -# define RADEON_ROP3_Dn 0x00550000 -# define RADEON_ROP3_SDno 0x00dd0000 -# define RADEON_ROP3_Sn 0x00330000 -# define RADEON_ROP3_DSno 0x00bb0000 -# define RADEON_ROP3_DSan 0x00770000 -# define RADEON_ROP3_ONE 0x00ff0000 -# define RADEON_ROP3_DPa 0x00a00000 -# define RADEON_ROP3_PDna 0x00500000 -# define RADEON_ROP3_P 0x00f00000 -# define RADEON_ROP3_DPna 0x000a0000 -# define RADEON_ROP3_D 0x00aa0000 -# define RADEON_ROP3_DPx 0x005a0000 -# define RADEON_ROP3_DPo 0x00fa0000 -# define RADEON_ROP3_DPon 0x00050000 -# define RADEON_ROP3_PDxn 0x00a50000 -# define RADEON_ROP3_PDno 0x00f50000 -# define RADEON_ROP3_Pn 0x000f0000 -# define RADEON_ROP3_DPno 0x00af0000 -# define RADEON_ROP3_DPan 0x005f0000 -#define RADEON_DP_GUI_MASTER_CNTL_C 0x1c84 -#define RADEON_DP_MIX 0x16c8 -#define RADEON_DP_SRC_BKGD_CLR 0x15dc -#define RADEON_DP_SRC_FRGD_CLR 0x15d8 -#define RADEON_DP_WRITE_MASK 0x16cc -#define RADEON_DST_BRES_DEC 0x1630 -#define RADEON_DST_BRES_ERR 0x1628 -#define RADEON_DST_BRES_INC 0x162c -#define RADEON_DST_BRES_LNTH 0x1634 -#define RADEON_DST_BRES_LNTH_SUB 0x1638 -#define RADEON_DST_HEIGHT 0x1410 -#define RADEON_DST_HEIGHT_WIDTH 0x143c -#define RADEON_DST_HEIGHT_WIDTH_8 0x158c -#define RADEON_DST_HEIGHT_WIDTH_BW 0x15b4 -#define RADEON_DST_HEIGHT_Y 0x15a0 -#define RADEON_DST_LINE_START 0x1600 -#define RADEON_DST_LINE_END 0x1604 -#define RADEON_DST_LINE_PATCOUNT 0x1608 -# define RADEON_BRES_CNTL_SHIFT 8 -#define RADEON_DST_OFFSET 0x1404 -#define RADEON_DST_PITCH 0x1408 -#define RADEON_DST_PITCH_OFFSET 0x142c -#define RADEON_DST_PITCH_OFFSET_C 0x1c80 -# define RADEON_PITCH_SHIFT 21 -# define RADEON_DST_TILE_LINEAR (0 << 30) -# define RADEON_DST_TILE_MACRO (1 << 30) -# define RADEON_DST_TILE_MICRO (2 << 30) -# define RADEON_DST_TILE_BOTH (3 << 30) -#define RADEON_DST_WIDTH 0x140c -#define RADEON_DST_WIDTH_HEIGHT 0x1598 -#define RADEON_DST_WIDTH_X 0x1588 -#define RADEON_DST_WIDTH_X_INCY 0x159c -#define RADEON_DST_X 0x141c -#define RADEON_DST_X_SUB 0x15a4 -#define RADEON_DST_X_Y 0x1594 -#define RADEON_DST_Y 0x1420 -#define RADEON_DST_Y_SUB 0x15a8 -#define RADEON_DST_Y_X 0x1438 - -#define RADEON_FCP_CNTL 0x0910 -# define RADEON_FCP0_SRC_PCICLK 0 -# define RADEON_FCP0_SRC_PCLK 1 -# define RADEON_FCP0_SRC_PCLKb 2 -# define RADEON_FCP0_SRC_HREF 3 -# define RADEON_FCP0_SRC_GND 4 -# define RADEON_FCP0_SRC_HREFb 5 -#define RADEON_FLUSH_1 0x1704 -#define RADEON_FLUSH_2 0x1708 -#define RADEON_FLUSH_3 0x170c -#define RADEON_FLUSH_4 0x1710 -#define RADEON_FLUSH_5 0x1714 -#define RADEON_FLUSH_6 0x1718 -#define RADEON_FLUSH_7 0x171c -#define RADEON_FOG_3D_TABLE_START 0x1810 -#define RADEON_FOG_3D_TABLE_END 0x1814 -#define RADEON_FOG_3D_TABLE_DENSITY 0x181c -#define RADEON_FOG_TABLE_INDEX 0x1a14 -#define RADEON_FOG_TABLE_DATA 0x1a18 -#define RADEON_FP_CRTC_H_TOTAL_DISP 0x0250 -#define RADEON_FP_CRTC_V_TOTAL_DISP 0x0254 -# define RADEON_FP_CRTC_H_TOTAL_MASK 0x000003ff -# define RADEON_FP_CRTC_H_DISP_MASK 0x01ff0000 -# define RADEON_FP_CRTC_V_TOTAL_MASK 0x00000fff -# define RADEON_FP_CRTC_V_DISP_MASK 0x0fff0000 -# define RADEON_FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8 -# define RADEON_FP_H_SYNC_WID_MASK 0x003f0000 -# define RADEON_FP_V_SYNC_STRT_MASK 0x00000fff -# define RADEON_FP_V_SYNC_WID_MASK 0x001f0000 -# define RADEON_FP_CRTC_H_TOTAL_SHIFT 0x00000000 -# define RADEON_FP_CRTC_H_DISP_SHIFT 0x00000010 -# define RADEON_FP_CRTC_V_TOTAL_SHIFT 0x00000000 -# define RADEON_FP_CRTC_V_DISP_SHIFT 0x00000010 -# define RADEON_FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003 -# define RADEON_FP_H_SYNC_WID_SHIFT 0x00000010 -# define RADEON_FP_V_SYNC_STRT_SHIFT 0x00000000 -# define RADEON_FP_V_SYNC_WID_SHIFT 0x00000010 -#define RADEON_FP_GEN_CNTL 0x0284 -# define RADEON_FP_FPON (1 << 0) -# define RADEON_FP_BLANK_EN (1 << 1) -# define RADEON_FP_TMDS_EN (1 << 2) -# define RADEON_FP_PANEL_FORMAT (1 << 3) -# define RADEON_FP_EN_TMDS (1 << 7) -# define RADEON_FP_DETECT_SENSE (1 << 8) -# define R200_FP_SOURCE_SEL_MASK (3 << 10) -# define R200_FP_SOURCE_SEL_CRTC1 (0 << 10) -# define R200_FP_SOURCE_SEL_CRTC2 (1 << 10) -# define R200_FP_SOURCE_SEL_RMX (2 << 10) -# define R200_FP_SOURCE_SEL_TRANS (3 << 10) -# define RADEON_FP_SEL_CRTC1 (0 << 13) -# define RADEON_FP_SEL_CRTC2 (1 << 13) -# define RADEON_FP_CRTC_DONT_SHADOW_HPAR (1 << 15) -# define RADEON_FP_CRTC_DONT_SHADOW_VPAR (1 << 16) -# define RADEON_FP_CRTC_DONT_SHADOW_HEND (1 << 17) -# define RADEON_FP_CRTC_USE_SHADOW_VEND (1 << 18) -# define RADEON_FP_RMX_HVSYNC_CONTROL_EN (1 << 20) -# define RADEON_FP_DFP_SYNC_SEL (1 << 21) -# define RADEON_FP_CRTC_LOCK_8DOT (1 << 22) -# define RADEON_FP_CRT_SYNC_SEL (1 << 23) -# define RADEON_FP_USE_SHADOW_EN (1 << 24) -# define RADEON_FP_CRT_SYNC_ALT (1 << 26) -#define RADEON_FP2_GEN_CNTL 0x0288 -# define RADEON_FP2_BLANK_EN (1 << 1) -# define RADEON_FP2_ON (1 << 2) -# define RADEON_FP2_PANEL_FORMAT (1 << 3) -# define RADEON_FP2_DETECT_SENSE (1 << 8) -# define R200_FP2_SOURCE_SEL_MASK (3 << 10) -# define R200_FP2_SOURCE_SEL_CRTC1 (0 << 10) -# define R200_FP2_SOURCE_SEL_CRTC2 (1 << 10) -# define R200_FP2_SOURCE_SEL_RMX (2 << 10) -# define R200_FP2_SOURCE_SEL_TRANS_UNIT (3 << 10) -# define RADEON_FP2_SRC_SEL_MASK (3 << 13) -# define RADEON_FP2_SRC_SEL_CRTC2 (1 << 13) -# define RADEON_FP2_FP_POL (1 << 16) -# define RADEON_FP2_LP_POL (1 << 17) -# define RADEON_FP2_SCK_POL (1 << 18) -# define RADEON_FP2_LCD_CNTL_MASK (7 << 19) -# define RADEON_FP2_PAD_FLOP_EN (1 << 22) -# define RADEON_FP2_CRC_EN (1 << 23) -# define RADEON_FP2_CRC_READ_EN (1 << 24) -# define RADEON_FP2_DVO_EN (1 << 25) -# define RADEON_FP2_DVO_RATE_SEL_SDR (1 << 26) -# define R200_FP2_DVO_RATE_SEL_SDR (1 << 27) -# define R300_FP2_DVO_CLOCK_MODE_SINGLE (1 << 28) -# define R300_FP2_DVO_DUAL_CHANNEL_EN (1 << 29) -#define RADEON_FP_H_SYNC_STRT_WID 0x02c4 -#define RADEON_FP_H2_SYNC_STRT_WID 0x03c4 -#define RADEON_FP_HORZ_STRETCH 0x028c -#define RADEON_FP_HORZ2_STRETCH 0x038c -# define RADEON_HORZ_STRETCH_RATIO_MASK 0xffff -# define RADEON_HORZ_STRETCH_RATIO_MAX 4096 -# define RADEON_HORZ_PANEL_SIZE (0x1ff << 16) -# define RADEON_HORZ_PANEL_SHIFT 16 -# define RADEON_HORZ_STRETCH_PIXREP (0 << 25) -# define RADEON_HORZ_STRETCH_BLEND (1 << 26) -# define RADEON_HORZ_STRETCH_ENABLE (1 << 25) -# define RADEON_HORZ_AUTO_RATIO (1 << 27) -# define RADEON_HORZ_FP_LOOP_STRETCH (0x7 << 28) -# define RADEON_HORZ_AUTO_RATIO_INC (1 << 31) -#define RADEON_FP_HORZ_VERT_ACTIVE 0x0278 -#define RADEON_FP_V_SYNC_STRT_WID 0x02c8 -#define RADEON_FP_VERT_STRETCH 0x0290 -#define RADEON_FP_V2_SYNC_STRT_WID 0x03c8 -#define RADEON_FP_VERT2_STRETCH 0x0390 -# define RADEON_VERT_PANEL_SIZE (0xfff << 12) -# define RADEON_VERT_PANEL_SHIFT 12 -# define RADEON_VERT_STRETCH_RATIO_MASK 0xfff -# define RADEON_VERT_STRETCH_RATIO_SHIFT 0 -# define RADEON_VERT_STRETCH_RATIO_MAX 4096 -# define RADEON_VERT_STRETCH_ENABLE (1 << 25) -# define RADEON_VERT_STRETCH_LINEREP (0 << 26) -# define RADEON_VERT_STRETCH_BLEND (1 << 26) -# define RADEON_VERT_AUTO_RATIO_EN (1 << 27) -# define RADEON_VERT_AUTO_RATIO_INC (1 << 31) -# define RADEON_VERT_STRETCH_RESERVED 0x71000000 -#define RS400_FP_2ND_GEN_CNTL 0x0384 -# define RS400_FP_2ND_ON (1 << 0) -# define RS400_FP_2ND_BLANK_EN (1 << 1) -# define RS400_TMDS_2ND_EN (1 << 2) -# define RS400_PANEL_FORMAT_2ND (1 << 3) -# define RS400_FP_2ND_EN_TMDS (1 << 7) -# define RS400_FP_2ND_DETECT_SENSE (1 << 8) -# define RS400_FP_2ND_SOURCE_SEL_MASK (3 << 10) -# define RS400_FP_2ND_SOURCE_SEL_CRTC1 (0 << 10) -# define RS400_FP_2ND_SOURCE_SEL_CRTC2 (1 << 10) -# define RS400_FP_2ND_SOURCE_SEL_RMX (2 << 10) -# define RS400_FP_2ND_DETECT_EN (1 << 12) -# define RS400_HPD_2ND_SEL (1 << 13) -#define RS400_FP2_2_GEN_CNTL 0x0388 -# define RS400_FP2_2_BLANK_EN (1 << 1) -# define RS400_FP2_2_ON (1 << 2) -# define RS400_FP2_2_PANEL_FORMAT (1 << 3) -# define RS400_FP2_2_DETECT_SENSE (1 << 8) -# define RS400_FP2_2_SOURCE_SEL_MASK (3 << 10) -# define RS400_FP2_2_SOURCE_SEL_CRTC1 (0 << 10) -# define RS400_FP2_2_SOURCE_SEL_CRTC2 (1 << 10) -# define RS400_FP2_2_SOURCE_SEL_RMX (2 << 10) -# define RS400_FP2_2_DVO2_EN (1 << 25) -#define RS400_TMDS2_CNTL 0x0394 -#define RS400_TMDS2_TRANSMITTER_CNTL 0x03a4 -# define RS400_TMDS2_PLLEN (1 << 0) -# define RS400_TMDS2_PLLRST (1 << 1) - -#define RADEON_GEN_INT_CNTL 0x0040 -#define RADEON_GEN_INT_STATUS 0x0044 -# define RADEON_VSYNC_INT_AK (1 << 2) -# define RADEON_VSYNC_INT (1 << 2) -# define RADEON_VSYNC2_INT_AK (1 << 6) -# define RADEON_VSYNC2_INT (1 << 6) -#define RADEON_GENENB 0x03c3 /* VGA */ -#define RADEON_GENFC_RD 0x03ca /* VGA */ -#define RADEON_GENFC_WT 0x03da /* VGA, 0x03ba */ -#define RADEON_GENMO_RD 0x03cc /* VGA */ -#define RADEON_GENMO_WT 0x03c2 /* VGA */ -#define RADEON_GENS0 0x03c2 /* VGA */ -#define RADEON_GENS1 0x03da /* VGA, 0x03ba */ -#define RADEON_GPIO_MONID 0x0068 /* DDC interface via I2C */ -#define RADEON_GPIO_MONIDB 0x006c -#define RADEON_GPIO_CRT2_DDC 0x006c -#define RADEON_GPIO_DVI_DDC 0x0064 -#define RADEON_GPIO_VGA_DDC 0x0060 -# define RADEON_GPIO_A_0 (1 << 0) -# define RADEON_GPIO_A_1 (1 << 1) -# define RADEON_GPIO_Y_0 (1 << 8) -# define RADEON_GPIO_Y_1 (1 << 9) -# define RADEON_GPIO_Y_SHIFT_0 8 -# define RADEON_GPIO_Y_SHIFT_1 9 -# define RADEON_GPIO_EN_0 (1 << 16) -# define RADEON_GPIO_EN_1 (1 << 17) -# define RADEON_GPIO_MASK_0 (1 << 24) /*??*/ -# define RADEON_GPIO_MASK_1 (1 << 25) /*??*/ -#define RADEON_GRPH8_DATA 0x03cf /* VGA */ -#define RADEON_GRPH8_IDX 0x03ce /* VGA */ -#define RADEON_GUI_SCRATCH_REG0 0x15e0 -#define RADEON_GUI_SCRATCH_REG1 0x15e4 -#define RADEON_GUI_SCRATCH_REG2 0x15e8 -#define RADEON_GUI_SCRATCH_REG3 0x15ec -#define RADEON_GUI_SCRATCH_REG4 0x15f0 -#define RADEON_GUI_SCRATCH_REG5 0x15f4 - -#define RADEON_HEADER 0x0f0e /* PCI */ -#define RADEON_HOST_DATA0 0x17c0 -#define RADEON_HOST_DATA1 0x17c4 -#define RADEON_HOST_DATA2 0x17c8 -#define RADEON_HOST_DATA3 0x17cc -#define RADEON_HOST_DATA4 0x17d0 -#define RADEON_HOST_DATA5 0x17d4 -#define RADEON_HOST_DATA6 0x17d8 -#define RADEON_HOST_DATA7 0x17dc -#define RADEON_HOST_DATA_LAST 0x17e0 -#define RADEON_HOST_PATH_CNTL 0x0130 -# define RADEON_HDP_SOFT_RESET (1 << 26) -# define RADEON_HDP_APER_CNTL (1 << 23) -#define RADEON_HTOTAL_CNTL 0x0009 /* PLL */ -# define RADEON_HTOT_CNTL_VGA_EN (1 << 28) -#define RADEON_HTOTAL2_CNTL 0x002e /* PLL */ - - /* Multimedia I2C bus */ -#define RADEON_I2C_CNTL_0 0x0090 -#define RADEON_I2C_DONE (1<<0) -#define RADEON_I2C_NACK (1<<1) -#define RADEON_I2C_HALT (1<<2) -#define RADEON_I2C_SOFT_RST (1<<5) -#define RADEON_I2C_DRIVE_EN (1<<6) -#define RADEON_I2C_DRIVE_SEL (1<<7) -#define RADEON_I2C_START (1<<8) -#define RADEON_I2C_STOP (1<<9) -#define RADEON_I2C_RECEIVE (1<<10) -#define RADEON_I2C_ABORT (1<<11) -#define RADEON_I2C_GO (1<<12) -#define RADEON_I2C_CNTL_1 0x0094 -#define RADEON_I2C_SEL (1<<16) -#define RADEON_I2C_EN (1<<17) -#define RADEON_I2C_DATA 0x0098 - -#define RADEON_DVI_I2C_CNTL_0 0x02e0 -#define RADEON_DVI_I2C_CNTL_1 0x02e4 /* ? */ -#define RADEON_DVI_I2C_DATA 0x02e8 - -#define RADEON_INTERRUPT_LINE 0x0f3c /* PCI */ -#define RADEON_INTERRUPT_PIN 0x0f3d /* PCI */ -#define RADEON_IO_BASE 0x0f14 /* PCI */ - -#define RADEON_LATENCY 0x0f0d /* PCI */ -#define RADEON_LEAD_BRES_DEC 0x1608 -#define RADEON_LEAD_BRES_LNTH 0x161c -#define RADEON_LEAD_BRES_LNTH_SUB 0x1624 -#define RADEON_LVDS_GEN_CNTL 0x02d0 -# define RADEON_LVDS_ON (1 << 0) -# define RADEON_LVDS_DISPLAY_DIS (1 << 1) -# define RADEON_LVDS_PANEL_TYPE (1 << 2) -# define RADEON_LVDS_PANEL_FORMAT (1 << 3) -# define RADEON_LVDS_RST_FM (1 << 6) -# define RADEON_LVDS_EN (1 << 7) -# define RADEON_LVDS_BL_MOD_LEVEL_SHIFT 8 -# define RADEON_LVDS_BL_MOD_LEVEL_MASK (0xff << 8) -# define RADEON_LVDS_BL_MOD_EN (1 << 16) -# define RADEON_LVDS_DIGON (1 << 18) -# define RADEON_LVDS_BLON (1 << 19) -# define RADEON_LVDS_SEL_CRTC2 (1 << 23) -#define RADEON_LVDS_PLL_CNTL 0x02d4 -# define RADEON_HSYNC_DELAY_SHIFT 28 -# define RADEON_HSYNC_DELAY_MASK (0xf << 28) -# define RADEON_LVDS_PLL_EN (1 << 16) -# define RADEON_LVDS_PLL_RESET (1 << 17) -# define R300_LVDS_SRC_SEL_MASK (3 << 18) -# define R300_LVDS_SRC_SEL_CRTC1 (0 << 18) -# define R300_LVDS_SRC_SEL_CRTC2 (1 << 18) -# define R300_LVDS_SRC_SEL_RMX (2 << 18) - -#define RADEON_MAX_LATENCY 0x0f3f /* PCI */ -#define RADEON_MC_AGP_LOCATION 0x014c -#define RADEON_MC_FB_LOCATION 0x0148 -#define RADEON_DISPLAY_BASE_ADDR 0x23c -#define RADEON_DISPLAY2_BASE_ADDR 0x33c -#define RADEON_OV0_BASE_ADDR 0x43c -#define RADEON_NB_TOM 0x15c -#define R300_MC_INIT_MISC_LAT_TIMER 0x180 -# define R300_MC_DISP0R_INIT_LAT_SHIFT 8 -# define R300_MC_DISP0R_INIT_LAT_MASK 0xf -# define R300_MC_DISP1R_INIT_LAT_SHIFT 12 -# define R300_MC_DISP1R_INIT_LAT_MASK 0xf -#define RADEON_MCLK_CNTL 0x0012 /* PLL */ -# define RADEON_FORCEON_MCLKA (1 << 16) -# define RADEON_FORCEON_MCLKB (1 << 17) -# define RADEON_FORCEON_YCLKA (1 << 18) -# define RADEON_FORCEON_YCLKB (1 << 19) -# define RADEON_FORCEON_MC (1 << 20) -# define RADEON_FORCEON_AIC (1 << 21) -# define R300_DISABLE_MC_MCLKA (1 << 21) -# define R300_DISABLE_MC_MCLKB (1 << 21) -#define RADEON_MCLK_MISC 0x001f /* PLL */ -# define RADEON_MC_MCLK_MAX_DYN_STOP_LAT (1 << 12) -# define RADEON_IO_MCLK_MAX_DYN_STOP_LAT (1 << 13) -# define RADEON_MC_MCLK_DYN_ENABLE (1 << 14) -# define RADEON_IO_MCLK_DYN_ENABLE (1 << 15) -#define RADEON_LCD_GPIO_MASK 0x01a0 -#define RADEON_GPIOPAD_EN 0x01a0 -#define RADEON_LCD_GPIO_Y_REG 0x01a4 -#define RADEON_MDGPIO_A_REG 0x01ac -#define RADEON_MDGPIO_EN_REG 0x01b0 -#define RADEON_MDGPIO_MASK 0x0198 -#define RADEON_GPIOPAD_MASK 0x0198 -#define RADEON_GPIOPAD_A 0x019c -#define RADEON_MDGPIO_Y_REG 0x01b4 -#define RADEON_MEM_ADDR_CONFIG 0x0148 -#define RADEON_MEM_BASE 0x0f10 /* PCI */ -#define RADEON_MEM_CNTL 0x0140 -# define RADEON_MEM_NUM_CHANNELS_MASK 0x01 -# define RADEON_MEM_USE_B_CH_ONLY (1 << 1) -# define RV100_HALF_MODE (1 << 3) -# define R300_MEM_NUM_CHANNELS_MASK 0x03 -# define R300_MEM_USE_CD_CH_ONLY (1 << 2) -#define RADEON_MEM_TIMING_CNTL 0x0144 /* EXT_MEM_CNTL */ -#define RADEON_MEM_INIT_LAT_TIMER 0x0154 -#define RADEON_MEM_INTF_CNTL 0x014c -#define RADEON_MEM_SDRAM_MODE_REG 0x0158 -# define RADEON_SDRAM_MODE_MASK 0xffff0000 -# define RADEON_B3MEM_RESET_MASK 0x6fffffff -# define RADEON_MEM_CFG_TYPE_DDR (1 << 30) -#define RADEON_MEM_STR_CNTL 0x0150 -# define RADEON_MEM_PWRUP_COMPL_A (1 << 0) -# define RADEON_MEM_PWRUP_COMPL_B (1 << 1) -# define R300_MEM_PWRUP_COMPL_C (1 << 2) -# define R300_MEM_PWRUP_COMPL_D (1 << 3) -# define RADEON_MEM_PWRUP_COMPLETE 0x03 -# define R300_MEM_PWRUP_COMPLETE 0x0f -#define RADEON_MC_STATUS 0x0150 -# define RADEON_MC_IDLE (1 << 2) -# define R300_MC_IDLE (1 << 4) -#define RADEON_MEM_VGA_RP_SEL 0x003c -#define RADEON_MEM_VGA_WP_SEL 0x0038 -#define RADEON_MIN_GRANT 0x0f3e /* PCI */ -#define RADEON_MM_DATA 0x0004 -#define RADEON_MM_INDEX 0x0000 -#define RADEON_MPLL_CNTL 0x000e /* PLL */ -#define RADEON_MPP_TB_CONFIG 0x01c0 /* ? */ -#define RADEON_MPP_GP_CONFIG 0x01c8 /* ? */ -#define RADEON_SEPROM_CNTL1 0x01c0 -# define RADEON_SCK_PRESCALE_SHIFT 24 -# define RADEON_SCK_PRESCALE_MASK (0xff << 24) -#define R300_MC_IND_INDEX 0x01f8 -# define R300_MC_IND_ADDR_MASK 0x3f -# define R300_MC_IND_WR_EN (1 << 8) -#define R300_MC_IND_DATA 0x01fc -#define R300_MC_READ_CNTL_AB 0x017c -# define R300_MEM_RBS_POSITION_A_MASK 0x03 -#define R300_MC_READ_CNTL_CD_mcind 0x24 -# define R300_MEM_RBS_POSITION_C_MASK 0x03 - -#define RADEON_N_VIF_COUNT 0x0248 - -#define RADEON_OV0_AUTO_FLIP_CNTL 0x0470 -# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_NUM 0x00000007 -# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_REPEAT_FIELD 0x00000008 -# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD 0x00000010 -# define RADEON_OV0_AUTO_FLIP_CNTL_IGNORE_REPEAT_FIELD 0x00000020 -# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE 0x00000040 -# define RADEON_OV0_AUTO_FLIP_CNTL_VID_PORT_SELECT 0x00000300 -# define RADEON_OV0_AUTO_FLIP_CNTL_P1_FIRST_LINE_EVEN 0x00010000 -# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_EVEN_DOWN 0x00040000 -# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_ODD_DOWN 0x00080000 -# define RADEON_OV0_AUTO_FLIP_CNTL_FIELD_POL_SOURCE 0x00800000 - -#define RADEON_OV0_COLOUR_CNTL 0x04E0 -#define RADEON_OV0_DEINTERLACE_PATTERN 0x0474 -#define RADEON_OV0_EXCLUSIVE_HORZ 0x0408 -# define RADEON_EXCL_HORZ_START_MASK 0x000000ff -# define RADEON_EXCL_HORZ_END_MASK 0x0000ff00 -# define RADEON_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000 -# define RADEON_EXCL_HORZ_EXCLUSIVE_EN 0x80000000 -#define RADEON_OV0_EXCLUSIVE_VERT 0x040C -# define RADEON_EXCL_VERT_START_MASK 0x000003ff -# define RADEON_EXCL_VERT_END_MASK 0x03ff0000 -#define RADEON_OV0_FILTER_CNTL 0x04A0 -# define RADEON_FILTER_PROGRAMMABLE_COEF 0x0 -# define RADEON_FILTER_HC_COEF_HORZ_Y 0x1 -# define RADEON_FILTER_HC_COEF_HORZ_UV 0x2 -# define RADEON_FILTER_HC_COEF_VERT_Y 0x4 -# define RADEON_FILTER_HC_COEF_VERT_UV 0x8 -# define RADEON_FILTER_HARDCODED_COEF 0xf -# define RADEON_FILTER_COEF_MASK 0xf - -#define RADEON_OV0_FOUR_TAP_COEF_0 0x04B0 -#define RADEON_OV0_FOUR_TAP_COEF_1 0x04B4 -#define RADEON_OV0_FOUR_TAP_COEF_2 0x04B8 -#define RADEON_OV0_FOUR_TAP_COEF_3 0x04BC -#define RADEON_OV0_FOUR_TAP_COEF_4 0x04C0 -#define RADEON_OV0_FLAG_CNTL 0x04DC -#define RADEON_OV0_GAMMA_000_00F 0x0d40 -#define RADEON_OV0_GAMMA_010_01F 0x0d44 -#define RADEON_OV0_GAMMA_020_03F 0x0d48 -#define RADEON_OV0_GAMMA_040_07F 0x0d4c -#define RADEON_OV0_GAMMA_080_0BF 0x0e00 -#define RADEON_OV0_GAMMA_0C0_0FF 0x0e04 -#define RADEON_OV0_GAMMA_100_13F 0x0e08 -#define RADEON_OV0_GAMMA_140_17F 0x0e0c -#define RADEON_OV0_GAMMA_180_1BF 0x0e10 -#define RADEON_OV0_GAMMA_1C0_1FF 0x0e14 -#define RADEON_OV0_GAMMA_200_23F 0x0e18 -#define RADEON_OV0_GAMMA_240_27F 0x0e1c -#define RADEON_OV0_GAMMA_280_2BF 0x0e20 -#define RADEON_OV0_GAMMA_2C0_2FF 0x0e24 -#define RADEON_OV0_GAMMA_300_33F 0x0e28 -#define RADEON_OV0_GAMMA_340_37F 0x0e2c -#define RADEON_OV0_GAMMA_380_3BF 0x0d50 -#define RADEON_OV0_GAMMA_3C0_3FF 0x0d54 -#define RADEON_OV0_GRAPHICS_KEY_CLR_LOW 0x04EC -#define RADEON_OV0_GRAPHICS_KEY_CLR_HIGH 0x04F0 -#define RADEON_OV0_H_INC 0x0480 -#define RADEON_OV0_KEY_CNTL 0x04F4 -# define RADEON_VIDEO_KEY_FN_MASK 0x00000003L -# define RADEON_VIDEO_KEY_FN_FALSE 0x00000000L -# define RADEON_VIDEO_KEY_FN_TRUE 0x00000001L -# define RADEON_VIDEO_KEY_FN_EQ 0x00000002L -# define RADEON_VIDEO_KEY_FN_NE 0x00000003L -# define RADEON_GRAPHIC_KEY_FN_MASK 0x00000030L -# define RADEON_GRAPHIC_KEY_FN_FALSE 0x00000000L -# define RADEON_GRAPHIC_KEY_FN_TRUE 0x00000010L -# define RADEON_GRAPHIC_KEY_FN_EQ 0x00000020L -# define RADEON_GRAPHIC_KEY_FN_NE 0x00000030L -# define RADEON_CMP_MIX_MASK 0x00000100L -# define RADEON_CMP_MIX_OR 0x00000000L -# define RADEON_CMP_MIX_AND 0x00000100L -#define RADEON_OV0_LIN_TRANS_A 0x0d20 -#define RADEON_OV0_LIN_TRANS_B 0x0d24 -#define RADEON_OV0_LIN_TRANS_C 0x0d28 -#define RADEON_OV0_LIN_TRANS_D 0x0d2c -#define RADEON_OV0_LIN_TRANS_E 0x0d30 -#define RADEON_OV0_LIN_TRANS_F 0x0d34 -#define RADEON_OV0_P1_BLANK_LINES_AT_TOP 0x0430 -# define RADEON_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL -# define RADEON_P1_ACTIVE_LINES_M1 0x0fff0000L -#define RADEON_OV0_P1_H_ACCUM_INIT 0x0488 -#define RADEON_OV0_P1_V_ACCUM_INIT 0x0428 -# define RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L -# define RADEON_OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L -#define RADEON_OV0_P1_X_START_END 0x0494 -#define RADEON_OV0_P2_X_START_END 0x0498 -#define RADEON_OV0_P23_BLANK_LINES_AT_TOP 0x0434 -# define RADEON_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL -# define RADEON_P23_ACTIVE_LINES_M1 0x07ff0000L -#define RADEON_OV0_P23_H_ACCUM_INIT 0x048C -#define RADEON_OV0_P23_V_ACCUM_INIT 0x042C -#define RADEON_OV0_P3_X_START_END 0x049C -#define RADEON_OV0_REG_LOAD_CNTL 0x0410 -# define RADEON_REG_LD_CTL_LOCK 0x00000001L -# define RADEON_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L -# define RADEON_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L -# define RADEON_REG_LD_CTL_LOCK_READBACK 0x00000008L -# define RADEON_REG_LD_CTL_FLIP_READBACK 0x00000010L -#define RADEON_OV0_SCALE_CNTL 0x0420 -# define RADEON_SCALER_HORZ_PICK_NEAREST 0x00000004L -# define RADEON_SCALER_VERT_PICK_NEAREST 0x00000008L -# define RADEON_SCALER_SIGNED_UV 0x00000010L -# define RADEON_SCALER_GAMMA_SEL_MASK 0x00000060L -# define RADEON_SCALER_GAMMA_SEL_BRIGHT 0x00000000L -# define RADEON_SCALER_GAMMA_SEL_G22 0x00000020L -# define RADEON_SCALER_GAMMA_SEL_G18 0x00000040L -# define RADEON_SCALER_GAMMA_SEL_G14 0x00000060L -# define RADEON_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L -# define RADEON_SCALER_SURFAC_FORMAT 0x00000f00L -# define RADEON_SCALER_SOURCE_15BPP 0x00000300L -# define RADEON_SCALER_SOURCE_16BPP 0x00000400L -# define RADEON_SCALER_SOURCE_32BPP 0x00000600L -# define RADEON_SCALER_SOURCE_YUV9 0x00000900L -# define RADEON_SCALER_SOURCE_YUV12 0x00000A00L -# define RADEON_SCALER_SOURCE_VYUY422 0x00000B00L -# define RADEON_SCALER_SOURCE_YVYU422 0x00000C00L -# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L -# define RADEON_SCALER_TEMPORAL_DEINT 0x00002000L -# define RADEON_SCALER_CRTC_SEL 0x00004000L -# define RADEON_SCALER_SMART_SWITCH 0x00008000L -# define RADEON_SCALER_BURST_PER_PLANE 0x007F0000L -# define RADEON_SCALER_DOUBLE_BUFFER 0x01000000L -# define RADEON_SCALER_DIS_LIMIT 0x08000000L -# define RADEON_SCALER_LIN_TRANS_BYPASS 0x10000000L -# define RADEON_SCALER_INT_EMU 0x20000000L -# define RADEON_SCALER_ENABLE 0x40000000L -# define RADEON_SCALER_SOFT_RESET 0x80000000L -#define RADEON_OV0_STEP_BY 0x0484 -#define RADEON_OV0_TEST 0x04F8 -#define RADEON_OV0_V_INC 0x0424 -#define RADEON_OV0_VID_BUF_PITCH0_VALUE 0x0460 -#define RADEON_OV0_VID_BUF_PITCH1_VALUE 0x0464 -#define RADEON_OV0_VID_BUF0_BASE_ADRS 0x0440 -# define RADEON_VIF_BUF0_PITCH_SEL 0x00000001L -# define RADEON_VIF_BUF0_TILE_ADRS 0x00000002L -# define RADEON_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L -# define RADEON_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L -#define RADEON_OV0_VID_BUF1_BASE_ADRS 0x0444 -# define RADEON_VIF_BUF1_PITCH_SEL 0x00000001L -# define RADEON_VIF_BUF1_TILE_ADRS 0x00000002L -# define RADEON_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L -# define RADEON_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L -#define RADEON_OV0_VID_BUF2_BASE_ADRS 0x0448 -# define RADEON_VIF_BUF2_PITCH_SEL 0x00000001L -# define RADEON_VIF_BUF2_TILE_ADRS 0x00000002L -# define RADEON_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L -# define RADEON_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L -#define RADEON_OV0_VID_BUF3_BASE_ADRS 0x044C -#define RADEON_OV0_VID_BUF4_BASE_ADRS 0x0450 -#define RADEON_OV0_VID_BUF5_BASE_ADRS 0x0454 -#define RADEON_OV0_VIDEO_KEY_CLR_HIGH 0x04E8 -#define RADEON_OV0_VIDEO_KEY_CLR_LOW 0x04E4 -#define RADEON_OV0_Y_X_START 0x0400 -#define RADEON_OV0_Y_X_END 0x0404 -#define RADEON_OV1_Y_X_START 0x0600 -#define RADEON_OV1_Y_X_END 0x0604 -#define RADEON_OVR_CLR 0x0230 -#define RADEON_OVR_WID_LEFT_RIGHT 0x0234 -#define RADEON_OVR_WID_TOP_BOTTOM 0x0238 - -/* first capture unit */ - -#define RADEON_CAP0_BUF0_OFFSET 0x0920 -#define RADEON_CAP0_BUF1_OFFSET 0x0924 -#define RADEON_CAP0_BUF0_EVEN_OFFSET 0x0928 -#define RADEON_CAP0_BUF1_EVEN_OFFSET 0x092C - -#define RADEON_CAP0_BUF_PITCH 0x0930 -#define RADEON_CAP0_V_WINDOW 0x0934 -#define RADEON_CAP0_H_WINDOW 0x0938 -#define RADEON_CAP0_VBI0_OFFSET 0x093C -#define RADEON_CAP0_VBI1_OFFSET 0x0940 -#define RADEON_CAP0_VBI_V_WINDOW 0x0944 -#define RADEON_CAP0_VBI_H_WINDOW 0x0948 -#define RADEON_CAP0_PORT_MODE_CNTL 0x094C -#define RADEON_CAP0_TRIG_CNTL 0x0950 -#define RADEON_CAP0_DEBUG 0x0954 -#define RADEON_CAP0_CONFIG 0x0958 -# define RADEON_CAP0_CONFIG_CONTINUOS 0x00000001 -# define RADEON_CAP0_CONFIG_START_FIELD_EVEN 0x00000002 -# define RADEON_CAP0_CONFIG_START_BUF_GET 0x00000004 -# define RADEON_CAP0_CONFIG_START_BUF_SET 0x00000008 -# define RADEON_CAP0_CONFIG_BUF_TYPE_ALT 0x00000010 -# define RADEON_CAP0_CONFIG_BUF_TYPE_FRAME 0x00000020 -# define RADEON_CAP0_CONFIG_ONESHOT_MODE_FRAME 0x00000040 -# define RADEON_CAP0_CONFIG_BUF_MODE_DOUBLE 0x00000080 -# define RADEON_CAP0_CONFIG_BUF_MODE_TRIPLE 0x00000100 -# define RADEON_CAP0_CONFIG_MIRROR_EN 0x00000200 -# define RADEON_CAP0_CONFIG_ONESHOT_MIRROR_EN 0x00000400 -# define RADEON_CAP0_CONFIG_VIDEO_SIGNED_UV 0x00000800 -# define RADEON_CAP0_CONFIG_ANC_DECODE_EN 0x00001000 -# define RADEON_CAP0_CONFIG_VBI_EN 0x00002000 -# define RADEON_CAP0_CONFIG_SOFT_PULL_DOWN_EN 0x00004000 -# define RADEON_CAP0_CONFIG_VIP_EXTEND_FLAG_EN 0x00008000 -# define RADEON_CAP0_CONFIG_FAKE_FIELD_EN 0x00010000 -# define RADEON_CAP0_CONFIG_ODD_ONE_MORE_LINE 0x00020000 -# define RADEON_CAP0_CONFIG_EVEN_ONE_MORE_LINE 0x00040000 -# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_2 0x00080000 -# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_4 0x00100000 -# define RADEON_CAP0_CONFIG_VERT_DIVIDE_2 0x00200000 -# define RADEON_CAP0_CONFIG_VERT_DIVIDE_4 0x00400000 -# define RADEON_CAP0_CONFIG_FORMAT_BROOKTREE 0x00000000 -# define RADEON_CAP0_CONFIG_FORMAT_CCIR656 0x00800000 -# define RADEON_CAP0_CONFIG_FORMAT_ZV 0x01000000 -# define RADEON_CAP0_CONFIG_FORMAT_VIP 0x01800000 -# define RADEON_CAP0_CONFIG_FORMAT_TRANSPORT 0x02000000 -# define RADEON_CAP0_CONFIG_HORZ_DECIMATOR 0x04000000 -# define RADEON_CAP0_CONFIG_VIDEO_IN_YVYU422 0x00000000 -# define RADEON_CAP0_CONFIG_VIDEO_IN_VYUY422 0x20000000 -# define RADEON_CAP0_CONFIG_VBI_DIVIDE_2 0x40000000 -# define RADEON_CAP0_CONFIG_VBI_DIVIDE_4 0x80000000 -#define RADEON_CAP0_ANC_ODD_OFFSET 0x095C -#define RADEON_CAP0_ANC_EVEN_OFFSET 0x0960 -#define RADEON_CAP0_ANC_H_WINDOW 0x0964 -#define RADEON_CAP0_VIDEO_SYNC_TEST 0x0968 -#define RADEON_CAP0_ONESHOT_BUF_OFFSET 0x096C -#define RADEON_CAP0_BUF_STATUS 0x0970 -/* #define RADEON_CAP0_DWNSC_XRATIO 0x0978 */ -/* #define RADEON_CAP0_XSHARPNESS 0x097C */ -#define RADEON_CAP0_VBI2_OFFSET 0x0980 -#define RADEON_CAP0_VBI3_OFFSET 0x0984 -#define RADEON_CAP0_ANC2_OFFSET 0x0988 -#define RADEON_CAP0_ANC3_OFFSET 0x098C -#define RADEON_VID_BUFFER_CONTROL 0x0900 - -/* second capture unit */ - -#define RADEON_CAP1_BUF0_OFFSET 0x0990 -#define RADEON_CAP1_BUF1_OFFSET 0x0994 -#define RADEON_CAP1_BUF0_EVEN_OFFSET 0x0998 -#define RADEON_CAP1_BUF1_EVEN_OFFSET 0x099C - -#define RADEON_CAP1_BUF_PITCH 0x09A0 -#define RADEON_CAP1_V_WINDOW 0x09A4 -#define RADEON_CAP1_H_WINDOW 0x09A8 -#define RADEON_CAP1_VBI_ODD_OFFSET 0x09AC -#define RADEON_CAP1_VBI_EVEN_OFFSET 0x09B0 -#define RADEON_CAP1_VBI_V_WINDOW 0x09B4 -#define RADEON_CAP1_VBI_H_WINDOW 0x09B8 -#define RADEON_CAP1_PORT_MODE_CNTL 0x09BC -#define RADEON_CAP1_TRIG_CNTL 0x09C0 -#define RADEON_CAP1_DEBUG 0x09C4 -#define RADEON_CAP1_CONFIG 0x09C8 -#define RADEON_CAP1_ANC_ODD_OFFSET 0x09CC -#define RADEON_CAP1_ANC_EVEN_OFFSET 0x09D0 -#define RADEON_CAP1_ANC_H_WINDOW 0x09D4 -#define RADEON_CAP1_VIDEO_SYNC_TEST 0x09D8 -#define RADEON_CAP1_ONESHOT_BUF_OFFSET 0x09DC -#define RADEON_CAP1_BUF_STATUS 0x09E0 -#define RADEON_CAP1_DWNSC_XRATIO 0x09E8 -#define RADEON_CAP1_XSHARPNESS 0x09EC - -/* misc multimedia registers */ - -#define RADEON_IDCT_RUNS 0x1F80 -#define RADEON_IDCT_LEVELS 0x1F84 -#define RADEON_IDCT_CONTROL 0x1FBC -#define RADEON_IDCT_AUTH_CONTROL 0x1F88 -#define RADEON_IDCT_AUTH 0x1F8C - -#define RADEON_P2PLL_CNTL 0x002a /* P2PLL */ -# define RADEON_P2PLL_RESET (1 << 0) -# define RADEON_P2PLL_SLEEP (1 << 1) -# define RADEON_P2PLL_PVG_MASK (7 << 11) -# define RADEON_P2PLL_PVG_SHIFT 11 -# define RADEON_P2PLL_ATOMIC_UPDATE_EN (1 << 16) -# define RADEON_P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17) -# define RADEON_P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18) -#define RADEON_P2PLL_DIV_0 0x002c -# define RADEON_P2PLL_FB0_DIV_MASK 0x07ff -# define RADEON_P2PLL_POST0_DIV_MASK 0x00070000 -#define RADEON_P2PLL_REF_DIV 0x002B /* PLL */ -# define RADEON_P2PLL_REF_DIV_MASK 0x03ff -# define RADEON_P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ -# define RADEON_P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ -# define R300_PPLL_REF_DIV_ACC_MASK (0x3ff << 18) -# define R300_PPLL_REF_DIV_ACC_SHIFT 18 -#define RADEON_PALETTE_DATA 0x00b4 -#define RADEON_PALETTE_30_DATA 0x00b8 -#define RADEON_PALETTE_INDEX 0x00b0 -#define RADEON_PCI_GART_PAGE 0x017c -#define RADEON_PIXCLKS_CNTL 0x002d -# define RADEON_PIX2CLK_SRC_SEL_MASK 0x03 -# define RADEON_PIX2CLK_SRC_SEL_CPUCLK 0x00 -# define RADEON_PIX2CLK_SRC_SEL_PSCANCLK 0x01 -# define RADEON_PIX2CLK_SRC_SEL_BYTECLK 0x02 -# define RADEON_PIX2CLK_SRC_SEL_P2PLLCLK 0x03 -# define RADEON_PIX2CLK_ALWAYS_ONb (1<<6) -# define RADEON_PIX2CLK_DAC_ALWAYS_ONb (1<<7) -# define RADEON_PIXCLK_TV_SRC_SEL (1 << 8) -# define RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb (1 << 9) -# define R300_DVOCLK_ALWAYS_ONb (1 << 10) -# define RADEON_PIXCLK_BLEND_ALWAYS_ONb (1 << 11) -# define RADEON_PIXCLK_GV_ALWAYS_ONb (1 << 12) -# define RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb (1 << 13) -# define R300_PIXCLK_DVO_ALWAYS_ONb (1 << 13) -# define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) -# define RADEON_PIXCLK_TMDS_ALWAYS_ONb (1 << 15) -# define R300_PIXCLK_TRANS_ALWAYS_ONb (1 << 16) -# define R300_PIXCLK_TVO_ALWAYS_ONb (1 << 17) -# define R300_P2G2CLK_ALWAYS_ONb (1 << 18) -# define R300_P2G2CLK_DAC_ALWAYS_ONb (1 << 19) -# define R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23) -#define RADEON_PLANE_3D_MASK_C 0x1d44 -#define RADEON_PLL_TEST_CNTL 0x0013 /* PLL */ -# define RADEON_PLL_MASK_READ_B (1 << 9) -#define RADEON_PMI_CAP_ID 0x0f5c /* PCI */ -#define RADEON_PMI_DATA 0x0f63 /* PCI */ -#define RADEON_PMI_NXT_CAP_PTR 0x0f5d /* PCI */ -#define RADEON_PMI_PMC_REG 0x0f5e /* PCI */ -#define RADEON_PMI_PMCSR_REG 0x0f60 /* PCI */ -#define RADEON_PMI_REGISTER 0x0f5c /* PCI */ -#define RADEON_PPLL_CNTL 0x0002 /* PLL */ -# define RADEON_PPLL_RESET (1 << 0) -# define RADEON_PPLL_SLEEP (1 << 1) -# define RADEON_PPLL_PVG_MASK (7 << 11) -# define RADEON_PPLL_PVG_SHIFT 11 -# define RADEON_PPLL_ATOMIC_UPDATE_EN (1 << 16) -# define RADEON_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17) -# define RADEON_PPLL_ATOMIC_UPDATE_VSYNC (1 << 18) -#define RADEON_PPLL_DIV_0 0x0004 /* PLL */ -#define RADEON_PPLL_DIV_1 0x0005 /* PLL */ -#define RADEON_PPLL_DIV_2 0x0006 /* PLL */ -#define RADEON_PPLL_DIV_3 0x0007 /* PLL */ -# define RADEON_PPLL_FB3_DIV_MASK 0x07ff -# define RADEON_PPLL_POST3_DIV_MASK 0x00070000 -#define RADEON_PPLL_REF_DIV 0x0003 /* PLL */ -# define RADEON_PPLL_REF_DIV_MASK 0x03ff -# define RADEON_PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ -# define RADEON_PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ -#define RADEON_PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */ - -#define RADEON_RBBM_GUICNTL 0x172c -# define RADEON_HOST_DATA_SWAP_NONE (0 << 0) -# define RADEON_HOST_DATA_SWAP_16BIT (1 << 0) -# define RADEON_HOST_DATA_SWAP_32BIT (2 << 0) -# define RADEON_HOST_DATA_SWAP_HDW (3 << 0) -#define RADEON_RBBM_SOFT_RESET 0x00f0 -# define RADEON_SOFT_RESET_CP (1 << 0) -# define RADEON_SOFT_RESET_HI (1 << 1) -# define RADEON_SOFT_RESET_SE (1 << 2) -# define RADEON_SOFT_RESET_RE (1 << 3) -# define RADEON_SOFT_RESET_PP (1 << 4) -# define RADEON_SOFT_RESET_E2 (1 << 5) -# define RADEON_SOFT_RESET_RB (1 << 6) -# define RADEON_SOFT_RESET_HDP (1 << 7) -#define RADEON_RBBM_STATUS 0x0e40 -# define RADEON_RBBM_FIFOCNT_MASK 0x007f -# define RADEON_RBBM_ACTIVE (1 << 31) -#define RADEON_RB2D_DSTCACHE_CTLSTAT 0x342c -# define RADEON_RB2D_DC_FLUSH (3 << 0) -# define RADEON_RB2D_DC_FREE (3 << 2) -# define RADEON_RB2D_DC_FLUSH_ALL 0xf -# define RADEON_RB2D_DC_BUSY (1 << 31) -#define RADEON_RB2D_DSTCACHE_MODE 0x3428 -#define RADEON_DSTCACHE_CTLSTAT 0x1714 - -#define RADEON_RB3D_ZCACHE_MODE 0x3250 -#define RADEON_RB3D_ZCACHE_CTLSTAT 0x3254 -# define RADEON_RB3D_ZC_FLUSH_ALL 0x5 -#define RADEON_RB3D_DSTCACHE_MODE 0x3258 -# define RADEON_RB3D_DC_CACHE_ENABLE (0) -# define RADEON_RB3D_DC_2D_CACHE_DISABLE (1) -# define RADEON_RB3D_DC_3D_CACHE_DISABLE (2) -# define RADEON_RB3D_DC_CACHE_DISABLE (3) -# define RADEON_RB3D_DC_2D_CACHE_LINESIZE_128 (1 << 2) -# define RADEON_RB3D_DC_3D_CACHE_LINESIZE_128 (2 << 2) -# define RADEON_RB3D_DC_2D_CACHE_AUTOFLUSH (1 << 8) -# define RADEON_RB3D_DC_3D_CACHE_AUTOFLUSH (2 << 8) -# define R200_RB3D_DC_2D_CACHE_AUTOFREE (1 << 10) -# define R200_RB3D_DC_3D_CACHE_AUTOFREE (2 << 10) -# define RADEON_RB3D_DC_FORCE_RMW (1 << 16) -# define RADEON_RB3D_DC_DISABLE_RI_FILL (1 << 24) -# define RADEON_RB3D_DC_DISABLE_RI_READ (1 << 25) - -#define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325C -# define RADEON_RB3D_DC_FLUSH (3 << 0) -# define RADEON_RB3D_DC_FREE (3 << 2) -# define RADEON_RB3D_DC_FLUSH_ALL 0xf -# define RADEON_RB3D_DC_BUSY (1 << 31) - -#define RADEON_REG_BASE 0x0f18 /* PCI */ -#define RADEON_REGPROG_INF 0x0f09 /* PCI */ -#define RADEON_REVISION_ID 0x0f08 /* PCI */ - -#define RADEON_SC_BOTTOM 0x164c -#define RADEON_SC_BOTTOM_RIGHT 0x16f0 -#define RADEON_SC_BOTTOM_RIGHT_C 0x1c8c -#define RADEON_SC_LEFT 0x1640 -#define RADEON_SC_RIGHT 0x1644 -#define RADEON_SC_TOP 0x1648 -#define RADEON_SC_TOP_LEFT 0x16ec -#define RADEON_SC_TOP_LEFT_C 0x1c88 -# define RADEON_SC_SIGN_MASK_LO 0x8000 -# define RADEON_SC_SIGN_MASK_HI 0x80000000 -#define RADEON_SCLK_CNTL 0x000d /* PLL */ -# define RADEON_SCLK_SRC_SEL_MASK 0x0007 -# define RADEON_DYN_STOP_LAT_MASK 0x00007ff8 -# define RADEON_CP_MAX_DYN_STOP_LAT 0x0008 -# define RADEON_SCLK_FORCEON_MASK 0xffff8000 -# define RADEON_SCLK_FORCE_DISP2 (1<<15) -# define RADEON_SCLK_FORCE_CP (1<<16) -# define RADEON_SCLK_FORCE_HDP (1<<17) -# define RADEON_SCLK_FORCE_DISP1 (1<<18) -# define RADEON_SCLK_FORCE_TOP (1<<19) -# define RADEON_SCLK_FORCE_E2 (1<<20) -# define RADEON_SCLK_FORCE_SE (1<<21) -# define RADEON_SCLK_FORCE_IDCT (1<<22) -# define RADEON_SCLK_FORCE_VIP (1<<23) -# define RADEON_SCLK_FORCE_RE (1<<24) -# define RADEON_SCLK_FORCE_PB (1<<25) -# define RADEON_SCLK_FORCE_TAM (1<<26) -# define RADEON_SCLK_FORCE_TDM (1<<27) -# define RADEON_SCLK_FORCE_RB (1<<28) -# define RADEON_SCLK_FORCE_TV_SCLK (1<<29) -# define RADEON_SCLK_FORCE_SUBPIC (1<<30) -# define RADEON_SCLK_FORCE_OV0 (1<<31) -# define R300_SCLK_FORCE_VAP (1<<21) -# define R300_SCLK_FORCE_SR (1<<25) -# define R300_SCLK_FORCE_PX (1<<26) -# define R300_SCLK_FORCE_TX (1<<27) -# define R300_SCLK_FORCE_US (1<<28) -# define R300_SCLK_FORCE_SU (1<<30) -#define R300_SCLK_CNTL2 0x1e /* PLL */ -# define R300_SCLK_TCL_MAX_DYN_STOP_LAT (1<<10) -# define R300_SCLK_GA_MAX_DYN_STOP_LAT (1<<11) -# define R300_SCLK_CBA_MAX_DYN_STOP_LAT (1<<12) -# define R300_SCLK_FORCE_TCL (1<<13) -# define R300_SCLK_FORCE_CBA (1<<14) -# define R300_SCLK_FORCE_GA (1<<15) -#define RADEON_SCLK_MORE_CNTL 0x0035 /* PLL */ -# define RADEON_SCLK_MORE_MAX_DYN_STOP_LAT 0x0007 -# define RADEON_SCLK_MORE_FORCEON 0x0700 -#define RADEON_SDRAM_MODE_REG 0x0158 -#define RADEON_SEQ8_DATA 0x03c5 /* VGA */ -#define RADEON_SEQ8_IDX 0x03c4 /* VGA */ -#define RADEON_SNAPSHOT_F_COUNT 0x0244 -#define RADEON_SNAPSHOT_VH_COUNTS 0x0240 -#define RADEON_SNAPSHOT_VIF_COUNT 0x024c -#define RADEON_SRC_OFFSET 0x15ac -#define RADEON_SRC_PITCH 0x15b0 -#define RADEON_SRC_PITCH_OFFSET 0x1428 -#define RADEON_SRC_SC_BOTTOM 0x165c -#define RADEON_SRC_SC_BOTTOM_RIGHT 0x16f4 -#define RADEON_SRC_SC_RIGHT 0x1654 -#define RADEON_SRC_X 0x1414 -#define RADEON_SRC_X_Y 0x1590 -#define RADEON_SRC_Y 0x1418 -#define RADEON_SRC_Y_X 0x1434 -#define RADEON_STATUS 0x0f06 /* PCI */ -#define RADEON_SUBPIC_CNTL 0x0540 /* ? */ -#define RADEON_SUB_CLASS 0x0f0a /* PCI */ -#define RADEON_SURFACE_CNTL 0x0b00 -# define RADEON_SURF_TRANSLATION_DIS (1 << 8) -# define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20) -# define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21) -# define RADEON_NONSURF_AP1_SWP_16BPP (1 << 22) -# define RADEON_NONSURF_AP1_SWP_32BPP (1 << 23) -#define RADEON_SURFACE0_INFO 0x0b0c -# define RADEON_SURF_TILE_COLOR_MACRO (0 << 16) -# define RADEON_SURF_TILE_COLOR_BOTH (1 << 16) -# define RADEON_SURF_TILE_DEPTH_32BPP (2 << 16) -# define RADEON_SURF_TILE_DEPTH_16BPP (3 << 16) -# define R200_SURF_TILE_NONE (0 << 16) -# define R200_SURF_TILE_COLOR_MACRO (1 << 16) -# define R200_SURF_TILE_COLOR_MICRO (2 << 16) -# define R200_SURF_TILE_COLOR_BOTH (3 << 16) -# define R200_SURF_TILE_DEPTH_32BPP (4 << 16) -# define R200_SURF_TILE_DEPTH_16BPP (5 << 16) -# define R300_SURF_TILE_NONE (0 << 16) -# define R300_SURF_TILE_COLOR_MACRO (1 << 16) -# define R300_SURF_TILE_DEPTH_32BPP (2 << 16) -# define RADEON_SURF_AP0_SWP_16BPP (1 << 20) -# define RADEON_SURF_AP0_SWP_32BPP (1 << 21) -# define RADEON_SURF_AP1_SWP_16BPP (1 << 22) -# define RADEON_SURF_AP1_SWP_32BPP (1 << 23) -#define RADEON_SURFACE0_LOWER_BOUND 0x0b04 -#define RADEON_SURFACE0_UPPER_BOUND 0x0b08 -#define RADEON_SURFACE1_INFO 0x0b1c -#define RADEON_SURFACE1_LOWER_BOUND 0x0b14 -#define RADEON_SURFACE1_UPPER_BOUND 0x0b18 -#define RADEON_SURFACE2_INFO 0x0b2c -#define RADEON_SURFACE2_LOWER_BOUND 0x0b24 -#define RADEON_SURFACE2_UPPER_BOUND 0x0b28 -#define RADEON_SURFACE3_INFO 0x0b3c -#define RADEON_SURFACE3_LOWER_BOUND 0x0b34 -#define RADEON_SURFACE3_UPPER_BOUND 0x0b38 -#define RADEON_SURFACE4_INFO 0x0b4c -#define RADEON_SURFACE4_LOWER_BOUND 0x0b44 -#define RADEON_SURFACE4_UPPER_BOUND 0x0b48 -#define RADEON_SURFACE5_INFO 0x0b5c -#define RADEON_SURFACE5_LOWER_BOUND 0x0b54 -#define RADEON_SURFACE5_UPPER_BOUND 0x0b58 -#define RADEON_SURFACE6_INFO 0x0b6c -#define RADEON_SURFACE6_LOWER_BOUND 0x0b64 -#define RADEON_SURFACE6_UPPER_BOUND 0x0b68 -#define RADEON_SURFACE7_INFO 0x0b7c -#define RADEON_SURFACE7_LOWER_BOUND 0x0b74 -#define RADEON_SURFACE7_UPPER_BOUND 0x0b78 -#define RADEON_SW_SEMAPHORE 0x013c - -#define RADEON_TEST_DEBUG_CNTL 0x0120 -#define RADEON_TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN 0x00000001 - -#define RADEON_TEST_DEBUG_MUX 0x0124 -#define RADEON_TEST_DEBUG_OUT 0x012c -#define RADEON_TMDS_PLL_CNTL 0x02a8 -#define RADEON_TMDS_TRANSMITTER_CNTL 0x02a4 -# define RADEON_TMDS_TRANSMITTER_PLLEN 1 -# define RADEON_TMDS_TRANSMITTER_PLLRST 2 -#define RADEON_TRAIL_BRES_DEC 0x1614 -#define RADEON_TRAIL_BRES_ERR 0x160c -#define RADEON_TRAIL_BRES_INC 0x1610 -#define RADEON_TRAIL_X 0x1618 -#define RADEON_TRAIL_X_SUB 0x1620 - -#define RADEON_VCLK_ECP_CNTL 0x0008 /* PLL */ -# define RADEON_VCLK_SRC_SEL_MASK 0x03 -# define RADEON_VCLK_SRC_SEL_CPUCLK 0x00 -# define RADEON_VCLK_SRC_SEL_PSCANCLK 0x01 -# define RADEON_VCLK_SRC_SEL_BYTECLK 0x02 -# define RADEON_VCLK_SRC_SEL_PPLLCLK 0x03 -# define RADEON_PIXCLK_ALWAYS_ONb (1<<6) -# define RADEON_PIXCLK_DAC_ALWAYS_ONb (1<<7) -# define R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF (1<<23) - -#define RADEON_VENDOR_ID 0x0f00 /* PCI */ -#define RADEON_VGA_DDA_CONFIG 0x02e8 -#define RADEON_VGA_DDA_ON_OFF 0x02ec -#define RADEON_VID_BUFFER_CONTROL 0x0900 -#define RADEON_VIDEOMUX_CNTL 0x0190 - - /* VIP bus */ -#define RADEON_VIPH_CH0_DATA 0x0c00 -#define RADEON_VIPH_CH1_DATA 0x0c04 -#define RADEON_VIPH_CH2_DATA 0x0c08 -#define RADEON_VIPH_CH3_DATA 0x0c0c -#define RADEON_VIPH_CH0_ADDR 0x0c10 -#define RADEON_VIPH_CH1_ADDR 0x0c14 -#define RADEON_VIPH_CH2_ADDR 0x0c18 -#define RADEON_VIPH_CH3_ADDR 0x0c1c -#define RADEON_VIPH_CH0_SBCNT 0x0c20 -#define RADEON_VIPH_CH1_SBCNT 0x0c24 -#define RADEON_VIPH_CH2_SBCNT 0x0c28 -#define RADEON_VIPH_CH3_SBCNT 0x0c2c -#define RADEON_VIPH_CH0_ABCNT 0x0c30 -#define RADEON_VIPH_CH1_ABCNT 0x0c34 -#define RADEON_VIPH_CH2_ABCNT 0x0c38 -#define RADEON_VIPH_CH3_ABCNT 0x0c3c -#define RADEON_VIPH_CONTROL 0x0c40 -# define RADEON_VIP_BUSY 0 -# define RADEON_VIP_IDLE 1 -# define RADEON_VIP_RESET 2 -# define RADEON_VIPH_EN (1 << 21) -#define RADEON_VIPH_DV_LAT 0x0c44 -#define RADEON_VIPH_BM_CHUNK 0x0c48 -#define RADEON_VIPH_DV_INT 0x0c4c -#define RADEON_VIPH_TIMEOUT_STAT 0x0c50 -#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_STAT 0x00000010 -#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_AK 0x00000010 -#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REGR_DIS 0x01000000 - -#define RADEON_VIPH_REG_DATA 0x0084 -#define RADEON_VIPH_REG_ADDR 0x0080 - - -#define RADEON_WAIT_UNTIL 0x1720 -# define RADEON_WAIT_CRTC_PFLIP (1 << 0) -# define RADEON_WAIT_RE_CRTC_VLINE (1 << 1) -# define RADEON_WAIT_FE_CRTC_VLINE (1 << 2) -# define RADEON_WAIT_CRTC_VLINE (1 << 3) -# define RADEON_WAIT_DMA_VID_IDLE (1 << 8) -# define RADEON_WAIT_DMA_GUI_IDLE (1 << 9) -# define RADEON_WAIT_CMDFIFO (1 << 10) /* wait for CMDFIFO_ENTRIES */ -# define RADEON_WAIT_OV0_FLIP (1 << 11) -# define RADEON_WAIT_AGP_FLUSH (1 << 13) -# define RADEON_WAIT_2D_IDLE (1 << 14) -# define RADEON_WAIT_3D_IDLE (1 << 15) -# define RADEON_WAIT_2D_IDLECLEAN (1 << 16) -# define RADEON_WAIT_3D_IDLECLEAN (1 << 17) -# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18) -# define RADEON_CMDFIFO_ENTRIES_SHIFT 10 -# define RADEON_CMDFIFO_ENTRIES_MASK 0x7f -# define RADEON_WAIT_VAP_IDLE (1 << 28) -# define RADEON_WAIT_BOTH_CRTC_PFLIP (1 << 30) -# define RADEON_ENG_DISPLAY_SELECT_CRTC0 (0 << 31) -# define RADEON_ENG_DISPLAY_SELECT_CRTC1 (1 << 31) - -#define RADEON_X_MPLL_REF_FB_DIV 0x000a /* PLL */ -#define RADEON_XCLK_CNTL 0x000d /* PLL */ -#define RADEON_XDLL_CNTL 0x000c /* PLL */ -#define RADEON_XPLL_CNTL 0x000b /* PLL */ - - - - /* Registers for 3D/TCL */ -#define RADEON_PP_BORDER_COLOR_0 0x1d40 -#define RADEON_PP_BORDER_COLOR_1 0x1d44 -#define RADEON_PP_BORDER_COLOR_2 0x1d48 -#define RADEON_PP_CNTL 0x1c38 -# define RADEON_STIPPLE_ENABLE (1 << 0) -# define RADEON_SCISSOR_ENABLE (1 << 1) -# define RADEON_PATTERN_ENABLE (1 << 2) -# define RADEON_SHADOW_ENABLE (1 << 3) -# define RADEON_TEX_ENABLE_MASK (0xf << 4) -# define RADEON_TEX_0_ENABLE (1 << 4) -# define RADEON_TEX_1_ENABLE (1 << 5) -# define RADEON_TEX_2_ENABLE (1 << 6) -# define RADEON_TEX_3_ENABLE (1 << 7) -# define RADEON_TEX_BLEND_ENABLE_MASK (0xf << 12) -# define RADEON_TEX_BLEND_0_ENABLE (1 << 12) -# define RADEON_TEX_BLEND_1_ENABLE (1 << 13) -# define RADEON_TEX_BLEND_2_ENABLE (1 << 14) -# define RADEON_TEX_BLEND_3_ENABLE (1 << 15) -# define RADEON_PLANAR_YUV_ENABLE (1 << 20) -# define RADEON_SPECULAR_ENABLE (1 << 21) -# define RADEON_FOG_ENABLE (1 << 22) -# define RADEON_ALPHA_TEST_ENABLE (1 << 23) -# define RADEON_ANTI_ALIAS_NONE (0 << 24) -# define RADEON_ANTI_ALIAS_LINE (1 << 24) -# define RADEON_ANTI_ALIAS_POLY (2 << 24) -# define RADEON_ANTI_ALIAS_LINE_POLY (3 << 24) -# define RADEON_BUMP_MAP_ENABLE (1 << 26) -# define RADEON_BUMPED_MAP_T0 (0 << 27) -# define RADEON_BUMPED_MAP_T1 (1 << 27) -# define RADEON_BUMPED_MAP_T2 (2 << 27) -# define RADEON_TEX_3D_ENABLE_0 (1 << 29) -# define RADEON_TEX_3D_ENABLE_1 (1 << 30) -# define RADEON_MC_ENABLE (1 << 31) -#define RADEON_PP_FOG_COLOR 0x1c18 -# define RADEON_FOG_COLOR_MASK 0x00ffffff -# define RADEON_FOG_VERTEX (0 << 24) -# define RADEON_FOG_TABLE (1 << 24) -# define RADEON_FOG_USE_DEPTH (0 << 25) -# define RADEON_FOG_USE_DIFFUSE_ALPHA (2 << 25) -# define RADEON_FOG_USE_SPEC_ALPHA (3 << 25) -#define RADEON_PP_LUM_MATRIX 0x1d00 -#define RADEON_PP_MISC 0x1c14 -# define RADEON_REF_ALPHA_MASK 0x000000ff -# define RADEON_ALPHA_TEST_FAIL (0 << 8) -# define RADEON_ALPHA_TEST_LESS (1 << 8) -# define RADEON_ALPHA_TEST_LEQUAL (2 << 8) -# define RADEON_ALPHA_TEST_EQUAL (3 << 8) -# define RADEON_ALPHA_TEST_GEQUAL (4 << 8) -# define RADEON_ALPHA_TEST_GREATER (5 << 8) -# define RADEON_ALPHA_TEST_NEQUAL (6 << 8) -# define RADEON_ALPHA_TEST_PASS (7 << 8) -# define RADEON_ALPHA_TEST_OP_MASK (7 << 8) -# define RADEON_CHROMA_FUNC_FAIL (0 << 16) -# define RADEON_CHROMA_FUNC_PASS (1 << 16) -# define RADEON_CHROMA_FUNC_NEQUAL (2 << 16) -# define RADEON_CHROMA_FUNC_EQUAL (3 << 16) -# define RADEON_CHROMA_KEY_NEAREST (0 << 18) -# define RADEON_CHROMA_KEY_ZERO (1 << 18) -# define RADEON_SHADOW_ID_AUTO_INC (1 << 20) -# define RADEON_SHADOW_FUNC_EQUAL (0 << 21) -# define RADEON_SHADOW_FUNC_NEQUAL (1 << 21) -# define RADEON_SHADOW_PASS_1 (0 << 22) -# define RADEON_SHADOW_PASS_2 (1 << 22) -# define RADEON_RIGHT_HAND_CUBE_D3D (0 << 24) -# define RADEON_RIGHT_HAND_CUBE_OGL (1 << 24) -#define RADEON_PP_ROT_MATRIX_0 0x1d58 -#define RADEON_PP_ROT_MATRIX_1 0x1d5c -#define RADEON_PP_TXFILTER_0 0x1c54 -#define RADEON_PP_TXFILTER_1 0x1c6c -#define RADEON_PP_TXFILTER_2 0x1c84 -# define RADEON_MAG_FILTER_NEAREST (0 << 0) -# define RADEON_MAG_FILTER_LINEAR (1 << 0) -# define RADEON_MAG_FILTER_MASK (1 << 0) -# define RADEON_MIN_FILTER_NEAREST (0 << 1) -# define RADEON_MIN_FILTER_LINEAR (1 << 1) -# define RADEON_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) -# define RADEON_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) -# define RADEON_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) -# define RADEON_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) -# define RADEON_MIN_FILTER_ANISO_NEAREST (8 << 1) -# define RADEON_MIN_FILTER_ANISO_LINEAR (9 << 1) -# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) -# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) -# define RADEON_MIN_FILTER_MASK (15 << 1) -# define RADEON_MAX_ANISO_1_TO_1 (0 << 5) -# define RADEON_MAX_ANISO_2_TO_1 (1 << 5) -# define RADEON_MAX_ANISO_4_TO_1 (2 << 5) -# define RADEON_MAX_ANISO_8_TO_1 (3 << 5) -# define RADEON_MAX_ANISO_16_TO_1 (4 << 5) -# define RADEON_MAX_ANISO_MASK (7 << 5) -# define RADEON_LOD_BIAS_MASK (0xff << 8) -# define RADEON_LOD_BIAS_SHIFT 8 -# define RADEON_MAX_MIP_LEVEL_MASK (0x0f << 16) -# define RADEON_MAX_MIP_LEVEL_SHIFT 16 -# define RADEON_YUV_TO_RGB (1 << 20) -# define RADEON_YUV_TEMPERATURE_COOL (0 << 21) -# define RADEON_YUV_TEMPERATURE_HOT (1 << 21) -# define RADEON_YUV_TEMPERATURE_MASK (1 << 21) -# define RADEON_WRAPEN_S (1 << 22) -# define RADEON_CLAMP_S_WRAP (0 << 23) -# define RADEON_CLAMP_S_MIRROR (1 << 23) -# define RADEON_CLAMP_S_CLAMP_LAST (2 << 23) -# define RADEON_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) -# define RADEON_CLAMP_S_CLAMP_BORDER (4 << 23) -# define RADEON_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) -# define RADEON_CLAMP_S_CLAMP_GL (6 << 23) -# define RADEON_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) -# define RADEON_CLAMP_S_MASK (7 << 23) -# define RADEON_WRAPEN_T (1 << 26) -# define RADEON_CLAMP_T_WRAP (0 << 27) -# define RADEON_CLAMP_T_MIRROR (1 << 27) -# define RADEON_CLAMP_T_CLAMP_LAST (2 << 27) -# define RADEON_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) -# define RADEON_CLAMP_T_CLAMP_BORDER (4 << 27) -# define RADEON_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) -# define RADEON_CLAMP_T_CLAMP_GL (6 << 27) -# define RADEON_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) -# define RADEON_CLAMP_T_MASK (7 << 27) -# define RADEON_BORDER_MODE_OGL (0 << 31) -# define RADEON_BORDER_MODE_D3D (1 << 31) -#define RADEON_PP_TXFORMAT_0 0x1c58 -#define RADEON_PP_TXFORMAT_1 0x1c70 -#define RADEON_PP_TXFORMAT_2 0x1c88 -# define RADEON_TXFORMAT_I8 (0 << 0) -# define RADEON_TXFORMAT_AI88 (1 << 0) -# define RADEON_TXFORMAT_RGB332 (2 << 0) -# define RADEON_TXFORMAT_ARGB1555 (3 << 0) -# define RADEON_TXFORMAT_RGB565 (4 << 0) -# define RADEON_TXFORMAT_ARGB4444 (5 << 0) -# define RADEON_TXFORMAT_ARGB8888 (6 << 0) -# define RADEON_TXFORMAT_RGBA8888 (7 << 0) -# define RADEON_TXFORMAT_Y8 (8 << 0) -# define RADEON_TXFORMAT_VYUY422 (10 << 0) -# define RADEON_TXFORMAT_YVYU422 (11 << 0) -# define RADEON_TXFORMAT_DXT1 (12 << 0) -# define RADEON_TXFORMAT_DXT23 (14 << 0) -# define RADEON_TXFORMAT_DXT45 (15 << 0) -# define RADEON_TXFORMAT_FORMAT_MASK (31 << 0) -# define RADEON_TXFORMAT_FORMAT_SHIFT 0 -# define RADEON_TXFORMAT_APPLE_YUV_MODE (1 << 5) -# define RADEON_TXFORMAT_ALPHA_IN_MAP (1 << 6) -# define RADEON_TXFORMAT_NON_POWER2 (1 << 7) -# define RADEON_TXFORMAT_WIDTH_MASK (15 << 8) -# define RADEON_TXFORMAT_WIDTH_SHIFT 8 -# define RADEON_TXFORMAT_HEIGHT_MASK (15 << 12) -# define RADEON_TXFORMAT_HEIGHT_SHIFT 12 -# define RADEON_TXFORMAT_F5_WIDTH_MASK (15 << 16) -# define RADEON_TXFORMAT_F5_WIDTH_SHIFT 16 -# define RADEON_TXFORMAT_F5_HEIGHT_MASK (15 << 20) -# define RADEON_TXFORMAT_F5_HEIGHT_SHIFT 20 -# define RADEON_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) -# define RADEON_TXFORMAT_ST_ROUTE_MASK (3 << 24) -# define RADEON_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) -# define RADEON_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) -# define RADEON_TXFORMAT_ENDIAN_NO_SWAP (0 << 26) -# define RADEON_TXFORMAT_ENDIAN_16BPP_SWAP (1 << 26) -# define RADEON_TXFORMAT_ENDIAN_32BPP_SWAP (2 << 26) -# define RADEON_TXFORMAT_ENDIAN_HALFDW_SWAP (3 << 26) -# define RADEON_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) -# define RADEON_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) -# define RADEON_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) -# define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1 << 31) -#define RADEON_PP_CUBIC_FACES_0 0x1d24 -#define RADEON_PP_CUBIC_FACES_1 0x1d28 -#define RADEON_PP_CUBIC_FACES_2 0x1d2c -# define RADEON_FACE_WIDTH_1_SHIFT 0 -# define RADEON_FACE_HEIGHT_1_SHIFT 4 -# define RADEON_FACE_WIDTH_1_MASK (0xf << 0) -# define RADEON_FACE_HEIGHT_1_MASK (0xf << 4) -# define RADEON_FACE_WIDTH_2_SHIFT 8 -# define RADEON_FACE_HEIGHT_2_SHIFT 12 -# define RADEON_FACE_WIDTH_2_MASK (0xf << 8) -# define RADEON_FACE_HEIGHT_2_MASK (0xf << 12) -# define RADEON_FACE_WIDTH_3_SHIFT 16 -# define RADEON_FACE_HEIGHT_3_SHIFT 20 -# define RADEON_FACE_WIDTH_3_MASK (0xf << 16) -# define RADEON_FACE_HEIGHT_3_MASK (0xf << 20) -# define RADEON_FACE_WIDTH_4_SHIFT 24 -# define RADEON_FACE_HEIGHT_4_SHIFT 28 -# define RADEON_FACE_WIDTH_4_MASK (0xf << 24) -# define RADEON_FACE_HEIGHT_4_MASK (0xf << 28) - -#define RADEON_PP_TXOFFSET_0 0x1c5c -#define RADEON_PP_TXOFFSET_1 0x1c74 -#define RADEON_PP_TXOFFSET_2 0x1c8c -# define RADEON_TXO_ENDIAN_NO_SWAP (0 << 0) -# define RADEON_TXO_ENDIAN_BYTE_SWAP (1 << 0) -# define RADEON_TXO_ENDIAN_WORD_SWAP (2 << 0) -# define RADEON_TXO_ENDIAN_HALFDW_SWAP (3 << 0) -# define RADEON_TXO_MACRO_LINEAR (0 << 2) -# define RADEON_TXO_MACRO_TILE (1 << 2) -# define RADEON_TXO_MICRO_LINEAR (0 << 3) -# define RADEON_TXO_MICRO_TILE_X2 (1 << 3) -# define RADEON_TXO_MICRO_TILE_OPT (2 << 3) -# define RADEON_TXO_OFFSET_MASK 0xffffffe0 -# define RADEON_TXO_OFFSET_SHIFT 5 - -#define RADEON_PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */ -#define RADEON_PP_CUBIC_OFFSET_T0_1 0x1dd4 -#define RADEON_PP_CUBIC_OFFSET_T0_2 0x1dd8 -#define RADEON_PP_CUBIC_OFFSET_T0_3 0x1ddc -#define RADEON_PP_CUBIC_OFFSET_T0_4 0x1de0 -#define RADEON_PP_CUBIC_OFFSET_T1_0 0x1e00 -#define RADEON_PP_CUBIC_OFFSET_T1_1 0x1e04 -#define RADEON_PP_CUBIC_OFFSET_T1_2 0x1e08 -#define RADEON_PP_CUBIC_OFFSET_T1_3 0x1e0c -#define RADEON_PP_CUBIC_OFFSET_T1_4 0x1e10 -#define RADEON_PP_CUBIC_OFFSET_T2_0 0x1e14 -#define RADEON_PP_CUBIC_OFFSET_T2_1 0x1e18 -#define RADEON_PP_CUBIC_OFFSET_T2_2 0x1e1c -#define RADEON_PP_CUBIC_OFFSET_T2_3 0x1e20 -#define RADEON_PP_CUBIC_OFFSET_T2_4 0x1e24 - -#define RADEON_PP_TEX_SIZE_0 0x1d04 /* NPOT */ -#define RADEON_PP_TEX_SIZE_1 0x1d0c -#define RADEON_PP_TEX_SIZE_2 0x1d14 -# define RADEON_TEX_USIZE_MASK (0x7ff << 0) -# define RADEON_TEX_USIZE_SHIFT 0 -# define RADEON_TEX_VSIZE_MASK (0x7ff << 16) -# define RADEON_TEX_VSIZE_SHIFT 16 -# define RADEON_SIGNED_RGB_MASK (1 << 30) -# define RADEON_SIGNED_RGB_SHIFT 30 -# define RADEON_SIGNED_ALPHA_MASK (1 << 31) -# define RADEON_SIGNED_ALPHA_SHIFT 31 -#define RADEON_PP_TEX_PITCH_0 0x1d08 /* NPOT */ -#define RADEON_PP_TEX_PITCH_1 0x1d10 /* NPOT */ -#define RADEON_PP_TEX_PITCH_2 0x1d18 /* NPOT */ -/* note: bits 13-5: 32 byte aligned stride of texture map */ - -#define RADEON_PP_TXCBLEND_0 0x1c60 -#define RADEON_PP_TXCBLEND_1 0x1c78 -#define RADEON_PP_TXCBLEND_2 0x1c90 -# define RADEON_COLOR_ARG_A_SHIFT 0 -# define RADEON_COLOR_ARG_A_MASK (0x1f << 0) -# define RADEON_COLOR_ARG_A_ZERO (0 << 0) -# define RADEON_COLOR_ARG_A_CURRENT_COLOR (2 << 0) -# define RADEON_COLOR_ARG_A_CURRENT_ALPHA (3 << 0) -# define RADEON_COLOR_ARG_A_DIFFUSE_COLOR (4 << 0) -# define RADEON_COLOR_ARG_A_DIFFUSE_ALPHA (5 << 0) -# define RADEON_COLOR_ARG_A_SPECULAR_COLOR (6 << 0) -# define RADEON_COLOR_ARG_A_SPECULAR_ALPHA (7 << 0) -# define RADEON_COLOR_ARG_A_TFACTOR_COLOR (8 << 0) -# define RADEON_COLOR_ARG_A_TFACTOR_ALPHA (9 << 0) -# define RADEON_COLOR_ARG_A_T0_COLOR (10 << 0) -# define RADEON_COLOR_ARG_A_T0_ALPHA (11 << 0) -# define RADEON_COLOR_ARG_A_T1_COLOR (12 << 0) -# define RADEON_COLOR_ARG_A_T1_ALPHA (13 << 0) -# define RADEON_COLOR_ARG_A_T2_COLOR (14 << 0) -# define RADEON_COLOR_ARG_A_T2_ALPHA (15 << 0) -# define RADEON_COLOR_ARG_A_T3_COLOR (16 << 0) -# define RADEON_COLOR_ARG_A_T3_ALPHA (17 << 0) -# define RADEON_COLOR_ARG_B_SHIFT 5 -# define RADEON_COLOR_ARG_B_MASK (0x1f << 5) -# define RADEON_COLOR_ARG_B_ZERO (0 << 5) -# define RADEON_COLOR_ARG_B_CURRENT_COLOR (2 << 5) -# define RADEON_COLOR_ARG_B_CURRENT_ALPHA (3 << 5) -# define RADEON_COLOR_ARG_B_DIFFUSE_COLOR (4 << 5) -# define RADEON_COLOR_ARG_B_DIFFUSE_ALPHA (5 << 5) -# define RADEON_COLOR_ARG_B_SPECULAR_COLOR (6 << 5) -# define RADEON_COLOR_ARG_B_SPECULAR_ALPHA (7 << 5) -# define RADEON_COLOR_ARG_B_TFACTOR_COLOR (8 << 5) -# define RADEON_COLOR_ARG_B_TFACTOR_ALPHA (9 << 5) -# define RADEON_COLOR_ARG_B_T0_COLOR (10 << 5) -# define RADEON_COLOR_ARG_B_T0_ALPHA (11 << 5) -# define RADEON_COLOR_ARG_B_T1_COLOR (12 << 5) -# define RADEON_COLOR_ARG_B_T1_ALPHA (13 << 5) -# define RADEON_COLOR_ARG_B_T2_COLOR (14 << 5) -# define RADEON_COLOR_ARG_B_T2_ALPHA (15 << 5) -# define RADEON_COLOR_ARG_B_T3_COLOR (16 << 5) -# define RADEON_COLOR_ARG_B_T3_ALPHA (17 << 5) -# define RADEON_COLOR_ARG_C_SHIFT 10 -# define RADEON_COLOR_ARG_C_MASK (0x1f << 10) -# define RADEON_COLOR_ARG_C_ZERO (0 << 10) -# define RADEON_COLOR_ARG_C_CURRENT_COLOR (2 << 10) -# define RADEON_COLOR_ARG_C_CURRENT_ALPHA (3 << 10) -# define RADEON_COLOR_ARG_C_DIFFUSE_COLOR (4 << 10) -# define RADEON_COLOR_ARG_C_DIFFUSE_ALPHA (5 << 10) -# define RADEON_COLOR_ARG_C_SPECULAR_COLOR (6 << 10) -# define RADEON_COLOR_ARG_C_SPECULAR_ALPHA (7 << 10) -# define RADEON_COLOR_ARG_C_TFACTOR_COLOR (8 << 10) -# define RADEON_COLOR_ARG_C_TFACTOR_ALPHA (9 << 10) -# define RADEON_COLOR_ARG_C_T0_COLOR (10 << 10) -# define RADEON_COLOR_ARG_C_T0_ALPHA (11 << 10) -# define RADEON_COLOR_ARG_C_T1_COLOR (12 << 10) -# define RADEON_COLOR_ARG_C_T1_ALPHA (13 << 10) -# define RADEON_COLOR_ARG_C_T2_COLOR (14 << 10) -# define RADEON_COLOR_ARG_C_T2_ALPHA (15 << 10) -# define RADEON_COLOR_ARG_C_T3_COLOR (16 << 10) -# define RADEON_COLOR_ARG_C_T3_ALPHA (17 << 10) -# define RADEON_COMP_ARG_A (1 << 15) -# define RADEON_COMP_ARG_A_SHIFT 15 -# define RADEON_COMP_ARG_B (1 << 16) -# define RADEON_COMP_ARG_B_SHIFT 16 -# define RADEON_COMP_ARG_C (1 << 17) -# define RADEON_COMP_ARG_C_SHIFT 17 -# define RADEON_BLEND_CTL_MASK (7 << 18) -# define RADEON_BLEND_CTL_ADD (0 << 18) -# define RADEON_BLEND_CTL_SUBTRACT (1 << 18) -# define RADEON_BLEND_CTL_ADDSIGNED (2 << 18) -# define RADEON_BLEND_CTL_BLEND (3 << 18) -# define RADEON_BLEND_CTL_DOT3 (4 << 18) -# define RADEON_SCALE_SHIFT 21 -# define RADEON_SCALE_MASK (3 << 21) -# define RADEON_SCALE_1X (0 << 21) -# define RADEON_SCALE_2X (1 << 21) -# define RADEON_SCALE_4X (2 << 21) -# define RADEON_CLAMP_TX (1 << 23) -# define RADEON_T0_EQ_TCUR (1 << 24) -# define RADEON_T1_EQ_TCUR (1 << 25) -# define RADEON_T2_EQ_TCUR (1 << 26) -# define RADEON_T3_EQ_TCUR (1 << 27) -# define RADEON_COLOR_ARG_MASK 0x1f -# define RADEON_COMP_ARG_SHIFT 15 -#define RADEON_PP_TXABLEND_0 0x1c64 -#define RADEON_PP_TXABLEND_1 0x1c7c -#define RADEON_PP_TXABLEND_2 0x1c94 -# define RADEON_ALPHA_ARG_A_SHIFT 0 -# define RADEON_ALPHA_ARG_A_MASK (0xf << 0) -# define RADEON_ALPHA_ARG_A_ZERO (0 << 0) -# define RADEON_ALPHA_ARG_A_CURRENT_ALPHA (1 << 0) -# define RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA (2 << 0) -# define RADEON_ALPHA_ARG_A_SPECULAR_ALPHA (3 << 0) -# define RADEON_ALPHA_ARG_A_TFACTOR_ALPHA (4 << 0) -# define RADEON_ALPHA_ARG_A_T0_ALPHA (5 << 0) -# define RADEON_ALPHA_ARG_A_T1_ALPHA (6 << 0) -# define RADEON_ALPHA_ARG_A_T2_ALPHA (7 << 0) -# define RADEON_ALPHA_ARG_A_T3_ALPHA (8 << 0) -# define RADEON_ALPHA_ARG_B_SHIFT 4 -# define RADEON_ALPHA_ARG_B_MASK (0xf << 4) -# define RADEON_ALPHA_ARG_B_ZERO (0 << 4) -# define RADEON_ALPHA_ARG_B_CURRENT_ALPHA (1 << 4) -# define RADEON_ALPHA_ARG_B_DIFFUSE_ALPHA (2 << 4) -# define RADEON_ALPHA_ARG_B_SPECULAR_ALPHA (3 << 4) -# define RADEON_ALPHA_ARG_B_TFACTOR_ALPHA (4 << 4) -# define RADEON_ALPHA_ARG_B_T0_ALPHA (5 << 4) -# define RADEON_ALPHA_ARG_B_T1_ALPHA (6 << 4) -# define RADEON_ALPHA_ARG_B_T2_ALPHA (7 << 4) -# define RADEON_ALPHA_ARG_B_T3_ALPHA (8 << 4) -# define RADEON_ALPHA_ARG_C_SHIFT 8 -# define RADEON_ALPHA_ARG_C_MASK (0xf << 8) -# define RADEON_ALPHA_ARG_C_ZERO (0 << 8) -# define RADEON_ALPHA_ARG_C_CURRENT_ALPHA (1 << 8) -# define RADEON_ALPHA_ARG_C_DIFFUSE_ALPHA (2 << 8) -# define RADEON_ALPHA_ARG_C_SPECULAR_ALPHA (3 << 8) -# define RADEON_ALPHA_ARG_C_TFACTOR_ALPHA (4 << 8) -# define RADEON_ALPHA_ARG_C_T0_ALPHA (5 << 8) -# define RADEON_ALPHA_ARG_C_T1_ALPHA (6 << 8) -# define RADEON_ALPHA_ARG_C_T2_ALPHA (7 << 8) -# define RADEON_ALPHA_ARG_C_T3_ALPHA (8 << 8) -# define RADEON_DOT_ALPHA_DONT_REPLICATE (1 << 9) -# define RADEON_ALPHA_ARG_MASK 0xf - -#define RADEON_PP_TFACTOR_0 0x1c68 -#define RADEON_PP_TFACTOR_1 0x1c80 -#define RADEON_PP_TFACTOR_2 0x1c98 - -#define RADEON_RB3D_BLENDCNTL 0x1c20 -# define RADEON_COMB_FCN_MASK (3 << 12) -# define RADEON_COMB_FCN_ADD_CLAMP (0 << 12) -# define RADEON_COMB_FCN_ADD_NOCLAMP (1 << 12) -# define RADEON_COMB_FCN_SUB_CLAMP (2 << 12) -# define RADEON_COMB_FCN_SUB_NOCLAMP (3 << 12) -# define RADEON_SRC_BLEND_GL_ZERO (32 << 16) -# define RADEON_SRC_BLEND_GL_ONE (33 << 16) -# define RADEON_SRC_BLEND_GL_SRC_COLOR (34 << 16) -# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16) -# define RADEON_SRC_BLEND_GL_DST_COLOR (36 << 16) -# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16) -# define RADEON_SRC_BLEND_GL_SRC_ALPHA (38 << 16) -# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16) -# define RADEON_SRC_BLEND_GL_DST_ALPHA (40 << 16) -# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16) -# define RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16) -# define RADEON_SRC_BLEND_MASK (63 << 16) -# define RADEON_DST_BLEND_GL_ZERO (32 << 24) -# define RADEON_DST_BLEND_GL_ONE (33 << 24) -# define RADEON_DST_BLEND_GL_SRC_COLOR (34 << 24) -# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24) -# define RADEON_DST_BLEND_GL_DST_COLOR (36 << 24) -# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24) -# define RADEON_DST_BLEND_GL_SRC_ALPHA (38 << 24) -# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24) -# define RADEON_DST_BLEND_GL_DST_ALPHA (40 << 24) -# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24) -# define RADEON_DST_BLEND_MASK (63 << 24) -#define RADEON_RB3D_CNTL 0x1c3c -# define RADEON_ALPHA_BLEND_ENABLE (1 << 0) -# define RADEON_PLANE_MASK_ENABLE (1 << 1) -# define RADEON_DITHER_ENABLE (1 << 2) -# define RADEON_ROUND_ENABLE (1 << 3) -# define RADEON_SCALE_DITHER_ENABLE (1 << 4) -# define RADEON_DITHER_INIT (1 << 5) -# define RADEON_ROP_ENABLE (1 << 6) -# define RADEON_STENCIL_ENABLE (1 << 7) -# define RADEON_Z_ENABLE (1 << 8) -# define RADEON_DEPTH_XZ_OFFEST_ENABLE (1 << 9) -# define RADEON_COLOR_FORMAT_ARGB1555 (3 << 10) -# define RADEON_COLOR_FORMAT_RGB565 (4 << 10) -# define RADEON_COLOR_FORMAT_ARGB8888 (6 << 10) -# define RADEON_COLOR_FORMAT_RGB332 (7 << 10) -# define RADEON_COLOR_FORMAT_Y8 (8 << 10) -# define RADEON_COLOR_FORMAT_RGB8 (9 << 10) -# define RADEON_COLOR_FORMAT_YUV422_VYUY (11 << 10) -# define RADEON_COLOR_FORMAT_YUV422_YVYU (12 << 10) -# define RADEON_COLOR_FORMAT_aYUV444 (14 << 10) -# define RADEON_COLOR_FORMAT_ARGB4444 (15 << 10) -# define RADEON_CLRCMP_FLIP_ENABLE (1 << 14) -#define RADEON_RB3D_COLOROFFSET 0x1c40 -# define RADEON_COLOROFFSET_MASK 0xfffffff0 -#define RADEON_RB3D_COLORPITCH 0x1c48 -# define RADEON_COLORPITCH_MASK 0x000001ff8 -# define RADEON_COLOR_TILE_ENABLE (1 << 16) -# define RADEON_COLOR_MICROTILE_ENABLE (1 << 17) -# define RADEON_COLOR_ENDIAN_NO_SWAP (0 << 18) -# define RADEON_COLOR_ENDIAN_WORD_SWAP (1 << 18) -# define RADEON_COLOR_ENDIAN_DWORD_SWAP (2 << 18) -#define RADEON_RB3D_DEPTHOFFSET 0x1c24 -#define RADEON_RB3D_DEPTHPITCH 0x1c28 -# define RADEON_DEPTHPITCH_MASK 0x00001ff8 -# define RADEON_DEPTH_ENDIAN_NO_SWAP (0 << 18) -# define RADEON_DEPTH_ENDIAN_WORD_SWAP (1 << 18) -# define RADEON_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) -#define RADEON_RB3D_PLANEMASK 0x1d84 -#define RADEON_RB3D_ROPCNTL 0x1d80 -# define RADEON_ROP_MASK (15 << 8) -# define RADEON_ROP_CLEAR (0 << 8) -# define RADEON_ROP_NOR (1 << 8) -# define RADEON_ROP_AND_INVERTED (2 << 8) -# define RADEON_ROP_COPY_INVERTED (3 << 8) -# define RADEON_ROP_AND_REVERSE (4 << 8) -# define RADEON_ROP_INVERT (5 << 8) -# define RADEON_ROP_XOR (6 << 8) -# define RADEON_ROP_NAND (7 << 8) -# define RADEON_ROP_AND (8 << 8) -# define RADEON_ROP_EQUIV (9 << 8) -# define RADEON_ROP_NOOP (10 << 8) -# define RADEON_ROP_OR_INVERTED (11 << 8) -# define RADEON_ROP_COPY (12 << 8) -# define RADEON_ROP_OR_REVERSE (13 << 8) -# define RADEON_ROP_OR (14 << 8) -# define RADEON_ROP_SET (15 << 8) -#define RADEON_RB3D_STENCILREFMASK 0x1d7c -# define RADEON_STENCIL_REF_SHIFT 0 -# define RADEON_STENCIL_REF_MASK (0xff << 0) -# define RADEON_STENCIL_MASK_SHIFT 16 -# define RADEON_STENCIL_VALUE_MASK (0xff << 16) -# define RADEON_STENCIL_WRITEMASK_SHIFT 24 -# define RADEON_STENCIL_WRITE_MASK (0xff << 24) -#define RADEON_RB3D_ZSTENCILCNTL 0x1c2c -# define RADEON_DEPTH_FORMAT_MASK (0xf << 0) -# define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) -# define RADEON_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) -# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0) -# define RADEON_DEPTH_FORMAT_32BIT_INT_Z (4 << 0) -# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0) -# define RADEON_DEPTH_FORMAT_16BIT_FLOAT_W (7 << 0) -# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0) -# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0) -# define RADEON_Z_TEST_NEVER (0 << 4) -# define RADEON_Z_TEST_LESS (1 << 4) -# define RADEON_Z_TEST_LEQUAL (2 << 4) -# define RADEON_Z_TEST_EQUAL (3 << 4) -# define RADEON_Z_TEST_GEQUAL (4 << 4) -# define RADEON_Z_TEST_GREATER (5 << 4) -# define RADEON_Z_TEST_NEQUAL (6 << 4) -# define RADEON_Z_TEST_ALWAYS (7 << 4) -# define RADEON_Z_TEST_MASK (7 << 4) -# define RADEON_STENCIL_TEST_NEVER (0 << 12) -# define RADEON_STENCIL_TEST_LESS (1 << 12) -# define RADEON_STENCIL_TEST_LEQUAL (2 << 12) -# define RADEON_STENCIL_TEST_EQUAL (3 << 12) -# define RADEON_STENCIL_TEST_GEQUAL (4 << 12) -# define RADEON_STENCIL_TEST_GREATER (5 << 12) -# define RADEON_STENCIL_TEST_NEQUAL (6 << 12) -# define RADEON_STENCIL_TEST_ALWAYS (7 << 12) -# define RADEON_STENCIL_TEST_MASK (0x7 << 12) -# define RADEON_STENCIL_FAIL_KEEP (0 << 16) -# define RADEON_STENCIL_FAIL_ZERO (1 << 16) -# define RADEON_STENCIL_FAIL_REPLACE (2 << 16) -# define RADEON_STENCIL_FAIL_INC (3 << 16) -# define RADEON_STENCIL_FAIL_DEC (4 << 16) -# define RADEON_STENCIL_FAIL_INVERT (5 << 16) -# define RADEON_STENCIL_FAIL_MASK (0x7 << 16) -# define RADEON_STENCIL_ZPASS_KEEP (0 << 20) -# define RADEON_STENCIL_ZPASS_ZERO (1 << 20) -# define RADEON_STENCIL_ZPASS_REPLACE (2 << 20) -# define RADEON_STENCIL_ZPASS_INC (3 << 20) -# define RADEON_STENCIL_ZPASS_DEC (4 << 20) -# define RADEON_STENCIL_ZPASS_INVERT (5 << 20) -# define RADEON_STENCIL_ZPASS_MASK (0x7 << 20) -# define RADEON_STENCIL_ZFAIL_KEEP (0 << 24) -# define RADEON_STENCIL_ZFAIL_ZERO (1 << 24) -# define RADEON_STENCIL_ZFAIL_REPLACE (2 << 24) -# define RADEON_STENCIL_ZFAIL_INC (3 << 24) -# define RADEON_STENCIL_ZFAIL_DEC (4 << 24) -# define RADEON_STENCIL_ZFAIL_INVERT (5 << 24) -# define RADEON_STENCIL_ZFAIL_MASK (0x7 << 24) -# define RADEON_Z_COMPRESSION_ENABLE (1 << 28) -# define RADEON_FORCE_Z_DIRTY (1 << 29) -# define RADEON_Z_WRITE_ENABLE (1 << 30) -#define RADEON_RE_LINE_PATTERN 0x1cd0 -# define RADEON_LINE_PATTERN_MASK 0x0000ffff -# define RADEON_LINE_REPEAT_COUNT_SHIFT 16 -# define RADEON_LINE_PATTERN_START_SHIFT 24 -# define RADEON_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28) -# define RADEON_LINE_PATTERN_BIG_BIT_ORDER (1 << 28) -# define RADEON_LINE_PATTERN_AUTO_RESET (1 << 29) -#define RADEON_RE_LINE_STATE 0x1cd4 -# define RADEON_LINE_CURRENT_PTR_SHIFT 0 -# define RADEON_LINE_CURRENT_COUNT_SHIFT 8 -#define RADEON_RE_MISC 0x26c4 -# define RADEON_STIPPLE_COORD_MASK 0x1f -# define RADEON_STIPPLE_X_OFFSET_SHIFT 0 -# define RADEON_STIPPLE_X_OFFSET_MASK (0x1f << 0) -# define RADEON_STIPPLE_Y_OFFSET_SHIFT 8 -# define RADEON_STIPPLE_Y_OFFSET_MASK (0x1f << 8) -# define RADEON_STIPPLE_LITTLE_BIT_ORDER (0 << 16) -# define RADEON_STIPPLE_BIG_BIT_ORDER (1 << 16) -#define RADEON_RE_SOLID_COLOR 0x1c1c -#define RADEON_RE_TOP_LEFT 0x26c0 -# define RADEON_RE_LEFT_SHIFT 0 -# define RADEON_RE_TOP_SHIFT 16 -#define RADEON_RE_WIDTH_HEIGHT 0x1c44 -# define RADEON_RE_WIDTH_SHIFT 0 -# define RADEON_RE_HEIGHT_SHIFT 16 - -#define RADEON_SE_CNTL 0x1c4c -# define RADEON_FFACE_CULL_CW (0 << 0) -# define RADEON_FFACE_CULL_CCW (1 << 0) -# define RADEON_FFACE_CULL_DIR_MASK (1 << 0) -# define RADEON_BFACE_CULL (0 << 1) -# define RADEON_BFACE_SOLID (3 << 1) -# define RADEON_FFACE_CULL (0 << 3) -# define RADEON_FFACE_SOLID (3 << 3) -# define RADEON_FFACE_CULL_MASK (3 << 3) -# define RADEON_BADVTX_CULL_DISABLE (1 << 5) -# define RADEON_FLAT_SHADE_VTX_0 (0 << 6) -# define RADEON_FLAT_SHADE_VTX_1 (1 << 6) -# define RADEON_FLAT_SHADE_VTX_2 (2 << 6) -# define RADEON_FLAT_SHADE_VTX_LAST (3 << 6) -# define RADEON_DIFFUSE_SHADE_SOLID (0 << 8) -# define RADEON_DIFFUSE_SHADE_FLAT (1 << 8) -# define RADEON_DIFFUSE_SHADE_GOURAUD (2 << 8) -# define RADEON_DIFFUSE_SHADE_MASK (3 << 8) -# define RADEON_ALPHA_SHADE_SOLID (0 << 10) -# define RADEON_ALPHA_SHADE_FLAT (1 << 10) -# define RADEON_ALPHA_SHADE_GOURAUD (2 << 10) -# define RADEON_ALPHA_SHADE_MASK (3 << 10) -# define RADEON_SPECULAR_SHADE_SOLID (0 << 12) -# define RADEON_SPECULAR_SHADE_FLAT (1 << 12) -# define RADEON_SPECULAR_SHADE_GOURAUD (2 << 12) -# define RADEON_SPECULAR_SHADE_MASK (3 << 12) -# define RADEON_FOG_SHADE_SOLID (0 << 14) -# define RADEON_FOG_SHADE_FLAT (1 << 14) -# define RADEON_FOG_SHADE_GOURAUD (2 << 14) -# define RADEON_FOG_SHADE_MASK (3 << 14) -# define RADEON_ZBIAS_ENABLE_POINT (1 << 16) -# define RADEON_ZBIAS_ENABLE_LINE (1 << 17) -# define RADEON_ZBIAS_ENABLE_TRI (1 << 18) -# define RADEON_WIDELINE_ENABLE (1 << 20) -# define RADEON_VPORT_XY_XFORM_ENABLE (1 << 24) -# define RADEON_VPORT_Z_XFORM_ENABLE (1 << 25) -# define RADEON_VTX_PIX_CENTER_D3D (0 << 27) -# define RADEON_VTX_PIX_CENTER_OGL (1 << 27) -# define RADEON_ROUND_MODE_TRUNC (0 << 28) -# define RADEON_ROUND_MODE_ROUND (1 << 28) -# define RADEON_ROUND_MODE_ROUND_EVEN (2 << 28) -# define RADEON_ROUND_MODE_ROUND_ODD (3 << 28) -# define RADEON_ROUND_PREC_16TH_PIX (0 << 30) -# define RADEON_ROUND_PREC_8TH_PIX (1 << 30) -# define RADEON_ROUND_PREC_4TH_PIX (2 << 30) -# define RADEON_ROUND_PREC_HALF_PIX (3 << 30) -#define R200_RE_CNTL 0x1c50 -# define R200_STIPPLE_ENABLE 0x1 -# define R200_SCISSOR_ENABLE 0x2 -# define R200_PATTERN_ENABLE 0x4 -# define R200_PERSPECTIVE_ENABLE 0x8 -# define R200_POINT_SMOOTH 0x20 -# define R200_VTX_STQ0_D3D 0x00010000 -# define R200_VTX_STQ1_D3D 0x00040000 -# define R200_VTX_STQ2_D3D 0x00100000 -# define R200_VTX_STQ3_D3D 0x00400000 -# define R200_VTX_STQ4_D3D 0x01000000 -# define R200_VTX_STQ5_D3D 0x04000000 -#define RADEON_SE_CNTL_STATUS 0x2140 -# define RADEON_VC_NO_SWAP (0 << 0) -# define RADEON_VC_16BIT_SWAP (1 << 0) -# define RADEON_VC_32BIT_SWAP (2 << 0) -# define RADEON_VC_HALF_DWORD_SWAP (3 << 0) -# define RADEON_TCL_BYPASS (1 << 8) -#define RADEON_SE_COORD_FMT 0x1c50 -# define RADEON_VTX_XY_PRE_MULT_1_OVER_W0 (1 << 0) -# define RADEON_VTX_Z_PRE_MULT_1_OVER_W0 (1 << 1) -# define RADEON_VTX_ST0_NONPARAMETRIC (1 << 8) -# define RADEON_VTX_ST1_NONPARAMETRIC (1 << 9) -# define RADEON_VTX_ST2_NONPARAMETRIC (1 << 10) -# define RADEON_VTX_ST3_NONPARAMETRIC (1 << 11) -# define RADEON_VTX_W0_NORMALIZE (1 << 12) -# define RADEON_VTX_W0_IS_NOT_1_OVER_W0 (1 << 16) -# define RADEON_VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17) -# define RADEON_VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19) -# define RADEON_VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21) -# define RADEON_VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23) -# define RADEON_TEX1_W_ROUTING_USE_W0 (0 << 26) -# define RADEON_TEX1_W_ROUTING_USE_Q1 (1 << 26) -#define RADEON_SE_LINE_WIDTH 0x1db8 -#define RADEON_SE_TCL_LIGHT_MODEL_CTL 0x226c -# define RADEON_LIGHTING_ENABLE (1 << 0) -# define RADEON_LIGHT_IN_MODELSPACE (1 << 1) -# define RADEON_LOCAL_VIEWER (1 << 2) -# define RADEON_NORMALIZE_NORMALS (1 << 3) -# define RADEON_RESCALE_NORMALS (1 << 4) -# define RADEON_SPECULAR_LIGHTS (1 << 5) -# define RADEON_DIFFUSE_SPECULAR_COMBINE (1 << 6) -# define RADEON_LIGHT_ALPHA (1 << 7) -# define RADEON_LOCAL_LIGHT_VEC_GL (1 << 8) -# define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9) -# define RADEON_LM_SOURCE_STATE_PREMULT 0 -# define RADEON_LM_SOURCE_STATE_MULT 1 -# define RADEON_LM_SOURCE_VERTEX_DIFFUSE 2 -# define RADEON_LM_SOURCE_VERTEX_SPECULAR 3 -# define RADEON_EMISSIVE_SOURCE_SHIFT 16 -# define RADEON_AMBIENT_SOURCE_SHIFT 18 -# define RADEON_DIFFUSE_SOURCE_SHIFT 20 -# define RADEON_SPECULAR_SOURCE_SHIFT 22 -#define RADEON_SE_TCL_MATERIAL_AMBIENT_RED 0x2220 -#define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224 -#define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228 -#define RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA 0x222c -#define RADEON_SE_TCL_MATERIAL_DIFFUSE_RED 0x2230 -#define RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN 0x2234 -#define RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE 0x2238 -#define RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA 0x223c -#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED 0x2210 -#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214 -#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE 0x2218 -#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c -#define RADEON_SE_TCL_MATERIAL_SPECULAR_RED 0x2240 -#define RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN 0x2244 -#define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248 -#define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c -#define RADEON_SE_TCL_MATRIX_SELECT_0 0x225c -# define RADEON_MODELVIEW_0_SHIFT 0 -# define RADEON_MODELVIEW_1_SHIFT 4 -# define RADEON_MODELVIEW_2_SHIFT 8 -# define RADEON_MODELVIEW_3_SHIFT 12 -# define RADEON_IT_MODELVIEW_0_SHIFT 16 -# define RADEON_IT_MODELVIEW_1_SHIFT 20 -# define RADEON_IT_MODELVIEW_2_SHIFT 24 -# define RADEON_IT_MODELVIEW_3_SHIFT 28 -#define RADEON_SE_TCL_MATRIX_SELECT_1 0x2260 -# define RADEON_MODELPROJECT_0_SHIFT 0 -# define RADEON_MODELPROJECT_1_SHIFT 4 -# define RADEON_MODELPROJECT_2_SHIFT 8 -# define RADEON_MODELPROJECT_3_SHIFT 12 -# define RADEON_TEXMAT_0_SHIFT 16 -# define RADEON_TEXMAT_1_SHIFT 20 -# define RADEON_TEXMAT_2_SHIFT 24 -# define RADEON_TEXMAT_3_SHIFT 28 - - -#define RADEON_SE_TCL_OUTPUT_VTX_FMT 0x2254 -# define RADEON_TCL_VTX_W0 (1 << 0) -# define RADEON_TCL_VTX_FP_DIFFUSE (1 << 1) -# define RADEON_TCL_VTX_FP_ALPHA (1 << 2) -# define RADEON_TCL_VTX_PK_DIFFUSE (1 << 3) -# define RADEON_TCL_VTX_FP_SPEC (1 << 4) -# define RADEON_TCL_VTX_FP_FOG (1 << 5) -# define RADEON_TCL_VTX_PK_SPEC (1 << 6) -# define RADEON_TCL_VTX_ST0 (1 << 7) -# define RADEON_TCL_VTX_ST1 (1 << 8) -# define RADEON_TCL_VTX_Q1 (1 << 9) -# define RADEON_TCL_VTX_ST2 (1 << 10) -# define RADEON_TCL_VTX_Q2 (1 << 11) -# define RADEON_TCL_VTX_ST3 (1 << 12) -# define RADEON_TCL_VTX_Q3 (1 << 13) -# define RADEON_TCL_VTX_Q0 (1 << 14) -# define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15 -# define RADEON_TCL_VTX_NORM0 (1 << 18) -# define RADEON_TCL_VTX_XY1 (1 << 27) -# define RADEON_TCL_VTX_Z1 (1 << 28) -# define RADEON_TCL_VTX_W1 (1 << 29) -# define RADEON_TCL_VTX_NORM1 (1 << 30) -# define RADEON_TCL_VTX_Z0 (1 << 31) - -#define RADEON_SE_TCL_OUTPUT_VTX_SEL 0x2258 -# define RADEON_TCL_COMPUTE_XYZW (1 << 0) -# define RADEON_TCL_COMPUTE_DIFFUSE (1 << 1) -# define RADEON_TCL_COMPUTE_SPECULAR (1 << 2) -# define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3) -# define RADEON_TCL_FORCE_INORDER_PROC (1 << 4) -# define RADEON_TCL_TEX_INPUT_TEX_0 0 -# define RADEON_TCL_TEX_INPUT_TEX_1 1 -# define RADEON_TCL_TEX_INPUT_TEX_2 2 -# define RADEON_TCL_TEX_INPUT_TEX_3 3 -# define RADEON_TCL_TEX_COMPUTED_TEX_0 8 -# define RADEON_TCL_TEX_COMPUTED_TEX_1 9 -# define RADEON_TCL_TEX_COMPUTED_TEX_2 10 -# define RADEON_TCL_TEX_COMPUTED_TEX_3 11 -# define RADEON_TCL_TEX_0_OUTPUT_SHIFT 16 -# define RADEON_TCL_TEX_1_OUTPUT_SHIFT 20 -# define RADEON_TCL_TEX_2_OUTPUT_SHIFT 24 -# define RADEON_TCL_TEX_3_OUTPUT_SHIFT 28 - -#define RADEON_SE_TCL_PER_LIGHT_CTL_0 0x2270 -# define RADEON_LIGHT_0_ENABLE (1 << 0) -# define RADEON_LIGHT_0_ENABLE_AMBIENT (1 << 1) -# define RADEON_LIGHT_0_ENABLE_SPECULAR (1 << 2) -# define RADEON_LIGHT_0_IS_LOCAL (1 << 3) -# define RADEON_LIGHT_0_IS_SPOT (1 << 4) -# define RADEON_LIGHT_0_DUAL_CONE (1 << 5) -# define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6) -# define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7) -# define RADEON_LIGHT_0_SHIFT 0 -# define RADEON_LIGHT_1_ENABLE (1 << 16) -# define RADEON_LIGHT_1_ENABLE_AMBIENT (1 << 17) -# define RADEON_LIGHT_1_ENABLE_SPECULAR (1 << 18) -# define RADEON_LIGHT_1_IS_LOCAL (1 << 19) -# define RADEON_LIGHT_1_IS_SPOT (1 << 20) -# define RADEON_LIGHT_1_DUAL_CONE (1 << 21) -# define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22) -# define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23) -# define RADEON_LIGHT_1_SHIFT 16 -#define RADEON_SE_TCL_PER_LIGHT_CTL_1 0x2274 -# define RADEON_LIGHT_2_SHIFT 0 -# define RADEON_LIGHT_3_SHIFT 16 -#define RADEON_SE_TCL_PER_LIGHT_CTL_2 0x2278 -# define RADEON_LIGHT_4_SHIFT 0 -# define RADEON_LIGHT_5_SHIFT 16 -#define RADEON_SE_TCL_PER_LIGHT_CTL_3 0x227c -# define RADEON_LIGHT_6_SHIFT 0 -# define RADEON_LIGHT_7_SHIFT 16 - -#define RADEON_SE_TCL_SHININESS 0x2250 - -#define RADEON_SE_TCL_TEXTURE_PROC_CTL 0x2268 -# define RADEON_TEXGEN_TEXMAT_0_ENABLE (1 << 0) -# define RADEON_TEXGEN_TEXMAT_1_ENABLE (1 << 1) -# define RADEON_TEXGEN_TEXMAT_2_ENABLE (1 << 2) -# define RADEON_TEXGEN_TEXMAT_3_ENABLE (1 << 3) -# define RADEON_TEXMAT_0_ENABLE (1 << 4) -# define RADEON_TEXMAT_1_ENABLE (1 << 5) -# define RADEON_TEXMAT_2_ENABLE (1 << 6) -# define RADEON_TEXMAT_3_ENABLE (1 << 7) -# define RADEON_TEXGEN_INPUT_MASK 0xf -# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0 -# define RADEON_TEXGEN_INPUT_TEXCOORD_1 1 -# define RADEON_TEXGEN_INPUT_TEXCOORD_2 2 -# define RADEON_TEXGEN_INPUT_TEXCOORD_3 3 -# define RADEON_TEXGEN_INPUT_OBJ 4 -# define RADEON_TEXGEN_INPUT_EYE 5 -# define RADEON_TEXGEN_INPUT_EYE_NORMAL 6 -# define RADEON_TEXGEN_INPUT_EYE_REFLECT 7 -# define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8 -# define RADEON_TEXGEN_0_INPUT_SHIFT 16 -# define RADEON_TEXGEN_1_INPUT_SHIFT 20 -# define RADEON_TEXGEN_2_INPUT_SHIFT 24 -# define RADEON_TEXGEN_3_INPUT_SHIFT 28 - -#define RADEON_SE_TCL_UCP_VERT_BLEND_CTL 0x2264 -# define RADEON_UCP_IN_CLIP_SPACE (1 << 0) -# define RADEON_UCP_IN_MODEL_SPACE (1 << 1) -# define RADEON_UCP_ENABLE_0 (1 << 2) -# define RADEON_UCP_ENABLE_1 (1 << 3) -# define RADEON_UCP_ENABLE_2 (1 << 4) -# define RADEON_UCP_ENABLE_3 (1 << 5) -# define RADEON_UCP_ENABLE_4 (1 << 6) -# define RADEON_UCP_ENABLE_5 (1 << 7) -# define RADEON_TCL_FOG_MASK (3 << 8) -# define RADEON_TCL_FOG_DISABLE (0 << 8) -# define RADEON_TCL_FOG_EXP (1 << 8) -# define RADEON_TCL_FOG_EXP2 (2 << 8) -# define RADEON_TCL_FOG_LINEAR (3 << 8) -# define RADEON_RNG_BASED_FOG (1 << 10) -# define RADEON_LIGHT_TWOSIDE (1 << 11) -# define RADEON_BLEND_OP_COUNT_MASK (7 << 12) -# define RADEON_BLEND_OP_COUNT_SHIFT 12 -# define RADEON_POSITION_BLEND_OP_ENABLE (1 << 16) -# define RADEON_NORMAL_BLEND_OP_ENABLE (1 << 17) -# define RADEON_VERTEX_BLEND_SRC_0_PRIMARY (1 << 18) -# define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18) -# define RADEON_VERTEX_BLEND_SRC_1_PRIMARY (1 << 19) -# define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19) -# define RADEON_VERTEX_BLEND_SRC_2_PRIMARY (1 << 20) -# define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20) -# define RADEON_VERTEX_BLEND_SRC_3_PRIMARY (1 << 21) -# define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21) -# define RADEON_VERTEX_BLEND_WGT_MINUS_ONE (1 << 22) -# define RADEON_CULL_FRONT_IS_CW (0 << 28) -# define RADEON_CULL_FRONT_IS_CCW (1 << 28) -# define RADEON_CULL_FRONT (1 << 29) -# define RADEON_CULL_BACK (1 << 30) -# define RADEON_FORCE_W_TO_ONE (1 << 31) - -#define RADEON_SE_VPORT_XSCALE 0x1d98 -#define RADEON_SE_VPORT_XOFFSET 0x1d9c -#define RADEON_SE_VPORT_YSCALE 0x1da0 -#define RADEON_SE_VPORT_YOFFSET 0x1da4 -#define RADEON_SE_VPORT_ZSCALE 0x1da8 -#define RADEON_SE_VPORT_ZOFFSET 0x1dac -#define RADEON_SE_ZBIAS_FACTOR 0x1db0 -#define RADEON_SE_ZBIAS_CONSTANT 0x1db4 - -#define RADEON_SE_VTX_FMT 0x2080 -# define RADEON_SE_VTX_FMT_XY 0x00000000 -# define RADEON_SE_VTX_FMT_W0 0x00000001 -# define RADEON_SE_VTX_FMT_FPCOLOR 0x00000002 -# define RADEON_SE_VTX_FMT_FPALPHA 0x00000004 -# define RADEON_SE_VTX_FMT_PKCOLOR 0x00000008 -# define RADEON_SE_VTX_FMT_FPSPEC 0x00000010 -# define RADEON_SE_VTX_FMT_FPFOG 0x00000020 -# define RADEON_SE_VTX_FMT_PKSPEC 0x00000040 -# define RADEON_SE_VTX_FMT_ST0 0x00000080 -# define RADEON_SE_VTX_FMT_ST1 0x00000100 -# define RADEON_SE_VTX_FMT_Q1 0x00000200 -# define RADEON_SE_VTX_FMT_ST2 0x00000400 -# define RADEON_SE_VTX_FMT_Q2 0x00000800 -# define RADEON_SE_VTX_FMT_ST3 0x00001000 -# define RADEON_SE_VTX_FMT_Q3 0x00002000 -# define RADEON_SE_VTX_FMT_Q0 0x00004000 -# define RADEON_SE_VTX_FMT_BLND_WEIGHT_CNT_MASK 0x00038000 -# define RADEON_SE_VTX_FMT_N0 0x00040000 -# define RADEON_SE_VTX_FMT_XY1 0x08000000 -# define RADEON_SE_VTX_FMT_Z1 0x10000000 -# define RADEON_SE_VTX_FMT_W1 0x20000000 -# define RADEON_SE_VTX_FMT_N1 0x40000000 -# define RADEON_SE_VTX_FMT_Z 0x80000000 - -#define RADEON_SE_VF_CNTL 0x2084 -# define RADEON_VF_PRIM_TYPE_POINT_LIST 1 -# define RADEON_VF_PRIM_TYPE_LINE_LIST 2 -# define RADEON_VF_PRIM_TYPE_LINE_STRIP 3 -# define RADEON_VF_PRIM_TYPE_TRIANGLE_LIST 4 -# define RADEON_VF_PRIM_TYPE_TRIANGLE_FAN 5 -# define RADEON_VF_PRIM_TYPE_TRIANGLE_STRIP 6 -# define RADEON_VF_PRIM_TYPE_TRIANGLE_FLAG 7 -# define RADEON_VF_PRIM_TYPE_RECTANGLE_LIST 8 -# define RADEON_VF_PRIM_TYPE_POINT_LIST_3 9 -# define RADEON_VF_PRIM_TYPE_LINE_LIST_3 10 -# define RADEON_VF_PRIM_TYPE_SPIRIT_LIST 11 -# define RADEON_VF_PRIM_TYPE_LINE_LOOP 12 -# define RADEON_VF_PRIM_TYPE_QUAD_LIST 13 -# define RADEON_VF_PRIM_TYPE_QUAD_STRIP 14 -# define RADEON_VF_PRIM_TYPE_POLYGON 15 -# define RADEON_VF_PRIM_WALK_STATE (0<<4) -# define RADEON_VF_PRIM_WALK_INDEX (1<<4) -# define RADEON_VF_PRIM_WALK_LIST (2<<4) -# define RADEON_VF_PRIM_WALK_DATA (3<<4) -# define RADEON_VF_COLOR_ORDER_RGBA (1<<6) -# define RADEON_VF_RADEON_MODE (1<<8) -# define RADEON_VF_TCL_OUTPUT_CTL_ENA (1<<9) -# define RADEON_VF_PROG_STREAM_ENA (1<<10) -# define RADEON_VF_INDEX_SIZE_SHIFT 11 -# define RADEON_VF_NUM_VERTICES_SHIFT 16 - -#define RADEON_SE_PORT_DATA0 0x2000 - -#define R200_SE_VAP_CNTL 0x2080 -# define R200_VAP_TCL_ENABLE 0x00000001 -# define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010 -# define R200_VAP_FORCE_W_TO_ONE 0x00010000 -# define R200_VAP_D3D_TEX_DEFAULT 0x00020000 -# define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18 -# define R200_VAP_VF_MAX_VTX_NUM (9 << 18) -# define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000 -#define R200_VF_MAX_VTX_INDX 0x210c -#define R200_VF_MIN_VTX_INDX 0x2110 -#define R200_SE_VTE_CNTL 0x20b0 -# define R200_VPORT_X_SCALE_ENA 0x00000001 -# define R200_VPORT_X_OFFSET_ENA 0x00000002 -# define R200_VPORT_Y_SCALE_ENA 0x00000004 -# define R200_VPORT_Y_OFFSET_ENA 0x00000008 -# define R200_VPORT_Z_SCALE_ENA 0x00000010 -# define R200_VPORT_Z_OFFSET_ENA 0x00000020 -# define R200_VTX_XY_FMT 0x00000100 -# define R200_VTX_Z_FMT 0x00000200 -# define R200_VTX_W0_FMT 0x00000400 -# define R200_VTX_W0_NORMALIZE 0x00000800 -# define R200_VTX_ST_DENORMALIZED 0x00001000 -#define R200_SE_VAP_CNTL_STATUS 0x2140 -# define R200_VC_NO_SWAP (0 << 0) -# define R200_VC_16BIT_SWAP (1 << 0) -# define R200_VC_32BIT_SWAP (2 << 0) -#define R200_PP_TXFILTER_0 0x2c00 -#define R200_PP_TXFILTER_1 0x2c20 -#define R200_PP_TXFILTER_2 0x2c40 -#define R200_PP_TXFILTER_3 0x2c60 -#define R200_PP_TXFILTER_4 0x2c80 -#define R200_PP_TXFILTER_5 0x2ca0 -# define R200_MAG_FILTER_NEAREST (0 << 0) -# define R200_MAG_FILTER_LINEAR (1 << 0) -# define R200_MAG_FILTER_MASK (1 << 0) -# define R200_MIN_FILTER_NEAREST (0 << 1) -# define R200_MIN_FILTER_LINEAR (1 << 1) -# define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) -# define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) -# define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) -# define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) -# define R200_MIN_FILTER_ANISO_NEAREST (8 << 1) -# define R200_MIN_FILTER_ANISO_LINEAR (9 << 1) -# define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) -# define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) -# define R200_MIN_FILTER_MASK (15 << 1) -# define R200_MAX_ANISO_1_TO_1 (0 << 5) -# define R200_MAX_ANISO_2_TO_1 (1 << 5) -# define R200_MAX_ANISO_4_TO_1 (2 << 5) -# define R200_MAX_ANISO_8_TO_1 (3 << 5) -# define R200_MAX_ANISO_16_TO_1 (4 << 5) -# define R200_MAX_ANISO_MASK (7 << 5) -# define R200_MAX_MIP_LEVEL_MASK (0x0f << 16) -# define R200_MAX_MIP_LEVEL_SHIFT 16 -# define R200_YUV_TO_RGB (1 << 20) -# define R200_YUV_TEMPERATURE_COOL (0 << 21) -# define R200_YUV_TEMPERATURE_HOT (1 << 21) -# define R200_YUV_TEMPERATURE_MASK (1 << 21) -# define R200_WRAPEN_S (1 << 22) -# define R200_CLAMP_S_WRAP (0 << 23) -# define R200_CLAMP_S_MIRROR (1 << 23) -# define R200_CLAMP_S_CLAMP_LAST (2 << 23) -# define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) -# define R200_CLAMP_S_CLAMP_BORDER (4 << 23) -# define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) -# define R200_CLAMP_S_CLAMP_GL (6 << 23) -# define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) -# define R200_CLAMP_S_MASK (7 << 23) -# define R200_WRAPEN_T (1 << 26) -# define R200_CLAMP_T_WRAP (0 << 27) -# define R200_CLAMP_T_MIRROR (1 << 27) -# define R200_CLAMP_T_CLAMP_LAST (2 << 27) -# define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) -# define R200_CLAMP_T_CLAMP_BORDER (4 << 27) -# define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) -# define R200_CLAMP_T_CLAMP_GL (6 << 27) -# define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) -# define R200_CLAMP_T_MASK (7 << 27) -# define R200_KILL_LT_ZERO (1 << 30) -# define R200_BORDER_MODE_OGL (0 << 31) -# define R200_BORDER_MODE_D3D (1 << 31) -#define R200_PP_TXFORMAT_0 0x2c04 -#define R200_PP_TXFORMAT_1 0x2c24 -#define R200_PP_TXFORMAT_2 0x2c44 -#define R200_PP_TXFORMAT_3 0x2c64 -#define R200_PP_TXFORMAT_4 0x2c84 -#define R200_PP_TXFORMAT_5 0x2ca4 -# define R200_TXFORMAT_I8 (0 << 0) -# define R200_TXFORMAT_AI88 (1 << 0) -# define R200_TXFORMAT_RGB332 (2 << 0) -# define R200_TXFORMAT_ARGB1555 (3 << 0) -# define R200_TXFORMAT_RGB565 (4 << 0) -# define R200_TXFORMAT_ARGB4444 (5 << 0) -# define R200_TXFORMAT_ARGB8888 (6 << 0) -# define R200_TXFORMAT_RGBA8888 (7 << 0) -# define R200_TXFORMAT_Y8 (8 << 0) -# define R200_TXFORMAT_AVYU4444 (9 << 0) -# define R200_TXFORMAT_VYUY422 (10 << 0) -# define R200_TXFORMAT_YVYU422 (11 << 0) -# define R200_TXFORMAT_DXT1 (12 << 0) -# define R200_TXFORMAT_DXT23 (14 << 0) -# define R200_TXFORMAT_DXT45 (15 << 0) -# define R200_TXFORMAT_ABGR8888 (22 << 0) -# define R200_TXFORMAT_FORMAT_MASK (31 << 0) -# define R200_TXFORMAT_FORMAT_SHIFT 0 -# define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6) -# define R200_TXFORMAT_NON_POWER2 (1 << 7) -# define R200_TXFORMAT_WIDTH_MASK (15 << 8) -# define R200_TXFORMAT_WIDTH_SHIFT 8 -# define R200_TXFORMAT_HEIGHT_MASK (15 << 12) -# define R200_TXFORMAT_HEIGHT_SHIFT 12 -# define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */ -# define R200_TXFORMAT_F5_WIDTH_SHIFT 16 -# define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20) -# define R200_TXFORMAT_F5_HEIGHT_SHIFT 20 -# define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) -# define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) -# define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) -# define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24) -# define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24) -# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) -# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) -# define R200_TXFORMAT_ST_ROUTE_SHIFT 24 -# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) -# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) -# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) -#define R200_PP_TXFORMAT_X_0 0x2c08 -#define R200_PP_TXFORMAT_X_1 0x2c28 -#define R200_PP_TXFORMAT_X_2 0x2c48 -#define R200_PP_TXFORMAT_X_3 0x2c68 -#define R200_PP_TXFORMAT_X_4 0x2c88 -#define R200_PP_TXFORMAT_X_5 0x2ca8 - -#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */ -#define R200_PP_TXSIZE_1 0x2c2c /* NPOT only */ -#define R200_PP_TXSIZE_2 0x2c4c /* NPOT only */ -#define R200_PP_TXSIZE_3 0x2c6c /* NPOT only */ -#define R200_PP_TXSIZE_4 0x2c8c /* NPOT only */ -#define R200_PP_TXSIZE_5 0x2cac /* NPOT only */ - -#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */ -#define R200_PP_TXPITCH_1 0x2c30 /* NPOT only */ -#define R200_PP_TXPITCH_2 0x2c50 /* NPOT only */ -#define R200_PP_TXPITCH_3 0x2c70 /* NPOT only */ -#define R200_PP_TXPITCH_4 0x2c90 /* NPOT only */ -#define R200_PP_TXPITCH_5 0x2cb0 /* NPOT only */ - -#define R200_PP_TXOFFSET_0 0x2d00 -# define R200_TXO_ENDIAN_NO_SWAP (0 << 0) -# define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0) -# define R200_TXO_ENDIAN_WORD_SWAP (2 << 0) -# define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0) -# define R200_TXO_MACRO_LINEAR (0 << 2) -# define R200_TXO_MACRO_TILE (1 << 2) -# define R200_TXO_MICRO_LINEAR (0 << 3) -# define R200_TXO_MICRO_TILE (1 << 3) -# define R200_TXO_OFFSET_MASK 0xffffffe0 -# define R200_TXO_OFFSET_SHIFT 5 -#define R200_PP_TXOFFSET_1 0x2d18 -#define R200_PP_TXOFFSET_2 0x2d30 -#define R200_PP_TXOFFSET_3 0x2d48 -#define R200_PP_TXOFFSET_4 0x2d60 -#define R200_PP_TXOFFSET_5 0x2d78 - -#define R200_PP_TFACTOR_0 0x2ee0 -#define R200_PP_TFACTOR_1 0x2ee4 -#define R200_PP_TFACTOR_2 0x2ee8 -#define R200_PP_TFACTOR_3 0x2eec -#define R200_PP_TFACTOR_4 0x2ef0 -#define R200_PP_TFACTOR_5 0x2ef4 - -#define R200_PP_TXCBLEND_0 0x2f00 -# define R200_TXC_ARG_A_ZERO (0) -# define R200_TXC_ARG_A_CURRENT_COLOR (2) -# define R200_TXC_ARG_A_CURRENT_ALPHA (3) -# define R200_TXC_ARG_A_DIFFUSE_COLOR (4) -# define R200_TXC_ARG_A_DIFFUSE_ALPHA (5) -# define R200_TXC_ARG_A_SPECULAR_COLOR (6) -# define R200_TXC_ARG_A_SPECULAR_ALPHA (7) -# define R200_TXC_ARG_A_TFACTOR_COLOR (8) -# define R200_TXC_ARG_A_TFACTOR_ALPHA (9) -# define R200_TXC_ARG_A_R0_COLOR (10) -# define R200_TXC_ARG_A_R0_ALPHA (11) -# define R200_TXC_ARG_A_R1_COLOR (12) -# define R200_TXC_ARG_A_R1_ALPHA (13) -# define R200_TXC_ARG_A_R2_COLOR (14) -# define R200_TXC_ARG_A_R2_ALPHA (15) -# define R200_TXC_ARG_A_R3_COLOR (16) -# define R200_TXC_ARG_A_R3_ALPHA (17) -# define R200_TXC_ARG_A_R4_COLOR (18) -# define R200_TXC_ARG_A_R4_ALPHA (19) -# define R200_TXC_ARG_A_R5_COLOR (20) -# define R200_TXC_ARG_A_R5_ALPHA (21) -# define R200_TXC_ARG_A_TFACTOR1_COLOR (26) -# define R200_TXC_ARG_A_TFACTOR1_ALPHA (27) -# define R200_TXC_ARG_A_MASK (31 << 0) -# define R200_TXC_ARG_A_SHIFT 0 -# define R200_TXC_ARG_B_ZERO (0 << 5) -# define R200_TXC_ARG_B_CURRENT_COLOR (2 << 5) -# define R200_TXC_ARG_B_CURRENT_ALPHA (3 << 5) -# define R200_TXC_ARG_B_DIFFUSE_COLOR (4 << 5) -# define R200_TXC_ARG_B_DIFFUSE_ALPHA (5 << 5) -# define R200_TXC_ARG_B_SPECULAR_COLOR (6 << 5) -# define R200_TXC_ARG_B_SPECULAR_ALPHA (7 << 5) -# define R200_TXC_ARG_B_TFACTOR_COLOR (8 << 5) -# define R200_TXC_ARG_B_TFACTOR_ALPHA (9 << 5) -# define R200_TXC_ARG_B_R0_COLOR (10 << 5) -# define R200_TXC_ARG_B_R0_ALPHA (11 << 5) -# define R200_TXC_ARG_B_R1_COLOR (12 << 5) -# define R200_TXC_ARG_B_R1_ALPHA (13 << 5) -# define R200_TXC_ARG_B_R2_COLOR (14 << 5) -# define R200_TXC_ARG_B_R2_ALPHA (15 << 5) -# define R200_TXC_ARG_B_R3_COLOR (16 << 5) -# define R200_TXC_ARG_B_R3_ALPHA (17 << 5) -# define R200_TXC_ARG_B_R4_COLOR (18 << 5) -# define R200_TXC_ARG_B_R4_ALPHA (19 << 5) -# define R200_TXC_ARG_B_R5_COLOR (20 << 5) -# define R200_TXC_ARG_B_R5_ALPHA (21 << 5) -# define R200_TXC_ARG_B_TFACTOR1_COLOR (26 << 5) -# define R200_TXC_ARG_B_TFACTOR1_ALPHA (27 << 5) -# define R200_TXC_ARG_B_MASK (31 << 5) -# define R200_TXC_ARG_B_SHIFT 5 -# define R200_TXC_ARG_C_ZERO (0 << 10) -# define R200_TXC_ARG_C_CURRENT_COLOR (2 << 10) -# define R200_TXC_ARG_C_CURRENT_ALPHA (3 << 10) -# define R200_TXC_ARG_C_DIFFUSE_COLOR (4 << 10) -# define R200_TXC_ARG_C_DIFFUSE_ALPHA (5 << 10) -# define R200_TXC_ARG_C_SPECULAR_COLOR (6 << 10) -# define R200_TXC_ARG_C_SPECULAR_ALPHA (7 << 10) -# define R200_TXC_ARG_C_TFACTOR_COLOR (8 << 10) -# define R200_TXC_ARG_C_TFACTOR_ALPHA (9 << 10) -# define R200_TXC_ARG_C_R0_COLOR (10 << 10) -# define R200_TXC_ARG_C_R0_ALPHA (11 << 10) -# define R200_TXC_ARG_C_R1_COLOR (12 << 10) -# define R200_TXC_ARG_C_R1_ALPHA (13 << 10) -# define R200_TXC_ARG_C_R2_COLOR (14 << 10) -# define R200_TXC_ARG_C_R2_ALPHA (15 << 10) -# define R200_TXC_ARG_C_R3_COLOR (16 << 10) -# define R200_TXC_ARG_C_R3_ALPHA (17 << 10) -# define R200_TXC_ARG_C_R4_COLOR (18 << 10) -# define R200_TXC_ARG_C_R4_ALPHA (19 << 10) -# define R200_TXC_ARG_C_R5_COLOR (20 << 10) -# define R200_TXC_ARG_C_R5_ALPHA (21 << 10) -# define R200_TXC_ARG_C_TFACTOR1_COLOR (26 << 10) -# define R200_TXC_ARG_C_TFACTOR1_ALPHA (27 << 10) -# define R200_TXC_ARG_C_MASK (31 << 10) -# define R200_TXC_ARG_C_SHIFT 10 -# define R200_TXC_COMP_ARG_A (1 << 16) -# define R200_TXC_COMP_ARG_A_SHIFT (16) -# define R200_TXC_BIAS_ARG_A (1 << 17) -# define R200_TXC_SCALE_ARG_A (1 << 18) -# define R200_TXC_NEG_ARG_A (1 << 19) -# define R200_TXC_COMP_ARG_B (1 << 20) -# define R200_TXC_COMP_ARG_B_SHIFT (20) -# define R200_TXC_BIAS_ARG_B (1 << 21) -# define R200_TXC_SCALE_ARG_B (1 << 22) -# define R200_TXC_NEG_ARG_B (1 << 23) -# define R200_TXC_COMP_ARG_C (1 << 24) -# define R200_TXC_COMP_ARG_C_SHIFT (24) -# define R200_TXC_BIAS_ARG_C (1 << 25) -# define R200_TXC_SCALE_ARG_C (1 << 26) -# define R200_TXC_NEG_ARG_C (1 << 27) -# define R200_TXC_OP_MADD (0 << 28) -# define R200_TXC_OP_CND0 (2 << 28) -# define R200_TXC_OP_LERP (3 << 28) -# define R200_TXC_OP_DOT3 (4 << 28) -# define R200_TXC_OP_DOT4 (5 << 28) -# define R200_TXC_OP_CONDITIONAL (6 << 28) -# define R200_TXC_OP_DOT2_ADD (7 << 28) -# define R200_TXC_OP_MASK (7 << 28) -#define R200_PP_TXCBLEND2_0 0x2f04 -# define R200_TXC_TFACTOR_SEL_SHIFT 0 -# define R200_TXC_TFACTOR_SEL_MASK 0x7 -# define R200_TXC_TFACTOR1_SEL_SHIFT 4 -# define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4) -# define R200_TXC_SCALE_SHIFT 8 -# define R200_TXC_SCALE_MASK (7 << 8) -# define R200_TXC_SCALE_1X (0 << 8) -# define R200_TXC_SCALE_2X (1 << 8) -# define R200_TXC_SCALE_4X (2 << 8) -# define R200_TXC_SCALE_8X (3 << 8) -# define R200_TXC_SCALE_INV2 (5 << 8) -# define R200_TXC_SCALE_INV4 (6 << 8) -# define R200_TXC_SCALE_INV8 (7 << 8) -# define R200_TXC_CLAMP_SHIFT 12 -# define R200_TXC_CLAMP_MASK (3 << 12) -# define R200_TXC_CLAMP_WRAP (0 << 12) -# define R200_TXC_CLAMP_0_1 (1 << 12) -# define R200_TXC_CLAMP_8_8 (2 << 12) -# define R200_TXC_OUTPUT_REG_MASK (7 << 16) -# define R200_TXC_OUTPUT_REG_NONE (0 << 16) -# define R200_TXC_OUTPUT_REG_R0 (1 << 16) -# define R200_TXC_OUTPUT_REG_R1 (2 << 16) -# define R200_TXC_OUTPUT_REG_R2 (3 << 16) -# define R200_TXC_OUTPUT_REG_R3 (4 << 16) -# define R200_TXC_OUTPUT_REG_R4 (5 << 16) -# define R200_TXC_OUTPUT_REG_R5 (6 << 16) -# define R200_TXC_OUTPUT_MASK_MASK (7 << 20) -# define R200_TXC_OUTPUT_MASK_RGB (0 << 20) -# define R200_TXC_OUTPUT_MASK_RG (1 << 20) -# define R200_TXC_OUTPUT_MASK_RB (2 << 20) -# define R200_TXC_OUTPUT_MASK_R (3 << 20) -# define R200_TXC_OUTPUT_MASK_GB (4 << 20) -# define R200_TXC_OUTPUT_MASK_G (5 << 20) -# define R200_TXC_OUTPUT_MASK_B (6 << 20) -# define R200_TXC_OUTPUT_MASK_NONE (7 << 20) -# define R200_TXC_REPL_NORMAL 0 -# define R200_TXC_REPL_RED 1 -# define R200_TXC_REPL_GREEN 2 -# define R200_TXC_REPL_BLUE 3 -# define R200_TXC_REPL_ARG_A_SHIFT 26 -# define R200_TXC_REPL_ARG_A_MASK (3 << 26) -# define R200_TXC_REPL_ARG_B_SHIFT 28 -# define R200_TXC_REPL_ARG_B_MASK (3 << 28) -# define R200_TXC_REPL_ARG_C_SHIFT 30 -# define R200_TXC_REPL_ARG_C_MASK (3 << 30) -#define R200_PP_TXABLEND_0 0x2f08 -# define R200_TXA_ARG_A_ZERO (0) -# define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */ -# define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */ -# define R200_TXA_ARG_A_DIFFUSE_ALPHA (4) -# define R200_TXA_ARG_A_DIFFUSE_BLUE (5) -# define R200_TXA_ARG_A_SPECULAR_ALPHA (6) -# define R200_TXA_ARG_A_SPECULAR_BLUE (7) -# define R200_TXA_ARG_A_TFACTOR_ALPHA (8) -# define R200_TXA_ARG_A_TFACTOR_BLUE (9) -# define R200_TXA_ARG_A_R0_ALPHA (10) -# define R200_TXA_ARG_A_R0_BLUE (11) -# define R200_TXA_ARG_A_R1_ALPHA (12) -# define R200_TXA_ARG_A_R1_BLUE (13) -# define R200_TXA_ARG_A_R2_ALPHA (14) -# define R200_TXA_ARG_A_R2_BLUE (15) -# define R200_TXA_ARG_A_R3_ALPHA (16) -# define R200_TXA_ARG_A_R3_BLUE (17) -# define R200_TXA_ARG_A_R4_ALPHA (18) -# define R200_TXA_ARG_A_R4_BLUE (19) -# define R200_TXA_ARG_A_R5_ALPHA (20) -# define R200_TXA_ARG_A_R5_BLUE (21) -# define R200_TXA_ARG_A_TFACTOR1_ALPHA (26) -# define R200_TXA_ARG_A_TFACTOR1_BLUE (27) -# define R200_TXA_ARG_A_MASK (31 << 0) -# define R200_TXA_ARG_A_SHIFT 0 -# define R200_TXA_ARG_B_ZERO (0 << 5) -# define R200_TXA_ARG_B_CURRENT_ALPHA (2 << 5) /* guess */ -# define R200_TXA_ARG_B_CURRENT_BLUE (3 << 5) /* guess */ -# define R200_TXA_ARG_B_DIFFUSE_ALPHA (4 << 5) -# define R200_TXA_ARG_B_DIFFUSE_BLUE (5 << 5) -# define R200_TXA_ARG_B_SPECULAR_ALPHA (6 << 5) -# define R200_TXA_ARG_B_SPECULAR_BLUE (7 << 5) -# define R200_TXA_ARG_B_TFACTOR_ALPHA (8 << 5) -# define R200_TXA_ARG_B_TFACTOR_BLUE (9 << 5) -# define R200_TXA_ARG_B_R0_ALPHA (10 << 5) -# define R200_TXA_ARG_B_R0_BLUE (11 << 5) -# define R200_TXA_ARG_B_R1_ALPHA (12 << 5) -# define R200_TXA_ARG_B_R1_BLUE (13 << 5) -# define R200_TXA_ARG_B_R2_ALPHA (14 << 5) -# define R200_TXA_ARG_B_R2_BLUE (15 << 5) -# define R200_TXA_ARG_B_R3_ALPHA (16 << 5) -# define R200_TXA_ARG_B_R3_BLUE (17 << 5) -# define R200_TXA_ARG_B_R4_ALPHA (18 << 5) -# define R200_TXA_ARG_B_R4_BLUE (19 << 5) -# define R200_TXA_ARG_B_R5_ALPHA (20 << 5) -# define R200_TXA_ARG_B_R5_BLUE (21 << 5) -# define R200_TXA_ARG_B_TFACTOR1_ALPHA (26 << 5) -# define R200_TXA_ARG_B_TFACTOR1_BLUE (27 << 5) -# define R200_TXA_ARG_B_MASK (31 << 5) -# define R200_TXA_ARG_B_SHIFT 5 -# define R200_TXA_ARG_C_ZERO (0 << 10) -# define R200_TXA_ARG_C_CURRENT_ALPHA (2 << 10) /* guess */ -# define R200_TXA_ARG_C_CURRENT_BLUE (3 << 10) /* guess */ -# define R200_TXA_ARG_C_DIFFUSE_ALPHA (4 << 10) -# define R200_TXA_ARG_C_DIFFUSE_BLUE (5 << 10) -# define R200_TXA_ARG_C_SPECULAR_ALPHA (6 << 10) -# define R200_TXA_ARG_C_SPECULAR_BLUE (7 << 10) -# define R200_TXA_ARG_C_TFACTOR_ALPHA (8 << 10) -# define R200_TXA_ARG_C_TFACTOR_BLUE (9 << 10) -# define R200_TXA_ARG_C_R0_ALPHA (10 << 10) -# define R200_TXA_ARG_C_R0_BLUE (11 << 10) -# define R200_TXA_ARG_C_R1_ALPHA (12 << 10) -# define R200_TXA_ARG_C_R1_BLUE (13 << 10) -# define R200_TXA_ARG_C_R2_ALPHA (14 << 10) -# define R200_TXA_ARG_C_R2_BLUE (15 << 10) -# define R200_TXA_ARG_C_R3_ALPHA (16 << 10) -# define R200_TXA_ARG_C_R3_BLUE (17 << 10) -# define R200_TXA_ARG_C_R4_ALPHA (18 << 10) -# define R200_TXA_ARG_C_R4_BLUE (19 << 10) -# define R200_TXA_ARG_C_R5_ALPHA (20 << 10) -# define R200_TXA_ARG_C_R5_BLUE (21 << 10) -# define R200_TXA_ARG_C_TFACTOR1_ALPHA (26 << 10) -# define R200_TXA_ARG_C_TFACTOR1_BLUE (27 << 10) -# define R200_TXA_ARG_C_MASK (31 << 10) -# define R200_TXA_ARG_C_SHIFT 10 -# define R200_TXA_COMP_ARG_A (1 << 16) -# define R200_TXA_COMP_ARG_A_SHIFT (16) -# define R200_TXA_BIAS_ARG_A (1 << 17) -# define R200_TXA_SCALE_ARG_A (1 << 18) -# define R200_TXA_NEG_ARG_A (1 << 19) -# define R200_TXA_COMP_ARG_B (1 << 20) -# define R200_TXA_COMP_ARG_B_SHIFT (20) -# define R200_TXA_BIAS_ARG_B (1 << 21) -# define R200_TXA_SCALE_ARG_B (1 << 22) -# define R200_TXA_NEG_ARG_B (1 << 23) -# define R200_TXA_COMP_ARG_C (1 << 24) -# define R200_TXA_COMP_ARG_C_SHIFT (24) -# define R200_TXA_BIAS_ARG_C (1 << 25) -# define R200_TXA_SCALE_ARG_C (1 << 26) -# define R200_TXA_NEG_ARG_C (1 << 27) -# define R200_TXA_OP_MADD (0 << 28) -# define R200_TXA_OP_CND0 (2 << 28) -# define R200_TXA_OP_LERP (3 << 28) -# define R200_TXA_OP_CONDITIONAL (6 << 28) -# define R200_TXA_OP_MASK (7 << 28) -#define R200_PP_TXABLEND2_0 0x2f0c -# define R200_TXA_TFACTOR_SEL_SHIFT 0 -# define R200_TXA_TFACTOR_SEL_MASK 0x7 -# define R200_TXA_TFACTOR1_SEL_SHIFT 4 -# define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4) -# define R200_TXA_SCALE_SHIFT 8 -# define R200_TXA_SCALE_MASK (7 << 8) -# define R200_TXA_SCALE_1X (0 << 8) -# define R200_TXA_SCALE_2X (1 << 8) -# define R200_TXA_SCALE_4X (2 << 8) -# define R200_TXA_SCALE_8X (3 << 8) -# define R200_TXA_SCALE_INV2 (5 << 8) -# define R200_TXA_SCALE_INV4 (6 << 8) -# define R200_TXA_SCALE_INV8 (7 << 8) -# define R200_TXA_CLAMP_SHIFT 12 -# define R200_TXA_CLAMP_MASK (3 << 12) -# define R200_TXA_CLAMP_WRAP (0 << 12) -# define R200_TXA_CLAMP_0_1 (1 << 12) -# define R200_TXA_CLAMP_8_8 (2 << 12) -# define R200_TXA_OUTPUT_REG_MASK (7 << 16) -# define R200_TXA_OUTPUT_REG_NONE (0 << 16) -# define R200_TXA_OUTPUT_REG_R0 (1 << 16) -# define R200_TXA_OUTPUT_REG_R1 (2 << 16) -# define R200_TXA_OUTPUT_REG_R2 (3 << 16) -# define R200_TXA_OUTPUT_REG_R3 (4 << 16) -# define R200_TXA_OUTPUT_REG_R4 (5 << 16) -# define R200_TXA_OUTPUT_REG_R5 (6 << 16) -# define R200_TXA_DOT_ALPHA (1 << 20) -# define R200_TXA_REPL_NORMAL 0 -# define R200_TXA_REPL_RED 1 -# define R200_TXA_REPL_GREEN 2 -# define R200_TXA_REPL_ARG_A_SHIFT 26 -# define R200_TXA_REPL_ARG_A_MASK (3 << 26) -# define R200_TXA_REPL_ARG_B_SHIFT 28 -# define R200_TXA_REPL_ARG_B_MASK (3 << 28) -# define R200_TXA_REPL_ARG_C_SHIFT 30 -# define R200_TXA_REPL_ARG_C_MASK (3 << 30) - -#define R200_SE_VTX_FMT_0 0x2088 -# define R200_VTX_XY 0 /* always have xy */ -# define R200_VTX_Z0 (1<<0) -# define R200_VTX_W0 (1<<1) -# define R200_VTX_WEIGHT_COUNT_SHIFT (2) -# define R200_VTX_PV_MATRIX_SEL (1<<5) -# define R200_VTX_N0 (1<<6) -# define R200_VTX_POINT_SIZE (1<<7) -# define R200_VTX_DISCRETE_FOG (1<<8) -# define R200_VTX_SHININESS_0 (1<<9) -# define R200_VTX_SHININESS_1 (1<<10) -# define R200_VTX_COLOR_NOT_PRESENT 0 -# define R200_VTX_PK_RGBA 1 -# define R200_VTX_FP_RGB 2 -# define R200_VTX_FP_RGBA 3 -# define R200_VTX_COLOR_MASK 3 -# define R200_VTX_COLOR_0_SHIFT 11 -# define R200_VTX_COLOR_1_SHIFT 13 -# define R200_VTX_COLOR_2_SHIFT 15 -# define R200_VTX_COLOR_3_SHIFT 17 -# define R200_VTX_COLOR_4_SHIFT 19 -# define R200_VTX_COLOR_5_SHIFT 21 -# define R200_VTX_COLOR_6_SHIFT 23 -# define R200_VTX_COLOR_7_SHIFT 25 -# define R200_VTX_XY1 (1<<28) -# define R200_VTX_Z1 (1<<29) -# define R200_VTX_W1 (1<<30) -# define R200_VTX_N1 (1<<31) -#define R200_SE_VTX_FMT_1 0x208c -# define R200_VTX_TEX0_COMP_CNT_SHIFT 0 -# define R200_VTX_TEX1_COMP_CNT_SHIFT 3 -# define R200_VTX_TEX2_COMP_CNT_SHIFT 6 -# define R200_VTX_TEX3_COMP_CNT_SHIFT 9 -# define R200_VTX_TEX4_COMP_CNT_SHIFT 12 -# define R200_VTX_TEX5_COMP_CNT_SHIFT 15 - -#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 -#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 -#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250 -# define R200_OUTPUT_XYZW (1<<0) -# define R200_OUTPUT_COLOR_0 (1<<8) -# define R200_OUTPUT_COLOR_1 (1<<9) -# define R200_OUTPUT_TEX_0 (1<<16) -# define R200_OUTPUT_TEX_1 (1<<17) -# define R200_OUTPUT_TEX_2 (1<<18) -# define R200_OUTPUT_TEX_3 (1<<19) -# define R200_OUTPUT_TEX_4 (1<<20) -# define R200_OUTPUT_TEX_5 (1<<21) -# define R200_OUTPUT_TEX_MASK (0x3f<<16) -# define R200_OUTPUT_DISCRETE_FOG (1<<24) -# define R200_OUTPUT_PT_SIZE (1<<25) -# define R200_FORCE_INORDER_PROC (1<<31) -#define R200_PP_CNTL_X 0x2cc4 -#define R200_PP_TXMULTI_CTL_0 0x2c1c -#define R200_SE_VTX_STATE_CNTL 0x2180 -# define R200_UPDATE_USER_COLOR_0_ENA_MASK (1<<16) - - /* Registers for CP and Microcode Engine */ -#define RADEON_CP_ME_RAM_ADDR 0x07d4 -#define RADEON_CP_ME_RAM_RADDR 0x07d8 -#define RADEON_CP_ME_RAM_DATAH 0x07dc -#define RADEON_CP_ME_RAM_DATAL 0x07e0 - -#define RADEON_CP_RB_BASE 0x0700 -#define RADEON_CP_RB_CNTL 0x0704 -#define RADEON_CP_RB_RPTR_ADDR 0x070c -#define RADEON_CP_RB_RPTR 0x0710 -#define RADEON_CP_RB_WPTR 0x0714 - -#define RADEON_CP_IB_BASE 0x0738 -#define RADEON_CP_IB_BUFSZ 0x073c - -#define RADEON_CP_CSQ_CNTL 0x0740 -# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0) -# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28) -# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28) -# define RADEON_CSQ_PRIBM_INDDIS (2 << 28) -# define RADEON_CSQ_PRIPIO_INDBM (3 << 28) -# define RADEON_CSQ_PRIBM_INDBM (4 << 28) -# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28) -#define RADEON_CP_CSQ_STAT 0x07f8 -# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0) -# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8) -# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16) -# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24) -#define RADEON_CP_CSQ_ADDR 0x07f0 -#define RADEON_CP_CSQ_DATA 0x07f4 -#define RADEON_CP_CSQ_APER_PRIMARY 0x1000 -#define RADEON_CP_CSQ_APER_INDIRECT 0x1300 - -#define RADEON_CP_RB_WPTR_DELAY 0x0718 -# define RADEON_PRE_WRITE_TIMER_SHIFT 0 -# define RADEON_PRE_WRITE_LIMIT_SHIFT 23 - -#define RADEON_AIC_CNTL 0x01d0 -# define RADEON_PCIGART_TRANSLATE_EN (1 << 0) -#define RADEON_AIC_LO_ADDR 0x01dc - - - - /* Constants */ -#define RADEON_LAST_FRAME_REG RADEON_GUI_SCRATCH_REG0 -#define RADEON_LAST_CLEAR_REG RADEON_GUI_SCRATCH_REG2 - - - - /* CP packet types */ -#define RADEON_CP_PACKET0 0x00000000 -#define RADEON_CP_PACKET1 0x40000000 -#define RADEON_CP_PACKET2 0x80000000 -#define RADEON_CP_PACKET3 0xC0000000 -# define RADEON_CP_PACKET_MASK 0xC0000000 -# define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000 -# define RADEON_CP_PACKET_MAX_DWORDS (1 << 12) -# define RADEON_CP_PACKET0_REG_MASK 0x000007ff -# define RADEON_CP_PACKET1_REG0_MASK 0x000007ff -# define RADEON_CP_PACKET1_REG1_MASK 0x003ff800 - -#define RADEON_CP_PACKET0_ONE_REG_WR 0x00008000 - -#define RADEON_CP_PACKET3_NOP 0xC0001000 -#define RADEON_CP_PACKET3_NEXT_CHAR 0xC0001900 -#define RADEON_CP_PACKET3_PLY_NEXTSCAN 0xC0001D00 -#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00 -#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300 -#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400 -#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600 -#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800 -#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900 -#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00 -#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00 -#define R200_CP_PACKET3_3D_DRAW_IMMD_2 0xc0003500 -#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00 -#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100 -#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200 -#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300 -#define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400 -#define RADEON_CP_PACKET3_CNTL_POLYLINE 0xC0009500 -#define RADEON_CP_PACKET3_CNTL_POLYSCANLINES 0xC0009800 -#define RADEON_CP_PACKET3_CNTL_PAINT_MULTI 0xC0009A00 -#define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00 -#define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00 - - -#define RADEON_CP_VC_FRMT_XY 0x00000000 -#define RADEON_CP_VC_FRMT_W0 0x00000001 -#define RADEON_CP_VC_FRMT_FPCOLOR 0x00000002 -#define RADEON_CP_VC_FRMT_FPALPHA 0x00000004 -#define RADEON_CP_VC_FRMT_PKCOLOR 0x00000008 -#define RADEON_CP_VC_FRMT_FPSPEC 0x00000010 -#define RADEON_CP_VC_FRMT_FPFOG 0x00000020 -#define RADEON_CP_VC_FRMT_PKSPEC 0x00000040 -#define RADEON_CP_VC_FRMT_ST0 0x00000080 -#define RADEON_CP_VC_FRMT_ST1 0x00000100 -#define RADEON_CP_VC_FRMT_Q1 0x00000200 -#define RADEON_CP_VC_FRMT_ST2 0x00000400 -#define RADEON_CP_VC_FRMT_Q2 0x00000800 -#define RADEON_CP_VC_FRMT_ST3 0x00001000 -#define RADEON_CP_VC_FRMT_Q3 0x00002000 -#define RADEON_CP_VC_FRMT_Q0 0x00004000 -#define RADEON_CP_VC_FRMT_BLND_WEIGHT_CNT_MASK 0x00038000 -#define RADEON_CP_VC_FRMT_N0 0x00040000 -#define RADEON_CP_VC_FRMT_XY1 0x08000000 -#define RADEON_CP_VC_FRMT_Z1 0x10000000 -#define RADEON_CP_VC_FRMT_W1 0x20000000 -#define RADEON_CP_VC_FRMT_N1 0x40000000 -#define RADEON_CP_VC_FRMT_Z 0x80000000 - -#define RADEON_CP_VC_CNTL_PRIM_TYPE_NONE 0x00000000 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_POINT 0x00000001 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE 0x00000002 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP 0x00000003 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST 0x00000004 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN 0x00000005 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP 0x00000006 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_TYPE_2 0x00000007 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST 0x00000008 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST 0x00000009 -#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST 0x0000000a -#define RADEON_CP_VC_CNTL_PRIM_TYPE_QUAD_LIST 0x0000000d -#define RADEON_CP_VC_CNTL_PRIM_WALK_IND 0x00000010 -#define RADEON_CP_VC_CNTL_PRIM_WALK_LIST 0x00000020 -#define RADEON_CP_VC_CNTL_PRIM_WALK_RING 0x00000030 -#define RADEON_CP_VC_CNTL_COLOR_ORDER_BGRA 0x00000000 -#define RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA 0x00000040 -#define RADEON_CP_VC_CNTL_MAOS_ENABLE 0x00000080 -#define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE 0x00000000 -#define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE 0x00000100 -#define RADEON_CP_VC_CNTL_TCL_DISABLE 0x00000000 -#define RADEON_CP_VC_CNTL_TCL_ENABLE 0x00000200 -#define RADEON_CP_VC_CNTL_NUM_SHIFT 16 - -#define RADEON_VS_MATRIX_0_ADDR 0 -#define RADEON_VS_MATRIX_1_ADDR 4 -#define RADEON_VS_MATRIX_2_ADDR 8 -#define RADEON_VS_MATRIX_3_ADDR 12 -#define RADEON_VS_MATRIX_4_ADDR 16 -#define RADEON_VS_MATRIX_5_ADDR 20 -#define RADEON_VS_MATRIX_6_ADDR 24 -#define RADEON_VS_MATRIX_7_ADDR 28 -#define RADEON_VS_MATRIX_8_ADDR 32 -#define RADEON_VS_MATRIX_9_ADDR 36 -#define RADEON_VS_MATRIX_10_ADDR 40 -#define RADEON_VS_MATRIX_11_ADDR 44 -#define RADEON_VS_MATRIX_12_ADDR 48 -#define RADEON_VS_MATRIX_13_ADDR 52 -#define RADEON_VS_MATRIX_14_ADDR 56 -#define RADEON_VS_MATRIX_15_ADDR 60 -#define RADEON_VS_LIGHT_AMBIENT_ADDR 64 -#define RADEON_VS_LIGHT_DIFFUSE_ADDR 72 -#define RADEON_VS_LIGHT_SPECULAR_ADDR 80 -#define RADEON_VS_LIGHT_DIRPOS_ADDR 88 -#define RADEON_VS_LIGHT_HWVSPOT_ADDR 96 -#define RADEON_VS_LIGHT_ATTENUATION_ADDR 104 -#define RADEON_VS_MATRIX_EYE2CLIP_ADDR 112 -#define RADEON_VS_UCP_ADDR 116 -#define RADEON_VS_GLOBAL_AMBIENT_ADDR 122 -#define RADEON_VS_FOG_PARAM_ADDR 123 -#define RADEON_VS_EYE_VECTOR_ADDR 124 - -#define RADEON_SS_LIGHT_DCD_ADDR 0 -#define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR 8 -#define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR 16 -#define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR 24 -#define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR 32 -#define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR 48 -#define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR 49 -#define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR 50 -#define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 51 -#define RADEON_SS_SHININESS 60 - -#define RADEON_TV_MASTER_CNTL 0x0800 -# define RADEON_TV_ASYNC_RST (1 << 0) -# define RADEON_CRT_ASYNC_RST (1 << 1) -# define RADEON_RESTART_PHASE_FIX (1 << 3) -# define RADEON_TV_FIFO_ASYNC_RST (1 << 4) -# define RADEON_VIN_ASYNC_RST (1 << 5) -# define RADEON_AUD_ASYNC_RST (1 << 6) -# define RADEON_DVS_ASYNC_RST (1 << 7) -# define RADEON_CRT_FIFO_CE_EN (1 << 9) -# define RADEON_TV_FIFO_CE_EN (1 << 10) -# define RADEON_RE_SYNC_NOW_SEL_MASK (3 << 14) -# define RADEON_TVCLK_ALWAYS_ONb (1 << 30) -# define RADEON_TV_ON (1 << 31) -#define RADEON_TV_PRE_DAC_MUX_CNTL 0x0888 -# define RADEON_Y_RED_EN (1 << 0) -# define RADEON_C_GRN_EN (1 << 1) -# define RADEON_CMP_BLU_EN (1 << 2) -# define RADEON_DAC_DITHER_EN (1 << 3) -# define RADEON_RED_MX_FORCE_DAC_DATA (6 << 4) -# define RADEON_GRN_MX_FORCE_DAC_DATA (6 << 8) -# define RADEON_BLU_MX_FORCE_DAC_DATA (6 << 12) -# define RADEON_TV_FORCE_DAC_DATA_SHIFT 16 -#define RADEON_TV_RGB_CNTL 0x0804 -# define RADEON_SWITCH_TO_BLUE (1 << 4) -# define RADEON_RGB_DITHER_EN (1 << 5) -# define RADEON_RGB_SRC_SEL_MASK (3 << 8) -# define RADEON_RGB_SRC_SEL_CRTC1 (0 << 8) -# define RADEON_RGB_SRC_SEL_RMX (1 << 8) -# define RADEON_RGB_SRC_SEL_CRTC2 (2 << 8) -# define RADEON_RGB_CONVERT_BY_PASS (1 << 10) -# define RADEON_UVRAM_READ_MARGIN_SHIFT 16 -# define RADEON_FIFORAM_FFMACRO_READ_MARGIN_SHIFT 20 -# define RADEON_TVOUT_SCALE_EN (1 << 26) -#define RADEON_TV_SYNC_CNTL 0x0808 -# define RADEON_SYNC_OE (1 << 0) -# define RADEON_SYNC_OUT (1 << 1) -# define RADEON_SYNC_IN (1 << 2) -# define RADEON_SYNC_PUB (1 << 3) -# define RADEON_SYNC_PD (1 << 4) -# define RADEON_TV_SYNC_IO_DRIVE (1 << 5) -#define RADEON_TV_HTOTAL 0x080c -#define RADEON_TV_HDISP 0x0810 -#define RADEON_TV_HSTART 0x0818 -#define RADEON_TV_HCOUNT 0x081C -#define RADEON_TV_VTOTAL 0x0820 -#define RADEON_TV_VDISP 0x0824 -#define RADEON_TV_VCOUNT 0x0828 -#define RADEON_TV_FTOTAL 0x082c -#define RADEON_TV_FCOUNT 0x0830 -#define RADEON_TV_FRESTART 0x0834 -#define RADEON_TV_HRESTART 0x0838 -#define RADEON_TV_VRESTART 0x083c -#define RADEON_TV_HOST_READ_DATA 0x0840 -#define RADEON_TV_HOST_WRITE_DATA 0x0844 -#define RADEON_TV_HOST_RD_WT_CNTL 0x0848 -# define RADEON_HOST_FIFO_RD (1 << 12) -# define RADEON_HOST_FIFO_RD_ACK (1 << 13) -# define RADEON_HOST_FIFO_WT (1 << 14) -# define RADEON_HOST_FIFO_WT_ACK (1 << 15) -#define RADEON_TV_VSCALER_CNTL1 0x084c -# define RADEON_UV_INC_MASK 0xffff -# define RADEON_UV_INC_SHIFT 0 -# define RADEON_Y_W_EN (1 << 24) -# define RADEON_RESTART_FIELD (1 << 29) /* restart on field 0 */ -# define RADEON_Y_DEL_W_SIG_SHIFT 26 -#define RADEON_TV_TIMING_CNTL 0x0850 -# define RADEON_H_INC_MASK 0xfff -# define RADEON_H_INC_SHIFT 0 -# define RADEON_REQ_Y_FIRST (1 << 19) -# define RADEON_FORCE_BURST_ALWAYS (1 << 21) -# define RADEON_UV_POST_SCALE_BYPASS (1 << 23) -# define RADEON_UV_OUTPUT_POST_SCALE_SHIFT 24 -#define RADEON_TV_VSCALER_CNTL2 0x0854 -# define RADEON_DITHER_MODE (1 << 0) -# define RADEON_Y_OUTPUT_DITHER_EN (1 << 1) -# define RADEON_UV_OUTPUT_DITHER_EN (1 << 2) -# define RADEON_UV_TO_BUF_DITHER_EN (1 << 3) -#define RADEON_TV_Y_FALL_CNTL 0x0858 -# define RADEON_Y_FALL_PING_PONG (1 << 16) -# define RADEON_Y_COEF_EN (1 << 17) -#define RADEON_TV_Y_RISE_CNTL 0x085c -# define RADEON_Y_RISE_PING_PONG (1 << 16) -#define RADEON_TV_Y_SAW_TOOTH_CNTL 0x0860 -#define RADEON_TV_UPSAMP_AND_GAIN_CNTL 0x0864 -# define RADEON_YUPSAMP_EN (1 << 0) -# define RADEON_UVUPSAMP_EN (1 << 2) -#define RADEON_TV_GAIN_LIMIT_SETTINGS 0x0868 -# define RADEON_Y_GAIN_LIMIT_SHIFT 0 -# define RADEON_UV_GAIN_LIMIT_SHIFT 16 -#define RADEON_TV_LINEAR_GAIN_SETTINGS 0x086c -# define RADEON_Y_GAIN_SHIFT 0 -# define RADEON_UV_GAIN_SHIFT 16 -#define RADEON_TV_MODULATOR_CNTL1 0x0870 -# define RADEON_YFLT_EN (1 << 2) -# define RADEON_UVFLT_EN (1 << 3) -# define RADEON_ALT_PHASE_EN (1 << 6) -# define RADEON_SYNC_TIP_LEVEL (1 << 7) -# define RADEON_BLANK_LEVEL_SHIFT 8 -# define RADEON_SET_UP_LEVEL_SHIFT 16 -# define RADEON_SLEW_RATE_LIMIT (1 << 23) -# define RADEON_CY_FILT_BLEND_SHIFT 28 -#define RADEON_TV_MODULATOR_CNTL2 0x0874 -# define RADEON_TV_U_BURST_LEVEL_MASK 0x1ff -# define RADEON_TV_V_BURST_LEVEL_MASK 0x1ff -# define RADEON_TV_V_BURST_LEVEL_SHIFT 16 -#define RADEON_TV_CRC_CNTL 0x0890 -#define RADEON_TV_UV_ADR 0x08ac -# define RADEON_MAX_UV_ADR_MASK 0x000000ff -# define RADEON_MAX_UV_ADR_SHIFT 0 -# define RADEON_TABLE1_BOT_ADR_MASK 0x0000ff00 -# define RADEON_TABLE1_BOT_ADR_SHIFT 8 -# define RADEON_TABLE3_TOP_ADR_MASK 0x00ff0000 -# define RADEON_TABLE3_TOP_ADR_SHIFT 16 -# define RADEON_HCODE_TABLE_SEL_MASK 0x06000000 -# define RADEON_HCODE_TABLE_SEL_SHIFT 25 -# define RADEON_VCODE_TABLE_SEL_MASK 0x18000000 -# define RADEON_VCODE_TABLE_SEL_SHIFT 27 -# define RADEON_TV_MAX_FIFO_ADDR 0x1a7 -# define RADEON_TV_MAX_FIFO_ADDR_INTERNAL 0x1ff -#define RADEON_TV_PLL_FINE_CNTL 0x0020 /* PLL */ -#define RADEON_TV_PLL_CNTL 0x0021 /* PLL */ -# define RADEON_TV_M0LO_MASK 0xff -# define RADEON_TV_M0HI_MASK 0x7 -# define RADEON_TV_M0HI_SHIFT 18 -# define RADEON_TV_N0LO_MASK 0x1ff -# define RADEON_TV_N0LO_SHIFT 8 -# define RADEON_TV_N0HI_MASK 0x3 -# define RADEON_TV_N0HI_SHIFT 21 -# define RADEON_TV_P_MASK 0xf -# define RADEON_TV_P_SHIFT 24 -# define RADEON_TV_SLIP_EN (1 << 23) -# define RADEON_TV_DTO_EN (1 << 28) -#define RADEON_TV_PLL_CNTL1 0x0022 /* PLL */ -# define RADEON_TVPLL_RESET (1 << 1) -# define RADEON_TVPLL_SLEEP (1 << 3) -# define RADEON_TVPLL_REFCLK_SEL (1 << 4) -# define RADEON_TVPCP_SHIFT 8 -# define RADEON_TVPCP_MASK (7 << 8) -# define RADEON_TVPVG_SHIFT 11 -# define RADEON_TVPVG_MASK (7 << 11) -# define RADEON_TVPDC_SHIFT 14 -# define RADEON_TVPDC_MASK (3 << 14) -# define RADEON_TVPLL_TEST_DIS (1 << 31) -# define RADEON_TVCLK_SRC_SEL_TVPLL (1 << 30) - -#define RS400_DISP2_REQ_CNTL1 0xe30 -# define RS400_DISP2_START_REQ_LEVEL_SHIFT 0 -# define RS400_DISP2_START_REQ_LEVEL_MASK 0x3ff -# define RS400_DISP2_STOP_REQ_LEVEL_SHIFT 12 -# define RS400_DISP2_STOP_REQ_LEVEL_MASK 0x3ff -# define RS400_DISP2_ALLOW_FID_LEVEL_SHIFT 22 -# define RS400_DISP2_ALLOW_FID_LEVEL_MASK 0x3ff -#define RS400_DISP2_REQ_CNTL2 0xe34 -# define RS400_DISP2_CRITICAL_POINT_START_SHIFT 12 -# define RS400_DISP2_CRITICAL_POINT_START_MASK 0x3ff -# define RS400_DISP2_CRITICAL_POINT_STOP_SHIFT 22 -# define RS400_DISP2_CRITICAL_POINT_STOP_MASK 0x3ff -#define RS400_DMIF_MEM_CNTL1 0xe38 -# define RS400_DISP2_START_ADR_SHIFT 0 -# define RS400_DISP2_START_ADR_MASK 0x3ff -# define RS400_DISP1_CRITICAL_POINT_START_SHIFT 12 -# define RS400_DISP1_CRITICAL_POINT_START_MASK 0x3ff -# define RS400_DISP1_CRITICAL_POINT_STOP_SHIFT 22 -# define RS400_DISP1_CRITICAL_POINT_STOP_MASK 0x3ff -#define RS400_DISP1_REQ_CNTL1 0xe3c -# define RS400_DISP1_START_REQ_LEVEL_SHIFT 0 -# define RS400_DISP1_START_REQ_LEVEL_MASK 0x3ff -# define RS400_DISP1_STOP_REQ_LEVEL_SHIFT 12 -# define RS400_DISP1_STOP_REQ_LEVEL_MASK 0x3ff -# define RS400_DISP1_ALLOW_FID_LEVEL_SHIFT 22 -# define RS400_DISP1_ALLOW_FID_LEVEL_MASK 0x3ff - -#define RS690_MC_INDEX 0x78 -# define RS690_MC_INDEX_MASK 0x1ff -# define RS690_MC_INDEX_WR_EN (1 << 9) -# define RS690_MC_INDEX_WR_ACK 0x7f -#define RS690_MC_DATA 0x7c - -#define RS690_MC_FB_LOCATION 0x100 -#define RS690_MC_AGP_LOCATION 0x101 -#define RS690_MC_AGP_BASE 0x102 -#define RS690_MC_AGP_BASE_2 0x103 -#define RS690_MC_INIT_MISC_LAT_TIMER 0x104 -#define RS690_MC_STATUS 0x90 -#define RS690_MC_STATUS_IDLE (1 << 0) - -#define RS600_MC_INDEX 0x78 -# define RS600_MC_INDEX_MASK 0xff -# define RS600_MC_INDEX_WR_EN (1 << 8) -# define RS600_MC_INDEX_WR_ACK 0xff -#define RS600_MC_DATA 0x7c - -#define RS600_MC_FB_LOCATION 0xA -#define RS600_MC_STATUS 0x0 -#define RS600_MC_STATUS_IDLE (1 << 0) - -#define AVIVO_MC_INDEX 0x0070 -#define R520_MC_STATUS 0x00 -# define R520_MC_STATUS_IDLE (1 << 1) -#define RV515_MC_STATUS 0x08 -# define RV515_MC_STATUS_IDLE (1 << 4) -#define RV515_MC_INIT_MISC_LAT_TIMER 0x09 -#define AVIVO_MC_DATA 0x0074 - -#define RV515_MC_FB_LOCATION 0x1 -#define RV515_MC_AGP_LOCATION 0x2 -#define RV515_MC_AGP_BASE 0x3 -#define RV515_MC_AGP_BASE_2 0x4 -#define RV515_MC_CNTL 0x5 -# define RV515_MEM_NUM_CHANNELS_MASK 0x3 -#define R520_MC_FB_LOCATION 0x4 -#define R520_MC_AGP_LOCATION 0x5 -#define R520_MC_AGP_BASE 0x6 -#define R520_MC_AGP_BASE_2 0x7 -#define R520_MC_CNTL0 0x8 -# define R520_MEM_NUM_CHANNELS_MASK (0x3 << 24) -# define R520_MEM_NUM_CHANNELS_SHIFT 24 -# define R520_MC_CHANNEL_SIZE (1 << 23) - -#define R600_RAMCFG 0x2408 -# define R600_CHANSIZE (1 << 7) -# define R600_CHANSIZE_OVERRIDE (1 << 10) - -#define AVIVO_HDP_FB_LOCATION 0x134 - -#define AVIVO_VGA_RENDER_CONTROL 0x0300 -# define AVIVO_VGA_VSTATUS_CNTL_MASK (3 << 16) -#define AVIVO_D1VGA_CONTROL 0x0330 -# define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0) -# define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8) -# define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9) -# define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10) -# define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16) -# define AVIVO_DVGA_CONTROL_ROTATE (1<<24) -#define AVIVO_D2VGA_CONTROL 0x0338 - -#define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400 -#define AVIVO_EXT1_PPLL_REF_DIV 0x404 -#define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408 -#define AVIVO_EXT1_PPLL_UPDATE_CNTL 0x40c - -#define AVIVO_EXT2_PPLL_REF_DIV_SRC 0x410 -#define AVIVO_EXT2_PPLL_REF_DIV 0x414 -#define AVIVO_EXT2_PPLL_UPDATE_LOCK 0x418 -#define AVIVO_EXT2_PPLL_UPDATE_CNTL 0x41c - -#define AVIVO_EXT1_PPLL_FB_DIV 0x430 -#define AVIVO_EXT2_PPLL_FB_DIV 0x434 - -#define AVIVO_EXT1_PPLL_POST_DIV_SRC 0x438 -#define AVIVO_EXT1_PPLL_POST_DIV 0x43c - -#define AVIVO_EXT2_PPLL_POST_DIV_SRC 0x440 -#define AVIVO_EXT2_PPLL_POST_DIV 0x444 - -#define AVIVO_EXT1_PPLL_CNTL 0x448 -#define AVIVO_EXT2_PPLL_CNTL 0x44c - -#define AVIVO_P1PLL_CNTL 0x450 -#define AVIVO_P2PLL_CNTL 0x454 -#define AVIVO_P1PLL_INT_SS_CNTL 0x458 -#define AVIVO_P2PLL_INT_SS_CNTL 0x45c -#define AVIVO_P1PLL_TMDSA_CNTL 0x460 -#define AVIVO_P2PLL_LVTMA_CNTL 0x464 - -#define AVIVO_PCLK_CRTC1_CNTL 0x480 -#define AVIVO_PCLK_CRTC2_CNTL 0x484 - -#define AVIVO_D1CRTC_H_TOTAL 0x6000 -#define AVIVO_D1CRTC_H_BLANK_START_END 0x6004 -#define AVIVO_D1CRTC_H_SYNC_A 0x6008 -#define AVIVO_D1CRTC_H_SYNC_A_CNTL 0x600c -#define AVIVO_D1CRTC_H_SYNC_B 0x6010 -#define AVIVO_D1CRTC_H_SYNC_B_CNTL 0x6014 - -#define AVIVO_D1CRTC_V_TOTAL 0x6020 -#define AVIVO_D1CRTC_V_BLANK_START_END 0x6024 -#define AVIVO_D1CRTC_V_SYNC_A 0x6028 -#define AVIVO_D1CRTC_V_SYNC_A_CNTL 0x602c -#define AVIVO_D1CRTC_V_SYNC_B 0x6030 -#define AVIVO_D1CRTC_V_SYNC_B_CNTL 0x6034 - -#define AVIVO_D1CRTC_CONTROL 0x6080 -# define AVIVO_CRTC_EN (1<<0) -#define AVIVO_D1CRTC_BLANK_CONTROL 0x6084 -#define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088 -#define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c -#define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4 - -/* master controls */ -#define AVIVO_DC_CRTC_MASTER_EN 0x60f8 -#define AVIVO_DC_CRTC_TV_CONTROL 0x60fc - -#define AVIVO_D1GRPH_ENABLE 0x6100 -#define AVIVO_D1GRPH_CONTROL 0x6104 -# define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0<<0) -# define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP (1<<0) -# define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP (2<<0) -# define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP (3<<0) - -# define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED (0<<8) - -# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555 (0<<8) -# define AVIVO_D1GRPH_CONTROL_16BPP_RGB565 (1<<8) -# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444 (2<<8) -# define AVIVO_D1GRPH_CONTROL_16BPP_AI88 (3<<8) -# define AVIVO_D1GRPH_CONTROL_16BPP_MONO16 (4<<8) - -# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888 (0<<8) -# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010 (1<<8) -# define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL (2<<8) -# define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010 (3<<8) - - -# define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616 (0<<8) - -# define AVIVO_D1GRPH_SWAP_RB (1<<16) -# define AVIVO_D1GRPH_TILED (1<<20) -# define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1<<21) - -#define AVIVO_D1GRPH_LUT_SEL 0x6108 -#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 -#define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118 -#define AVIVO_D1GRPH_PITCH 0x6120 -#define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124 -#define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128 -#define AVIVO_D1GRPH_X_START 0x612c -#define AVIVO_D1GRPH_Y_START 0x6130 -#define AVIVO_D1GRPH_X_END 0x6134 -#define AVIVO_D1GRPH_Y_END 0x6138 -#define AVIVO_D1GRPH_UPDATE 0x6144 -# define AVIVO_D1GRPH_UPDATE_LOCK (1<<16) -#define AVIVO_D1GRPH_FLIP_CONTROL 0x6148 - -#define AVIVO_D1CUR_CONTROL 0x6400 -# define AVIVO_D1CURSOR_EN (1<<0) -# define AVIVO_D1CURSOR_MODE_SHIFT 8 -# define AVIVO_D1CURSOR_MODE_MASK (0x3<<8) -# define AVIVO_D1CURSOR_MODE_24BPP (0x2) -#define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 -#define AVIVO_D1CUR_SIZE 0x6410 -#define AVIVO_D1CUR_POSITION 0x6414 -#define AVIVO_D1CUR_HOT_SPOT 0x6418 -#define AVIVO_D1CUR_UPDATE 0x6424 -# define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16) - -#define AVIVO_DC_LUT_RW_SELECT 0x6480 -#define AVIVO_DC_LUT_RW_MODE 0x6484 -#define AVIVO_DC_LUT_RW_INDEX 0x6488 -#define AVIVO_DC_LUT_SEQ_COLOR 0x648c -#define AVIVO_DC_LUT_PWL_DATA 0x6490 -#define AVIVO_DC_LUT_30_COLOR 0x6494 -#define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498 -#define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c -#define AVIVO_DC_LUT_AUTOFILL 0x64a0 - -#define AVIVO_DC_LUTA_CONTROL 0x64c0 -#define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4 -#define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8 -#define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc -#define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0 -#define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4 -#define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8 - -#define AVIVO_DC_LB_MEMORY_SPLIT 0x6520 -# define AVIVO_DC_LB_MEMORY_SPLIT_MASK 0x3 -# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT 0 -# define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0 -# define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1 -# define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY 2 -# define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3 -# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2) -# define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4 -# define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff - -#define AVIVO_D1MODE_DATA_FORMAT 0x6528 -# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) -#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652c -#define AVIVO_D1MODE_VIEWPORT_START 0x6580 -#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 -#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 -#define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM 0x658c - -#define AVIVO_D1SCL_SCALER_ENABLE 0x6590 -#define AVIVO_D1SCL_SCALER_TAP_CONTROL 0x6594 -#define AVIVO_D1SCL_UPDATE 0x65cc -# define AVIVO_D1SCL_UPDATE_LOCK (1<<16) - -/* second crtc */ -#define AVIVO_D2CRTC_H_TOTAL 0x6800 -#define AVIVO_D2CRTC_H_BLANK_START_END 0x6804 -#define AVIVO_D2CRTC_H_SYNC_A 0x6808 -#define AVIVO_D2CRTC_H_SYNC_A_CNTL 0x680c -#define AVIVO_D2CRTC_H_SYNC_B 0x6810 -#define AVIVO_D2CRTC_H_SYNC_B_CNTL 0x6814 - -#define AVIVO_D2CRTC_V_TOTAL 0x6820 -#define AVIVO_D2CRTC_V_BLANK_START_END 0x6824 -#define AVIVO_D2CRTC_V_SYNC_A 0x6828 -#define AVIVO_D2CRTC_V_SYNC_A_CNTL 0x682c -#define AVIVO_D2CRTC_V_SYNC_B 0x6830 -#define AVIVO_D2CRTC_V_SYNC_B_CNTL 0x6834 - -#define AVIVO_D2CRTC_CONTROL 0x6880 -#define AVIVO_D2CRTC_BLANK_CONTROL 0x6884 -#define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888 -#define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c -#define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4 - -#define AVIVO_D2GRPH_ENABLE 0x6900 -#define AVIVO_D2GRPH_CONTROL 0x6904 -#define AVIVO_D2GRPH_LUT_SEL 0x6908 -#define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS 0x6910 -#define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS 0x6918 -#define AVIVO_D2GRPH_PITCH 0x6920 -#define AVIVO_D2GRPH_SURFACE_OFFSET_X 0x6924 -#define AVIVO_D2GRPH_SURFACE_OFFSET_Y 0x6928 -#define AVIVO_D2GRPH_X_START 0x692c -#define AVIVO_D2GRPH_Y_START 0x6930 -#define AVIVO_D2GRPH_X_END 0x6934 -#define AVIVO_D2GRPH_Y_END 0x6938 -#define AVIVO_D2GRPH_UPDATE 0x6944 -#define AVIVO_D2GRPH_FLIP_CONTROL 0x6948 - -#define AVIVO_D2CUR_CONTROL 0x6c00 -#define AVIVO_D2CUR_SURFACE_ADDRESS 0x6c08 -#define AVIVO_D2CUR_SIZE 0x6c10 -#define AVIVO_D2CUR_POSITION 0x6c14 - -#define AVIVO_D2MODE_DATA_FORMAT 0x6d28 -#define AVIVO_D2MODE_DESKTOP_HEIGHT 0x6d2c -#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 -#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 -#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 -#define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM 0x6d8c - -#define AVIVO_D2SCL_SCALER_ENABLE 0x6d90 -#define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94 -#define AVIVO_D2SCL_UPDATE 0x6dcc - -#define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214 - -#define AVIVO_DACA_ENABLE 0x7800 -# define AVIVO_DAC_ENABLE (1 << 0) -#define AVIVO_DACA_SOURCE_SELECT 0x7804 -# define AVIVO_DAC_SOURCE_CRTC1 (0 << 0) -# define AVIVO_DAC_SOURCE_CRTC2 (1 << 0) -# define AVIVO_DAC_SOURCE_TV (2 << 0) - -#define AVIVO_DACA_FORCE_OUTPUT_CNTL 0x783c -# define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) -# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) -# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) -# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) -# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) -# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) -#define AVIVO_DACA_POWERDOWN 0x7850 -# define AVIVO_DACA_POWERDOWN_POWERDOWN (1 << 0) -# define AVIVO_DACA_POWERDOWN_BLUE (1 << 8) -# define AVIVO_DACA_POWERDOWN_GREEN (1 << 16) -# define AVIVO_DACA_POWERDOWN_RED (1 << 24) - -#define AVIVO_DACB_ENABLE 0x7a00 -#define AVIVO_DACB_SOURCE_SELECT 0x7a04 -#define AVIVO_DACB_FORCE_OUTPUT_CNTL 0x7a3c -# define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) -# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) -# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) -# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) -# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) -# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) -#define AVIVO_DACB_POWERDOWN 0x7a50 -# define AVIVO_DACB_POWERDOWN_POWERDOWN (1 << 0) -# define AVIVO_DACB_POWERDOWN_BLUE (1 << 8) -# define AVIVO_DACB_POWERDOWN_GREEN (1 << 16) -# define AVIVO_DACB_POWERDOWN_RED - -#define AVIVO_TMDSA_CNTL 0x7880 -# define AVIVO_TMDSA_CNTL_ENABLE (1 << 0) -# define AVIVO_TMDSA_CNTL_HPD_MASK (1 << 4) -# define AVIVO_TMDSA_CNTL_HPD_SELECT (1 << 8) -# define AVIVO_TMDSA_CNTL_SYNC_PHASE (1 << 12) -# define AVIVO_TMDSA_CNTL_PIXEL_ENCODING (1 << 16) -# define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE (1 << 24) -# define AVIVO_TMDSA_CNTL_SWAP (1 << 28) -#define AVIVO_TMDSA_SOURCE_SELECT 0x7884 -/* 78a8 appears to be some kind of (reasonably tolerant) clock? - * 78d0 definitely hits the transmitter, definitely clock. */ -/* MYSTERY1 This appears to control dithering? */ -#define AVIVO_TMDSA_BIT_DEPTH_CONTROL 0x7894 -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) -# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) -#define AVIVO_TMDSA_DCBALANCER_CONTROL 0x78d0 -# define AVIVO_TMDSA_DCBALANCER_CONTROL_EN (1 << 0) -# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN (1 << 8) -# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) -# define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE (1 << 24) -#define AVIVO_TMDSA_DATA_SYNCHRONIZATION 0x78d8 -# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) -# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) -#define AVIVO_TMDSA_CLOCK_ENABLE 0x7900 -#define AVIVO_TMDSA_TRANSMITTER_ENABLE 0x7904 -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE (1 << 0) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE (1 << 8) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK (1 << 16) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) -# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) - -#define AVIVO_TMDSA_TRANSMITTER_CONTROL 0x7910 -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK (1 << 8) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK (1 << 14) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) -# define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) - -#define AVIVO_LVTMA_CNTL 0x7a80 -# define AVIVO_LVTMA_CNTL_ENABLE (1 << 0) -# define AVIVO_LVTMA_CNTL_HPD_MASK (1 << 4) -# define AVIVO_LVTMA_CNTL_HPD_SELECT (1 << 8) -# define AVIVO_LVTMA_CNTL_SYNC_PHASE (1 << 12) -# define AVIVO_LVTMA_CNTL_PIXEL_ENCODING (1 << 16) -# define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE (1 << 24) -# define AVIVO_LVTMA_CNTL_SWAP (1 << 28) -#define AVIVO_LVTMA_SOURCE_SELECT 0x7a84 -#define AVIVO_LVTMA_COLOR_FORMAT 0x7a88 -#define AVIVO_LVTMA_BIT_DEPTH_CONTROL 0x7a94 -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) -# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) - - - -#define AVIVO_LVTMA_DCBALANCER_CONTROL 0x7ad0 -# define AVIVO_LVTMA_DCBALANCER_CONTROL_EN (1 << 0) -# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN (1 << 8) -# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) -# define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE (1 << 24) - -#define AVIVO_LVTMA_DATA_SYNCHRONIZATION 0x78d8 -# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) -# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) -#define R500_LVTMA_CLOCK_ENABLE 0x7b00 -#define R600_LVTMA_CLOCK_ENABLE 0x7b04 - -#define R500_LVTMA_TRANSMITTER_ENABLE 0x7b04 -#define R600_LVTMA_TRANSMITTER_ENABLE 0x7b08 -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN (1 << 5) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN (1 << 9) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) -# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) - -#define R500_LVTMA_TRANSMITTER_CONTROL 0x7b10 -#define R600_LVTMA_TRANSMITTER_CONTROL 0x7b14 -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK (1 << 8) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK (1 << 14) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) -# define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) - -#define R500_LVTMA_PWRSEQ_CNTL 0x7af0 -#define R600_LVTMA_PWRSEQ_CNTL 0x7af4 -# define AVIVO_LVTMA_PWRSEQ_EN (1 << 0) -# define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK (1 << 2) -# define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK (1 << 3) -# define AVIVO_LVTMA_PWRSEQ_TARGET_STATE (1 << 4) -# define AVIVO_LVTMA_SYNCEN (1 << 8) -# define AVIVO_LVTMA_SYNCEN_OVRD (1 << 9) -# define AVIVO_LVTMA_SYNCEN_POL (1 << 10) -# define AVIVO_LVTMA_DIGON (1 << 16) -# define AVIVO_LVTMA_DIGON_OVRD (1 << 17) -# define AVIVO_LVTMA_DIGON_POL (1 << 18) -# define AVIVO_LVTMA_BLON (1 << 24) -# define AVIVO_LVTMA_BLON_OVRD (1 << 25) -# define AVIVO_LVTMA_BLON_POL (1 << 26) - -#define R500_LVTMA_PWRSEQ_STATE 0x7af4 -#define R600_LVTMA_PWRSEQ_STATE 0x7af8 -# define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R (1 << 0) -# define AVIVO_LVTMA_PWRSEQ_STATE_DIGON (1 << 1) -# define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN (1 << 2) -# define AVIVO_LVTMA_PWRSEQ_STATE_BLON (1 << 3) -# define AVIVO_LVTMA_PWRSEQ_STATE_DONE (1 << 4) -# define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT (8) - -#define AVIVO_LVDS_BACKLIGHT_CNTL 0x7af8 -# define AVIVO_LVDS_BACKLIGHT_CNTL_EN (1 << 0) -# define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00 -# define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8 - -#define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988 - -#define AVIVO_GPIO_0 0x7e30 -#define AVIVO_GPIO_1 0x7e40 -#define AVIVO_GPIO_2 0x7e50 -#define AVIVO_GPIO_3 0x7e60 - -#define AVIVO_DC_GPIO_HPD_Y 0x7e9c - -#define AVIVO_I2C_STATUS 0x7d30 -# define AVIVO_I2C_STATUS_DONE (1 << 0) -# define AVIVO_I2C_STATUS_NACK (1 << 1) -# define AVIVO_I2C_STATUS_HALT (1 << 2) -# define AVIVO_I2C_STATUS_GO (1 << 3) -# define AVIVO_I2C_STATUS_MASK 0x7 -/* If radeon_mm_i2c is to be believed, this is HALT, NACK, and maybe - * DONE? */ -# define AVIVO_I2C_STATUS_CMD_RESET 0x7 -# define AVIVO_I2C_STATUS_CMD_WAIT (1 << 3) -#define AVIVO_I2C_STOP 0x7d34 -#define AVIVO_I2C_START_CNTL 0x7d38 -# define AVIVO_I2C_START (1 << 8) -# define AVIVO_I2C_CONNECTOR0 (0 << 16) -# define AVIVO_I2C_CONNECTOR1 (1 << 16) -#define R520_I2C_START (1<<0) -#define R520_I2C_STOP (1<<1) -#define R520_I2C_RX (1<<2) -#define R520_I2C_EN (1<<8) -#define R520_I2C_DDC1 (0<<16) -#define R520_I2C_DDC2 (1<<16) -#define R520_I2C_DDC3 (2<<16) -#define R520_I2C_DDC_MASK (3<<16) -#define AVIVO_I2C_CONTROL2 0x7d3c -# define AVIVO_I2C_7D3C_SIZE_SHIFT 8 -# define AVIVO_I2C_7D3C_SIZE_MASK (0xf << 8) -#define AVIVO_I2C_CONTROL3 0x7d40 -/* Reading is done 4 bytes at a time: read the bottom 8 bits from - * 7d44, four times in a row. - * Writing is a little more complex. First write DATA with - * 0xnnnnnnzz, then 0xnnnnnnyy, where nnnnnn is some non-deterministic - * magic number, zz is, I think, the slave address, and yy is the byte - * you want to write. */ -#define AVIVO_I2C_DATA 0x7d44 -#define R520_I2C_ADDR_COUNT_MASK (0x7) -#define R520_I2C_DATA_COUNT_SHIFT (8) -#define R520_I2C_DATA_COUNT_MASK (0xF00) -#define AVIVO_I2C_CNTL 0x7d50 -# define AVIVO_I2C_EN (1 << 0) -# define AVIVO_I2C_RESET (1 << 8) - -#define R600_GENERAL_PWRMGT 0x618 -# define R600_OPEN_DRAIN_PADS (1 << 11) - -#define R600_LOWER_GPIO_ENABLE 0x710 -#define R600_CTXSW_VID_LOWER_GPIO_CNTL 0x718 -#define R600_HIGH_VID_LOWER_GPIO_CNTL 0x71c -#define R600_MEDIUM_VID_LOWER_GPIO_CNTL 0x720 -#define R600_LOW_VID_LOWER_GPIO_CNTL 0x724 - -#define R600_MC_VM_FB_LOCATION 0x2180 -#define R600_MC_VM_AGP_TOP 0x2184 -#define R600_MC_VM_AGP_BOT 0x2188 -#define R600_MC_VM_AGP_BASE 0x218c -#define R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190 -#define R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194 -#define R600_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198 - -#define R700_MC_VM_FB_LOCATION 0x2024 - -#define R600_HDP_NONSURFACE_BASE 0x2c04 - -#define R600_BUS_CNTL 0x5420 -#define R600_CONFIG_CNTL 0x5424 -#define R600_CONFIG_MEMSIZE 0x5428 -#define R600_CONFIG_F0_BASE 0x542C -#define R600_CONFIG_APER_SIZE 0x5430 - -#define R600_ROM_CNTL 0x1600 -# define R600_SCK_OVERWRITE (1 << 1) -# define R600_SCK_PRESCALE_CRYSTAL_CLK_SHIFT 28 -# define R600_SCK_PRESCALE_CRYSTAL_CLK_MASK (0xf << 28) - -#define R600_BIOS_0_SCRATCH 0x1724 -#define R600_BIOS_1_SCRATCH 0x1728 -#define R600_BIOS_2_SCRATCH 0x172c -#define R600_BIOS_3_SCRATCH 0x1730 -#define R600_BIOS_4_SCRATCH 0x1734 -#define R600_BIOS_5_SCRATCH 0x1738 -#define R600_BIOS_6_SCRATCH 0x173c -#define R600_BIOS_7_SCRATCH 0x1740 - -#define R300_GB_TILE_CONFIG 0x4018 -# define R300_ENABLE_TILING (1 << 0) -# define R300_PIPE_COUNT_RV350 (0 << 1) -# define R300_PIPE_COUNT_R300 (3 << 1) -# define R300_PIPE_COUNT_R420_3P (6 << 1) -# define R300_PIPE_COUNT_R420 (7 << 1) -# define R300_TILE_SIZE_8 (0 << 4) -# define R300_TILE_SIZE_16 (1 << 4) -# define R300_TILE_SIZE_32 (2 << 4) -# define R300_SUBPIXEL_1_12 (0 << 16) -# define R300_SUBPIXEL_1_16 (1 << 16) -#define R300_GB_SELECT 0x401c -#define R300_GB_ENABLE 0x4008 -#define R300_GB_AA_CONFIG 0x4020 -#define R400_GB_PIPE_SELECT 0x402c -#define R300_GB_MSPOS0 0x4010 -# define R300_MS_X0_SHIFT 0 -# define R300_MS_Y0_SHIFT 4 -# define R300_MS_X1_SHIFT 8 -# define R300_MS_Y1_SHIFT 12 -# define R300_MS_X2_SHIFT 16 -# define R300_MS_Y2_SHIFT 20 -# define R300_MSBD0_Y_SHIFT 24 -# define R300_MSBD0_X_SHIFT 28 -#define R300_GB_MSPOS1 0x4014 -# define R300_MS_X3_SHIFT 0 -# define R300_MS_Y3_SHIFT 4 -# define R300_MS_X4_SHIFT 8 -# define R300_MS_Y4_SHIFT 12 -# define R300_MS_X5_SHIFT 16 -# define R300_MS_Y5_SHIFT 20 -# define R300_MSBD1_SHIFT 24 - -#define R300_GA_ENHANCE 0x4274 -# define R300_GA_DEADLOCK_CNTL (1 << 0) -# define R300_GA_FASTSYNC_CNTL (1 << 1) - -#define R300_GA_POLY_MODE 0x4288 -# define R300_FRONT_PTYPE_POINT (0 << 4) -# define R300_FRONT_PTYPE_LINE (1 << 4) -# define R300_FRONT_PTYPE_TRIANGE (2 << 4) -# define R300_BACK_PTYPE_POINT (0 << 7) -# define R300_BACK_PTYPE_LINE (1 << 7) -# define R300_BACK_PTYPE_TRIANGE (2 << 7) -#define R300_GA_ROUND_MODE 0x428c -# define R300_GEOMETRY_ROUND_TRUNC (0 << 0) -# define R300_GEOMETRY_ROUND_NEAREST (1 << 0) -# define R300_COLOR_ROUND_TRUNC (0 << 2) -# define R300_COLOR_ROUND_NEAREST (1 << 2) -#define R300_GA_COLOR_CONTROL 0x4278 -# define R300_RGB0_SHADING_SOLID (0 << 0) -# define R300_RGB0_SHADING_FLAT (1 << 0) -# define R300_RGB0_SHADING_GOURAUD (2 << 0) -# define R300_ALPHA0_SHADING_SOLID (0 << 2) -# define R300_ALPHA0_SHADING_FLAT (1 << 2) -# define R300_ALPHA0_SHADING_GOURAUD (2 << 2) -# define R300_RGB1_SHADING_SOLID (0 << 4) -# define R300_RGB1_SHADING_FLAT (1 << 4) -# define R300_RGB1_SHADING_GOURAUD (2 << 4) -# define R300_ALPHA1_SHADING_SOLID (0 << 6) -# define R300_ALPHA1_SHADING_FLAT (1 << 6) -# define R300_ALPHA1_SHADING_GOURAUD (2 << 6) -# define R300_RGB2_SHADING_SOLID (0 << 8) -# define R300_RGB2_SHADING_FLAT (1 << 8) -# define R300_RGB2_SHADING_GOURAUD (2 << 8) -# define R300_ALPHA2_SHADING_SOLID (0 << 10) -# define R300_ALPHA2_SHADING_FLAT (1 << 10) -# define R300_ALPHA2_SHADING_GOURAUD (2 << 10) -# define R300_RGB3_SHADING_SOLID (0 << 12) -# define R300_RGB3_SHADING_FLAT (1 << 12) -# define R300_RGB3_SHADING_GOURAUD (2 << 12) -# define R300_ALPHA3_SHADING_SOLID (0 << 14) -# define R300_ALPHA3_SHADING_FLAT (1 << 14) -# define R300_ALPHA3_SHADING_GOURAUD (2 << 14) -#define R300_GA_OFFSET 0x4290 - -#define R500_SU_REG_DEST 0x42c8 - -#define R300_VAP_CNTL_STATUS 0x2140 -# define R300_PVS_BYPASS (1 << 8) -#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 -#define R300_VAP_CNTL 0x2080 -# define R300_PVS_NUM_SLOTS_SHIFT 0 -# define R300_PVS_NUM_CNTLRS_SHIFT 4 -# define R300_PVS_NUM_FPUS_SHIFT 8 -# define R300_VF_MAX_VTX_NUM_SHIFT 18 -# define R300_GL_CLIP_SPACE_DEF (0 << 22) -# define R300_DX_CLIP_SPACE_DEF (1 << 22) -# define R500_TCL_STATE_OPTIMIZATION (1 << 23) -#define R300_VAP_VTE_CNTL 0x20B0 -# define R300_VPORT_X_SCALE_ENA (1 << 0) -# define R300_VPORT_X_OFFSET_ENA (1 << 1) -# define R300_VPORT_Y_SCALE_ENA (1 << 2) -# define R300_VPORT_Y_OFFSET_ENA (1 << 3) -# define R300_VPORT_Z_SCALE_ENA (1 << 4) -# define R300_VPORT_Z_OFFSET_ENA (1 << 5) -# define R300_VTX_XY_FMT (1 << 8) -# define R300_VTX_Z_FMT (1 << 9) -# define R300_VTX_W0_FMT (1 << 10) -#define R300_VAP_VTX_STATE_CNTL 0x2180 -#define R300_VAP_PSC_SGN_NORM_CNTL 0x21DC -#define R300_VAP_PROG_STREAM_CNTL_0 0x2150 -# define R300_DATA_TYPE_0_SHIFT 0 -# define R300_DATA_TYPE_FLOAT_1 0 -# define R300_DATA_TYPE_FLOAT_2 1 -# define R300_DATA_TYPE_FLOAT_3 2 -# define R300_DATA_TYPE_FLOAT_4 3 -# define R300_DATA_TYPE_BYTE 4 -# define R300_DATA_TYPE_D3DCOLOR 5 -# define R300_DATA_TYPE_SHORT_2 6 -# define R300_DATA_TYPE_SHORT_4 7 -# define R300_DATA_TYPE_VECTOR_3_TTT 8 -# define R300_DATA_TYPE_VECTOR_3_EET 9 -# define R300_SKIP_DWORDS_0_SHIFT 4 -# define R300_DST_VEC_LOC_0_SHIFT 8 -# define R300_LAST_VEC_0 (1 << 13) -# define R300_SIGNED_0 (1 << 14) -# define R300_NORMALIZE_0 (1 << 15) -# define R300_DATA_TYPE_1_SHIFT 16 -# define R300_SKIP_DWORDS_1_SHIFT 20 -# define R300_DST_VEC_LOC_1_SHIFT 24 -# define R300_LAST_VEC_1 (1 << 29) -# define R300_SIGNED_1 (1 << 30) -# define R300_NORMALIZE_1 (1 << 31) -#define R300_VAP_PROG_STREAM_CNTL_1 0x2154 -# define R300_DATA_TYPE_2_SHIFT 0 -# define R300_SKIP_DWORDS_2_SHIFT 4 -# define R300_DST_VEC_LOC_2_SHIFT 8 -# define R300_LAST_VEC_2 (1 << 13) -# define R300_SIGNED_2 (1 << 14) -# define R300_NORMALIZE_2 (1 << 15) -# define R300_DATA_TYPE_3_SHIFT 16 -# define R300_SKIP_DWORDS_3_SHIFT 20 -# define R300_DST_VEC_LOC_3_SHIFT 24 -# define R300_LAST_VEC_3 (1 << 29) -# define R300_SIGNED_3 (1 << 30) -# define R300_NORMALIZE_3 (1 << 31) -#define R300_VAP_PROG_STREAM_CNTL_EXT_0 0x21e0 -# define R300_SWIZZLE_SELECT_X_0_SHIFT 0 -# define R300_SWIZZLE_SELECT_Y_0_SHIFT 3 -# define R300_SWIZZLE_SELECT_Z_0_SHIFT 6 -# define R300_SWIZZLE_SELECT_W_0_SHIFT 9 -# define R300_SWIZZLE_SELECT_X 0 -# define R300_SWIZZLE_SELECT_Y 1 -# define R300_SWIZZLE_SELECT_Z 2 -# define R300_SWIZZLE_SELECT_W 3 -# define R300_SWIZZLE_SELECT_FP_ZERO 4 -# define R300_SWIZZLE_SELECT_FP_ONE 5 -# define R300_WRITE_ENA_0_SHIFT 12 -# define R300_WRITE_ENA_X 1 -# define R300_WRITE_ENA_Y 2 -# define R300_WRITE_ENA_Z 4 -# define R300_WRITE_ENA_W 8 -# define R300_SWIZZLE_SELECT_X_1_SHIFT 16 -# define R300_SWIZZLE_SELECT_Y_1_SHIFT 19 -# define R300_SWIZZLE_SELECT_Z_1_SHIFT 22 -# define R300_SWIZZLE_SELECT_W_1_SHIFT 25 -# define R300_WRITE_ENA_1_SHIFT 28 -#define R300_VAP_PROG_STREAM_CNTL_EXT_1 0x21e4 -# define R300_SWIZZLE_SELECT_X_2_SHIFT 0 -# define R300_SWIZZLE_SELECT_Y_2_SHIFT 3 -# define R300_SWIZZLE_SELECT_Z_2_SHIFT 6 -# define R300_SWIZZLE_SELECT_W_2_SHIFT 9 -# define R300_WRITE_ENA_2_SHIFT 12 -# define R300_SWIZZLE_SELECT_X_3_SHIFT 16 -# define R300_SWIZZLE_SELECT_Y_3_SHIFT 19 -# define R300_SWIZZLE_SELECT_Z_3_SHIFT 22 -# define R300_SWIZZLE_SELECT_W_3_SHIFT 25 -# define R300_WRITE_ENA_3_SHIFT 28 -#define R300_VAP_PVS_CODE_CNTL_0 0x22D0 -# define R300_PVS_FIRST_INST_SHIFT 0 -# define R300_PVS_XYZW_VALID_INST_SHIFT 10 -# define R300_PVS_LAST_INST_SHIFT 20 -#define R300_VAP_PVS_CODE_CNTL_1 0x22D8 -# define R300_PVS_LAST_VTX_SRC_INST_SHIFT 0 -#define R300_VAP_PVS_VECTOR_INDX_REG 0x2200 -#define R300_VAP_PVS_VECTOR_DATA_REG 0x2204 -/* PVS instructions */ -/* Opcode and dst instruction */ -#define R300_PVS_DST_OPCODE(x) (x << 0) -/* Vector ops */ -# define R300_VECTOR_NO_OP 0 -# define R300_VE_DOT_PRODUCT 1 -# define R300_VE_MULTIPLY 2 -# define R300_VE_ADD 3 -# define R300_VE_MULTIPLY_ADD 4 -# define R300_VE_DISTANCE_VECTOR 5 -# define R300_VE_FRACTION 6 -# define R300_VE_MAXIMUM 7 -# define R300_VE_MINIMUM 8 -# define R300_VE_SET_GREATER_THAN_EQUAL 9 -# define R300_VE_SET_LESS_THAN 10 -# define R300_VE_MULTIPLYX2_ADD 11 -# define R300_VE_MULTIPLY_CLAMP 12 -# define R300_VE_FLT2FIX_DX 13 -# define R300_VE_FLT2FIX_DX_RND 14 -/* R500 additions */ -# define R500_VE_PRED_SET_EQ_PUSH 15 -# define R500_VE_PRED_SET_GT_PUSH 16 -# define R500_VE_PRED_SET_GTE_PUSH 17 -# define R500_VE_PRED_SET_NEQ_PUSH 18 -# define R500_VE_COND_WRITE_EQ 19 -# define R500_VE_COND_WRITE_GT 20 -# define R500_VE_COND_WRITE_GTE 21 -# define R500_VE_COND_WRITE_NEQ 22 -# define R500_VE_COND_MUX_EQ 23 -# define R500_VE_COND_MUX_GT 24 -# define R500_VE_COND_MUX_GTE 25 -# define R500_VE_SET_GREATER_THAN 26 -# define R500_VE_SET_EQUAL 27 -# define R500_VE_SET_NOT_EQUAL 28 -/* Math ops */ -# define R300_MATH_NO_OP 0 -# define R300_ME_EXP_BASE2_DX 1 -# define R300_ME_LOG_BASE2_DX 2 -# define R300_ME_EXP_BASEE_FF 3 -# define R300_ME_LIGHT_COEFF_DX 4 -# define R300_ME_POWER_FUNC_FF 5 -# define R300_ME_RECIP_DX 6 -# define R300_ME_RECIP_FF 7 -# define R300_ME_RECIP_SQRT_DX 8 -# define R300_ME_RECIP_SQRT_FF 9 -# define R300_ME_MULTIPLY 10 -# define R300_ME_EXP_BASE2_FULL_DX 11 -# define R300_ME_LOG_BASE2_FULL_DX 12 -# define R300_ME_POWER_FUNC_FF_CLAMP_B 13 -# define R300_ME_POWER_FUNC_FF_CLAMP_B1 14 -# define R300_ME_POWER_FUNC_FF_CLAMP_01 15 -# define R300_ME_SIN 16 -# define R300_ME_COS 17 -/* R500 additions */ -# define R500_ME_LOG_BASE2_IEEE 18 -# define R500_ME_RECIP_IEEE 19 -# define R500_ME_RECIP_SQRT_IEEE 20 -# define R500_ME_PRED_SET_EQ 21 -# define R500_ME_PRED_SET_GT 22 -# define R500_ME_PRED_SET_GTE 23 -# define R500_ME_PRED_SET_NEQ 24 -# define R500_ME_PRED_SET_CLR 25 -# define R500_ME_PRED_SET_INV 26 -# define R500_ME_PRED_SET_POP 27 -# define R500_ME_PRED_SET_RESTORE 28 -/* macro */ -# define R300_PVS_MACRO_OP_2CLK_MADD 0 -# define R300_PVS_MACRO_OP_2CLK_M2X_ADD 1 -#define R300_PVS_DST_MATH_INST (1 << 6) -#define R300_PVS_DST_MACRO_INST (1 << 7) -#define R300_PVS_DST_REG_TYPE(x) (x << 8) -# define R300_PVS_DST_REG_TEMPORARY 0 -# define R300_PVS_DST_REG_A0 1 -# define R300_PVS_DST_REG_OUT 2 -# define R500_PVS_DST_REG_OUT_REPL_X 3 -# define R300_PVS_DST_REG_ALT_TEMPORARY 4 -# define R300_PVS_DST_REG_INPUT 5 -#define R300_PVS_DST_ADDR_MODE_1 (1 << 12) -#define R300_PVS_DST_OFFSET(x) (x << 13) -#define R300_PVS_DST_WE_X (1 << 20) -#define R300_PVS_DST_WE_Y (1 << 21) -#define R300_PVS_DST_WE_Z (1 << 22) -#define R300_PVS_DST_WE_W (1 << 23) -#define R300_PVS_DST_VE_SAT (1 << 24) -#define R300_PVS_DST_ME_SAT (1 << 25) -#define R300_PVS_DST_PRED_ENABLE (1 << 26) -#define R300_PVS_DST_PRED_SENSE (1 << 27) -#define R300_PVS_DST_DUAL_MATH_OP (1 << 28) -#define R300_PVS_DST_ADDR_SEL(x) (x << 29) -#define R300_PVS_DST_ADDR_MODE_0 (1 << 31) -/* src operand instruction */ -#define R300_PVS_SRC_REG_TYPE(x) (x << 0) -# define R300_PVS_SRC_REG_TEMPORARY 0 -# define R300_PVS_SRC_REG_INPUT 1 -# define R300_PVS_SRC_REG_CONSTANT 2 -# define R300_PVS_SRC_REG_ALT_TEMPORARY 3 -#define R300_SPARE_0 (1 << 2) -#define R300_PVS_SRC_ABS_XYZW (1 << 3) -#define R300_PVS_SRC_ADDR_MODE_0 (1 << 4) -#define R300_PVS_SRC_OFFSET(x) (x << 5) -#define R300_PVS_SRC_SWIZZLE_X(x) (x << 13) -#define R300_PVS_SRC_SWIZZLE_Y(x) (x << 16) -#define R300_PVS_SRC_SWIZZLE_Z(x) (x << 19) -#define R300_PVS_SRC_SWIZZLE_W(x) (x << 22) -# define R300_PVS_SRC_SELECT_X 0 -# define R300_PVS_SRC_SELECT_Y 1 -# define R300_PVS_SRC_SELECT_Z 2 -# define R300_PVS_SRC_SELECT_W 3 -# define R300_PVS_SRC_SELECT_FORCE_0 4 -# define R300_PVS_SRC_SELECT_FORCE_1 5 -#define R300_PVS_SRC_NEG_X (1 << 25) -#define R300_PVS_SRC_NEG_Y (1 << 26) -#define R300_PVS_SRC_NEG_Z (1 << 27) -#define R300_PVS_SRC_NEG_W (1 << 28) -#define R300_PVS_SRC_ADDR_SEL(x) (x << 29) -#define R300_PVS_SRC_ADDR_MODE_1 (1 << 31) - -#define R300_VAP_PVS_FLOW_CNTL_OPC 0x22dc -#define R300_VAP_OUT_VTX_FMT_0 0x2090 -# define R300_VTX_POS_PRESENT (1 << 0) -# define R300_VTX_COLOR_0_PRESENT (1 << 1) -# define R300_VTX_COLOR_1_PRESENT (1 << 2) -# define R300_VTX_COLOR_2_PRESENT (1 << 3) -# define R300_VTX_COLOR_3_PRESENT (1 << 4) -# define R300_VTX_PT_SIZE_PRESENT (1 << 16) -#define R300_VAP_OUT_VTX_FMT_1 0x2094 -# define R300_TEX_0_COMP_CNT_SHIFT 0 -# define R300_TEX_1_COMP_CNT_SHIFT 3 -# define R300_TEX_2_COMP_CNT_SHIFT 6 -# define R300_TEX_3_COMP_CNT_SHIFT 9 -# define R300_TEX_4_COMP_CNT_SHIFT 12 -# define R300_TEX_5_COMP_CNT_SHIFT 15 -# define R300_TEX_6_COMP_CNT_SHIFT 18 -# define R300_TEX_7_COMP_CNT_SHIFT 21 -#define R300_VAP_VTX_SIZE 0x20b4 -#define R300_VAP_GB_VERT_CLIP_ADJ 0x2220 -#define R300_VAP_GB_VERT_DISC_ADJ 0x2224 -#define R300_VAP_GB_HORZ_CLIP_ADJ 0x2228 -#define R300_VAP_GB_HORZ_DISC_ADJ 0x222c -#define R300_VAP_CLIP_CNTL 0x221c -# define R300_UCP_ENA_0 (1 << 0) -# define R300_UCP_ENA_1 (1 << 1) -# define R300_UCP_ENA_2 (1 << 2) -# define R300_UCP_ENA_3 (1 << 3) -# define R300_UCP_ENA_4 (1 << 4) -# define R300_UCP_ENA_5 (1 << 5) -# define R300_PS_UCP_MODE_SHIFT 14 -# define R300_CLIP_DISABLE (1 << 16) -# define R300_UCP_CULL_ONLY_ENA (1 << 17) -# define R300_BOUNDARY_EDGE_FLAG_ENA (1 << 18) -#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 - -#define R500_VAP_INDEX_OFFSET 0x208c - -#define R300_SU_TEX_WRAP 0x42a0 -#define R300_SU_POLY_OFFSET_ENABLE 0x42b4 -#define R300_SU_CULL_MODE 0x42b8 -# define R300_CULL_FRONT (1 << 0) -# define R300_CULL_BACK (1 << 1) -# define R300_FACE_POS (0 << 2) -# define R300_FACE_NEG (1 << 2) -#define R300_SU_DEPTH_SCALE 0x42c0 -#define R300_SU_DEPTH_OFFSET 0x42c4 - -#define R300_RS_COUNT 0x4300 -# define R300_RS_COUNT_IT_COUNT_SHIFT 0 -# define R300_RS_COUNT_IC_COUNT_SHIFT 7 -# define R300_RS_COUNT_HIRES_EN (1 << 18) - -#define R300_RS_IP_0 0x4310 -#define R300_RS_IP_1 0x4314 -# define R300_RS_TEX_PTR(x) (x << 0) -# define R300_RS_COL_PTR(x) (x << 6) -# define R300_RS_COL_FMT(x) (x << 9) -# define R300_RS_COL_FMT_RGBA 0 -# define R300_RS_COL_FMT_RGB0 2 -# define R300_RS_COL_FMT_RGB1 3 -# define R300_RS_COL_FMT_000A 4 -# define R300_RS_COL_FMT_0000 5 -# define R300_RS_COL_FMT_0001 6 -# define R300_RS_COL_FMT_111A 8 -# define R300_RS_COL_FMT_1110 9 -# define R300_RS_COL_FMT_1111 10 -# define R300_RS_SEL_S(x) (x << 13) -# define R300_RS_SEL_T(x) (x << 16) -# define R300_RS_SEL_R(x) (x << 19) -# define R300_RS_SEL_Q(x) (x << 22) -# define R300_RS_SEL_C0 0 -# define R300_RS_SEL_C1 1 -# define R300_RS_SEL_C2 2 -# define R300_RS_SEL_C3 3 -# define R300_RS_SEL_K0 4 -# define R300_RS_SEL_K1 5 -#define R300_RS_INST_COUNT 0x4304 -# define R300_INST_COUNT_RS(x) (x << 0) -# define R300_RS_W_EN (1 << 4) -# define R300_TX_OFFSET_RS(x) (x << 5) -#define R300_RS_INST_0 0x4330 -#define R300_RS_INST_1 0x4334 -# define R300_INST_TEX_ID(x) (x << 0) -# define R300_RS_INST_TEX_CN_WRITE (1 << 3) -# define R300_INST_TEX_ADDR(x) (x << 6) - -#define R300_TX_INVALTAGS 0x4100 -#define R300_TX_FILTER0_0 0x4400 -#define R300_TX_FILTER0_1 0x4404 -# define R300_TX_CLAMP_S(x) (x << 0) -# define R300_TX_CLAMP_T(x) (x << 3) -# define R300_TX_CLAMP_R(x) (x << 6) -# define R300_TX_CLAMP_WRAP 0 -# define R300_TX_CLAMP_MIRROR 1 -# define R300_TX_CLAMP_CLAMP_LAST 2 -# define R300_TX_CLAMP_MIRROR_CLAMP_LAST 3 -# define R300_TX_CLAMP_CLAMP_BORDER 4 -# define R300_TX_CLAMP_MIRROR_CLAMP_BORDER 5 -# define R300_TX_CLAMP_CLAMP_GL 6 -# define R300_TX_CLAMP_MIRROR_CLAMP_GL 7 -# define R300_TX_MAG_FILTER_NEAREST (1 << 9) -# define R300_TX_MIN_FILTER_NEAREST (1 << 11) -# define R300_TX_MAG_FILTER_LINEAR (2 << 9) -# define R300_TX_MIN_FILTER_LINEAR (2 << 11) -# define R300_TX_ID_SHIFT 28 -#define R300_TX_FILTER1_0 0x4440 -#define R300_TX_FILTER1_1 0x4444 -#define R300_TX_FORMAT0_0 0x4480 -#define R300_TX_FORMAT0_1 0x4484 -# define R300_TXWIDTH_SHIFT 0 -# define R300_TXHEIGHT_SHIFT 11 -# define R300_NUM_LEVELS_SHIFT 26 -# define R300_NUM_LEVELS_MASK 0x -# define R300_TXPROJECTED (1 << 30) -# define R300_TXPITCH_EN (1 << 31) -#define R300_TX_FORMAT1_0 0x44c0 -#define R300_TX_FORMAT1_1 0x44c4 -# define R300_TX_FORMAT_X8 0x0 -# define R300_TX_FORMAT_X16 0x1 -# define R300_TX_FORMAT_Y4X4 0x2 -# define R300_TX_FORMAT_Y8X8 0x3 -# define R300_TX_FORMAT_Y16X16 0x4 -# define R300_TX_FORMAT_Z3Y3X2 0x5 -# define R300_TX_FORMAT_Z5Y6X5 0x6 -# define R300_TX_FORMAT_Z6Y5X5 0x7 -# define R300_TX_FORMAT_Z11Y11X10 0x8 -# define R300_TX_FORMAT_Z10Y11X11 0x9 -# define R300_TX_FORMAT_W4Z4Y4X4 0xA -# define R300_TX_FORMAT_W1Z5Y5X5 0xB -# define R300_TX_FORMAT_W8Z8Y8X8 0xC -# define R300_TX_FORMAT_W2Z10Y10X10 0xD -# define R300_TX_FORMAT_W16Z16Y16X16 0xE -# define R300_TX_FORMAT_DXT1 0xF -# define R300_TX_FORMAT_DXT3 0x10 -# define R300_TX_FORMAT_DXT5 0x11 -# define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */ -# define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */ -# define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */ -# define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */ -# define R300_TX_FORMAT_VYUY422 0x14 /* no swizzle */ -# define R300_TX_FORMAT_YVYU422 0x15 /* no swizzle */ -# define R300_TX_FORMAT_X24_Y8 0x1e -# define R300_TX_FORMAT_X32 0x1e - /* Floating point formats */ - /* Note - hardware supports both 16 and 32 bit floating point */ -# define R300_TX_FORMAT_FL_I16 0x18 -# define R300_TX_FORMAT_FL_I16A16 0x19 -# define R300_TX_FORMAT_FL_R16G16B16A16 0x1A -# define R300_TX_FORMAT_FL_I32 0x1B -# define R300_TX_FORMAT_FL_I32A32 0x1C -# define R300_TX_FORMAT_FL_R32G32B32A32 0x1D - /* alpha modes, convenience mostly */ - /* if you have alpha, pick constant appropriate to the - number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */ -# define R300_TX_FORMAT_ALPHA_1CH 0x000 -# define R300_TX_FORMAT_ALPHA_2CH 0x200 -# define R300_TX_FORMAT_ALPHA_4CH 0x600 -# define R300_TX_FORMAT_ALPHA_NONE 0xA00 - /* Swizzling */ - /* constants */ -# define R300_TX_FORMAT_X 0 -# define R300_TX_FORMAT_Y 1 -# define R300_TX_FORMAT_Z 2 -# define R300_TX_FORMAT_W 3 -# define R300_TX_FORMAT_ZERO 4 -# define R300_TX_FORMAT_ONE 5 - /* 2.0*Z, everything above 1.0 is set to 0.0 */ -# define R300_TX_FORMAT_CUT_Z 6 - /* 2.0*W, everything above 1.0 is set to 0.0 */ -# define R300_TX_FORMAT_CUT_W 7 - -# define R300_TX_FORMAT_B_SHIFT 18 -# define R300_TX_FORMAT_G_SHIFT 15 -# define R300_TX_FORMAT_R_SHIFT 12 -# define R300_TX_FORMAT_A_SHIFT 9 - - /* Convenience macro to take care of layout and swizzling */ -# define R300_EASY_TX_FORMAT(B, G, R, A, FMT) ( \ - ((R300_TX_FORMAT_##B)< Date: Sat, 24 Jan 2009 03:34:17 -0800 Subject: r300: Add some useful debugging information; remove a couple compile warnings. Deck chairs on the Titanic. --- src/gallium/drivers/r300/r300_chipset.h | 27 ------------- src/gallium/drivers/r300/r300_cs.h | 16 ++++++-- src/gallium/drivers/r300/r300_screen.c | 72 +++++++++++++++++++++++++++++---- 3 files changed, 77 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h index f1502ff76c..c4104a65cb 100644 --- a/src/gallium/drivers/r300/r300_chipset.h +++ b/src/gallium/drivers/r300/r300_chipset.h @@ -73,33 +73,6 @@ enum { CHIP_FAMILY_RV570 }; -static const char* chip_families[] = { - "R300", - "R350", - "R360", - "RV350", - "RV370", - "RV380", - "R420", - "R423", - "R430", - "R480", - "R481", - "RV410", - "RS400", - "RC410", - "RS480", - "RS482", - "RS690", - "RS740", - "RV515", - "R520", - "RV530", - "R580", - "RV560", - "RV570" -}; - void r300_parse_chipset(struct r300_capabilities* caps); #endif /* R300_CHIPSET_H */ diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 67cb5ee7d1..2dcb92d9af 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -67,6 +67,8 @@ static uint32_t pack_float_32(float f) #define BEGIN_CS(size) do { \ CHECK_CS(size); \ + debug_printf("r300: BEGIN_CS in %s (%s:%d)", __FUNCTION__, __FILE__, \ + __LINE__); \ cs_winsys->begin_cs(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ } while (0) @@ -91,10 +93,16 @@ static uint32_t pack_float_32(float f) cs_winsys->write_cs_reloc(cs, bo, rd, wd, flags); \ } while (0) -#define END_CS \ - cs_winsys->end_cs(cs, __FILE__, __FUNCTION__, __LINE__) +#define END_CS do { \ + debug_printf("r300: END_CS in %s (%s:%d)", __FUNCTION__, __FILE__, \ + __LINE__); \ + cs_winsys->end_cs(cs, __FILE__, __FUNCTION__, __LINE__); \ +} while (0) -#define FLUSH_CS \ - cs_winsys->flush_cs(cs) +#define FLUSH_CS do { \ + debug_printf("r300: FLUSH_CS in %s (%s:%d)", __FUNCTION__, __FILE__, \ + __LINE__); \ + cs_winsys->flush_cs(cs); \ +} while (0) #endif /* R300_CS_H */ diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index bd5aa4f466..dc1e41749f 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -22,11 +22,44 @@ #include "r300_screen.h" +/* Return the identifier behind whom the brave coders responsible for this + * amalgamation of code, sweat, and duct tape, routinely obscure their names. + * + * ...I should have just put "Corbin Simpson", but I'm not that cool. + * + * (Or egotistical. Yet.) */ static const char* r300_get_vendor(struct pipe_screen* pscreen) { return "X.Org R300 Project"; } +static const char* chip_families[] = { + "R300", + "R350", + "R360", + "RV350", + "RV370", + "RV380", + "R420", + "R423", + "R430", + "R480", + "R481", + "RV410", + "RS400", + "RC410", + "RS480", + "RS482", + "RS690", + "RS740", + "RV515", + "R520", + "RV530", + "R580", + "RV560", + "RV570" +}; + static const char* r300_get_name(struct pipe_screen* pscreen) { struct r300_screen* r300screen = r300_screen(pscreen); @@ -74,18 +107,39 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) /* IN THEORY */ return 0; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: - /* 12 == 2048x2048 */ - return 12; + if (r300screen->caps->is_r500) { + /* 13 == 4096x4096 */ + return 13; + } else { + /* 12 == 2048x2048 */ + return 12; + } case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: - /* XXX educated guess */ - return 8; + /* So, technically, the limit is the same as above, but some math + * shows why this is silly. Assuming RGBA, 4cpp, we can see that + * 4096*4096*4096 = 64.0 GiB exactly, so it's not exactly + * practical. However, if at some point a game really wants this, + * then we can remove this limit. */ + if (r300screen->caps->is_r500) { + /* 9 == 256x256x256 */ + return 9; + } else { + /* 8 == 128*128*128 */ + return 8; + } case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: - /* XXX educated guess */ - return 11; + if (r300screen->caps->is_r500) { + /* 13 == 4096x4096 */ + return 13; + } else { + /* 12 == 2048x2048 */ + return 12; + } case PIPE_CAP_MAX_RENDER_TARGETS: /* XXX 4 eventually */ return 1; default: + debug_printf("r300: Implementation error: Bad param %d", param); return 0; } } @@ -108,7 +162,7 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) case PIPE_CAP_MAX_TEXTURE_LOD_BIAS: return 16.0f; default: - /* XXX implementation error? */ + debug_printf("r300: Implementation error: Bad paramf %d", param); return 0.0f; } } @@ -121,6 +175,8 @@ static boolean check_tex_2d_format(enum pipe_format format) case PIPE_FORMAT_I8_UNORM: return TRUE; default: + debug_printf("r300: Warning: Got unknown format: %d, in %s", + format, __FUNCTION__); break; } @@ -138,6 +194,8 @@ static boolean r300_is_format_supported(struct pipe_screen* pscreen, case PIPE_TEXTURE_2D: return check_tex_2d_format(format); default: + debug_printf("r300: Warning: Got unknown format target: %d", + format); break; } -- cgit v1.2.3 From 161f4068aa5f8b556d0c00c3e31192b3736aada5 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 04:03:11 -0800 Subject: r300: More state setters. --- src/gallium/drivers/r300/r300_state.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index e52d8ec9c2..1f6abc2385 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -704,13 +704,33 @@ static void r300_set_scissor_state(struct pipe_context* pipe, } static void r300_set_viewport_state(struct pipe_context* pipe, - const struct pipe_viewport_state* state) + const struct pipe_viewport_state* state) { struct r300_context* r300 = r300_context(pipe); /* XXX handing this off to Draw for now */ draw_set_viewport_state(r300->draw, state); } +static void r300_set_vertex_buffers(struct pipe_context* pipe, + unsigned count, + const struct pipe_vertex_buffer* buffers) +{ + struct r300_context* r300 = r300_context(pipe); + /* XXX Draw */ + draw_flush(r300->draw); + draw_set_vertex_buffers(r300->draw, count, buffers); +} + +static void r300_set_vertex_elements(struct pipe_context* pipe, + unsigned count, + const struct pipe_vertex_element* elements) +{ + struct r300_context* r300 = r300_context(pipe); + /* XXX Draw */ + draw_flush(r300->draw); + draw_set_vertex_elements(r300->draw, count, elements); +} + static void* r300_create_vs_state(struct pipe_context* pipe, const struct pipe_shader_state* state) { @@ -772,8 +792,8 @@ void r300_init_state_functions(struct r300_context* r300) r300->context.set_viewport_state = r300_set_viewport_state; - /* XXX r300->context.set_vertex_buffers = r300_set_vertex_buffers; - * XXX r300->context.set_vertex_elements = r300_set_vertex_elements; */ + r300->context.set_vertex_buffers = r300_set_vertex_buffers; + r300->context.set_vertex_elements = r300_set_vertex_elements; r300->context.create_vs_state = r300_create_vs_state; r300->context.bind_vs_state = r300_bind_vs_state; -- cgit v1.2.3 From f2a7d4f2e8e890e69e1dfa9067db4e90df63989f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 04:03:27 -0800 Subject: r300: Newlines, dammit! --- src/gallium/drivers/r300/r300_cs.h | 6 +++--- src/gallium/drivers/r300/r300_screen.c | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 2dcb92d9af..e6860cbaf7 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -67,7 +67,7 @@ static uint32_t pack_float_32(float f) #define BEGIN_CS(size) do { \ CHECK_CS(size); \ - debug_printf("r300: BEGIN_CS in %s (%s:%d)", __FUNCTION__, __FILE__, \ + debug_printf("r300: BEGIN_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \ __LINE__); \ cs_winsys->begin_cs(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ } while (0) @@ -94,13 +94,13 @@ static uint32_t pack_float_32(float f) } while (0) #define END_CS do { \ - debug_printf("r300: END_CS in %s (%s:%d)", __FUNCTION__, __FILE__, \ + debug_printf("r300: END_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \ __LINE__); \ cs_winsys->end_cs(cs, __FILE__, __FUNCTION__, __LINE__); \ } while (0) #define FLUSH_CS do { \ - debug_printf("r300: FLUSH_CS in %s (%s:%d)", __FUNCTION__, __FILE__, \ + debug_printf("r300: FLUSH_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \ __LINE__); \ cs_winsys->flush_cs(cs); \ } while (0) diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index dc1e41749f..25ddb0e8c6 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -139,7 +139,8 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) /* XXX 4 eventually */ return 1; default: - debug_printf("r300: Implementation error: Bad param %d", param); + debug_printf("r300: Implementation error: Bad param %d\n", + param); return 0; } } @@ -162,7 +163,8 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) case PIPE_CAP_MAX_TEXTURE_LOD_BIAS: return 16.0f; default: - debug_printf("r300: Implementation error: Bad paramf %d", param); + debug_printf("r300: Implementation error: Bad paramf %d\n", + param); return 0.0f; } } @@ -175,7 +177,7 @@ static boolean check_tex_2d_format(enum pipe_format format) case PIPE_FORMAT_I8_UNORM: return TRUE; default: - debug_printf("r300: Warning: Got unknown format: %d, in %s", + debug_printf("r300: Warning: Got unknown format: %d, in %s\n", format, __FUNCTION__); break; } @@ -194,7 +196,7 @@ static boolean r300_is_format_supported(struct pipe_screen* pscreen, case PIPE_TEXTURE_2D: return check_tex_2d_format(format); default: - debug_printf("r300: Warning: Got unknown format target: %d", + debug_printf("r300: Warning: Got unknown format target: %d\n", format); break; } -- cgit v1.2.3 From f045988ee101fbef77f280f37f56967e6a95c5f2 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 04:08:33 -0800 Subject: r300: Add more capabilities. --- src/gallium/drivers/r300/r300_screen.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 25ddb0e8c6..6de97a79e1 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -80,9 +80,6 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) case PIPE_CAP_NPOT_TEXTURES: /* IN THEORY */ return 0; - case PIPE_CAP_S3TC: - /* IN THEORY */ - return 0; case PIPE_CAP_TWO_SIDED_STENCIL: /* IN THEORY */ /* if (r300screen->is_r500) { @@ -91,21 +88,27 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) * return 0; * } */ return 0; + case PIPE_CAP_GLSL: + /* IN THEORY */ + return 0; + case PIPE_CAP_S3TC: + /* IN THEORY */ + return 0; case PIPE_CAP_ANISOTROPIC_FILTER: /* IN THEORY */ return 0; case PIPE_CAP_POINT_SPRITE: /* IN THEORY */ return 0; + case PIPE_CAP_MAX_RENDER_TARGETS: + /* XXX 4 eventually */ + return 1; case PIPE_CAP_OCCLUSION_QUERY: /* IN THEORY */ return 0; case PIPE_CAP_TEXTURE_SHADOW_MAP: /* IN THEORY */ return 0; - case PIPE_CAP_GLSL: - /* IN THEORY */ - return 0; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: if (r300screen->caps->is_r500) { /* 13 == 4096x4096 */ @@ -135,9 +138,13 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) /* 12 == 2048x2048 */ return 12; } - case PIPE_CAP_MAX_RENDER_TARGETS: - /* XXX 4 eventually */ + case PIPE_CAP_TEXTURE_MIRROR_CLAMP: + return 1; + case PIPE_CAP_TEXTURE_MIRROR_REPEAT: return 1; + case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: + /* XXX guessing */ + return 2; default: debug_printf("r300: Implementation error: Bad param %d\n", param); -- cgit v1.2.3 From 57b062f77551f0111fd210a2d8dd44be6acfc818 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 04:11:03 -0800 Subject: r300: Make format names legible. --- src/gallium/drivers/r300/r300_screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 6de97a79e1..607dfe911c 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -184,8 +184,8 @@ static boolean check_tex_2d_format(enum pipe_format format) case PIPE_FORMAT_I8_UNORM: return TRUE; default: - debug_printf("r300: Warning: Got unknown format: %d, in %s\n", - format, __FUNCTION__); + debug_printf("r300: Warning: Got unknown format: %s, in %s\n", + pf_name(format), __FUNCTION__); break; } -- cgit v1.2.3 From 188f61d43ae82c63d557d25282e349926321e3d0 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 05:44:01 -0800 Subject: r300: Hook up clear, set it to fallback. --- src/gallium/drivers/r300/r300_context.c | 2 ++ src/gallium/drivers/r300/r300_context.h | 1 + src/gallium/drivers/r300/r300_state.c | 18 ++++++++++++++++-- src/gallium/drivers/r300/r300_surface.c | 8 +++++++- 4 files changed, 26 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 314b2f0a11..e63e1278bf 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -47,6 +47,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.destroy = r300_destroy_context; + r300->context.clear = r300_clear; + r300->draw = draw_create(); r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 52ddfa1df9..f246c57f48 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -27,6 +27,7 @@ #include "pipe/p_context.h" #include "util/u_memory.h" +#include "r300_clear.h" #include "r300_screen.h" #include "r300_winsys.h" diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 1f6abc2385..907ebe5c75 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -204,6 +204,14 @@ static void r300_set_clip_state(struct pipe_context* pipe, draw_set_clip_state(r300->draw, state); } +static void + r300_set_constant_buffer(struct pipe_context* pipe, + uint shader, uint index, + const struct pipe_constant_buffer* buffer) +{ + /* XXX */ +} + static uint32_t translate_depth_stencil_function(int zs_func) { switch (zs_func) { case PIPE_FUNC_NEVER: @@ -367,6 +375,12 @@ static void r300_delete_dsa_state(struct pipe_context* pipe, FREE(state); } +static void r300_set_edgeflags(struct pipe_context* pipe, + const unsigned* bitfield) +{ + /* XXX you know it's bad when i915 has this blank too */ +} + static void r300_set_framebuffer_state(struct pipe_context* pipe, const struct pipe_framebuffer_state* state) @@ -762,13 +776,13 @@ void r300_init_state_functions(struct r300_context* r300) r300->context.set_clip_state = r300_set_clip_state; - /* XXX r300->context.set_constant_buffer = r300_set_constant_buffer; */ + r300->context.set_constant_buffer = r300_set_constant_buffer; r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; - /* XXX r300->context.set_edgeflags = r300_set_edgeflags; */ + r300->context.set_edgeflags = r300_set_edgeflags; r300->context.set_framebuffer_state = r300_set_framebuffer_state; diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index dd1c8862a7..c9957a0af2 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -30,6 +30,12 @@ static void r300_surface_fill(struct pipe_context* pipe, unsigned w, unsigned h, unsigned color) { + +void *dst_map = pipe->screen->surface_map( pipe->screen, dest, +PIPE_BUFFER_USAGE_CPU_WRITE ); +pipe_fill_rect(dst_map, &dest->block, dest->stride, x, y, w, h, color); +pipe->screen->surface_unmap(pipe->screen, dest); +return; struct r300_context* r300 = r300_context(pipe); CS_LOCALS(r300); struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps; @@ -278,7 +284,7 @@ static void r300_surface_fill(struct pipe_context* pipe, /* XXX might have to switch to 2D */ OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); - OUT_CS_RELOC(0, dest->buffer, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); /* XXX this needs more TLC (or TCL, as it were) */ OUT_CS_REG(R300_RB3D_COLORPITCH0, R300_COLOR_FORMAT_ARGB8888); #if 0 -- cgit v1.2.3 From f40e6988bdbdc89a7753d5a28323757e58f3e01f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 Jan 2009 06:21:00 -0800 Subject: Rebased to gallium-0.2, Jan 24 2009. --- src/gallium/drivers/r300/r300_texture.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 4adfe478c3..eb7c9d06f5 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -120,7 +120,6 @@ static struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen, if (surface) { surface->refcount = 1; - surface->winsys = screen->winsys; pipe_texture_reference(&surface->texture, texture); pipe_buffer_reference(screen, &surface->buffer, tex->buffer); surface->format = texture->format; -- cgit v1.2.3 From 412cf4d38be628200982208b7f93bb17530bb6db Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 25 Jan 2009 16:29:02 -0800 Subject: BROKEN This commit is only to protect against data loss, so please skip it when bisecting. Thanks. --- src/gallium/drivers/r300/r300_cs.h | 15 +- src/gallium/drivers/r300/r300_surface.c | 320 ++++++++++++++++++++++++++++++- src/gallium/winsys/drm/amd/amd_context.c | 2 +- 3 files changed, 322 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index e6860cbaf7..edcfb9628f 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -72,19 +72,24 @@ static uint32_t pack_float_32(float f) cs_winsys->begin_cs(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ } while (0) -#define OUT_CS(value) \ - cs_winsys->write_cs_dword(cs, value) +#define OUT_CS(value) do { \ + cs_winsys->write_cs_dword(cs, value); \ +} while (0) -#define OUT_CS_32F(value) \ - cs_winsys->write_cs_dword(cs, pack_float_32(value)) +#define OUT_CS_32F(value) do { \ + cs_winsys->write_cs_dword(cs, pack_float_32(value)); \ +} while (0) #define OUT_CS_REG(register, value) do { \ + debug_printf("writing 0x%x to register 0x%x\n", value, register); \ OUT_CS(CP_PACKET0(register, 0)); \ - OUT_CS(value); } while (0) + OUT_CS(value); \ +} while (0) /* Note: This expects count to be the number of registers, * not the actual packet0 count! */ #define OUT_CS_REG_SEQ(register, count) do { \ + debug_printf("writing register sequence 0x%x\n", register); \ OUT_CS(CP_PACKET0(register, ((count) - 1))); \ } while (0) diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index c9957a0af2..8afa06dec8 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -30,14 +30,9 @@ static void r300_surface_fill(struct pipe_context* pipe, unsigned w, unsigned h, unsigned color) { - -void *dst_map = pipe->screen->surface_map( pipe->screen, dest, -PIPE_BUFFER_USAGE_CPU_WRITE ); -pipe_fill_rect(dst_map, &dest->block, dest->stride, x, y, w, h, color); -pipe->screen->surface_unmap(pipe->screen, dest); -return; struct r300_context* r300 = r300_context(pipe); CS_LOCALS(r300); +#if 0 struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps; boolean has_tcl = caps->has_tcl; boolean is_r500 = caps->is_r500; @@ -47,6 +42,13 @@ return; * XXX it goes without saying that this needs to be cleaned up and * shifted around to work with the rest of the driver's state handling. */ + BEGIN_CS(450); + /* XXX */ + OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); + OUT_CS_REG(R300_TX_INVALTAGS, 0x0); + OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); + OUT_CS_REG(R300_TX_INVALTAGS, 0x0); + /* Sequence starting at R300_VAP_PROG_STREAM_CNTL_0 */ OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, 1); if (has_tcl) { @@ -93,8 +95,23 @@ return; R300_VPORT_Z_OFFSET_ENA); OUT_CS(0x8); + /* XXX */ + OUT_CS_REG_SEQ(R300_VAP_VF_MAX_VTX_INDX, 2); + OUT_CS(0xFFFFFF); + OUT_CS(0x0); + + OUT_CS_REG(R300_VAP_CNTL_STATUS, 0x0); + + OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4); + OUT_CS(0x3f800000); + OUT_CS(0x3f800000); + OUT_CS(0x3f800000); + OUT_CS(0x3f800000); + OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); + OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff); + OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); OUT_CS(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT); @@ -135,7 +152,7 @@ return; OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); } else { - OUT_CS_REG(R300_RS_IP_0, 8); + OUT_CS_REG_SEQ(R300_RS_IP_0, 8); for (i = 0; i < 8; ++i) { OUT_CS(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); } @@ -287,7 +304,6 @@ return; OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); /* XXX this needs more TLC (or TCL, as it were) */ OUT_CS_REG(R300_RB3D_COLORPITCH0, R300_COLOR_FORMAT_ARGB8888); -#if 0 if (flags & (CLEARBUFFER_DEPTH | CLEARBUFFER_STENCIL)) { assert(rrbd != 0); cbpitch = (rrbd->pitch / rrbd->cpp); @@ -337,7 +353,11 @@ return; (ctx->Stencil.Clear & R300_STENCILREF_MASK)); END_BATCH(); } -#endif + + OUT_CS_REG_SEQ(R300_ZB_CNTL, 3); + OUT_CS(0x0); + OUT_CS(0x0); + OUT_CS(0x0); OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | @@ -355,7 +375,289 @@ return; /* XXX this should be split off, also figure out WTF with the numbers */ OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); + END_CS; FLUSH_CS; +#endif +BEGIN_CS(276); +OUT_CS_REG(0x1720, 0x00068000); +OUT_CS_REG(0x4100, 0x00000000); +OUT_CS_REG(0x1720, 0x00068000); +OUT_CS_REG(0x1D98, 0x43000000); +OUT_CS_REG(0x1D9C, 0x43002000); +OUT_CS_REG(0x1DA0, 0xC3000000); +OUT_CS_REG(0x1DA4, 0x43002000); +OUT_CS_REG(0x1DA8, 0x3F000000); +OUT_CS_REG(0x1DAC, 0x3F000000); +OUT_CS_REG(0x2284, 0x00000000); +OUT_CS_REG(0x2080, 0x0030046A); +OUT_CS_REG(0x20B0, 0x0000043F); +OUT_CS_REG(0x20B4, 0x00000008); +OUT_CS_REG(0x2134, 0x00FFFFFF); +OUT_CS_REG(0x2138, 0x00000000); +OUT_CS_REG(0x2140, 0x00000000); +OUT_CS_REG(0x2150, 0x00000000); +OUT_CS_REG(0x21E0, 0x00000000); +OUT_CS_REG(0x2180, 0x00000000); +OUT_CS_REG(0x2184, 0x00000000); +OUT_CS_REG(0x21DC, 0xAAAAAAAA); +OUT_CS_REG(0x221C, 0x00000000); +OUT_CS_REG(0x2220, 0x3F800000); +OUT_CS_REG(0x2224, 0x3F800000); +OUT_CS_REG(0x2228, 0x3F800000); +OUT_CS_REG(0x222C, 0x3F800000); +OUT_CS_REG(0x2288, 0x0000FFFF); +OUT_CS_REG(0x2090, 0x00000000); +OUT_CS_REG(0x2094, 0x00000000); +OUT_CS_REG(0x22D0, 0x00000000); +OUT_CS_REG(0x22D4, 0x00000000); +OUT_CS_REG(0x22D8, 0x00000000); +OUT_CS_REG(0x4008, 0x00000007); +OUT_CS_REG(0x4010, 0x66666666); +OUT_CS_REG(0x4014, 0x06666666); +OUT_CS_REG(0x4018, 0x00000011); +OUT_CS_REG(0x401C, 0x00000004); +OUT_CS_REG(0x4020, 0x00000000); +OUT_CS_REG(0x4104, 0x00000000); +OUT_CS_REG(0x4200, 0x00000000); +OUT_CS_REG(0x4204, 0x00000000); +OUT_CS_REG(0x4208, 0x3F800000); +OUT_CS_REG(0x420C, 0x3F800000); +OUT_CS_REG(0x4214, 0x00050005); +OUT_CS_REG(0x421C, 0x00060006); +OUT_CS_REG(0x4230, 0x18000006); +OUT_CS_REG(0x4234, 0x00020006); +OUT_CS_REG(0x4238, 0x3BAAAAAB); +OUT_CS_REG(0x4234, 0x00030006); +OUT_CS_REG(0x4260, 0x00000000); +OUT_CS_REG(0x4264, 0x00000000); +OUT_CS_REG(0x4268, 0x3F800000); +OUT_CS_REG(0x4274, 0x00000002); +OUT_CS_REG(0x4278, 0x0003AAAA); +OUT_CS_REG(0x427C, 0x00000000); +OUT_CS_REG(0x4280, 0x00000000); +OUT_CS_REG(0x4288, 0x00000000); +OUT_CS_REG(0x428C, 0x00000001); +OUT_CS_REG(0x4290, 0x00000000); +OUT_CS_REG(0x4294, 0x3DBF1412); +OUT_CS_REG(0x4298, 0x00000000); +OUT_CS_REG(0x42A0, 0x00000000); +OUT_CS_REG(0x42A4, 0x00000000); +OUT_CS_REG(0x42A8, 0x00000000); +OUT_CS_REG(0x42AC, 0x00000000); +OUT_CS_REG(0x42B0, 0x00000000); +OUT_CS_REG(0x42B4, 0x00000000); +OUT_CS_REG(0x42B8, 0x00000000); +OUT_CS_REG(0x42C0, 0x4B7FFFFF); +OUT_CS_REG(0x42C4, 0x00000000); +OUT_CS_REG(0x4300, 0x00000000); +OUT_CS_REG(0x4304, 0x00000000); +OUT_CS_REG(0x4310, 0x00000000); +OUT_CS_REG(0x4314, 0x00000000); +OUT_CS_REG(0x4318, 0x00000000); +OUT_CS_REG(0x431C, 0x00000000); +OUT_CS_REG(0x4320, 0x00000000); +OUT_CS_REG(0x4324, 0x00000000); +OUT_CS_REG(0x4328, 0x00000000); +OUT_CS_REG(0x432C, 0x00000000); +OUT_CS_REG(0x4330, 0x00000000); +OUT_CS_REG(0x43A4, 0x0000001C); +OUT_CS_REG(0x43A8, 0x2DA49525); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x46A4, 0x00001B00); +OUT_CS_REG(0x46A8, 0x00001B0F); +OUT_CS_REG(0x46AC, 0x00001B0F); +OUT_CS_REG(0x46B0, 0x00001B0F); +OUT_CS_REG(0x46B4, 0x00000001); +OUT_CS_REG(0x4600, 0x00000000); +OUT_CS_REG(0x4604, 0x00000000); +OUT_CS_REG(0x4608, 0x00000000); +OUT_CS_REG(0x4610, 0x00000000); +OUT_CS_REG(0x4614, 0x00000000); +OUT_CS_REG(0x4618, 0x00000000); +OUT_CS_REG(0x461C, 0x00000000); +OUT_CS_REG(0x48C0, 0x00000000); +OUT_CS_REG(0x46C0, 0x00000000); +OUT_CS_REG(0x49C0, 0x00000000); +OUT_CS_REG(0x47C0, 0x00000000); +OUT_CS_REG(0x4BC0, 0x00000002); +OUT_CS_REG(0x4BC8, 0x00000000); +OUT_CS_REG(0x4BCC, 0x00000000); +OUT_CS_REG(0x4BD0, 0x00000000); +OUT_CS_REG(0x4BD4, 0x00000000); +OUT_CS_REG(0x4BD8, 0x00000000); +OUT_CS_REG(0x4BD8, 0x00000000); +OUT_CS_REG(0x4E00, 0x00000000); +OUT_CS_REG(0x4E04, 0x20210000); +OUT_CS_REG(0x4E08, 0x20210000); +OUT_CS_REG(0x4E0C, 0x0000000F); +OUT_CS_REG(0x4E10, 0x00000000); +OUT_CS_REG(0x4E18, 0x00000000); +OUT_CS_REG(0x4E28, 0x00000000); +OUT_CS_REG(0x4E38, 0x00C00100); +OUT_CS_REG(0x4E50, 0x00000000); +OUT_CS_REG(0x4E54, 0x00000000); +OUT_CS_REG(0x4E58, 0x00000000); +OUT_CS_REG(0x4E5C, 0x00000000); +OUT_CS_REG(0x4E60, 0x00000000); +OUT_CS_REG(0x4E64, 0x00000000); +OUT_CS_REG(0x4E68, 0x00000000); +OUT_CS_REG(0x4E6C, 0x00000000); +OUT_CS_REG(0x4E70, 0x00000000); +OUT_CS_REG(0x4E88, 0x00000000); +OUT_CS_REG(0x4EA0, 0x00000000); +OUT_CS_REG(0x4EA4, 0xFFFFFFFF); +OUT_CS_REG(0x4F00, 0x00000010); +OUT_CS_REG(0x4F04, 0x00038038); +OUT_CS_REG(0x4F08, 0x00FFFF00); +OUT_CS_REG(0x4F10, 0x00000002); +OUT_CS_REG(0x4F14, 0x00000001); +OUT_CS_REG(0x4F18, 0x00000003); +OUT_CS_REG(0x4F1C, 0x00000000); +OUT_CS_REG(0x4F20, 0x00000000); +OUT_CS_REG(0x4F24, 0x00000100); +OUT_CS_REG(0x4F28, 0x00000000); +OUT_CS_REG(0x4F30, 0x00000000); +OUT_CS_REG(0x4F34, 0x00000000); +OUT_CS_REG(0x4F44, 0x00000000); +OUT_CS_REG(0x4F54, 0x00000000); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000406); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x3F800000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000400); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000401); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000402); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000403); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000404); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000405); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2150, 0x21030003); +OUT_CS_REG(0x4BC0, 0x00000000); +OUT_CS_REG(0x21E0, 0xF688F688); +OUT_CS_REG(0x2180, 0x00000001); +OUT_CS_REG(0x2184, 0x00000405); +OUT_CS_REG(0x20B0, 0x0000043F); +OUT_CS_REG(0x20B4, 0x00000008); +OUT_CS_REG(0x21DC, 0xAAAAAAAA); +OUT_CS_REG(0x2090, 0x00000003); +OUT_CS_REG(0x2094, 0x00000000); +OUT_CS_REG(0x4104, 0x00000000); +OUT_CS_REG(0x1D98, 0x3F800000); +OUT_CS_REG(0x1D9C, 0x00000000); +OUT_CS_REG(0x1DA0, 0x3F800000); +OUT_CS_REG(0x1DA4, 0x00000000); +OUT_CS_REG(0x1DA8, 0x3F800000); +OUT_CS_REG(0x1DAC, 0x00000000); +OUT_CS_REG(0x4BD4, 0x00000000); +OUT_CS_REG(0x4E04, 0x00000000); +OUT_CS_REG(0x4E08, 0x00000000); +OUT_CS_REG(0x221C, 0x0001C000); +OUT_CS_REG(0x421C, 0x06000600); +OUT_CS_REG(0x4310, 0x00D10000); +OUT_CS_REG(0x4314, 0x00D10000); +OUT_CS_REG(0x4318, 0x00D10000); +OUT_CS_REG(0x431C, 0x00D10000); +OUT_CS_REG(0x4320, 0x00D10000); +OUT_CS_REG(0x4324, 0x00D10000); +OUT_CS_REG(0x4328, 0x00D10000); +OUT_CS_REG(0x432C, 0x00D10000); +OUT_CS_REG(0x4300, 0x00040080); +OUT_CS_REG(0x4304, 0x00000000); +OUT_CS_REG(0x4330, 0x00004000); +OUT_CS_REG(0x4600, 0x00000000); +OUT_CS_REG(0x4604, 0x00000000); +OUT_CS_REG(0x4608, 0x00000000); +OUT_CS_REG(0x4610, 0x00000000); +OUT_CS_REG(0x4614, 0x00000000); +OUT_CS_REG(0x4618, 0x00000000); +OUT_CS_REG(0x461C, 0x00400000); +OUT_CS_REG(0x48C0, 0x00050A80); +OUT_CS_REG(0x46C0, 0x1C000000); +OUT_CS_REG(0x49C0, 0x00040889); +OUT_CS_REG(0x47C0, 0x01000000); +OUT_CS_REG(0x2284, 0x00000000); +OUT_CS_REG(0x2080, 0x0030045A); +OUT_CS_REG(0x22D0, 0x00100000); +OUT_CS_REG(0x22D4, 0x00000000); +OUT_CS_REG(0x22D8, 0x00000001); +OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(0x1720, 0x10008000); +OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(0x2284, 0x00000001); +OUT_CS_REG(0x2200, 0x00000000); +OUT_CS_REG(0x2208, 0x00F00203); +OUT_CS_REG(0x2208, 0x00D10001); +OUT_CS_REG(0x2208, 0x01248001); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x2208, 0x00F02203); +OUT_CS_REG(0x2208, 0x00D10021); +OUT_CS_REG(0x2208, 0x01248021); +OUT_CS_REG(0x2208, 0x00000000); +OUT_CS_REG(0x1720, 0x00068000); +OUT_CS_REG(0x4E28, 0x00000000); +OUT_CS_REG(0x4E38, 0x00C00100); +OUT_CS_REG(0x4E0C, 0x0000000F); +OUT_CS_REG(0x4F00, 0x00000000); +OUT_CS_REG(0x4F04, 0x00000000); +OUT_CS_REG(0x4F08, 0x00FF0000); +OUT_CS_REG(0x4E4C, 0x0000000A); +OUT_CS_REG(0x4F18, 0x00000003); +OUT_CS_REG(0x1720, 0x00068000); + +END_CS; +FLUSH_CS; r300->dirty_state = R300_NEW_KITCHEN_SINK; } diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index df8eb850c8..9b3c9c2ab2 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -242,7 +242,7 @@ GLboolean amd_context_create(const __GLcontextModes *visual, return GL_FALSE; } - if (GL_TRUE) { + if (1) { fprintf(stderr, "Creating r300 context...\n"); pipe = r300_create_context(NULL, -- cgit v1.2.3 From 29a4f5493529042d1068a7d35da1e7f542474503 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 25 Jan 2009 21:35:26 -0800 Subject: r300: Working trivial/clear for RV410. This might work for other people too. --- src/gallium/drivers/r300/r300_cs.h | 8 +- src/gallium/drivers/r300/r300_cs_inlines.h | 35 +++ src/gallium/drivers/r300/r300_surface.c | 404 +++-------------------------- 3 files changed, 80 insertions(+), 367 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_cs_inlines.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index edcfb9628f..d515c2f025 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -81,7 +81,7 @@ static uint32_t pack_float_32(float f) } while (0) #define OUT_CS_REG(register, value) do { \ - debug_printf("writing 0x%x to register 0x%x\n", value, register); \ + debug_printf("r300: writing 0x%x to register 0x%x\n", value, register); \ OUT_CS(CP_PACKET0(register, 0)); \ OUT_CS(value); \ } while (0) @@ -89,11 +89,13 @@ static uint32_t pack_float_32(float f) /* Note: This expects count to be the number of registers, * not the actual packet0 count! */ #define OUT_CS_REG_SEQ(register, count) do { \ - debug_printf("writing register sequence 0x%x\n", register); \ + debug_printf("r300: writing register sequence 0x%x\n", register); \ OUT_CS(CP_PACKET0(register, ((count) - 1))); \ } while (0) #define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \ + debug_printf("r300: writing relocation for buffer %p, offset %d\n", \ + bo, offset); \ OUT_CS(offset); \ cs_winsys->write_cs_reloc(cs, bo, rd, wd, flags); \ } while (0) @@ -110,4 +112,6 @@ static uint32_t pack_float_32(float f) cs_winsys->flush_cs(cs); \ } while (0) +#include "r300_cs_inlines.h" + #endif /* R300_CS_H */ diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h new file mode 100644 index 0000000000..aa0e647008 --- /dev/null +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +/* r300_cs_inlines: This is just a handful of useful inlines for sending + * (very) common instructions to the CS buffer. Should only be included from + * r300_cs.h, probably. */ + +#ifdef R300_CS_H + +#define R300_PACIFY do { \ + OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | \ + (1 << 18) | (1 << 31)); \ +} while (0) + + +#endif /* R300_CS_H */ diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 8afa06dec8..226cc7fc6c 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -32,356 +32,18 @@ static void r300_surface_fill(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); CS_LOCALS(r300); -#if 0 - struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps; - boolean has_tcl = caps->has_tcl; - boolean is_r500 = caps->is_r500; - /* For the for loops. */ - int i; - /* Emit a shitload of state, and then draw a point to clear the buffer. - * XXX it goes without saying that this needs to be cleaned up and - * shifted around to work with the rest of the driver's state handling. - */ - BEGIN_CS(450); - /* XXX */ - OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); - OUT_CS_REG(R300_TX_INVALTAGS, 0x0); - OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); - OUT_CS_REG(R300_TX_INVALTAGS, 0x0); + float r, g, b, a; + r = (float)((color >> 16) & 0xff) / 255.0f; + g = (float)((color >> 8) & 0xff) / 255.0f; + b = (float)((color >> 0) & 0xff) / 255.0f; + debug_printf("r300: Filling surface %p at (%d,%d)," + " dimensions %dx%d, color 0x%x\n", + dest, x, y, w, h, color); - /* Sequence starting at R300_VAP_PROG_STREAM_CNTL_0 */ - OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, 1); - if (has_tcl) { - OUT_CS(((((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))); - } else { - OUT_CS(((((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))); - } - - /* Disable fog */ - OUT_CS_REG(R300_FG_FOG_BLEND, 0); - OUT_CS_REG(R300_FG_ALPHA_FUNC, 0); - - OUT_CS_REG(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_CS_REG_SEQ(R300_VAP_VTX_STATE_CNTL, 2); - OUT_CS((R300_SEL_USER_COLOR_0 << R300_COLOR_0_ASSEMBLY_SHIFT)); - OUT_CS(R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR | R300_INPUT_CNTL_TC0); - - /* comes from fglrx startup of clear */ - OUT_CS_REG_SEQ(R300_SE_VTE_CNTL, 2); - OUT_CS(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_CS(0x8); - - /* XXX */ - OUT_CS_REG_SEQ(R300_VAP_VF_MAX_VTX_INDX, 2); - OUT_CS(0xFFFFFF); - OUT_CS(0x0); - - OUT_CS_REG(R300_VAP_CNTL_STATUS, 0x0); - - OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4); - OUT_CS(0x3f800000); - OUT_CS(0x3f800000); - OUT_CS(0x3f800000); - OUT_CS(0x3f800000); - - OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); - - OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff); - - OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); - OUT_CS(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | - R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT); - OUT_CS(0); /* no textures */ - - OUT_CS_REG(R300_TX_ENABLE, 0); - - OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); - OUT_CS_32F(1.0); - OUT_CS_32F(x); - OUT_CS_32F(1.0); - OUT_CS_32F(y); - OUT_CS_32F(1.0); - OUT_CS_32F(0.0); - - OUT_CS_REG_SEQ(R300_RB3D_CBLEND, 2); - OUT_CS(0x0); - OUT_CS(0x0); - - OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_PS_UCP_MODE_CLIP_AS_TRIFAN | R300_CLIP_DISABLE); - - OUT_CS_REG(R300_GA_POINT_SIZE, ((w * 6) << R300_POINTSIZE_X_SHIFT) | - ((h * 6) << R300_POINTSIZE_Y_SHIFT)); - - if (is_r500) { - OUT_CS_REG_SEQ(R500_RS_IP_0, 8); - for (i = 0; i < 8; ++i) { - OUT_CS((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_CS_REG_SEQ(R300_RS_COUNT, 2); - /* XXX could hires be disabled for a speed boost? */ - OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_CS(0x0); - - OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); - } else { - OUT_CS_REG_SEQ(R300_RS_IP_0, 8); - for (i = 0; i < 8; ++i) { - OUT_CS(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); - } - - OUT_CS_REG_SEQ(R300_RS_COUNT, 2); - /* XXX could hires be disabled for a speed boost? */ - OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_CS(0x0); - - OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); - } - - if (is_r500) { - OUT_CS_REG_SEQ(R500_US_CONFIG, 2); - OUT_CS(R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); - OUT_CS(0x0); - OUT_CS_REG_SEQ(R500_US_CODE_ADDR, 3); - OUT_CS(R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(1)); - OUT_CS(R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(1)); - OUT_CS(R500_US_CODE_OFFSET_ADDR(0)); - - OUT_CS_REG(R500_GA_US_VECTOR_INDEX, 0x0); - - OUT_CS_REG(R500_GA_US_VECTOR_DATA, 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); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, R500_RGB_ADDR0(0) | - R500_RGB_ADDR1(0) | - R500_RGB_ADDR1_CONST | - R500_RGB_ADDR2(0) | - R500_RGB_ADDR2_CONST); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, R500_ALPHA_ADDR0(0) | - R500_ALPHA_ADDR1(0) | - R500_ALPHA_ADDR1_CONST | - R500_ALPHA_ADDR2(0) | - R500_ALPHA_ADDR2_CONST); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, 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); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, R500_ALPHA_OP_CMP | - R500_ALPHA_SWIZ_A_A | - R500_ALPHA_SWIZ_B_A); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, 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); - - } else { - OUT_CS_REG_SEQ(R300_US_CONFIG, 3); - OUT_CS(0x0); - OUT_CS(0x0); - OUT_CS(0x0); - OUT_CS_REG_SEQ(R300_US_CODE_ADDR_0, 4); - OUT_CS(0x0); - OUT_CS(0x0); - OUT_CS(0x0); - OUT_CS(R300_RGBA_OUT); - - OUT_CS_REG(R300_US_ALU_RGB_INST_0, - FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); - OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, - FP_SELC(0, NO, XYZ, FP_TMP(0), 0, 0)); - OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, - FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO))); - OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, - FP_SELA(0, NO, W, FP_TMP(0), 0, 0)); - } - - /* XXX */ - uint32_t vap_cntl; - OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0); - 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 (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)); - } - - vap_cntl |= (caps->num_vert_pipes << - R300_PVS_NUM_FPUS_SHIFT); - - OUT_CS_REG(R300_VAP_CNTL, vap_cntl); - - /* XXX unbreak this - if (has_tcl) { - OUT_CS_REG_SEQ(R300_VAP_PVS_CODE_CNTL_0, 3); - OUT_CS((0 << R300_PVS_FIRST_INST_SHIFT) | - (0 << R300_PVS_XYZW_VALID_INST_SHIFT) | - (1 << R300_PVS_LAST_INST_SHIFT)); - OUT_CS((0 << R300_PVS_CONST_BASE_OFFSET_SHIFT) | - (0 << R300_PVS_MAX_CONST_ADDR_SHIFT)); - OUT_CS(1 << R300_PVS_LAST_VTX_SRC_INST_SHIFT); - - OUT_CS_REG(R300_SC_SCREENDOOR, 0x0); - OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 28)); - OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); - OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); - OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, R300_PVS_CODE_START); - - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, - 0, 0xf, PVS_DST_REG_OUT)); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_SRC_OPERAND(0, PVS_SRC_SELECT_X, PVS_SRC_SELECT_Y, - PVS_SRC_SELECT_Z, PVS_SRC_SELECT_W, - PVS_SRC_REG_INPUT, VSF_FLAG_NONE)); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 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, VSF_FLAG_NONE)); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); - - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, 1, 0xf, - PVS_DST_REG_OUT)); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, PVS_SRC_OPERAND(1, PVS_SRC_SELECT_X, - PVS_SRC_SELECT_Y, PVS_SRC_SELECT_Z, - PVS_SRC_SELECT_W, PVS_SRC_REG_INPUT, - VSF_FLAG_NONE)); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 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, VSF_FLAG_NONE)); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); - } */ - - /* TODO in bufmgr */ - /* XXX this should be split off, also figure out WTF with the numbers */ - OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); - /* XXX might have to switch to 2D */ - - OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); - OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); - /* XXX this needs more TLC (or TCL, as it were) */ - OUT_CS_REG(R300_RB3D_COLORPITCH0, R300_COLOR_FORMAT_ARGB8888); - if (flags & (CLEARBUFFER_DEPTH | CLEARBUFFER_STENCIL)) { - assert(rrbd != 0); - cbpitch = (rrbd->pitch / rrbd->cpp); - if (rrbd->bo->flags & RADEON_BO_FLAGS_MACRO_TILE){ - cbpitch |= R300_DEPTHMACROTILE_ENABLE; - } - if (rrbd->bo->flags & RADEON_BO_FLAGS_MICRO_TILE){ - cbpitch |= R300_DEPTHMICROTILE_TILED; - } - BEGIN_BATCH_NO_AUTOSTATE(4); - OUT_BATCH_REGSEQ(R300_ZB_DEPTHOFFSET, 1); - OUT_BATCH_RELOC(0, rrbd->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_BATCH_REGVAL(R300_ZB_DEPTHPITCH, cbpitch); - END_BATCH(); - } - - { - 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(); - } - - OUT_CS_REG_SEQ(R300_ZB_CNTL, 3); - OUT_CS(0x0); - OUT_CS(0x0); - OUT_CS(0x0); - - OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); - OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | - (1 << R300_PRIM_NUM_VERTICES_SHIFT)); - OUT_CS_32F(w / 2.0); - OUT_CS_32F(h / 2.0); - /* XXX this should be the depth value to clear to */ - OUT_CS_32F(1.0); - OUT_CS_32F(1.0); - OUT_CS_32F(color); - OUT_CS_32F(color); - OUT_CS_32F(color); - OUT_CS_32F(color); - - /* XXX this should be split off, also figure out WTF with the numbers */ - OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18)); - - END_CS; - FLUSH_CS; -#endif BEGIN_CS(276); -OUT_CS_REG(0x1720, 0x00068000); +R300_PACIFY; OUT_CS_REG(0x4100, 0x00000000); -OUT_CS_REG(0x1720, 0x00068000); +R300_PACIFY; OUT_CS_REG(0x1D98, 0x43000000); OUT_CS_REG(0x1D9C, 0x43002000); OUT_CS_REG(0x1DA0, 0xC3000000); @@ -423,7 +85,6 @@ OUT_CS_REG(0x4204, 0x00000000); OUT_CS_REG(0x4208, 0x3F800000); OUT_CS_REG(0x420C, 0x3F800000); OUT_CS_REG(0x4214, 0x00050005); -OUT_CS_REG(0x421C, 0x00060006); OUT_CS_REG(0x4230, 0x18000006); OUT_CS_REG(0x4234, 0x00020006); OUT_CS_REG(0x4238, 0x3BAAAAAB); @@ -492,8 +153,6 @@ OUT_CS_REG(0x4E08, 0x20210000); OUT_CS_REG(0x4E0C, 0x0000000F); OUT_CS_REG(0x4E10, 0x00000000); OUT_CS_REG(0x4E18, 0x00000000); -OUT_CS_REG(0x4E28, 0x00000000); -OUT_CS_REG(0x4E38, 0x00C00100); OUT_CS_REG(0x4E50, 0x00000000); OUT_CS_REG(0x4E54, 0x00000000); OUT_CS_REG(0x4E58, 0x00000000); @@ -513,15 +172,13 @@ OUT_CS_REG(0x4F10, 0x00000002); OUT_CS_REG(0x4F14, 0x00000001); OUT_CS_REG(0x4F18, 0x00000003); OUT_CS_REG(0x4F1C, 0x00000000); -OUT_CS_REG(0x4F20, 0x00000000); -OUT_CS_REG(0x4F24, 0x00000100); OUT_CS_REG(0x4F28, 0x00000000); OUT_CS_REG(0x4F30, 0x00000000); OUT_CS_REG(0x4F34, 0x00000000); OUT_CS_REG(0x4F44, 0x00000000); OUT_CS_REG(0x4F54, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000406); @@ -530,7 +187,7 @@ OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x3F800000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000400); @@ -539,7 +196,7 @@ OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000401); @@ -548,7 +205,7 @@ OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000402); @@ -557,7 +214,7 @@ OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000403); @@ -566,7 +223,7 @@ OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000404); @@ -575,7 +232,7 @@ OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000405); @@ -604,7 +261,8 @@ OUT_CS_REG(0x4BD4, 0x00000000); OUT_CS_REG(0x4E04, 0x00000000); OUT_CS_REG(0x4E08, 0x00000000); OUT_CS_REG(0x221C, 0x0001C000); -OUT_CS_REG(0x421C, 0x06000600); +OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | + ((w * 6) << R300_POINTSIZE_X_SHIFT)); OUT_CS_REG(0x4310, 0x00D10000); OUT_CS_REG(0x4314, 0x00D10000); OUT_CS_REG(0x4318, 0x00D10000); @@ -633,7 +291,7 @@ OUT_CS_REG(0x22D0, 0x00100000); OUT_CS_REG(0x22D4, 0x00000000); OUT_CS_REG(0x22D8, 0x00000001); OUT_CS_REG(0x43E8, 0x00000000); -OUT_CS_REG(0x1720, 0x10008000); +R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); OUT_CS_REG(0x2284, 0x00000001); OUT_CS_REG(0x2200, 0x00000000); @@ -645,16 +303,32 @@ OUT_CS_REG(0x2208, 0x00F02203); OUT_CS_REG(0x2208, 0x00D10021); OUT_CS_REG(0x2208, 0x01248021); OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x1720, 0x00068000); -OUT_CS_REG(0x4E28, 0x00000000); -OUT_CS_REG(0x4E38, 0x00C00100); +R300_PACIFY; +OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); +OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); +//OUT_CS_REG(0x4E38, 0x00C00100); OUT_CS_REG(0x4E0C, 0x0000000F); OUT_CS_REG(0x4F00, 0x00000000); OUT_CS_REG(0x4F04, 0x00000000); OUT_CS_REG(0x4F08, 0x00FF0000); + +/* XXX Packet3 */ +OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); +OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | +(1 << R300_PRIM_NUM_VERTICES_SHIFT)); +OUT_CS_32F(w / 2.0); +OUT_CS_32F(h / 2.0); +/* XXX this should be the depth value to clear to */ +OUT_CS_32F(1.0); +OUT_CS_32F(1.0); +OUT_CS_32F(r); +OUT_CS_32F(g); +OUT_CS_32F(b); +OUT_CS_32F(1.0); + OUT_CS_REG(0x4E4C, 0x0000000A); OUT_CS_REG(0x4F18, 0x00000003); -OUT_CS_REG(0x1720, 0x00068000); +R300_PACIFY; END_CS; FLUSH_CS; -- cgit v1.2.3 From 3e3122467f1e9f6dde77762d1a35a56f89fb25ce Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 26 Jan 2009 02:18:56 -0800 Subject: r300: Deobfuscate a few registers, fix inaccurate variable names. It's not "pipes", it's floating-point vertex processors. Completely different. --- src/gallium/drivers/r300/r300_chipset.c | 26 +++++++++++++------------- src/gallium/drivers/r300/r300_chipset.h | 9 +++++---- src/gallium/drivers/r300/r300_surface.c | 10 +++++++--- 3 files changed, 25 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index 494c9e54c0..4c84be26ef 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -31,7 +31,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) /* Reasonable defaults */ caps->has_tcl = TRUE; caps->is_r500 = FALSE; - caps->num_vert_pipes = 4; + caps->num_vert_fpus = 4; /* Note: These are not ordered by PCI ID. I leave that task to GCC, @@ -112,7 +112,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x4A50: case 0x4A54: caps->family = CHIP_FAMILY_R420; - caps->num_vert_pipes = 6; + caps->num_vert_fpus = 6; break; case 0x5548: @@ -125,7 +125,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x5554: case 0x5D57: caps->family = CHIP_FAMILY_R423; - caps->num_vert_pipes = 6; + caps->num_vert_fpus = 6; break; case 0x554C: @@ -136,7 +136,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x5D49: case 0x5D4A: caps->family = CHIP_FAMILY_R430; - caps->num_vert_pipes = 6; + caps->num_vert_fpus = 6; break; case 0x5D4C: @@ -146,7 +146,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x5D50: case 0x5D52: caps->family = CHIP_FAMILY_R480; - caps->num_vert_pipes = 6; + caps->num_vert_fpus = 6; break; case 0x4B49: @@ -154,7 +154,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x4B4B: case 0x4B4C: caps->family = CHIP_FAMILY_R481; - caps->num_vert_pipes = 6; + caps->num_vert_fpus = 6; break; case 0x5E4C: @@ -170,7 +170,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x5E4B: case 0x5E4D: caps->family = CHIP_FAMILY_RV410; - caps->num_vert_pipes = 6; + caps->num_vert_fpus = 6; break; case 0x5954: @@ -226,7 +226,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x710E: case 0x710F: caps->family = CHIP_FAMILY_R520; - caps->num_vert_pipes = 8; + caps->num_vert_fpus = 8; caps->is_r500 = TRUE; break; @@ -269,7 +269,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x7210: case 0x7211: caps->family = CHIP_FAMILY_RV515; - caps->num_vert_pipes = 2; + caps->num_vert_fpus = 2; caps->is_r500 = TRUE; break; @@ -290,7 +290,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x71DA: case 0x71DE: caps->family = CHIP_FAMILY_RV530; - caps->num_vert_pipes = 5; + caps->num_vert_fpus = 5; caps->is_r500 = TRUE; break; @@ -310,13 +310,13 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x724F: case 0x7284: caps->family = CHIP_FAMILY_R580; - caps->num_vert_pipes = 8; + caps->num_vert_fpus = 8; caps->is_r500 = TRUE; break; case 0x7280: caps->family = CHIP_FAMILY_RV570; - caps->num_vert_pipes = 5; + caps->num_vert_fpus = 5; caps->is_r500 = TRUE; break; @@ -332,7 +332,7 @@ void r300_parse_chipset(struct r300_capabilities* caps) case 0x7293: case 0x7297: caps->family = CHIP_FAMILY_RV560; - caps->num_vert_pipes = 5; + caps->num_vert_fpus = 5; caps->is_r500 = TRUE; break; diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h index c4104a65cb..a9cd372ec5 100644 --- a/src/gallium/drivers/r300/r300_chipset.h +++ b/src/gallium/drivers/r300/r300_chipset.h @@ -32,14 +32,15 @@ struct r300_capabilities { uint32_t pci_id; /* Chipset family */ int family; - /* The number of vertex pipes */ - int num_vert_pipes; + /* The number of vertex floating-point units */ + int num_vert_fpus; /* The number of fragment pipes */ int num_frag_pipes; /* Whether or not TCL is physically present */ boolean has_tcl; - /* Whether or not this is an RV515 or newer; R500s have many features: - * - Extra bit on texture sizes + /* Whether or not this is an RV515 or newer; R500s have many differences + * that require extra consideration, compared to their R3xx cousins: + * - Extra bit of width and height on texture sizes * - Blend color is split across two registers * - Universal Shader (US) block used for fragment shaders */ boolean is_r500; diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 226cc7fc6c..9a4b3455d1 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -32,6 +32,7 @@ static void r300_surface_fill(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); CS_LOCALS(r300); + struct r300_capabilities* caps = ((struct r300_screen*)pipe->screen)->caps; float r, g, b, a; r = (float)((color >> 16) & 0xff) / 255.0f; g = (float)((color >> 8) & 0xff) / 255.0f; @@ -51,7 +52,6 @@ OUT_CS_REG(0x1DA4, 0x43002000); OUT_CS_REG(0x1DA8, 0x3F000000); OUT_CS_REG(0x1DAC, 0x3F000000); OUT_CS_REG(0x2284, 0x00000000); -OUT_CS_REG(0x2080, 0x0030046A); OUT_CS_REG(0x20B0, 0x0000043F); OUT_CS_REG(0x20B4, 0x00000008); OUT_CS_REG(0x2134, 0x00FFFFFF); @@ -76,7 +76,8 @@ OUT_CS_REG(0x22D8, 0x00000000); OUT_CS_REG(0x4008, 0x00000007); OUT_CS_REG(0x4010, 0x66666666); OUT_CS_REG(0x4014, 0x06666666); -OUT_CS_REG(0x4018, 0x00000011); +/* XXX why doesn't classic Mesa write the number of pipes, too? */ +OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | R300_GB_TILE_SIZE_16); OUT_CS_REG(0x401C, 0x00000004); OUT_CS_REG(0x4020, 0x00000000); OUT_CS_REG(0x4104, 0x00000000); @@ -286,7 +287,10 @@ OUT_CS_REG(0x46C0, 0x1C000000); OUT_CS_REG(0x49C0, 0x00040889); OUT_CS_REG(0x47C0, 0x01000000); OUT_CS_REG(0x2284, 0x00000000); -OUT_CS_REG(0x2080, 0x0030045A); +/* XXX these magic numbers should be explained when + * this becomes a cached state object */ +OUT_CS_REG(R300_VAP_CNTL, 0xA | (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | + (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); OUT_CS_REG(0x22D0, 0x00100000); OUT_CS_REG(0x22D4, 0x00000000); OUT_CS_REG(0x22D8, 0x00000001); -- cgit v1.2.3 From 2c2f819a1de0fc29866fdf90cce4550b0d2a0bad Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 26 Jan 2009 10:26:41 -0800 Subject: r300: Add r300_flush. Haha, I always do this. --- src/gallium/drivers/r300/r300_flush.c | 42 +++++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_flush.h | 33 +++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/gallium/drivers/r300/r300_flush.c create mode 100644 src/gallium/drivers/r300/r300_flush.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c new file mode 100644 index 0000000000..3766f0a0a7 --- /dev/null +++ b/src/gallium/drivers/r300/r300_flush.c @@ -0,0 +1,42 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_flush.h" + +static void r300_flush(struct pipe_context* pipe, + unsigned flags, + struct pipe_fence_handle** fence) +{ + struct r300_context* r300 = r300_context(pipe); + CS_LOCALS(r300); + + if (r300->dirty_hw) { + FLUSH_CS; + r300->dirty_state = R300_NEW_KITCHEN_SINK; + r300->dirty_hw = 0; + } +} + +void r300_init_flush_functions(struct r300_context* r300) +{ + r300->context.flush = r300_flush; +} diff --git a/src/gallium/drivers/r300/r300_flush.h b/src/gallium/drivers/r300/r300_flush.h new file mode 100644 index 0000000000..a1b224b39c --- /dev/null +++ b/src/gallium/drivers/r300/r300_flush.h @@ -0,0 +1,33 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_FLUSH_H +#define R300_FLUSH_H + +#include "pipe/p_context.h" + +#include "r300_context.h" +#include "r300_cs.h" + +void r300_init_flush_functions(struct r300_context* r300); + +#endif /* R300_FLUSH_H */ -- cgit v1.2.3 From f1ba451bcc7764fd2b92fc8408f6b52c1d670b1f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 27 Jan 2009 03:40:46 -0800 Subject: r300: Set up blend state emit, clean up blend registers. Also add at least one missing register to r300_reg. --- src/gallium/drivers/r300/r300_emit.c | 18 +++++++++----- src/gallium/drivers/r300/r300_reg.h | 2 ++ src/gallium/drivers/r300/r300_surface.c | 42 +++++++++++++++++---------------- src/gallium/drivers/r300/r300_surface.h | 9 +++++-- 4 files changed, 43 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 19bfcbdd5b..de606cfab7 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -26,6 +26,17 @@ #include "r300_cs.h" #include "r300_screen.h" +void r300_emit_blend_state(struct r300_context* r300, + struct r300_blend_state* blend) +{ + CS_LOCALS(r300); + OUT_CS_REG_SEQ(R300_RB3D_CBLEND, 2); + OUT_CS(blend->blend_control); + OUT_CS(blend->alpha_blend_control); + OUT_CS_REG(R300_RB3D_ROPCNTL, blend->rop); + OUT_CS_REG(R300_RB3D_DITHER_CTL, blend->dither); +} + static void r300_emit_dirty_state(struct r300_context* r300) { struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; @@ -38,12 +49,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) /* XXX check size */ if (r300->dirty_state & R300_NEW_BLEND) { - struct r300_blend_state* blend = r300->blend_state; - /* XXX next two are contiguous regs */ - OUT_CS_REG(R300_RB3D_CBLEND, blend->blend_control); - OUT_CS_REG(R300_RB3D_ABLEND, blend->alpha_blend_control); - OUT_CS_REG(R300_RB3D_ROPCNTL, blend->rop); - OUT_CS_REG(R300_RB3D_DITHER_CTL, blend->dither); + r300_emit_blend_state(r300, r300->blend_state); } if (r300->dirty_state & R300_NEW_BLEND_COLOR) { diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index 7f4a508b1b..c1796ad7a8 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -151,6 +151,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_VTX_W0_FMT (1 << 10) # define R300_SERIAL_PROC_ENA (1 << 11) +#define R300_VAP_VTX_SIZE 0x20b4 + /* BEGIN: Vertex data assembly - lots of uncertainties */ /* gap */ diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 9a4b3455d1..6c7784dd4d 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -43,24 +43,30 @@ static void r300_surface_fill(struct pipe_context* pipe, BEGIN_CS(276); R300_PACIFY; -OUT_CS_REG(0x4100, 0x00000000); +OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; +/* Viewport setup */ OUT_CS_REG(0x1D98, 0x43000000); OUT_CS_REG(0x1D9C, 0x43002000); OUT_CS_REG(0x1DA0, 0xC3000000); OUT_CS_REG(0x1DA4, 0x43002000); OUT_CS_REG(0x1DA8, 0x3F000000); OUT_CS_REG(0x1DAC, 0x3F000000); -OUT_CS_REG(0x2284, 0x00000000); -OUT_CS_REG(0x20B0, 0x0000043F); -OUT_CS_REG(0x20B4, 0x00000008); -OUT_CS_REG(0x2134, 0x00FFFFFF); -OUT_CS_REG(0x2138, 0x00000000); -OUT_CS_REG(0x2140, 0x00000000); -OUT_CS_REG(0x2150, 0x00000000); -OUT_CS_REG(0x21E0, 0x00000000); -OUT_CS_REG(0x2180, 0x00000000); -OUT_CS_REG(0x2184, 0x00000000); +/* Flush PVS. */ +OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); + +OUT_CS_REG(R300_SE_VTE_CNTL, 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 | R300_VTX_W0_FMT); +/* Vertex size. */ +OUT_CS_REG(R300_VAP_VTX_SIZE, 0x8); +/* Max and min vertex index clamp. */ +OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, 0xFFFFFF); +OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0x0); +/* XXX endian */ +OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP); +OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0); OUT_CS_REG(0x21DC, 0xAAAAAAAA); OUT_CS_REG(0x221C, 0x00000000); OUT_CS_REG(0x2220, 0x3F800000); @@ -149,12 +155,8 @@ OUT_CS_REG(0x4BD4, 0x00000000); OUT_CS_REG(0x4BD8, 0x00000000); OUT_CS_REG(0x4BD8, 0x00000000); OUT_CS_REG(0x4E00, 0x00000000); -OUT_CS_REG(0x4E04, 0x20210000); -OUT_CS_REG(0x4E08, 0x20210000); OUT_CS_REG(0x4E0C, 0x0000000F); OUT_CS_REG(0x4E10, 0x00000000); -OUT_CS_REG(0x4E18, 0x00000000); -OUT_CS_REG(0x4E50, 0x00000000); OUT_CS_REG(0x4E54, 0x00000000); OUT_CS_REG(0x4E58, 0x00000000); OUT_CS_REG(0x4E5C, 0x00000000); @@ -243,9 +245,9 @@ OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2150, 0x21030003); OUT_CS_REG(0x4BC0, 0x00000000); -OUT_CS_REG(0x21E0, 0xF688F688); -OUT_CS_REG(0x2180, 0x00000001); -OUT_CS_REG(0x2184, 0x00000405); +OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688); +OUT_CS_REG(R300_VAP_VTX_STATE_CNTL, 0x1); +OUT_CS_REG(R300_VAP_VSM_VTX_ASSM, 0x405); OUT_CS_REG(0x20B0, 0x0000043F); OUT_CS_REG(0x20B4, 0x00000008); OUT_CS_REG(0x21DC, 0xAAAAAAAA); @@ -259,8 +261,8 @@ OUT_CS_REG(0x1DA4, 0x00000000); OUT_CS_REG(0x1DA8, 0x3F800000); OUT_CS_REG(0x1DAC, 0x00000000); OUT_CS_REG(0x4BD4, 0x00000000); -OUT_CS_REG(0x4E04, 0x00000000); -OUT_CS_REG(0x4E08, 0x00000000); +r300_emit_blend_state(r300, &blend_clear_state); +/* XXX emit blend state */ OUT_CS_REG(0x221C, 0x0001C000); OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index 2d64a95412..6d71601b98 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -30,8 +30,13 @@ #include "r300_context.h" #include "r300_cs.h" +#include "r300_emit.h" -/* XXX integrate this into r300_reg */ -#include "r300_fragprog.h" +const struct r300_blend_state blend_clear_state = { + .blend_control = 0x0, + .alpha_blend_control = 0x0, + .rop = 0x0, + .dither = 0x0, +}; #endif /* R300_SURFACE_H */ -- cgit v1.2.3 From 2cb90c8e805d010ba4594264dd9edbbb7f95513a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 27 Jan 2009 04:03:38 -0800 Subject: r300: Count BEGIN_CS, END_CS, warn if count is off. --- src/gallium/drivers/r300/r300_cs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index d515c2f025..653e2fdafa 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -60,7 +60,8 @@ static uint32_t pack_float_32(float f) #define CS_LOCALS(context) \ struct r300_winsys* cs_winsys = context->winsys; \ - struct radeon_cs* cs = cs_winsys->cs + struct radeon_cs* cs = cs_winsys->cs; \ + int cs_count; #define CHECK_CS(size) \ cs_winsys->check_cs(cs, (size)) @@ -70,6 +71,7 @@ static uint32_t pack_float_32(float f) debug_printf("r300: BEGIN_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \ __LINE__); \ cs_winsys->begin_cs(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ + int cs_count = size; \ } while (0) #define OUT_CS(value) do { \ @@ -103,6 +105,8 @@ static uint32_t pack_float_32(float f) #define END_CS do { \ debug_printf("r300: END_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \ __LINE__); \ + if (cs_count != 0) \ + debug_printf("r300: Warning: cs_count off by %d\n", cs_count); \ cs_winsys->end_cs(cs, __FILE__, __FUNCTION__, __LINE__); \ } while (0) -- cgit v1.2.3 From bea0c5812bd2795b514725d2a3788add3dc209af Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 27 Jan 2009 04:04:57 -0800 Subject: r300: Add blend color state emit. Slow and steady wins the race. Or something like that. --- src/gallium/drivers/r300/r300_emit.c | 40 ++++++++++++++++++++------------- src/gallium/drivers/r300/r300_emit.h | 31 +++++++++++++++++++++++++ src/gallium/drivers/r300/r300_surface.c | 6 ++++- src/gallium/drivers/r300/r300_surface.h | 6 +++++ 4 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_emit.h (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index de606cfab7..e091352c3b 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -22,24 +22,44 @@ /* r300_emit: Functions for emitting state. */ -#include "r300_context.h" -#include "r300_cs.h" -#include "r300_screen.h" +#include "r300_emit.h" void r300_emit_blend_state(struct r300_context* r300, struct r300_blend_state* blend) { CS_LOCALS(r300); + BEGIN_CS(7); OUT_CS_REG_SEQ(R300_RB3D_CBLEND, 2); OUT_CS(blend->blend_control); OUT_CS(blend->alpha_blend_control); OUT_CS_REG(R300_RB3D_ROPCNTL, blend->rop); OUT_CS_REG(R300_RB3D_DITHER_CTL, blend->dither); + END_CS; +} + +void r300_emit_blend_color_state(struct r300_context* r300, + struct r300_blend_color_state* bc) +{ + struct r300_screen* r300screen = + (struct r300_screen*)r300->context.screen; + CS_LOCALS(r300); + if (r300screen->caps->is_r500) { + BEGIN_CS(3); + OUT_CS_REG_SEQ(R500_RB3D_CONSTANT_COLOR_AR, 2); + OUT_CS(bc->blend_color_red_alpha); + OUT_CS(bc->blend_color_green_blue); + END_CS; + } else { + BEGIN_CS(2); + OUT_CS_REG(R300_RB3D_BLEND_COLOR, bc->blend_color); + END_CS; + } } static void r300_emit_dirty_state(struct r300_context* r300) { - struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; + struct r300_screen* r300screen = + (struct r300_screen*)r300->context.screen; CS_LOCALS(r300); if (!(r300->dirty_state) && !(r300->dirty_hw)) { @@ -53,17 +73,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) } if (r300->dirty_state & R300_NEW_BLEND_COLOR) { - struct r300_blend_color_state* blend_color = r300->blend_color_state; - if (r300screen->caps->is_r500) { - /* XXX next two are contiguous regs */ - OUT_CS_REG(R500_RB3D_CONSTANT_COLOR_AR, - blend_color->blend_color_red_alpha); - OUT_CS_REG(R500_RB3D_CONSTANT_COLOR_GB, - blend_color->blend_color_green_blue); - } else { - OUT_CS_REG(R300_RB3D_BLEND_COLOR, - blend_color->blend_color); - } + r300_emit_blend_color_state(r300, r300->blend_color_state); } if (r300->dirty_state & R300_NEW_DSA) { diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h new file mode 100644 index 0000000000..5756b6acf4 --- /dev/null +++ b/src/gallium/drivers/r300/r300_emit.h @@ -0,0 +1,31 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_context.h" +#include "r300_cs.h" +#include "r300_screen.h" + +void r300_emit_blend_state(struct r300_context* r300, + struct r300_blend_state* blend); + +void r300_emit_blend_color_state(struct r300_context* r300, + struct r300_blend_color_state* bc); diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 6c7784dd4d..2e5a572f47 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -156,6 +156,9 @@ OUT_CS_REG(0x4BD8, 0x00000000); OUT_CS_REG(0x4BD8, 0x00000000); OUT_CS_REG(0x4E00, 0x00000000); OUT_CS_REG(0x4E0C, 0x0000000F); + +r300_emit_blend_color_state(r300, &blend_color_clear_state); + OUT_CS_REG(0x4E10, 0x00000000); OUT_CS_REG(0x4E54, 0x00000000); OUT_CS_REG(0x4E58, 0x00000000); @@ -261,8 +264,9 @@ OUT_CS_REG(0x1DA4, 0x00000000); OUT_CS_REG(0x1DA8, 0x3F800000); OUT_CS_REG(0x1DAC, 0x00000000); OUT_CS_REG(0x4BD4, 0x00000000); + r300_emit_blend_state(r300, &blend_clear_state); -/* XXX emit blend state */ + OUT_CS_REG(0x221C, 0x0001C000); OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index 6d71601b98..8ec7151f4d 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -39,4 +39,10 @@ const struct r300_blend_state blend_clear_state = { .dither = 0x0, }; +const struct r300_blend_color_state blend_color_clear_state = { + .blend_color = 0x0, + .blend_color_red_alpha = 0x0, + .blend_color_green_blue = 0x0, +}; + #endif /* R300_SURFACE_H */ -- cgit v1.2.3 From 2e635ef563e2bff50e7a2af4f505bbd066865723 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 27 Jan 2009 04:48:19 -0800 Subject: r300: Add dsa state emit. Seeing a pattern yet? --- src/gallium/drivers/r300/r300_emit.c | 31 ++++++++++++++++++++----------- src/gallium/drivers/r300/r300_emit.h | 3 +++ src/gallium/drivers/r300/r300_surface.c | 9 +++------ src/gallium/drivers/r300/r300_surface.h | 10 ++++++++++ 4 files changed, 36 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index e091352c3b..d8de766c31 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -56,6 +56,25 @@ void r300_emit_blend_color_state(struct r300_context* r300, } } +void r300_emit_dsa_state(struct r300_context* r300, + struct r300_dsa_state* dsa) +{ + struct r300_screen* r300screen = + (struct r300_screen*)r300->context.screen; + CS_LOCALS(r300); + BEGIN_CS(r300screen->caps->is_r500 ? 12 : 10); + OUT_CS_REG(R300_FG_ALPHA_FUNC, dsa->alpha_function); + OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); + OUT_CS_REG_SEQ(R300_ZB_CNTL, 3); + OUT_CS(dsa->z_buffer_control); + OUT_CS(dsa->z_stencil_control); + OUT_CS(dsa->stencil_ref_mask); + OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top); + if (r300screen->caps->is_r500) { + OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); + } +} + static void r300_emit_dirty_state(struct r300_context* r300) { struct r300_screen* r300screen = @@ -77,17 +96,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) } if (r300->dirty_state & R300_NEW_DSA) { - struct r300_dsa_state* dsa = r300->dsa_state; - OUT_CS_REG(R300_FG_ALPHA_FUNC, dsa->alpha_function); - OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); - /* XXX next three are contiguous regs */ - OUT_CS_REG(R300_ZB_CNTL, dsa->z_buffer_control); - OUT_CS_REG(R300_ZB_ZSTENCILCNTL, dsa->z_stencil_control); - OUT_CS_REG(R300_ZB_STENCILREFMASK, dsa->stencil_ref_mask); - OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top); - if (r300screen->caps->is_r500) { - OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); - } + r300_emit_dsa_state(r300, r300->dsa_state); } if (r300->dirty_state & R300_NEW_RASTERIZER) { diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 5756b6acf4..98287bc1f3 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -29,3 +29,6 @@ void r300_emit_blend_state(struct r300_context* r300, void r300_emit_blend_color_state(struct r300_context* r300, struct r300_blend_color_state* bc); + +void r300_emit_dsa_state(struct r300_context* r300, + struct r300_dsa_state* dsa); diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 2e5a572f47..aab1850144 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -151,7 +151,6 @@ OUT_CS_REG(0x4BC0, 0x00000002); OUT_CS_REG(0x4BC8, 0x00000000); OUT_CS_REG(0x4BCC, 0x00000000); OUT_CS_REG(0x4BD0, 0x00000000); -OUT_CS_REG(0x4BD4, 0x00000000); OUT_CS_REG(0x4BD8, 0x00000000); OUT_CS_REG(0x4BD8, 0x00000000); OUT_CS_REG(0x4E00, 0x00000000); @@ -175,7 +174,6 @@ OUT_CS_REG(0x4F00, 0x00000010); OUT_CS_REG(0x4F04, 0x00038038); OUT_CS_REG(0x4F08, 0x00FFFF00); OUT_CS_REG(0x4F10, 0x00000002); -OUT_CS_REG(0x4F14, 0x00000001); OUT_CS_REG(0x4F18, 0x00000003); OUT_CS_REG(0x4F1C, 0x00000000); OUT_CS_REG(0x4F28, 0x00000000); @@ -313,15 +311,14 @@ OUT_CS_REG(0x2208, 0x00F02203); OUT_CS_REG(0x2208, 0x00D10021); OUT_CS_REG(0x2208, 0x01248021); OUT_CS_REG(0x2208, 0x00000000); + +r300_emit_dsa_state(r300, &dsa_clear_state); + R300_PACIFY; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); //OUT_CS_REG(0x4E38, 0x00C00100); OUT_CS_REG(0x4E0C, 0x0000000F); -OUT_CS_REG(0x4F00, 0x00000000); -OUT_CS_REG(0x4F04, 0x00000000); -OUT_CS_REG(0x4F08, 0x00FF0000); - /* XXX Packet3 */ OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index 8ec7151f4d..2b89698ca5 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -45,4 +45,14 @@ const struct r300_blend_color_state blend_color_clear_state = { .blend_color_green_blue = 0x0, }; +const struct r300_dsa_state dsa_clear_state = { + .alpha_function = 0x0, + .alpha_reference = 0x0, + .z_buffer_control = 0x0, + .z_stencil_control = 0x0, + .stencil_ref_mask = 0x0, + .z_buffer_top = R300_ZTOP_ENABLE, + .stencil_ref_bf = 0x0, +}; + #endif /* R300_SURFACE_H */ -- cgit v1.2.3 From 962d2e678f4da6ffef4f21f2fa9b062747bfbb85 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 27 Jan 2009 15:12:01 -0800 Subject: r300: Clean up PVS upload emits. --- src/gallium/drivers/r300/r300_surface.c | 82 +++++---------------------------- 1 file changed, 11 insertions(+), 71 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index aab1850144..c0b020f81d 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -184,66 +184,6 @@ OUT_CS_REG(0x4F54, 0x00000000); OUT_CS_REG(0x43E8, 0x00000000); R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000406); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x3F800000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x43E8, 0x00000000); -R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000400); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x43E8, 0x00000000); -R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000401); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x43E8, 0x00000000); -R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000402); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x43E8, 0x00000000); -R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000403); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x43E8, 0x00000000); -R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000404); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x43E8, 0x00000000); -R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000405); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00000000); OUT_CS_REG(0x2150, 0x21030003); OUT_CS_REG(0x4BC0, 0x00000000); OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688); @@ -290,7 +230,6 @@ OUT_CS_REG(0x48C0, 0x00050A80); OUT_CS_REG(0x46C0, 0x1C000000); OUT_CS_REG(0x49C0, 0x00040889); OUT_CS_REG(0x47C0, 0x01000000); -OUT_CS_REG(0x2284, 0x00000000); /* XXX these magic numbers should be explained when * this becomes a cached state object */ OUT_CS_REG(R300_VAP_CNTL, 0xA | (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | @@ -301,16 +240,17 @@ OUT_CS_REG(0x22D8, 0x00000001); OUT_CS_REG(0x43E8, 0x00000000); R300_PACIFY; OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2284, 0x00000001); -OUT_CS_REG(0x2200, 0x00000000); -OUT_CS_REG(0x2208, 0x00F00203); -OUT_CS_REG(0x2208, 0x00D10001); -OUT_CS_REG(0x2208, 0x01248001); -OUT_CS_REG(0x2208, 0x00000000); -OUT_CS_REG(0x2208, 0x00F02203); -OUT_CS_REG(0x2208, 0x00D10021); -OUT_CS_REG(0x2208, 0x01248021); -OUT_CS_REG(0x2208, 0x00000000); +/* XXX translate these back into normal instructions */ +OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); +OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF00203); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10001); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248001); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF02203); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); +OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); r300_emit_dsa_state(r300, &dsa_clear_state); -- cgit v1.2.3 From 9814fca71897a11f635945224105eb40c021d787 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 27 Jan 2009 17:56:44 -0800 Subject: r300: Cleanup first part of RS block. Working towards r500-ability. --- src/gallium/drivers/r300/r300_surface.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index c0b020f81d..728a0076b7 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -33,6 +33,7 @@ static void r300_surface_fill(struct pipe_context* pipe, struct r300_context* r300 = r300_context(pipe); CS_LOCALS(r300); struct r300_capabilities* caps = ((struct r300_screen*)pipe->screen)->caps; + int i; float r, g, b, a; r = (float)((color >> 16) & 0xff) / 255.0f; g = (float)((color >> 8) & 0xff) / 255.0f; @@ -117,8 +118,6 @@ OUT_CS_REG(0x42B4, 0x00000000); OUT_CS_REG(0x42B8, 0x00000000); OUT_CS_REG(0x42C0, 0x4B7FFFFF); OUT_CS_REG(0x42C4, 0x00000000); -OUT_CS_REG(0x4300, 0x00000000); -OUT_CS_REG(0x4304, 0x00000000); OUT_CS_REG(0x4310, 0x00000000); OUT_CS_REG(0x4314, 0x00000000); OUT_CS_REG(0x4318, 0x00000000); @@ -208,16 +207,26 @@ r300_emit_blend_state(r300, &blend_clear_state); OUT_CS_REG(0x221C, 0x0001C000); OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); -OUT_CS_REG(0x4310, 0x00D10000); -OUT_CS_REG(0x4314, 0x00D10000); -OUT_CS_REG(0x4318, 0x00D10000); -OUT_CS_REG(0x431C, 0x00D10000); -OUT_CS_REG(0x4320, 0x00D10000); -OUT_CS_REG(0x4324, 0x00D10000); -OUT_CS_REG(0x4328, 0x00D10000); -OUT_CS_REG(0x432C, 0x00D10000); -OUT_CS_REG(0x4300, 0x00040080); -OUT_CS_REG(0x4304, 0x00000000); + +/* XXX RS block setup */ +if (caps->is_r500) { + OUT_CS_REG_SEQ(R500_RS_IP_0, 8); + for (i = 0; i < 8; i++) { + /* I like the operator macros more than the shift macros... */ + OUT_CS((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)); + } +} else { + OUT_CS_REG_SEQ(R300_RS_IP_0, 8); + for (i = 0; i < 8; i++) { + OUT_CS(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); + } +} +OUT_CS_REG(R300_RS_COUNT, (1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); +OUT_CS_REG(R300_RS_INST_COUNT, 0x0); + OUT_CS_REG(0x4330, 0x00004000); OUT_CS_REG(0x4600, 0x00000000); OUT_CS_REG(0x4604, 0x00000000); -- cgit v1.2.3 From 3f1bc7ed3285de255d0a76f1ed3e439f3b668d9b Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 27 Jan 2009 18:09:14 -0800 Subject: r300: Moar RS cleanup. How could I possibly miss these? --- src/gallium/drivers/r300/r300_surface.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 728a0076b7..47a3aac77d 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -118,15 +118,6 @@ OUT_CS_REG(0x42B4, 0x00000000); OUT_CS_REG(0x42B8, 0x00000000); OUT_CS_REG(0x42C0, 0x4B7FFFFF); OUT_CS_REG(0x42C4, 0x00000000); -OUT_CS_REG(0x4310, 0x00000000); -OUT_CS_REG(0x4314, 0x00000000); -OUT_CS_REG(0x4318, 0x00000000); -OUT_CS_REG(0x431C, 0x00000000); -OUT_CS_REG(0x4320, 0x00000000); -OUT_CS_REG(0x4324, 0x00000000); -OUT_CS_REG(0x4328, 0x00000000); -OUT_CS_REG(0x432C, 0x00000000); -OUT_CS_REG(0x4330, 0x00000000); OUT_CS_REG(0x43A4, 0x0000001C); OUT_CS_REG(0x43A8, 0x2DA49525); OUT_CS_REG(0x43E8, 0x00FFFFFF); -- cgit v1.2.3 From f6add70ef889b609a114baf8f6bcb43413caa702 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 28 Jan 2009 02:40:18 -0800 Subject: r300: Fix small r300_reg typo. --- src/gallium/drivers/r300/r300_reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index c1796ad7a8..37f168ed4c 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -658,7 +658,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_GB_FOG_SELECT_C3A (3 << 0) # define R300_GB_FOG_SELECT_1_1_W (4 << 0) # define R300_GB_FOG_SELECT_Z (5 << 0) -# define R300_GB_DEPTH_SELECT_Z (0 << 3 +# define R300_GB_DEPTH_SELECT_Z (0 << 3) # define R300_GB_DEPTH_SELECT_1_1_W (1 << 3) # define R300_GB_W_SELECT_1_W (0 << 4) # define R300_GB_W_SELECT_1 (1 << 4) -- cgit v1.2.3 From 80dc1801409f9913cc37b8fc8e68c692bc8a22ca Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 28 Jan 2009 02:51:51 -0800 Subject: r300: A handful of thingys. --- src/gallium/drivers/r300/r300_cs.h | 6 ++-- src/gallium/drivers/r300/r300_emit.c | 1 + src/gallium/drivers/r300/r300_reg.h | 2 +- src/gallium/drivers/r300/r300_surface.c | 54 ++++++++++++++++++--------------- 4 files changed, 35 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 653e2fdafa..42ec9fb094 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -61,7 +61,7 @@ static uint32_t pack_float_32(float f) #define CS_LOCALS(context) \ struct r300_winsys* cs_winsys = context->winsys; \ struct radeon_cs* cs = cs_winsys->cs; \ - int cs_count; + int cs_count = 0; #define CHECK_CS(size) \ cs_winsys->check_cs(cs, (size)) @@ -75,11 +75,13 @@ static uint32_t pack_float_32(float f) } while (0) #define OUT_CS(value) do { \ - cs_winsys->write_cs_dword(cs, value); \ + cs_winsys->write_cs_dword(cs, (value)); \ + cs_count--; \ } while (0) #define OUT_CS_32F(value) do { \ cs_winsys->write_cs_dword(cs, pack_float_32(value)); \ + cs_count--; \ } while (0) #define OUT_CS_REG(register, value) do { \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index d8de766c31..4ae8a46637 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -73,6 +73,7 @@ void r300_emit_dsa_state(struct r300_context* r300, if (r300screen->caps->is_r500) { OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); } + END_CS; } static void r300_emit_dirty_state(struct r300_context* r300) diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index 37f168ed4c..c1d5009b86 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -670,7 +670,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_GB_FOG_STUFF_COMP_MASK 0x00000c00 /* Specifies the graphics pipeline configuration for antialiasing. */ -#define GB_AA_CONFIG 0x4020 +#define R300_GB_AA_CONFIG 0x4020 # define GB_AA_CONFIG_AA_DISABLE (0 << 0) # define GB_AA_CONFIG_AA_ENABLE (1 << 0) # define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_2 (0 << 1) diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 47a3aac77d..fc756133b4 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -68,30 +68,31 @@ OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0x0); /* XXX endian */ OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP); OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0); -OUT_CS_REG(0x21DC, 0xAAAAAAAA); -OUT_CS_REG(0x221C, 0x00000000); -OUT_CS_REG(0x2220, 0x3F800000); -OUT_CS_REG(0x2224, 0x3F800000); -OUT_CS_REG(0x2228, 0x3F800000); -OUT_CS_REG(0x222C, 0x3F800000); -OUT_CS_REG(0x2288, 0x0000FFFF); -OUT_CS_REG(0x2090, 0x00000000); -OUT_CS_REG(0x2094, 0x00000000); -OUT_CS_REG(0x22D0, 0x00000000); -OUT_CS_REG(0x22D4, 0x00000000); -OUT_CS_REG(0x22D8, 0x00000000); -OUT_CS_REG(0x4008, 0x00000007); -OUT_CS_REG(0x4010, 0x66666666); -OUT_CS_REG(0x4014, 0x06666666); +/* XXX magic number not in r300_reg */ +OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); +OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0); +OUT_CS_REG(R300_VAP_GB_VERT_CLIP_ADJ, 4); +OUT_CS_32F(1.0); +OUT_CS_32F(1.0); +OUT_CS_32F(1.0); +OUT_CS_32F(1.0); +/* XXX is this too long? */ +OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xFFFF); +OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE | + R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE); +/* XXX more magic numbers */ +OUT_CS_REG(R300_GB_MSPOS0, 0x66666666); +OUT_CS_REG(R300_GB_MSPOS1, 0x66666666); /* XXX why doesn't classic Mesa write the number of pipes, too? */ OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | R300_GB_TILE_SIZE_16); -OUT_CS_REG(0x401C, 0x00000004); -OUT_CS_REG(0x4020, 0x00000000); -OUT_CS_REG(0x4104, 0x00000000); -OUT_CS_REG(0x4200, 0x00000000); -OUT_CS_REG(0x4204, 0x00000000); -OUT_CS_REG(0x4208, 0x3F800000); -OUT_CS_REG(0x420C, 0x3F800000); +OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W); +OUT_CS_REG(R300_GB_AA_CONFIG, 0x0); +/* XXX point tex stuffing */ +OUT_CS_REG_SEQ(R300_GA_POINT_S0, 4); +OUT_CS_32F(0.0); +OUT_CS_32F(0.0); +OUT_CS_32F(1.0); +OUT_CS_32F(1.0); OUT_CS_REG(0x4214, 0x00050005); OUT_CS_REG(0x4230, 0x18000006); OUT_CS_REG(0x4234, 0x00020006); @@ -184,7 +185,7 @@ OUT_CS_REG(0x20B4, 0x00000008); OUT_CS_REG(0x21DC, 0xAAAAAAAA); OUT_CS_REG(0x2090, 0x00000003); OUT_CS_REG(0x2094, 0x00000000); -OUT_CS_REG(0x4104, 0x00000000); +OUT_CS_REG(R300_TX_ENABLE, 0x0); OUT_CS_REG(0x1D98, 0x3F800000); OUT_CS_REG(0x1D9C, 0x00000000); OUT_CS_REG(0x1DA0, 0x3F800000); @@ -273,8 +274,11 @@ OUT_CS_32F(g); OUT_CS_32F(b); OUT_CS_32F(1.0); -OUT_CS_REG(0x4E4C, 0x0000000A); -OUT_CS_REG(0x4F18, 0x00000003); +/* XXX figure out why this is 0xA and not 0x2 */ +/* XXX OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA); +OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, + R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | + R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */ R300_PACIFY; END_CS; -- cgit v1.2.3 From 84ec4d6bedf33bf03ff7a778632eef7b209944cb Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 28 Jan 2009 02:57:08 -0800 Subject: Ack, forgot to update the index again. --- src/gallium/drivers/r300/r300_cs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 42ec9fb094..5686e5a6e9 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -68,10 +68,10 @@ static uint32_t pack_float_32(float f) #define BEGIN_CS(size) do { \ CHECK_CS(size); \ - debug_printf("r300: BEGIN_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \ - __LINE__); \ + debug_printf("r300: BEGIN_CS, count %d, in %s (%s:%d)\n", \ + size, __FUNCTION__, __FILE__, __LINE__); \ cs_winsys->begin_cs(cs, (size), __FILE__, __FUNCTION__, __LINE__); \ - int cs_count = size; \ + cs_count = size; \ } while (0) #define OUT_CS(value) do { \ -- cgit v1.2.3 From 588d8f3befa007e03ffb124033e6879330ad9614 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 28 Jan 2009 03:06:08 -0800 Subject: r300: Fix a few more registers. --- src/gallium/drivers/r300/r300_surface.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index fc756133b4..0ef26d4305 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -93,11 +93,13 @@ OUT_CS_32F(0.0); OUT_CS_32F(0.0); OUT_CS_32F(1.0); OUT_CS_32F(1.0); -OUT_CS_REG(0x4214, 0x00050005); -OUT_CS_REG(0x4230, 0x18000006); -OUT_CS_REG(0x4234, 0x00020006); -OUT_CS_REG(0x4238, 0x3BAAAAAB); +OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 | + (0x5 << R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT)); +/* XXX should this be related to the actual point size? */ +OUT_CS_REG(R300_GA_POINT_MINMAX, 0x6 | + (0x1800 << R300_GA_POINT_MINMAX_MAX_SHIFT)); OUT_CS_REG(0x4234, 0x00030006); +OUT_CS_REG(0x4238, 0x3BAAAAAB); OUT_CS_REG(0x4260, 0x00000000); OUT_CS_REG(0x4264, 0x00000000); OUT_CS_REG(0x4268, 0x3F800000); -- cgit v1.2.3 From 00f96d054d782fd0fa7b103b857fb19d3e4a1472 Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Wed, 28 Jan 2009 14:53:39 +0100 Subject: r300: name registers for human readability Signed-off-by: Corbin Simpson --- src/gallium/drivers/r300/r300_surface.c | 206 ++++++++++++++++---------------- 1 file changed, 103 insertions(+), 103 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 0ef26d4305..48e0f54db9 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -47,12 +47,12 @@ R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; /* Viewport setup */ -OUT_CS_REG(0x1D98, 0x43000000); -OUT_CS_REG(0x1D9C, 0x43002000); -OUT_CS_REG(0x1DA0, 0xC3000000); -OUT_CS_REG(0x1DA4, 0x43002000); -OUT_CS_REG(0x1DA8, 0x3F000000); -OUT_CS_REG(0x1DAC, 0x3F000000); +OUT_CS_REG(R300_SE_VPORT_XSCALE, 0x43000000); +OUT_CS_REG(R300_SE_VPORT_XOFFSET, 0x43002000); +OUT_CS_REG(R300_SE_VPORT_YSCALE, 0xC3000000); +OUT_CS_REG(R300_SE_VPORT_YOFFSET, 0x43002000); +OUT_CS_REG(R300_SE_VPORT_ZSCALE, 0x3F000000); +OUT_CS_REG(R300_SE_VPORT_ZOFFSET, 0x3F000000); /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); @@ -98,61 +98,61 @@ OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 | /* XXX should this be related to the actual point size? */ OUT_CS_REG(R300_GA_POINT_MINMAX, 0x6 | (0x1800 << R300_GA_POINT_MINMAX_MAX_SHIFT)); -OUT_CS_REG(0x4234, 0x00030006); -OUT_CS_REG(0x4238, 0x3BAAAAAB); -OUT_CS_REG(0x4260, 0x00000000); -OUT_CS_REG(0x4264, 0x00000000); -OUT_CS_REG(0x4268, 0x3F800000); -OUT_CS_REG(0x4274, 0x00000002); -OUT_CS_REG(0x4278, 0x0003AAAA); -OUT_CS_REG(0x427C, 0x00000000); -OUT_CS_REG(0x4280, 0x00000000); -OUT_CS_REG(0x4288, 0x00000000); -OUT_CS_REG(0x428C, 0x00000001); -OUT_CS_REG(0x4290, 0x00000000); -OUT_CS_REG(0x4294, 0x3DBF1412); -OUT_CS_REG(0x4298, 0x00000000); -OUT_CS_REG(0x42A0, 0x00000000); -OUT_CS_REG(0x42A4, 0x00000000); -OUT_CS_REG(0x42A8, 0x00000000); -OUT_CS_REG(0x42AC, 0x00000000); -OUT_CS_REG(0x42B0, 0x00000000); -OUT_CS_REG(0x42B4, 0x00000000); -OUT_CS_REG(0x42B8, 0x00000000); -OUT_CS_REG(0x42C0, 0x4B7FFFFF); -OUT_CS_REG(0x42C4, 0x00000000); -OUT_CS_REG(0x43A4, 0x0000001C); -OUT_CS_REG(0x43A8, 0x2DA49525); -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x46A4, 0x00001B00); +OUT_CS_REG(R300_GA_LINE_CNTL, 0x00030006); +OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, 0x3BAAAAAB); +OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, 0x00000000); +OUT_CS_REG(R300_GA_LINE_S0, 0x00000000); +OUT_CS_REG(R300_GA_LINE_S1, 0x3F800000); +OUT_CS_REG(R300_GA_ENHANCE, 0x00000002); +OUT_CS_REG(R300_GA_COLOR_CONTROL, 0x0003AAAA); +OUT_CS_REG(R300_GA_SOLID_RG, 0x00000000); +OUT_CS_REG(R300_GA_SOLID_BA, 0x00000000); +OUT_CS_REG(R300_GA_POLY_MODE, 0x00000000); +OUT_CS_REG(R300_GA_ROUND_MODE, 0x00000001); +OUT_CS_REG(R300_GA_OFFSET, 0x00000000); +OUT_CS_REG(R300_GA_FOG_SCALE, 0x3DBF1412); +OUT_CS_REG(R300_GA_FOG_OFFSET, 0x00000000); +OUT_CS_REG(R300_SU_TEX_WRAP, 0x00000000); +OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, 0x00000000); +OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, 0x00000000); +OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_SCALE, 0x00000000); +OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_OFFSET, 0x00000000); +OUT_CS_REG(R300_SU_POLY_OFFSET_ENABLE, 0x00000000); +OUT_CS_REG(R300_SU_CULL_MODE, 0x00000000); +OUT_CS_REG(R300_SU_DEPTH_SCALE, 0x4B7FFFFF); +OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000); +OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C); +OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525); +OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); +OUT_CS_REG(R300_US_OUT_FMT, 0x00001B00); OUT_CS_REG(0x46A8, 0x00001B0F); OUT_CS_REG(0x46AC, 0x00001B0F); OUT_CS_REG(0x46B0, 0x00001B0F); -OUT_CS_REG(0x46B4, 0x00000001); -OUT_CS_REG(0x4600, 0x00000000); -OUT_CS_REG(0x4604, 0x00000000); -OUT_CS_REG(0x4608, 0x00000000); -OUT_CS_REG(0x4610, 0x00000000); -OUT_CS_REG(0x4614, 0x00000000); -OUT_CS_REG(0x4618, 0x00000000); -OUT_CS_REG(0x461C, 0x00000000); -OUT_CS_REG(0x48C0, 0x00000000); -OUT_CS_REG(0x46C0, 0x00000000); -OUT_CS_REG(0x49C0, 0x00000000); -OUT_CS_REG(0x47C0, 0x00000000); -OUT_CS_REG(0x4BC0, 0x00000002); -OUT_CS_REG(0x4BC8, 0x00000000); -OUT_CS_REG(0x4BCC, 0x00000000); -OUT_CS_REG(0x4BD0, 0x00000000); -OUT_CS_REG(0x4BD8, 0x00000000); -OUT_CS_REG(0x4BD8, 0x00000000); -OUT_CS_REG(0x4E00, 0x00000000); -OUT_CS_REG(0x4E0C, 0x0000000F); +OUT_CS_REG(R300_US_W_FMT, 0x00000001); +OUT_CS_REG(R300_US_CONFIG, 0x00000000); +OUT_CS_REG(R300_US_PIXSIZE, 0x00000000); +OUT_CS_REG(R300_US_CODE_OFFSET, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_0, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_1, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_2, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_3, 0x00000000); +OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x00000000); +OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x00000000); +OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x00000000); +OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x00000000); +OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000002); +OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x00000000); +OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000); +OUT_CS_REG(R300_FG_FOG_COLOR_B, 0x00000000); +OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000); +OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000); +OUT_CS_REG(R300_RB3D_CCTL, 0x00000000); +OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); r300_emit_blend_color_state(r300, &blend_color_clear_state); -OUT_CS_REG(0x4E10, 0x00000000); -OUT_CS_REG(0x4E54, 0x00000000); +OUT_CS_REG(R300_RB3D_BLEND_COLOR, 0x00000000); +OUT_CS_REG(0x4E54, 0x00000000); OUT_CS_REG(0x4E58, 0x00000000); OUT_CS_REG(0x4E5C, 0x00000000); OUT_CS_REG(0x4E60, 0x00000000); @@ -160,45 +160,45 @@ OUT_CS_REG(0x4E64, 0x00000000); OUT_CS_REG(0x4E68, 0x00000000); OUT_CS_REG(0x4E6C, 0x00000000); OUT_CS_REG(0x4E70, 0x00000000); -OUT_CS_REG(0x4E88, 0x00000000); -OUT_CS_REG(0x4EA0, 0x00000000); -OUT_CS_REG(0x4EA4, 0xFFFFFFFF); -OUT_CS_REG(0x4F00, 0x00000010); -OUT_CS_REG(0x4F04, 0x00038038); -OUT_CS_REG(0x4F08, 0x00FFFF00); -OUT_CS_REG(0x4F10, 0x00000002); -OUT_CS_REG(0x4F18, 0x00000003); -OUT_CS_REG(0x4F1C, 0x00000000); -OUT_CS_REG(0x4F28, 0x00000000); +OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000); +OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000); +OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFFFFFFFF); +OUT_CS_REG(R300_ZB_CNTL, 0x00000010); +OUT_CS_REG(R300_ZB_ZSTENCILCNTL, 0x00038038); +OUT_CS_REG(R300_ZB_STENCILREFMASK, 0x00FFFF00); +OUT_CS_REG(R300_ZB_FORMAT, 0x00000002); +OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, 0x00000003); +OUT_CS_REG(R300_ZB_BW_CNTL, 0x00000000); +OUT_CS_REG(R300_ZB_DEPTHCLEARVALUE, 0x00000000); OUT_CS_REG(0x4F30, 0x00000000); OUT_CS_REG(0x4F34, 0x00000000); -OUT_CS_REG(0x4F44, 0x00000000); -OUT_CS_REG(0x4F54, 0x00000000); -OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); +OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); +OUT_CS_REG(R300_SC_SCREENDOOR, 0x00000000); R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); -OUT_CS_REG(0x2150, 0x21030003); -OUT_CS_REG(0x4BC0, 0x00000000); +OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); +OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x21030003); +OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000000); OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688); OUT_CS_REG(R300_VAP_VTX_STATE_CNTL, 0x1); OUT_CS_REG(R300_VAP_VSM_VTX_ASSM, 0x405); -OUT_CS_REG(0x20B0, 0x0000043F); -OUT_CS_REG(0x20B4, 0x00000008); -OUT_CS_REG(0x21DC, 0xAAAAAAAA); -OUT_CS_REG(0x2090, 0x00000003); -OUT_CS_REG(0x2094, 0x00000000); +OUT_CS_REG(R300_SE_VTE_CNTL, 0x0000043F); +OUT_CS_REG(R300_VAP_VTX_SIZE, 0x00000008); +OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); +OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_0, 0x00000003); +OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_1, 0x00000000); OUT_CS_REG(R300_TX_ENABLE, 0x0); -OUT_CS_REG(0x1D98, 0x3F800000); -OUT_CS_REG(0x1D9C, 0x00000000); -OUT_CS_REG(0x1DA0, 0x3F800000); -OUT_CS_REG(0x1DA4, 0x00000000); -OUT_CS_REG(0x1DA8, 0x3F800000); -OUT_CS_REG(0x1DAC, 0x00000000); -OUT_CS_REG(0x4BD4, 0x00000000); +OUT_CS_REG(R300_SE_VPORT_XSCALE, 0x3F800000); +OUT_CS_REG(R300_SE_VPORT_XOFFSET, 0x00000000); +OUT_CS_REG(R300_SE_VPORT_YSCALE, 0x3F800000); +OUT_CS_REG(R300_SE_VPORT_YOFFSET, 0x00000000); +OUT_CS_REG(R300_SE_VPORT_ZSCALE, 0x3F800000); +OUT_CS_REG(R300_SE_VPORT_ZOFFSET, 0x00000000); +OUT_CS_REG(R300_FG_ALPHA_FUNC, 0x00000000); r300_emit_blend_state(r300, &blend_clear_state); -OUT_CS_REG(0x221C, 0x0001C000); +OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0001C000); OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); @@ -221,28 +221,28 @@ if (caps->is_r500) { OUT_CS_REG(R300_RS_COUNT, (1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); OUT_CS_REG(R300_RS_INST_COUNT, 0x0); -OUT_CS_REG(0x4330, 0x00004000); -OUT_CS_REG(0x4600, 0x00000000); -OUT_CS_REG(0x4604, 0x00000000); -OUT_CS_REG(0x4608, 0x00000000); -OUT_CS_REG(0x4610, 0x00000000); -OUT_CS_REG(0x4614, 0x00000000); -OUT_CS_REG(0x4618, 0x00000000); -OUT_CS_REG(0x461C, 0x00400000); -OUT_CS_REG(0x48C0, 0x00050A80); -OUT_CS_REG(0x46C0, 0x1C000000); -OUT_CS_REG(0x49C0, 0x00040889); -OUT_CS_REG(0x47C0, 0x01000000); +OUT_CS_REG(R300_RS_INST_0, 0x00004000); +OUT_CS_REG(R300_US_CONFIG, 0x00000000); +OUT_CS_REG(R300_US_PIXSIZE, 0x00000000); +OUT_CS_REG(R300_US_CODE_OFFSET, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_0, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_1, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_2, 0x00000000); +OUT_CS_REG(R300_US_CODE_ADDR_3, 0x00400000); +OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x00050A80); +OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); +OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x00040889); +OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x01000000); /* XXX these magic numbers should be explained when * this becomes a cached state object */ OUT_CS_REG(R300_VAP_CNTL, 0xA | (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); -OUT_CS_REG(0x22D0, 0x00100000); -OUT_CS_REG(0x22D4, 0x00000000); -OUT_CS_REG(0x22D8, 0x00000001); -OUT_CS_REG(0x43E8, 0x00000000); +OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000); +OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000); +OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001); +OUT_CS_REG(R300_SC_SCREENDOOR, 0x00000000); R300_PACIFY; -OUT_CS_REG(0x43E8, 0x00FFFFFF); +OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); /* XXX translate these back into normal instructions */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); @@ -260,8 +260,8 @@ r300_emit_dsa_state(r300, &dsa_clear_state); R300_PACIFY; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); -//OUT_CS_REG(0x4E38, 0x00C00100); -OUT_CS_REG(0x4E0C, 0x0000000F); +//OUT_CS_REG(R300_RB3D_COLORPITCH0, 0x00C00100); +OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); /* XXX Packet3 */ OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | -- cgit v1.2.3 From f0fce46a48a1f0547a1e50ad54696c4b660c8dce Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Thu, 29 Jan 2009 00:12:32 +0100 Subject: r300: attempt at trivial/clear on r5xx --- src/gallium/drivers/r300/r300_cs.h | 4 +- src/gallium/drivers/r300/r300_reg.h | 25 ++++++++-- src/gallium/drivers/r300/r300_surface.c | 83 +++++++++++++++++++++++++-------- 3 files changed, 87 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 5686e5a6e9..d15887fb1c 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -85,7 +85,7 @@ static uint32_t pack_float_32(float f) } while (0) #define OUT_CS_REG(register, value) do { \ - debug_printf("r300: writing 0x%x to register 0x%x\n", value, register); \ + debug_printf("r300: writing 0x%08X to register 0x%04X\n", value, register); \ OUT_CS(CP_PACKET0(register, 0)); \ OUT_CS(value); \ } while (0) @@ -93,7 +93,7 @@ static uint32_t pack_float_32(float f) /* Note: This expects count to be the number of registers, * not the actual packet0 count! */ #define OUT_CS_REG_SEQ(register, count) do { \ - debug_printf("r300: writing register sequence 0x%x\n", register); \ + debug_printf("r300: writing register sequence of %d to 0x%04X\n", count, register); \ OUT_CS(CP_PACKET0(register, ((count) - 1))); \ } while (0) diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index c1d5009b86..9281e6656f 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -1669,7 +1669,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_TEX_INST_MASK (7 << 15) /* Output format from the unfied shader */ -#define R300_US_OUT_FMT 0x46A4 +#define R300_US_OUT_FMT_0 0x46A4 # define R300_US_OUT_FMT_C4_8 (0 << 0) # define R300_US_OUT_FMT_C4_10 (1 << 0) # define R300_US_OUT_FMT_C4_10_GAMMA (2 << 0) @@ -1691,7 +1691,24 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_US_OUT_FMT_C4_16_FP (18 << 0) # define R300_US_OUT_FMT_C_32_FP (19 << 0) # define R300_US_OUT_FMT_C2_32_FP (20 << 0) -# define R300_US_OUT_FMT_C4_32_FP (20 << 0) +# define R300_US_OUT_FMT_C4_32_FP (21 << 0) +# define R300_C0_SEL_A (0 << 8) +# define R300_C0_SEL_R (1 << 8) +# define R300_C0_SEL_G (2 << 8) +# define R300_C0_SEL_B (3 << 8) +# define R300_C1_SEL_A (0 << 10) +# define R300_C1_SEL_R (1 << 10) +# define R300_C1_SEL_G (2 << 10) +# define R300_C1_SEL_B (3 << 10) +# define R300_C2_SEL_A (0 << 12) +# define R300_C2_SEL_R (1 << 12) +# define R300_C2_SEL_G (2 << 12) +# define R300_C2_SEL_B (3 << 12) +# define R300_C3_SEL_A (0 << 14) +# define R300_C3_SEL_R (1 << 14) +# define R300_C3_SEL_G (2 << 14) +# define R300_C3_SEL_B (3 << 14) +# define R300_OUT_SIGN(x) (x << 16) /* ALU * The ALU instructions register blocks are enumerated according to the order @@ -2987,7 +3004,7 @@ enum { # define R500_US_CODE_RANGE_ADDR(x) (x << 0) # define R500_US_CODE_RANGE_SIZE(x) (x << 16) #define R500_US_CONFIG 0x4600 -# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) +# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 0) #define R500_US_FC_ADDR_0 0xa000 # define R500_FC_BOOL_ADDR(x) (x << 0) # define R500_FC_INT_ADDR(x) (x << 8) @@ -3031,7 +3048,7 @@ enum { # define R500_FORMAT_TXHEIGHT(x) (x << 11) # define R500_FORMAT_TXDEPTH(x) (x << 22) /* _0 through _3 */ -#define R500_US_OUT_FMT_0 0x46a4 +#define R500_US_OUT_FMT_0 0x46A4 # define R500_OUT_FMT_C4_8 (0 << 0) # define R500_OUT_FMT_C4_10 (1 << 0) # define R500_OUT_FMT_C4_10_GAMMA (2 << 0) diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 48e0f54db9..f2d0183c98 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -42,7 +42,7 @@ static void r300_surface_fill(struct pipe_context* pipe, " dimensions %dx%d, color 0x%x\n", dest, x, y, w, h, color); -BEGIN_CS(276); +BEGIN_CS((caps->is_r500) ? 367 : 276); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; @@ -88,10 +88,9 @@ OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | R300_GB_TILE_SIZE_16); OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W); OUT_CS_REG(R300_GB_AA_CONFIG, 0x0); /* XXX point tex stuffing */ -OUT_CS_REG_SEQ(R300_GA_POINT_S0, 4); +OUT_CS_REG_SEQ(R300_GA_POINT_S0, 1); OUT_CS_32F(0.0); -OUT_CS_32F(0.0); -OUT_CS_32F(1.0); +OUT_CS_REG_SEQ(R300_GA_POINT_S1, 1); OUT_CS_32F(1.0); OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 | (0x5 << R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT)); @@ -124,10 +123,11 @@ OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000); OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C); OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525); OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); -OUT_CS_REG(R300_US_OUT_FMT, 0x00001B00); -OUT_CS_REG(0x46A8, 0x00001B0F); -OUT_CS_REG(0x46AC, 0x00001B0F); -OUT_CS_REG(0x46B0, 0x00001B0F); +OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); +OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R); +OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); +OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); +OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); OUT_CS_REG(R300_US_W_FMT, 0x00000001); OUT_CS_REG(R300_US_CONFIG, 0x00000000); OUT_CS_REG(R300_US_PIXSIZE, 0x00000000); @@ -152,14 +152,10 @@ OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); r300_emit_blend_color_state(r300, &blend_color_clear_state); OUT_CS_REG(R300_RB3D_BLEND_COLOR, 0x00000000); -OUT_CS_REG(0x4E54, 0x00000000); -OUT_CS_REG(0x4E58, 0x00000000); -OUT_CS_REG(0x4E5C, 0x00000000); -OUT_CS_REG(0x4E60, 0x00000000); -OUT_CS_REG(0x4E64, 0x00000000); -OUT_CS_REG(0x4E68, 0x00000000); -OUT_CS_REG(0x4E6C, 0x00000000); -OUT_CS_REG(0x4E70, 0x00000000); +/* XXX: Oh the wonderful unknown */ +OUT_CS_REG_SEQ(0x4E54, 8); +for (i = 0; i < 8; i++) + OUT_CS(0x00000000); OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000); OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000); OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFFFFFFFF); @@ -202,16 +198,65 @@ OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0001C000); OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); -/* XXX RS block setup */ +/* XXX RS block and fp setup */ if (caps->is_r500) { - OUT_CS_REG_SEQ(R500_RS_IP_0, 8); - for (i = 0; i < 8; i++) { + OUT_CS_REG_SEQ(R500_RS_IP_0, 16); + for (i = 0; i < 16; i++) { /* I like the operator macros more than the shift macros... */ OUT_CS((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)); } + R300_PACIFY; + OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); + OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | + R500_US_CODE_END_ADDR(1)); + OUT_CS_REG(R500_US_CODE_RANGE, R500_US_CODE_RANGE_ADDR(0) | + R500_US_CODE_RANGE_SIZE(1)); + OUT_CS_REG(R500_US_CODE_OFFSET, R500_US_CODE_OFFSET_ADDR(0)); + R300_PACIFY; + OUT_CS_REG(R500_US_CMN_INST_0, + 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); + OUT_CS_REG(R500_US_ALU_RGB_ADDR_0, + R500_RGB_ADDR0(0) | + R500_RGB_ADDR1(0) | + R500_RGB_ADDR1_CONST | + R500_RGB_ADDR2(0) | + R500_RGB_ADDR2_CONST); + OUT_CS_REG(R500_US_ALU_ALPHA_ADDR_0, + R500_ALPHA_ADDR0(0) | + R500_ALPHA_ADDR1(0) | + R500_ALPHA_ADDR1_CONST | + R500_ALPHA_ADDR2(0) | + R500_ALPHA_ADDR2_CONST); + OUT_CS_REG(R500_US_ALU_RGB_INST_0, + 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); + OUT_CS_REG(R500_US_ALU_ALPHA_INST_0, + R500_ALPHA_OP_CMP | + R500_ALPHA_SWIZ_A_A | + R500_ALPHA_SWIZ_B_A); + OUT_CS_REG(R500_US_ALU_RGBA_INST_0, + 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); } else { OUT_CS_REG_SEQ(R300_RS_IP_0, 8); for (i = 0; i < 8; i++) { -- cgit v1.2.3 From c199f330322921e01c8c30e3ea69a2a5291ae8ee Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 28 Jan 2009 21:33:35 -0800 Subject: r300: Unbreak emit, fix up a bunch of little things. --- src/gallium/drivers/r300/r300_cs.h | 9 +++- src/gallium/drivers/r300/r300_emit.c | 7 +++- src/gallium/drivers/r300/r300_surface.c | 73 +++++++++++++++++---------------- src/gallium/drivers/r300/r300_surface.h | 2 +- 4 files changed, 50 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index d15887fb1c..734ccb13d9 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -85,7 +85,9 @@ static uint32_t pack_float_32(float f) } while (0) #define OUT_CS_REG(register, value) do { \ - debug_printf("r300: writing 0x%08X to register 0x%04X\n", value, register); \ + debug_printf("r300: writing 0x%08X to register 0x%04X\n", \ + value, register); \ + assert(register); \ OUT_CS(CP_PACKET0(register, 0)); \ OUT_CS(value); \ } while (0) @@ -93,13 +95,16 @@ static uint32_t pack_float_32(float f) /* Note: This expects count to be the number of registers, * not the actual packet0 count! */ #define OUT_CS_REG_SEQ(register, count) do { \ - debug_printf("r300: writing register sequence of %d to 0x%04X\n", count, register); \ + debug_printf("r300: writing register sequence of %d to 0x%04X\n", \ + count, register); \ + assert(register); \ OUT_CS(CP_PACKET0(register, ((count) - 1))); \ } while (0) #define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \ debug_printf("r300: writing relocation for buffer %p, offset %d\n", \ bo, offset); \ + assert(bo); \ OUT_CS(offset); \ cs_winsys->write_cs_reloc(cs, bo, rd, wd, flags); \ } while (0) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 4ae8a46637..c5f08a2404 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -62,9 +62,12 @@ void r300_emit_dsa_state(struct r300_context* r300, struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; CS_LOCALS(r300); - BEGIN_CS(r300screen->caps->is_r500 ? 12 : 10); + BEGIN_CS(r300screen->caps->is_r500 ? 12 : 8); OUT_CS_REG(R300_FG_ALPHA_FUNC, dsa->alpha_function); - OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); + /* XXX figure out the r300 counterpart for this */ + if (r300screen->caps->is_r500) { + OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); + } OUT_CS_REG_SEQ(R300_ZB_CNTL, 3); OUT_CS(dsa->z_buffer_control); OUT_CS(dsa->z_stencil_control); diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index f2d0183c98..185b56ff88 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -42,17 +42,10 @@ static void r300_surface_fill(struct pipe_context* pipe, " dimensions %dx%d, color 0x%x\n", dest, x, y, w, h, color); -BEGIN_CS((caps->is_r500) ? 367 : 276); +BEGIN_CS((caps->is_r500) ? 367 : 322); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; -/* Viewport setup */ -OUT_CS_REG(R300_SE_VPORT_XSCALE, 0x43000000); -OUT_CS_REG(R300_SE_VPORT_XOFFSET, 0x43002000); -OUT_CS_REG(R300_SE_VPORT_YSCALE, 0xC3000000); -OUT_CS_REG(R300_SE_VPORT_YOFFSET, 0x43002000); -OUT_CS_REG(R300_SE_VPORT_ZSCALE, 0x3F000000); -OUT_CS_REG(R300_SE_VPORT_ZOFFSET, 0x3F000000); /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); @@ -71,7 +64,7 @@ OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0); /* XXX magic number not in r300_reg */ OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0); -OUT_CS_REG(R300_VAP_GB_VERT_CLIP_ADJ, 4); +OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4); OUT_CS_32F(1.0); OUT_CS_32F(1.0); OUT_CS_32F(1.0); @@ -149,9 +142,6 @@ OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000); OUT_CS_REG(R300_RB3D_CCTL, 0x00000000); OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); -r300_emit_blend_color_state(r300, &blend_color_clear_state); - -OUT_CS_REG(R300_RB3D_BLEND_COLOR, 0x00000000); /* XXX: Oh the wonderful unknown */ OUT_CS_REG_SEQ(0x4E54, 8); for (i = 0; i < 8; i++) @@ -184,16 +174,16 @@ OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_0, 0x00000003); OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_1, 0x00000000); OUT_CS_REG(R300_TX_ENABLE, 0x0); -OUT_CS_REG(R300_SE_VPORT_XSCALE, 0x3F800000); -OUT_CS_REG(R300_SE_VPORT_XOFFSET, 0x00000000); -OUT_CS_REG(R300_SE_VPORT_YSCALE, 0x3F800000); -OUT_CS_REG(R300_SE_VPORT_YOFFSET, 0x00000000); -OUT_CS_REG(R300_SE_VPORT_ZSCALE, 0x3F800000); -OUT_CS_REG(R300_SE_VPORT_ZOFFSET, 0x00000000); +/* XXX viewport setup */ +OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); +OUT_CS_32F(1.0); +OUT_CS_32F(0.0); +OUT_CS_32F(1.0); +OUT_CS_32F(0.0); +OUT_CS_32F(1.0); +OUT_CS_32F(0.0); OUT_CS_REG(R300_FG_ALPHA_FUNC, 0x00000000); -r300_emit_blend_state(r300, &blend_clear_state); - OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0001C000); OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); @@ -262,22 +252,22 @@ if (caps->is_r500) { for (i = 0; i < 8; i++) { OUT_CS(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); } -} -OUT_CS_REG(R300_RS_COUNT, (1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); -OUT_CS_REG(R300_RS_INST_COUNT, 0x0); + OUT_CS_REG(R300_RS_COUNT, (1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); + OUT_CS_REG(R300_RS_INST_COUNT, 0x0); -OUT_CS_REG(R300_RS_INST_0, 0x00004000); -OUT_CS_REG(R300_US_CONFIG, 0x00000000); -OUT_CS_REG(R300_US_PIXSIZE, 0x00000000); -OUT_CS_REG(R300_US_CODE_OFFSET, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_0, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_1, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_2, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_3, 0x00400000); -OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x00050A80); -OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); -OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x00040889); -OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x01000000); + OUT_CS_REG(R300_RS_INST_0, 0x00004000); + OUT_CS_REG(R300_US_CONFIG, 0x00000000); + OUT_CS_REG(R300_US_PIXSIZE, 0x00000000); + OUT_CS_REG(R300_US_CODE_OFFSET, 0x00000000); + OUT_CS_REG(R300_US_CODE_ADDR_0, 0x00000000); + OUT_CS_REG(R300_US_CODE_ADDR_1, 0x00000000); + OUT_CS_REG(R300_US_CODE_ADDR_2, 0x00000000); + OUT_CS_REG(R300_US_CODE_ADDR_3, 0x00400000); + OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x00050A80); + OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); + OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x00040889); + OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x01000000); +} /* XXX these magic numbers should be explained when * this becomes a cached state object */ OUT_CS_REG(R300_VAP_CNTL, 0xA | (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | @@ -300,12 +290,23 @@ OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); +r300_emit_blend_state(r300, &blend_clear_state); +r300_emit_blend_color_state(r300, &blend_color_clear_state); r300_emit_dsa_state(r300, &dsa_clear_state); R300_PACIFY; +/* Flush colorbuffer and blend caches. */ +OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, + R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D | + R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_SIGNAL); +OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, + R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | + R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); + OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); -//OUT_CS_REG(R300_RB3D_COLORPITCH0, 0x00C00100); +OUT_CS_REG(R300_RB3D_COLORPITCH0, (w >> 1) | R300_COLOR_TILE_ENABLE | + R300_COLOR_FORMAT_ARGB8888); OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); /* XXX Packet3 */ OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index 2b89698ca5..e1d53116a1 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -50,7 +50,7 @@ const struct r300_dsa_state dsa_clear_state = { .alpha_reference = 0x0, .z_buffer_control = 0x0, .z_stencil_control = 0x0, - .stencil_ref_mask = 0x0, + .stencil_ref_mask = R300_STENCILWRITEMASK_MASK, .z_buffer_top = R300_ZTOP_ENABLE, .stencil_ref_bf = 0x0, }; -- cgit v1.2.3 From 0c9d2bbb1296e7b5c812ce04f79aff2d8308907c Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Thu, 29 Jan 2009 20:24:34 +0100 Subject: r300: set up r5xx fragment shader; clear still broken --- src/gallium/drivers/r300/r300_emit.c | 6 +-- src/gallium/drivers/r300/r300_reg.h | 2 +- src/gallium/drivers/r300/r300_surface.c | 82 ++++++++++----------------------- 3 files changed, 29 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index c5f08a2404..001aa02f41 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -62,11 +62,11 @@ void r300_emit_dsa_state(struct r300_context* r300, struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; CS_LOCALS(r300); - BEGIN_CS(r300screen->caps->is_r500 ? 12 : 8); + BEGIN_CS(r300screen->caps->is_r500 ? 8 : 8); OUT_CS_REG(R300_FG_ALPHA_FUNC, dsa->alpha_function); /* XXX figure out the r300 counterpart for this */ if (r300screen->caps->is_r500) { - OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); + /* OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); */ } OUT_CS_REG_SEQ(R300_ZB_CNTL, 3); OUT_CS(dsa->z_buffer_control); @@ -74,7 +74,7 @@ void r300_emit_dsa_state(struct r300_context* r300, OUT_CS(dsa->stencil_ref_mask); OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top); if (r300screen->caps->is_r500) { - OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); + /* OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); */ } END_CS; } diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index 9281e6656f..f01e15b8dd 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -3004,7 +3004,7 @@ enum { # define R500_US_CODE_RANGE_ADDR(x) (x << 0) # define R500_US_CODE_RANGE_SIZE(x) (x << 16) #define R500_US_CONFIG 0x4600 -# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 0) +# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) #define R500_US_FC_ADDR_0 0xa000 # define R500_FC_BOOL_ADDR(x) (x << 0) # define R500_FC_INT_ADDR(x) (x << 8) diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 185b56ff88..0503d8faed 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -42,7 +42,7 @@ static void r300_surface_fill(struct pipe_context* pipe, " dimensions %dx%d, color 0x%x\n", dest, x, y, w, h, color); -BEGIN_CS((caps->is_r500) ? 367 : 322); +BEGIN_CS((caps->is_r500) ? 300 : 322); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; @@ -122,17 +122,6 @@ OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); OUT_CS_REG(R300_US_W_FMT, 0x00000001); -OUT_CS_REG(R300_US_CONFIG, 0x00000000); -OUT_CS_REG(R300_US_PIXSIZE, 0x00000000); -OUT_CS_REG(R300_US_CODE_OFFSET, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_0, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_1, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_2, 0x00000000); -OUT_CS_REG(R300_US_CODE_ADDR_3, 0x00000000); -OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x00000000); -OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x00000000); -OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x00000000); -OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x00000000); OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000002); OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x00000000); OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000); @@ -149,9 +138,6 @@ for (i = 0; i < 8; i++) OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000); OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000); OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFFFFFFFF); -OUT_CS_REG(R300_ZB_CNTL, 0x00000010); -OUT_CS_REG(R300_ZB_ZSTENCILCNTL, 0x00038038); -OUT_CS_REG(R300_ZB_STENCILREFMASK, 0x00FFFF00); OUT_CS_REG(R300_ZB_FORMAT, 0x00000002); OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, 0x00000003); OUT_CS_REG(R300_ZB_BW_CNTL, 0x00000000); @@ -182,7 +168,6 @@ OUT_CS_32F(1.0); OUT_CS_32F(0.0); OUT_CS_32F(1.0); OUT_CS_32F(0.0); -OUT_CS_REG(R300_FG_ALPHA_FUNC, 0x00000000); OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0001C000); OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | @@ -200,53 +185,36 @@ if (caps->is_r500) { } R300_PACIFY; OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); + OUT_CS_REG(R500_US_PIXSIZE, 0x00000000); OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(1)); OUT_CS_REG(R500_US_CODE_RANGE, R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(1)); OUT_CS_REG(R500_US_CODE_OFFSET, R500_US_CODE_OFFSET_ADDR(0)); R300_PACIFY; - OUT_CS_REG(R500_US_CMN_INST_0, - 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); - OUT_CS_REG(R500_US_ALU_RGB_ADDR_0, - R500_RGB_ADDR0(0) | - R500_RGB_ADDR1(0) | - R500_RGB_ADDR1_CONST | - R500_RGB_ADDR2(0) | - R500_RGB_ADDR2_CONST); - OUT_CS_REG(R500_US_ALU_ALPHA_ADDR_0, - R500_ALPHA_ADDR0(0) | - R500_ALPHA_ADDR1(0) | - R500_ALPHA_ADDR1_CONST | - R500_ALPHA_ADDR2(0) | - R500_ALPHA_ADDR2_CONST); - OUT_CS_REG(R500_US_ALU_RGB_INST_0, - 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); - OUT_CS_REG(R500_US_ALU_ALPHA_INST_0, - R500_ALPHA_OP_CMP | - R500_ALPHA_SWIZ_A_A | - R500_ALPHA_SWIZ_B_A); - OUT_CS_REG(R500_US_ALU_RGBA_INST_0, - 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); + OUT_CS_REG(R500_GA_US_VECTOR_INDEX, + 0 | R500_GA_US_VECTOR_INDEX_TYPE_INSTR); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + 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); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST | + R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | R500_ALPHA_ADDR1_CONST | + R500_ALPHA_ADDR2(0) | R500_ALPHA_ADDR2_CONST); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + 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); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + 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); } else { OUT_CS_REG_SEQ(R300_RS_IP_0, 8); for (i = 0; i < 8; i++) { -- cgit v1.2.3 From 09b107058d11ac2362ea296556b68331ff04f193 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 29 Jan 2009 12:27:00 -0800 Subject: r300: Try to fix up RS a bit more. --- src/gallium/drivers/r300/r300_surface.c | 41 ++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 0503d8faed..cc6b4f3d79 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -90,6 +90,7 @@ OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 | /* XXX should this be related to the actual point size? */ OUT_CS_REG(R300_GA_POINT_MINMAX, 0x6 | (0x1800 << R300_GA_POINT_MINMAX_MAX_SHIFT)); +/* XXX this big chunk should be refactored into rs_state */ OUT_CS_REG(R300_GA_LINE_CNTL, 0x00030006); OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, 0x3BAAAAAB); OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, 0x00000000); @@ -175,15 +176,20 @@ OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | /* XXX RS block and fp setup */ if (caps->is_r500) { - OUT_CS_REG_SEQ(R500_RS_IP_0, 16); - for (i = 0; i < 16; i++) { + OUT_CS_REG_SEQ(R500_RS_IP_0, 8); + for (i = 0; i < 8; i++) { /* I like the operator macros more than the shift macros... */ OUT_CS((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)); } - R300_PACIFY; + /* XXX */ + OUT_CS_REG_SEQ(R300_RS_COUNT, 2); + OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); + OUT_CS(0x0); + OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); + OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); OUT_CS_REG(R500_US_PIXSIZE, 0x00000000); OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | @@ -220,21 +226,24 @@ if (caps->is_r500) { for (i = 0; i < 8; i++) { OUT_CS(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); } - OUT_CS_REG(R300_RS_COUNT, (1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_CS_REG(R300_RS_INST_COUNT, 0x0); + /* XXX */ + OUT_CS_REG_SEQ(R300_RS_COUNT, 2); + OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); + OUT_CS(0x0); + OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); - OUT_CS_REG(R300_RS_INST_0, 0x00004000); - OUT_CS_REG(R300_US_CONFIG, 0x00000000); - OUT_CS_REG(R300_US_PIXSIZE, 0x00000000); - OUT_CS_REG(R300_US_CODE_OFFSET, 0x00000000); - OUT_CS_REG(R300_US_CODE_ADDR_0, 0x00000000); - OUT_CS_REG(R300_US_CODE_ADDR_1, 0x00000000); - OUT_CS_REG(R300_US_CODE_ADDR_2, 0x00000000); - OUT_CS_REG(R300_US_CODE_ADDR_3, 0x00400000); - OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x00050A80); + /* XXX magic numbers */ + OUT_CS_REG(R300_US_CONFIG, 0x0); + OUT_CS_REG(R300_US_PIXSIZE, 0x0); + OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000); + OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x50A80); OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); - OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x00040889); - OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x01000000); + OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x40889); + OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x1000000); } /* XXX these magic numbers should be explained when * this becomes a cached state object */ -- cgit v1.2.3 From e14a10691e1a0ca6b453faf705f94494113962de Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 29 Jan 2009 13:23:11 -0800 Subject: r300: Add cleaned-up clear fallback, sort more regs. --- src/gallium/drivers/r300/r300_reg.h | 10 +++++----- src/gallium/drivers/r300/r300_surface.c | 35 ++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index f01e15b8dd..dbd0cc28e2 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -1233,11 +1233,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define R300_RS_INST_0 0x4330 #define R300_RS_INST_1 0x4334 #define R300_RS_INST_2 0x4338 -#define R300_RS_INST_3 0x433C /* GUESS */ -#define R300_RS_INST_4 0x4340 /* GUESS */ -#define R300_RS_INST_5 0x4344 /* GUESS */ -#define R300_RS_INST_6 0x4348 /* GUESS */ -#define R300_RS_INST_7 0x434C /* GUESS */ +#define R300_RS_INST_3 0x433C +#define R300_RS_INST_4 0x4340 +#define R300_RS_INST_5 0x4344 +#define R300_RS_INST_6 0x4348 +#define R300_RS_INST_7 0x434C # define R300_RS_INST_TEX_ID(x) ((x) << 0) # define R300_RS_INST_TEX_CN_WRITE (1 << 3) # define R300_RS_INST_TEX_ADDR_SHIFT 6 diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index cc6b4f3d79..3ffaee54b6 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -42,6 +42,16 @@ static void r300_surface_fill(struct pipe_context* pipe, " dimensions %dx%d, color 0x%x\n", dest, x, y, w, h, color); + /* Fallback? */ + if (0) { + debug_printf("r300: Falling back on surface clear..."); + void* map = pipe->screen->surface_map(pipe->screen, dest, + PIPE_BUFFER_USAGE_CPU_WRITE); + pipe_fill_rect(map, &dest->block, &dest->stride, x, y, w, h, color); + pipe->screen->surface_unmap(pipe->screen, dest); + return; + } + BEGIN_CS((caps->is_r500) ? 300 : 322); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); @@ -117,12 +127,6 @@ OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000); OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C); OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525); OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); -OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); -OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R); -OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); -OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); -OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_US_OUT_FMT_UNUSED); -OUT_CS_REG(R300_US_W_FMT, 0x00000001); OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000002); OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x00000000); OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000); @@ -164,9 +168,9 @@ OUT_CS_REG(R300_TX_ENABLE, 0x0); /* XXX viewport setup */ OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); OUT_CS_32F(1.0); -OUT_CS_32F(0.0); +OUT_CS_32F((float)x); OUT_CS_32F(1.0); -OUT_CS_32F(0.0); +OUT_CS_32F((float)y); OUT_CS_32F(1.0); OUT_CS_32F(0.0); @@ -224,17 +228,18 @@ if (caps->is_r500) { } else { OUT_CS_REG_SEQ(R300_RS_IP_0, 8); for (i = 0; i < 8; i++) { - OUT_CS(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); + OUT_CS(R300_RS_SEL_T(R300_RS_SEL_K0) | + R300_RS_SEL_R(R300_RS_SEL_K0) | R300_RS_SEL_Q(R300_RS_SEL_K1)); } /* XXX */ OUT_CS_REG_SEQ(R300_RS_COUNT, 2); OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_CS(0x0); + OUT_CS(1); OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); /* XXX magic numbers */ - OUT_CS_REG(R300_US_CONFIG, 0x0); - OUT_CS_REG(R300_US_PIXSIZE, 0x0); + OUT_CS_REG(R300_US_CONFIG, 0); + OUT_CS_REG(R300_US_PIXSIZE, 2); OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0); OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); @@ -244,6 +249,12 @@ if (caps->is_r500) { OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x40889); OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x1000000); + OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); + OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); } /* XXX these magic numbers should be explained when * this becomes a cached state object */ -- cgit v1.2.3 From 8c8bdcde6d9eb1cda7bf268cd75ca7676e220075 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 29 Jan 2009 15:50:46 -0800 Subject: r300: Add line stipple state to rs_state. --- src/gallium/drivers/r300/r300_context.h | 10 ++++++---- src/gallium/drivers/r300/r300_state.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index f246c57f48..13982784ff 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -61,12 +61,14 @@ struct r300_fs_state { struct r300_rs_state { uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */ - uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ - uint32_t depth_offset_front; /* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */ - uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */ - uint32_t depth_offset_back; /* R300_SU_POLY_OFFSET_BACK_OFFSET: 0x42b0 */ + uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ + uint32_t depth_offset_front;/* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */ + uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */ + uint32_t depth_offset_back; /* R300_SU_POLY_OFFSET_BACK_OFFSET: 0x42b0 */ uint32_t polygon_offset_enable; /* R300_SU_POLY_OFFSET_ENABLE: 0x42b4 */ uint32_t cull_mode; /* R300_SU_CULL_MODE: 0x42b8 */ + uint32_t line_stipple_config; /* R300_GA_LINE_STIPPLE_CONFIG: 0x4328 */ + uint32_t line_stipple_value; /* R300_GA_LINE_STIPPLE_VALUE: 0x4260 */ }; struct r300_sampler_state { diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 907ebe5c75..ee947feb5a 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -440,9 +440,6 @@ struct pipe_rasterizer_state unsigned point_size_per_vertex:1; /**< size computed in vertex shader */ unsigned multisample:1; /* XXX maybe more ms state in future */ unsigned line_smooth:1; - unsigned line_stipple_enable:1; - unsigned line_stipple_factor:8; /**< [1..256] actually */ - unsigned line_stipple_pattern:16; unsigned line_last_pixel:1; unsigned bypass_clipping:1; unsigned bypass_vs:1; /**< Skip the vertex shader. Note that the shader is @@ -504,6 +501,15 @@ static void* r300_create_rs_state(struct pipe_context* pipe, pack_float_32(state->offset_scale); } + if (state->line_stipple_enable) { + rs->line_stipple_config = + R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_LINE | + (pack_float_32((float)state->line_stipple_factor) & + R300_GA_LINE_STIPPLE_CONFIG_STIPPLE_SCALE_MASK); + /* XXX this might need to be scaled up */ + rs->line_stipple_value = state->line_stipple_pattern; + } + /* XXX this is part of HW TCL */ /* XXX endian control */ rs->vap_control_status = R300_VAP_TCL_BYPASS; -- cgit v1.2.3 From 7ccc9a92ce83d5e38549a6f6c5f22b358a90e578 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 29 Jan 2009 15:53:32 -0800 Subject: amd: Add AMD_SOFTPIPE environment option. If set, AMD_SOFTPIPE will make amd switch to softpipe. --- src/gallium/winsys/drm/amd/amd_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index 9b3c9c2ab2..86e6e0f5f7 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -242,7 +242,7 @@ GLboolean amd_context_create(const __GLcontextModes *visual, return GL_FALSE; } - if (1) { + if (!getenv("AMD_SOFTPIPE")) { fprintf(stderr, "Creating r300 context...\n"); pipe = r300_create_context(NULL, -- cgit v1.2.3 From 70b508bffba723b58817e375447c1695d9d5602b Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 30 Jan 2009 01:24:03 -0800 Subject: r300: Split rs_state emit into its own function. --- src/gallium/drivers/r300/r300_emit.c | 29 ++++++++++++++++++++--------- src/gallium/drivers/r300/r300_emit.h | 4 +++- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 001aa02f41..de5719db8d 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -79,6 +79,25 @@ void r300_emit_dsa_state(struct r300_context* r300, END_CS; } +void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs) +{ + struct r300_screen* r300screen = + (struct r300_screen*)r300->context.screen; + CS_LOCALS(r300); + BEGIN_CS(14); + OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status); + OUT_CS_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 6); + OUT_CS(rs->depth_scale_front); + OUT_CS(rs->depth_offset_front); + OUT_CS(rs->depth_scale_back); + OUT_CS(rs->depth_offset_back); + OUT_CS(rs->polygon_offset_enable); + OUT_CS(rs->cull_mode); + OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, rs->line_stipple_config); + OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, rs->line_stipple_value); + END_CS; +} + static void r300_emit_dirty_state(struct r300_context* r300) { struct r300_screen* r300screen = @@ -104,15 +123,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) } if (r300->dirty_state & R300_NEW_RASTERIZER) { - struct r300_rs_state* rs = r300->rs_state; - OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status); - /* XXX next six are contiguous regs */ - OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, rs->depth_scale_front); - OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, rs->depth_offset_front); - OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_SCALE, rs->depth_scale_back); - OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_OFFSET, rs->depth_offset_back); - OUT_CS_REG(R300_SU_POLY_OFFSET_ENABLE, rs->polygon_offset_enable); - OUT_CS_REG(R300_SU_CULL_MODE, rs->cull_mode); + r300_emit_rs_state(r300, r300->rs_state); } if (r300->dirty_state & R300_NEW_SCISSOR) { diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 98287bc1f3..b6e69386f9 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -31,4 +31,6 @@ void r300_emit_blend_color_state(struct r300_context* r300, struct r300_blend_color_state* bc); void r300_emit_dsa_state(struct r300_context* r300, - struct r300_dsa_state* dsa); + struct r300_dsa_state* dsa); + +void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs); -- cgit v1.2.3 From e6e6b493b6123df675d5222b0e78087a370aea01 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 30 Jan 2009 02:17:48 -0800 Subject: r300: Add more rs_state, fix indents on dsa_state. --- src/gallium/drivers/r300/r300_context.h | 2 ++ src/gallium/drivers/r300/r300_state.c | 51 ++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 13982784ff..0cb0ec20d5 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -61,6 +61,8 @@ struct r300_fs_state { struct r300_rs_state { uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */ + uint32_t point_size; /* R300_GA_POINT_SIZE: 0x421c */ + uint32_t line_control; /* R300_GA_LINE_CNTL: 0x4234 */ uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ uint32_t depth_offset_front;/* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */ uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index ee947feb5a..d81aee94e3 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -307,8 +307,8 @@ static void* } dsa->z_stencil_control |= - (translate_depth_stencil_function(state->depth.func) << - R300_Z_FUNC_SHIFT); + (translate_depth_stencil_function(state->depth.func) << + R300_Z_FUNC_SHIFT); } /* Stencil buffer setup. */ @@ -331,25 +331,25 @@ static void* if (state->stencil[1].enabled) { dsa->z_buffer_control |= R300_STENCIL_FRONT_BACK; dsa->z_stencil_control |= - (translate_depth_stencil_function(state->stencil[1].func) << - R300_S_BACK_FUNC_SHIFT) | - (translate_stencil_op(state->stencil[1].fail_op) << - R300_S_BACK_SFAIL_OP_SHIFT) | - (translate_stencil_op(state->stencil[1].zpass_op) << - R300_S_BACK_ZPASS_OP_SHIFT) | - (translate_stencil_op(state->stencil[1].zfail_op) << - R300_S_BACK_ZFAIL_OP_SHIFT); + (translate_depth_stencil_function(state->stencil[1].func) << + R300_S_BACK_FUNC_SHIFT) | + (translate_stencil_op(state->stencil[1].fail_op) << + R300_S_BACK_SFAIL_OP_SHIFT) | + (translate_stencil_op(state->stencil[1].zpass_op) << + R300_S_BACK_ZPASS_OP_SHIFT) | + (translate_stencil_op(state->stencil[1].zfail_op) << + R300_S_BACK_ZFAIL_OP_SHIFT); dsa->stencil_ref_bf = (state->stencil[1].ref_value) | - (state->stencil[1].value_mask << R300_STENCILMASK_SHIFT) | - (state->stencil[1].write_mask << R300_STENCILWRITEMASK_SHIFT); + (state->stencil[1].value_mask << R300_STENCILMASK_SHIFT) | + (state->stencil[1].write_mask << R300_STENCILWRITEMASK_SHIFT); } } /* Alpha test setup. */ if (state->alpha.enabled) { dsa->alpha_function = translate_alpha_function(state->alpha.func) | - R300_FG_ALPHA_FUNC_ENABLE; + R300_FG_ALPHA_FUNC_ENABLE; dsa->alpha_reference = CLAMP(state->alpha.ref * 1023.0f, 0, 1023); } else { dsa->z_buffer_top = R300_ZTOP_ENABLE; @@ -437,7 +437,6 @@ struct pipe_rasterizer_state unsigned poly_stipple_enable:1; unsigned point_smooth:1; unsigned point_sprite:1; - unsigned point_size_per_vertex:1; /**< size computed in vertex shader */ unsigned multisample:1; /* XXX maybe more ms state in future */ unsigned line_smooth:1; unsigned line_last_pixel:1; @@ -447,14 +446,14 @@ struct pipe_rasterizer_state unsigned origin_lower_left:1; /**< Is (0,0) the lower-left corner? */ unsigned flatshade_first:1; /**< take color attribute from the first vertex of a primitive */ unsigned gl_rasterization_rules:1; /**< enable tweaks for GL rasterization? */ - - float line_width; - float point_size; /**< used when no per-vertex size */ - float point_size_min; /* XXX - temporary, will go away */ - float point_size_max; /* XXX - temporary, will go away */ ubyte sprite_coord_mode[PIPE_MAX_SHADER_OUTPUTS]; /**< PIPE_SPRITE_COORD_ */ }; #endif + +static INLINE int pack_float_16_6x(float f) { + return ((int)(f * 6.0) & 0xffff); +} + /* Create a new rasterizer state based on the CSO rasterizer state. * * This is a very large chunk of state, and covers most of the graphics @@ -467,6 +466,16 @@ static void* r300_create_rs_state(struct pipe_context* pipe, { struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state); + /* XXX this is part of HW TCL */ + /* XXX endian control */ + rs->vap_control_status = R300_VAP_TCL_BYPASS; + + rs->point_size = pack_float_16_6x(state->point_size) | + (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT); + + rs->line_control = pack_float_16_6x(state->line_width) | + R300_GA_LINE_CNTL_END_TYPE_COMP; + /* Radeons don't think in "CW/CCW", they think in "front/back". */ if (state->front_winding == PIPE_WINDING_CW) { rs->cull_mode = R300_FRONT_FACE_CW; @@ -510,10 +519,6 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->line_stipple_value = state->line_stipple_pattern; } - /* XXX this is part of HW TCL */ - /* XXX endian control */ - rs->vap_control_status = R300_VAP_TCL_BYPASS; - return (void*)rs; } -- cgit v1.2.3 From 38f610e5360a2beb46f92e75942745cfbfbac22a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 1 Feb 2009 23:43:30 -0800 Subject: r300: Add u_simple_screen support. --- src/gallium/drivers/r300/r300_screen.c | 1 + src/gallium/drivers/r300/r300_screen.h | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 607dfe911c..99dcf38f43 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -264,6 +264,7 @@ struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys, r300screen->screen.surface_unmap = r300_surface_unmap; r300_init_screen_texture_functions(&r300screen->screen); + u_simple_screen_init(&r300screen->screen); return &r300screen->screen; } diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index b45ce5e8c6..2e25f61dbf 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -26,6 +26,7 @@ #include "pipe/p_inlines.h" #include "pipe/p_screen.h" #include "util/u_memory.h" +#include "util/u_simple_screen.h" #include "r300_chipset.h" #include "r300_texture.h" -- cgit v1.2.3 From ce6710e369d3b5c512ba8b315efc863fd41de734 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 1 Feb 2009 23:58:16 -0800 Subject: r300: Clean up after rebase. Fix a couple struct members, clear up a few texture lines. --- src/gallium/drivers/r300/r300_state.c | 11 ++++++----- src/gallium/drivers/r300/r300_texture.c | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index d81aee94e3..96fdce903e 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -325,8 +325,8 @@ static void* R300_S_FRONT_ZFAIL_OP_SHIFT); dsa->stencil_ref_mask = (state->stencil[0].ref_value) | - (state->stencil[0].value_mask << R300_STENCILMASK_SHIFT) | - (state->stencil[0].write_mask << R300_STENCILWRITEMASK_SHIFT); + (state->stencil[0].valuemask << R300_STENCILMASK_SHIFT) | + (state->stencil[0].writemask << R300_STENCILWRITEMASK_SHIFT); if (state->stencil[1].enabled) { dsa->z_buffer_control |= R300_STENCIL_FRONT_BACK; @@ -341,8 +341,8 @@ static void* R300_S_BACK_ZFAIL_OP_SHIFT); dsa->stencil_ref_bf = (state->stencil[1].ref_value) | - (state->stencil[1].value_mask << R300_STENCILMASK_SHIFT) | - (state->stencil[1].write_mask << R300_STENCILWRITEMASK_SHIFT); + (state->stencil[1].valuemask << R300_STENCILMASK_SHIFT) | + (state->stencil[1].writemask << R300_STENCILWRITEMASK_SHIFT); } } @@ -350,7 +350,8 @@ static void* if (state->alpha.enabled) { dsa->alpha_function = translate_alpha_function(state->alpha.func) | R300_FG_ALPHA_FUNC_ENABLE; - dsa->alpha_reference = CLAMP(state->alpha.ref * 1023.0f, 0, 1023); + dsa->alpha_reference = CLAMP(state->alpha.ref_value * 1023.0f, + 0, 1023); } else { dsa->z_buffer_top = R300_ZTOP_ENABLE; } diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index eb7c9d06f5..ae2d525d78 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -58,7 +58,7 @@ static struct pipe_texture* r300_texture_create(struct pipe_screen* screen, const struct pipe_texture* template) { - struct r300_screen* r300screen = r300_screen(screen); + /* XXX struct r300_screen* r300screen = r300_screen(screen); */ struct r300_texture* tex = CALLOC_STRUCT(r300_texture); @@ -72,9 +72,9 @@ static struct pipe_texture* r300_setup_miptree(tex); - tex->buffer = screen->winsys->buffer_create(screen->winsys, 32, - PIPE_BUFFER_USAGE_PIXEL, - tex->size); + tex->buffer = screen->buffer_create(screen->winsys, 32, + PIPE_BUFFER_USAGE_PIXEL, + tex->size); if (!tex->buffer) { FREE(tex); -- cgit v1.2.3 From ffc5e9a422da5b3eaadc57995afcbc483739f426 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 2 Feb 2009 00:18:25 -0800 Subject: amd: Fix build errors from rebase. --- src/gallium/winsys/drm/amd/amd_buffer.c | 1 - src/gallium/winsys/drm/amd/amd_buffer.h | 2 +- src/gallium/winsys/drm/amd/amd_context.c | 1 - src/gallium/winsys/drm/amd/amd_screen.c | 7 ++++--- src/gallium/winsys/drm/amd/amd_screen.h | 1 - 5 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/amd/amd_buffer.c b/src/gallium/winsys/drm/amd/amd_buffer.c index 3d400243a5..fb7c6f33ed 100644 --- a/src/gallium/winsys/drm/amd/amd_buffer.c +++ b/src/gallium/winsys/drm/amd/amd_buffer.c @@ -30,7 +30,6 @@ #include #include "dri_util.h" #include "state_tracker/st_public.h" -#include "pipe/p_winsys.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" #include "amd_buffer.h" diff --git a/src/gallium/winsys/drm/amd/amd_buffer.h b/src/gallium/winsys/drm/amd/amd_buffer.h index d67967ebea..238ca572ae 100644 --- a/src/gallium/winsys/drm/amd/amd_buffer.h +++ b/src/gallium/winsys/drm/amd/amd_buffer.h @@ -30,7 +30,7 @@ #ifndef AMD_BUFFER_H #define AMD_BUFFER_H -#include "pipe/p_winsys.h" +#include "pipe/internal/p_winsys_screen.h" #include "amd_screen.h" #include "amd_context.h" #include "radeon_bo.h" diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c index 86e6e0f5f7..e089cf6874 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/amd/amd_context.c @@ -29,7 +29,6 @@ */ #include #include "dri_util.h" -#include "pipe/p_winsys.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" #include "state_tracker/st_public.h" diff --git a/src/gallium/winsys/drm/amd/amd_screen.c b/src/gallium/winsys/drm/amd/amd_screen.c index fcf8524525..d62b47f36d 100644 --- a/src/gallium/winsys/drm/amd/amd_screen.c +++ b/src/gallium/winsys/drm/amd/amd_screen.c @@ -247,14 +247,15 @@ static void amd_buffer_destroy(__DRIdrawablePrivate * dri_drawable) static void amd_swap_buffers(__DRIdrawablePrivate *dri_drawable) { struct amd_framebuffer *amd_fb; - struct pipe_surface *back_surf; + struct pipe_surface *back_surf = NULL; amd_fb = dri_drawable->driverPrivate; assert(amd_fb); assert(amd_fb->st_framebuffer); - back_surf = st_get_framebuffer_surface(amd_fb->st_framebuffer, - ST_SURFACE_BACK_LEFT); + st_get_framebuffer_surface(amd_fb->st_framebuffer, + ST_SURFACE_BACK_LEFT, + &back_surf); if (back_surf) { st_notify_swapbuffers(amd_fb->st_framebuffer); /* TODO: do we want to do anythings ? */ diff --git a/src/gallium/winsys/drm/amd/amd_screen.h b/src/gallium/winsys/drm/amd/amd_screen.h index 7f21fa477c..2617393f2e 100644 --- a/src/gallium/winsys/drm/amd/amd_screen.h +++ b/src/gallium/winsys/drm/amd/amd_screen.h @@ -30,7 +30,6 @@ #ifndef AMD_SCREEN_H #define AMD_SCREEN_H -#include "pipe/p_winsys.h" #include "dri_util.h" #include "radeon_bo.h" -- cgit v1.2.3 From 92ced46eaf1f389108ed8d3d788498d799f0b385 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Feb 2009 07:48:10 -0700 Subject: mesa: move code after decls. Fixes Window build failure. --- src/mesa/swrast/s_triangle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 063130714c..0598052f50 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -266,9 +266,6 @@ affine_span(GLcontext *ctx, SWspan *span, GLchan sample[4]; /* the filtered texture sample */ const GLuint texEnableSave = ctx->Texture._EnabledUnits; - /* Disable tex units so they're not re-applied in swrast_write_rgba_span */ - ctx->Texture._EnabledUnits = 0x0; - /* Instead of defining a function for each mode, a test is done * between the outer and inner loops. This is to reduce code size * and complexity. Observe that an optimizing compiler kills @@ -397,6 +394,9 @@ affine_span(GLcontext *ctx, SWspan *span, GLuint i; GLchan *dest = span->array->rgba[0]; + /* Disable tex units so they're not re-applied in swrast_write_rgba_span */ + ctx->Texture._EnabledUnits = 0x0; + span->intTex[0] -= FIXED_HALF; span->intTex[1] -= FIXED_HALF; switch (info->filter) { -- cgit v1.2.3 From dd1c68f15123a889a3ce9d2afe724e272d163e32 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Jan 2009 13:23:12 -0800 Subject: dri2: Avoid round-tripping on DRI2GetBuffers for the same set of buffers. We only wanted to request when asked for the same set of buffers when a resize has happened. We can just watch the protocol stream for a ConfigureNotify and flag to do it then. This is about a 5% win from doing two glViewport()s per frame in openarena. --- src/glx/x11/dri2_glx.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ src/glx/x11/glxclient.h | 1 + 2 files changed, 53 insertions(+) (limited to 'src') diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index d16f809126..41861d5d27 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -60,6 +60,9 @@ struct __GLXDRIdisplayPrivateRec { int driMajor; int driMinor; int driPatch; + + unsigned long configureSeqno; + Bool (*oldConfigProc)(Display *, XEvent *, xEvent *); }; struct __GLXDRIcontextPrivateRec { @@ -73,6 +76,7 @@ struct __GLXDRIdrawablePrivateRec { __DRIbuffer buffers[5]; int bufferCount; int width, height; + unsigned long configureSeqno; }; static void dri2DestroyContext(__GLXDRIcontext *context, @@ -166,6 +170,7 @@ static __GLXDRIdrawable *dri2CreateDrawable(__GLXscreenConfigs *psc, pdraw->base.xDrawable = xDrawable; pdraw->base.drawable = drawable; pdraw->base.psc = psc; + pdraw->configureSeqno = ~0; DRI2CreateDrawable(psc->dpy, xDrawable); @@ -223,9 +228,30 @@ dri2GetBuffers(__DRIdrawable *driDrawable, int *out_count, void *loaderPrivate) { __GLXDRIdrawablePrivate *pdraw = loaderPrivate; + __GLXdisplayPrivate *dpyPriv = __glXInitialize(pdraw->base.psc->dpy); + __GLXDRIdisplayPrivate *pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display; DRI2Buffer *buffers; int i; + /** + * Check if a ConfigureNotify has come in since we last asked for the + * buffers associated with this drawable. If not, we can assume that they're + * the same set at glViewport time, and save a synchronous round-trip to the + * X Server. + */ + if (pdraw->configureSeqno == pdp->configureSeqno && + count == pdraw->bufferCount) { + for (i = 0; i < count; i++) { + if (pdraw->buffers[i].attachment != attachments[i]) + break; + } + if (i == count) { + *out_count = pdraw->bufferCount; + return pdraw->buffers; + } + } + pdraw->configureSeqno = pdp->configureSeqno; + buffers = DRI2GetBuffers(pdraw->base.psc->dpy, pdraw->base.xDrawable, width, height, attachments, count, out_count); if (buffers == NULL) @@ -233,6 +259,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable, pdraw->width = *width; pdraw->height = *height; + pdraw->bufferCount = *out_count; /* This assumes the DRI2 buffer attachment tokens matches the * __DRIbuffer tokens. */ @@ -365,6 +392,28 @@ static void dri2DestroyDisplay(__GLXDRIdisplay *dpy) Xfree(dpy); } +/** + * Makes a note on receiving ConfigureNotify that we need to re-check the + * DRI2 buffers, as window sizes may have resulted in reallocation. + */ +static Bool dri2ConfigureNotifyProc(Display *dpy, XEvent *re, xEvent *event) +{ + __GLXdisplayPrivate *dpyPriv = __glXInitialize(dpy); + __GLXDRIdisplayPrivate *pdp; + Bool ret; + + /* We should always be able to find our pdp, as it only gets torn down + * when the Display is torn down. + */ + pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display; + + ret = pdp->oldConfigProc(dpy, re, event); + + pdp->configureSeqno = re->xconfigure.serial; + + return ret; +} + /* * Allocate, initialize and return a __DRIdisplayPrivate object. * This is called from __glXInitialize() when we are given a new @@ -387,6 +436,9 @@ _X_HIDDEN __GLXDRIdisplay *dri2CreateDisplay(Display *dpy) return NULL; } + pdp->oldConfigProc = XESetWireToEvent(dpy, ConfigureNotify, + dri2ConfigureNotifyProc); + pdp->driPatch = 0; pdp->base.destroyDisplay = dri2DestroyDisplay; diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 16f6074ed8..bdc6287a45 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -602,6 +602,7 @@ extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, const GLvoid *, GLint); /* Initialize the GLX extension for dpy */ +extern __GLXdisplayPrivate * __glXGetPrivateFromDisplay(Display *dpy); extern __GLXdisplayPrivate *__glXInitialize(Display*); /************************************************************************/ -- cgit v1.2.3 From a2416e3d7ecb2fcf18d93a08bc3cc3639ed97b39 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 2 Feb 2009 14:42:04 -0800 Subject: r300, amd: Oops, a couple more API changes. Somehow I forgot to commit these. --- src/gallium/drivers/r300/r300_texture.c | 2 +- src/gallium/winsys/drm/amd/amd_buffer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index ae2d525d78..537425c1e2 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -72,7 +72,7 @@ static struct pipe_texture* r300_setup_miptree(tex); - tex->buffer = screen->buffer_create(screen->winsys, 32, + tex->buffer = screen->buffer_create(screen, 32, PIPE_BUFFER_USAGE_PIXEL, tex->size); diff --git a/src/gallium/winsys/drm/amd/amd_buffer.c b/src/gallium/winsys/drm/amd/amd_buffer.c index fb7c6f33ed..4b831c7fcc 100644 --- a/src/gallium/winsys/drm/amd/amd_buffer.c +++ b/src/gallium/winsys/drm/amd/amd_buffer.c @@ -231,7 +231,7 @@ struct pipe_surface *amd_surface_from_handle(struct amd_context *amd_context, pt = pipe_screen->texture_blanket(pipe_screen, &tmpl, &pitch, pb); if (pt == NULL) { - winsys_buffer_reference(pipe_winsys, &pb, NULL); + pipe_buffer_reference(pipe_screen, &pb, NULL); } ps = pipe_screen->get_tex_surface(pipe_screen, pt, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE); -- cgit v1.2.3 From c96bac0950eda6e707455b0c1ee29c1d87daf727 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Jan 2009 15:49:30 -0800 Subject: intel: replace custom metaops clear with generic. No real-world impact on performance seen. Even glxgears seems to be, if anything, happier. --- src/mesa/drivers/dri/intel/intel_clear.c | 245 ++++++++++++++++++++++--------- src/mesa/drivers/dri/intel/intel_pixel.h | 2 + 2 files changed, 176 insertions(+), 71 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 98f7292f59..5e1d91a4c4 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 2009 Intel Corporation. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -25,99 +26,201 @@ * **************************************************************************/ -#include "intel_clear.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/mtypes.h" +#include "main/attrib.h" +#include "main/blend.h" +#include "main/bufferobj.h" +#include "main/buffers.h" +#include "main/depth.h" +#include "main/enable.h" +#include "main/macros.h" +#include "main/matrix.h" +#include "main/texstate.h" +#include "main/stencil.h" +#include "main/varray.h" +#include "glapi/dispatch.h" +#include "swrast/swrast.h" + #include "intel_context.h" #include "intel_blit.h" -#include "intel_buffers.h" #include "intel_chipset.h" +#include "intel_clear.h" #include "intel_fbo.h" -#include "intel_regions.h" -#include "intel_batchbuffer.h" -#include "main/framebuffer.h" -#include "swrast/swrast.h" -#include "drirenderbuffer.h" +#include "intel_pixel.h" #define FILE_DEBUG_FLAG DEBUG_BLIT -/* A true meta version of this would be very simple and additionally - * machine independent. Maybe we'll get there one day. +/** + * Perform glClear where mask contains only color, depth, and/or stencil. + * + * The implementation is based on calling into Mesa to set GL state and + * performing normal triangle rendering. The intent of this path is to + * have as generic a path as possible, so that any driver could make use of + * it. */ -static void -intelClearWithTris(struct intel_context *intel, GLbitfield mask) +void +intel_clear_tris(GLcontext *ctx, GLbitfield mask) { - GLcontext *ctx = &intel->ctx; + struct intel_context *intel = intel_context(ctx); + GLfloat vertices[4][4]; + GLfloat color[4][4]; + GLfloat dst_z; struct gl_framebuffer *fb = ctx->DrawBuffer; - GLuint buf; + int i; + GLboolean saved_fp_enable = GL_FALSE, saved_vp_enable = GL_FALSE; + unsigned int saved_active_texture; + + assert((mask & ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT | + BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) == 0); + + _mesa_PushAttrib(GL_COLOR_BUFFER_BIT | + GL_CURRENT_BIT | + GL_DEPTH_BUFFER_BIT | + GL_ENABLE_BIT | + GL_STENCIL_BUFFER_BIT | + GL_TRANSFORM_BIT | + GL_CURRENT_BIT); + _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); + saved_active_texture = ctx->Texture.CurrentUnit; + + /* Disable existing GL state we don't want to apply to a clear. */ + _mesa_Disable(GL_ALPHA_TEST); + _mesa_Disable(GL_BLEND); + _mesa_Disable(GL_CULL_FACE); + _mesa_Disable(GL_FOG); + _mesa_Disable(GL_POLYGON_SMOOTH); + _mesa_Disable(GL_POLYGON_STIPPLE); + _mesa_Disable(GL_POLYGON_OFFSET_FILL); + _mesa_Disable(GL_LIGHTING); + _mesa_Disable(GL_CLIP_PLANE0); + _mesa_Disable(GL_CLIP_PLANE1); + _mesa_Disable(GL_CLIP_PLANE2); + _mesa_Disable(GL_CLIP_PLANE3); + _mesa_Disable(GL_CLIP_PLANE4); + _mesa_Disable(GL_CLIP_PLANE5); + if (ctx->Extensions.ARB_fragment_program && ctx->FragmentProgram.Enabled) { + saved_fp_enable = GL_TRUE; + _mesa_Disable(GL_FRAGMENT_PROGRAM_ARB); + } + if (ctx->Extensions.ARB_vertex_program && ctx->VertexProgram.Enabled) { + saved_vp_enable = GL_TRUE; + _mesa_Disable(GL_VERTEX_PROGRAM_ARB); + } + + if (ctx->Texture._EnabledUnits != 0) { + int i; + + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + _mesa_ActiveTextureARB(GL_TEXTURE0 + i); + _mesa_Disable(GL_TEXTURE_1D); + _mesa_Disable(GL_TEXTURE_2D); + _mesa_Disable(GL_TEXTURE_3D); + if (ctx->Extensions.ARB_texture_cube_map) + _mesa_Disable(GL_TEXTURE_CUBE_MAP_ARB); + if (ctx->Extensions.NV_texture_rectangle) + _mesa_Disable(GL_TEXTURE_RECTANGLE_NV); + if (ctx->Extensions.MESA_texture_array) { + _mesa_Disable(GL_TEXTURE_1D_ARRAY_EXT); + _mesa_Disable(GL_TEXTURE_2D_ARRAY_EXT); + } + } + } + + intel_meta_set_passthrough_transform(intel); - intel->vtbl.install_meta_state(intel); + for (i = 0; i < 4; i++) { + color[i][0] = ctx->Color.ClearColor[0]; + color[i][1] = ctx->Color.ClearColor[1]; + color[i][2] = ctx->Color.ClearColor[2]; + color[i][3] = ctx->Color.ClearColor[3]; + } + + /* convert clear Z from [0,1] to NDC coord in [-1,1] */ + dst_z = -1.0 + 2.0 * ctx->Depth.Clear; - /* Back and stencil cliprects are the same. Try and do both - * buffers at once: + /* Prepare the vertices, which are the same regardless of which buffer we're + * drawing to. */ - if (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH)) { - struct intel_region *backRegion = - intel_get_rb_region(fb, BUFFER_BACK_LEFT); - struct intel_region *depthRegion = - intel_get_rb_region(fb, BUFFER_DEPTH); + vertices[0][0] = fb->_Xmin; + vertices[0][1] = fb->_Ymin; + vertices[0][2] = dst_z; + vertices[0][3] = 1.0; + vertices[1][0] = fb->_Xmax; + vertices[1][1] = fb->_Ymin; + vertices[1][2] = dst_z; + vertices[1][3] = 1.0; + vertices[2][0] = fb->_Xmax; + vertices[2][1] = fb->_Ymax; + vertices[2][2] = dst_z; + vertices[2][3] = 1.0; + vertices[3][0] = fb->_Xmin; + vertices[3][1] = fb->_Ymax; + vertices[3][2] = dst_z; + vertices[3][3] = 1.0; - intel->vtbl.meta_draw_region(intel, backRegion, depthRegion); + _mesa_ColorPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &color); + _mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices); + _mesa_Enable(GL_COLOR_ARRAY); + _mesa_Enable(GL_VERTEX_ARRAY); + + while (mask != 0) { + GLuint this_mask = 0; if (mask & BUFFER_BIT_BACK_LEFT) - intel->vtbl.meta_color_mask(intel, GL_TRUE); - else - intel->vtbl.meta_color_mask(intel, GL_FALSE); + this_mask = BUFFER_BIT_BACK_LEFT; + else if (mask & BUFFER_BIT_FRONT_LEFT) + this_mask = BUFFER_BIT_FRONT_LEFT; - if (mask & BUFFER_BIT_STENCIL) - intel->vtbl.meta_stencil_replace(intel, - intel->ctx.Stencil.WriteMask[0], - intel->ctx.Stencil.Clear); - else - intel->vtbl.meta_no_stencil_write(intel); + /* Clear depth/stencil in the same pass as color. */ + this_mask |= (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)); - if (mask & BUFFER_BIT_DEPTH) - intel->vtbl.meta_depth_replace(intel); + /* Select the current color buffer and use the color write mask if + * we have one, otherwise don't write any color channels. + */ + if (this_mask & BUFFER_BIT_FRONT_LEFT) + _mesa_DrawBuffer(GL_FRONT_LEFT); + else if (this_mask & BUFFER_BIT_BACK_LEFT) + _mesa_DrawBuffer(GL_BACK_LEFT); else - intel->vtbl.meta_no_depth_write(intel); - - intel->vtbl.meta_draw_quad(intel, - fb->_Xmin, - fb->_Xmax, - fb->_Ymin, - fb->_Ymax, - intel->ctx.Depth.Clear, - intel->ClearColor8888, - 0, 0, 0, 0); /* texcoords */ - - mask &= ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH); - } + _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); + + /* Control writing of the depth clear value to depth. */ + if (this_mask & BUFFER_BIT_DEPTH) { + _mesa_DepthFunc(GL_ALWAYS); + _mesa_Enable(GL_DEPTH_TEST); + } else { + _mesa_Disable(GL_DEPTH_TEST); + _mesa_DepthMask(GL_FALSE); + } - /* clear the remaining (color) renderbuffers */ - for (buf = 0; buf < BUFFER_COUNT && mask; buf++) { - const GLuint bufBit = 1 << buf; - if (mask & bufBit) { - struct intel_renderbuffer *irbColor = - intel_renderbuffer(fb->Attachment[buf].Renderbuffer); - - ASSERT(irbColor); - - intel->vtbl.meta_no_depth_write(intel); - intel->vtbl.meta_no_stencil_write(intel); - intel->vtbl.meta_color_mask(intel, GL_TRUE); - intel->vtbl.meta_draw_region(intel, irbColor->region, NULL); - - intel->vtbl.meta_draw_quad(intel, - fb->_Xmin, - fb->_Xmax, - fb->_Ymin, - fb->_Ymax, - 0, intel->ClearColor8888, - 0, 0, 0, 0); /* texcoords */ - - mask &= ~bufBit; + /* Control writing of the stencil clear value to stencil. */ + if (this_mask & BUFFER_BIT_STENCIL) { + _mesa_Enable(GL_STENCIL_TEST); + _mesa_StencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); + _mesa_StencilFuncSeparate(GL_FRONT, GL_ALWAYS, ctx->Stencil.Clear, + ctx->Stencil.WriteMask[0]); + } else { + _mesa_Disable(GL_STENCIL_TEST); } + + CALL_DrawArrays(ctx->Exec, (GL_TRIANGLE_FAN, 0, 4)); + + mask &= ~this_mask; } - intel->vtbl.leave_meta_state(intel); + intel_meta_restore_transform(intel); + + _mesa_ActiveTextureARB(GL_TEXTURE0 + saved_active_texture); + if (saved_fp_enable) + _mesa_Enable(GL_FRAGMENT_PROGRAM_ARB); + if (saved_vp_enable) + _mesa_Enable(GL_VERTEX_PROGRAM_ARB); + + _mesa_PopClientAttrib(); + _mesa_PopAttrib(); } static const char *buffer_names[] = { @@ -244,7 +347,7 @@ intelClear(GLcontext *ctx, GLbitfield mask) } DBG("\n"); } - intelClearWithTris(intel, tri_mask); + intel_clear_tris(ctx, tri_mask); } if (swrast_mask) { diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h index 76b8781316..cb41fa182c 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.h +++ b/src/mesa/drivers/dri/intel/intel_pixel.h @@ -76,4 +76,6 @@ void intelBitmap(GLcontext * ctx, const struct gl_pixelstore_attrib *unpack, const GLubyte * pixels); +void intel_clear_tris(GLcontext *ctx, GLbitfield mask); + #endif -- cgit v1.2.3 From 14321fcfde9e30d0b9f15aab3c9a057271ae6295 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Jan 2009 14:18:03 -0800 Subject: i965: Delete old metaops code now that there are no remaining consumers. --- src/mesa/drivers/dri/i965/Makefile | 1 - src/mesa/drivers/dri/i965/brw_context.c | 1 - src/mesa/drivers/dri/i965/brw_context.h | 30 -- src/mesa/drivers/dri/i965/brw_draw.c | 7 +- src/mesa/drivers/dri/i965/brw_fallback.c | 10 +- src/mesa/drivers/dri/i965/brw_metaops.c | 585 --------------------------- src/mesa/drivers/dri/i965/brw_misc_state.c | 7 +- src/mesa/drivers/dri/i965/brw_sf_state.c | 34 +- src/mesa/drivers/dri/i965/brw_state_upload.c | 1 - src/mesa/drivers/dri/i965/brw_vs.c | 7 +- src/mesa/drivers/dri/i965/brw_vs.h | 1 - src/mesa/drivers/dri/i965/brw_vs_emit.c | 16 +- src/mesa/drivers/dri/i965/brw_vtbl.c | 1 - src/mesa/drivers/dri/intel/intel_clear.c | 8 +- 14 files changed, 25 insertions(+), 684 deletions(-) delete mode 100644 src/mesa/drivers/dri/i965/brw_metaops.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index b7d52e5db5..2934414d99 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -51,7 +51,6 @@ DRIVER_SOURCES = \ brw_gs.c \ brw_gs_emit.c \ brw_gs_state.c \ - brw_metaops.c \ brw_misc_state.c \ brw_program.c \ brw_queryobj.c \ diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index d66781f5ae..e33cbb9ce0 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -148,7 +148,6 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, /* ctx->Const.MaxNativeVertexProgramTemps = 32; */ brw_init_attribs( brw ); - brw_init_metaops( brw ); brw_init_state( brw ); brw->state.dirty.mesa = ~0; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 5d3f99e025..fc0fda98cd 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -131,7 +131,6 @@ struct brw_context; #define BRW_NEW_WM_INPUT_DIMENSIONS 0x100 #define BRW_NEW_INPUT_VARYING 0x200 #define BRW_NEW_PSP 0x800 -#define BRW_NEW_METAOPS 0x1000 #define BRW_NEW_FENCE 0x2000 #define BRW_NEW_INDICES 0x4000 #define BRW_NEW_VERTICES 0x8000 @@ -491,28 +490,6 @@ struct brw_context unsigned int offset; } ib; - struct { - /* Will be allocated on demand if needed. - */ - struct brw_state_pointers attribs; - struct gl_vertex_program *vp; - struct gl_fragment_program *fp, *fp_tex; - - struct gl_buffer_object *vbo; - - struct intel_region *saved_draw_region; - GLuint saved_nr_draw_regions; - struct intel_region *saved_depth_region; - - GLuint restore_draw_buffers[MAX_DRAW_BUFFERS]; - GLuint restore_num_draw_buffers; - - struct gl_fragment_program *restore_fp; - - GLboolean active; - } metaops; - - /* Active vertex program: */ const struct gl_vertex_program *vertex_program; @@ -703,13 +680,6 @@ void brw_FrameBufferTexInit( struct brw_context *brw, void brw_FrameBufferTexDestroy( struct brw_context *brw ); void brw_validate_textures( struct brw_context *brw ); -/*====================================================================== - * brw_metaops.c - */ - -void brw_init_metaops( struct brw_context *brw ); -void brw_destroy_metaops( struct brw_context *brw ); - /*====================================================================== * brw_program.c diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 785fb784ca..6a4be83dfb 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -166,14 +166,11 @@ static void brw_merge_inputs( struct brw_context *brw, for (i = 0; i < VERT_ATTRIB_MAX; i++) { brw->vb.inputs[i].glarray = arrays[i]; - /* XXX: metaops passes null arrays */ - if (arrays[i]) { - if (arrays[i]->StrideB != 0) - brw->vb.info.varying |= 1 << i; + if (arrays[i]->StrideB != 0) + brw->vb.info.varying |= 1 << i; brw->vb.info.sizes[i/16] |= (brw->vb.inputs[i].glarray->Size - 1) << ((i%16) * 2); - } } /* Raise statechanges if input sizes and varying have changed: diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 4ea660a51a..e1ff169f12 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -47,20 +47,12 @@ static GLboolean do_check_fallback(struct brw_context *brw) GLcontext *ctx = &brw->intel.ctx; GLuint i; - /* BRW_NEW_METAOPS - */ - if (brw->metaops.active) - return GL_FALSE; - if (brw->intel.no_rast) { DBG("FALLBACK: rasterization disabled\n"); return GL_TRUE; } /* _NEW_RENDERMODE - * - * XXX: need to save/restore RenderMode in metaops state, or - * somehow move to a new attribs pointer: */ if (ctx->RenderMode != GL_RENDER) { DBG("FALLBACK: render mode\n"); @@ -101,7 +93,7 @@ static void check_fallback(struct brw_context *brw) const struct brw_tracked_state brw_check_fallback = { .dirty = { .mesa = _NEW_BUFFERS | _NEW_RENDERMODE | _NEW_TEXTURE | _NEW_STENCIL, - .brw = BRW_NEW_METAOPS, + .brw = 0, .cache = 0 }, .prepare = check_fallback diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c deleted file mode 100644 index 84d224387e..0000000000 --- a/src/mesa/drivers/dri/i965/brw_metaops.c +++ /dev/null @@ -1,585 +0,0 @@ -/* - Copyright (C) Intel Corp. 2006. All Rights Reserved. - Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to - develop this 3D driver. - - 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 - * frame buffer texture by Gary Wong - */ - - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" - -#include "shader/arbprogparse.h" - -#include "intel_screen.h" -#include "intel_batchbuffer.h" -#include "intel_regions.h" -#include "intel_buffers.h" - -#include "brw_context.h" -#include "brw_defines.h" -#include "brw_draw.h" -#include "brw_fallback.h" - -#define INIT(brw, STRUCT, ATTRIB) \ -do { \ - brw->attribs.ATTRIB = &ctx->ATTRIB; \ -} while (0) - -#define DUP(brw, STRUCT, ATTRIB) \ -do { \ - brw->metaops.attribs.ATTRIB = MALLOC_STRUCT(STRUCT); \ - memcpy(brw->metaops.attribs.ATTRIB, \ - brw->attribs.ATTRIB, \ - sizeof(struct STRUCT)); \ -} while (0) - - -#define INSTALL(brw, ATTRIB, STATE) \ -do { \ - brw->attribs.ATTRIB = brw->metaops.attribs.ATTRIB; \ - brw->state.dirty.mesa |= STATE; \ -} while (0) - -#define RESTORE(brw, ATTRIB, STATE) \ -do { \ - brw->attribs.ATTRIB = &brw->intel.ctx.ATTRIB; \ - brw->state.dirty.mesa |= STATE; \ -} while (0) - -static void init_attribs( struct brw_context *brw ) -{ - DUP(brw, gl_colorbuffer_attrib, Color); - DUP(brw, gl_depthbuffer_attrib, Depth); - DUP(brw, gl_fog_attrib, Fog); - DUP(brw, gl_hint_attrib, Hint); - DUP(brw, gl_light_attrib, Light); - DUP(brw, gl_line_attrib, Line); - DUP(brw, gl_point_attrib, Point); - DUP(brw, gl_polygon_attrib, Polygon); - DUP(brw, gl_scissor_attrib, Scissor); - DUP(brw, gl_stencil_attrib, Stencil); - DUP(brw, gl_texture_attrib, Texture); - DUP(brw, gl_transform_attrib, Transform); - DUP(brw, gl_viewport_attrib, Viewport); - DUP(brw, gl_vertex_program_state, VertexProgram); - DUP(brw, gl_fragment_program_state, FragmentProgram); -} - -static void install_attribs( struct brw_context *brw ) -{ - INSTALL(brw, Color, _NEW_COLOR); - INSTALL(brw, Depth, _NEW_DEPTH); - INSTALL(brw, Fog, _NEW_FOG); - INSTALL(brw, Hint, _NEW_HINT); - INSTALL(brw, Light, _NEW_LIGHT); - INSTALL(brw, Line, _NEW_LINE); - INSTALL(brw, Point, _NEW_POINT); - INSTALL(brw, Polygon, _NEW_POLYGON); - INSTALL(brw, Scissor, _NEW_SCISSOR); - INSTALL(brw, Stencil, _NEW_STENCIL); - INSTALL(brw, Texture, _NEW_TEXTURE); - INSTALL(brw, Transform, _NEW_TRANSFORM); - INSTALL(brw, Viewport, _NEW_VIEWPORT); - INSTALL(brw, VertexProgram, _NEW_PROGRAM); - INSTALL(brw, FragmentProgram, _NEW_PROGRAM); -} - -static void restore_attribs( struct brw_context *brw ) -{ - RESTORE(brw, Color, _NEW_COLOR); - RESTORE(brw, Depth, _NEW_DEPTH); - RESTORE(brw, Fog, _NEW_FOG); - RESTORE(brw, Hint, _NEW_HINT); - RESTORE(brw, Light, _NEW_LIGHT); - RESTORE(brw, Line, _NEW_LINE); - RESTORE(brw, Point, _NEW_POINT); - RESTORE(brw, Polygon, _NEW_POLYGON); - RESTORE(brw, Scissor, _NEW_SCISSOR); - RESTORE(brw, Stencil, _NEW_STENCIL); - RESTORE(brw, Texture, _NEW_TEXTURE); - RESTORE(brw, Transform, _NEW_TRANSFORM); - RESTORE(brw, Viewport, _NEW_VIEWPORT); - RESTORE(brw, VertexProgram, _NEW_PROGRAM); - RESTORE(brw, FragmentProgram, _NEW_PROGRAM); -} - - -static const char *vp_prog = - "!!ARBvp1.0\n" - "MOV result.color, vertex.color;\n" - "MOV result.position, vertex.position;\n" - "END\n"; - -static const char *fp_prog = - "!!ARBfp1.0\n" - "MOV result.color, fragment.color;\n" - "END\n"; - -static const char *fp_tex_prog = - "!!ARBfp1.0\n" - "TEMP a;\n" - "ADD a, fragment.position, program.local[0];\n" - "MUL a, a, program.local[1];\n" - "TEX result.color, a, texture[0], 2D;\n" - "MOV result.depth.z, fragment.position;\n" - "END\n"; - -/* Derived values of importance: - * - * FragmentProgram->_Current - * VertexProgram->_Enabled - * brw->vertex_program - * DrawBuffer->_ColorDrawBufferIndexes[0] - * - * - * More if drawpixels-through-texture is added. - */ -static void init_metaops_state( struct brw_context *brw ) -{ - GLcontext *ctx = &brw->intel.ctx; - - brw->metaops.vbo = ctx->Driver.NewBufferObject(ctx, 1, GL_ARRAY_BUFFER_ARB); - - ctx->Driver.BufferData(ctx, - GL_ARRAY_BUFFER_ARB, - 4096, - NULL, - GL_DYNAMIC_DRAW_ARB, - brw->metaops.vbo); - - brw->metaops.fp = (struct gl_fragment_program *) - ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 ); - - brw->metaops.fp_tex = (struct gl_fragment_program *) - ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 ); - - brw->metaops.vp = (struct gl_vertex_program *) - ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 1 ); - - _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB, - fp_prog, strlen(fp_prog), - brw->metaops.fp); - - _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB, - fp_tex_prog, strlen(fp_tex_prog), - brw->metaops.fp_tex); - - _mesa_parse_arb_vertex_program(ctx, GL_VERTEX_PROGRAM_ARB, - vp_prog, strlen(vp_prog), - brw->metaops.vp); - - brw->metaops.attribs.VertexProgram->_Current = brw->metaops.vp; - brw->metaops.attribs.VertexProgram->_Enabled = GL_TRUE; - - brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp; -} - -static void meta_flat_shade( struct intel_context *intel ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - brw->metaops.attribs.Light->ShadeModel = GL_FLAT; - brw->state.dirty.mesa |= _NEW_LIGHT; -} - - -static void meta_no_stencil_write( struct intel_context *intel ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - brw->metaops.attribs.Stencil->Enabled = GL_FALSE; - brw->metaops.attribs.Stencil->WriteMask[0] = GL_FALSE; - brw->state.dirty.mesa |= _NEW_STENCIL; -} - -static void meta_no_depth_write( struct intel_context *intel ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - brw->metaops.attribs.Depth->Test = GL_FALSE; - brw->metaops.attribs.Depth->Mask = GL_FALSE; - brw->state.dirty.mesa |= _NEW_DEPTH; -} - - -static void meta_depth_replace( struct intel_context *intel ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_TRUE ) - * ctx->Driver.DepthMask( ctx, GL_TRUE ) - */ - brw->metaops.attribs.Depth->Test = GL_TRUE; - brw->metaops.attribs.Depth->Mask = GL_TRUE; - brw->state.dirty.mesa |= _NEW_DEPTH; - - /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS ) - */ - brw->metaops.attribs.Depth->Func = GL_ALWAYS; - - brw->state.dirty.mesa |= _NEW_DEPTH; -} - - -static void meta_stencil_replace( struct intel_context *intel, - GLuint s_mask, - GLuint s_clear) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - brw->metaops.attribs.Stencil->Enabled = GL_TRUE; - brw->metaops.attribs.Stencil->WriteMask[0] = s_mask; - brw->metaops.attribs.Stencil->ValueMask[0] = 0xff; - brw->metaops.attribs.Stencil->Ref[0] = s_clear; - brw->metaops.attribs.Stencil->Function[0] = GL_ALWAYS; - brw->metaops.attribs.Stencil->FailFunc[0] = GL_REPLACE; - brw->metaops.attribs.Stencil->ZPassFunc[0] = GL_REPLACE; - brw->metaops.attribs.Stencil->ZFailFunc[0] = GL_REPLACE; - brw->state.dirty.mesa |= _NEW_STENCIL; -} - - -static void meta_color_mask( struct intel_context *intel, GLboolean state ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - if (state) - COPY_4V(brw->metaops.attribs.Color->ColorMask, - brw->intel.ctx.Color.ColorMask); - else - ASSIGN_4V(brw->metaops.attribs.Color->ColorMask, 0, 0, 0, 0); - - brw->state.dirty.mesa |= _NEW_COLOR; -} - -static void meta_no_texture( struct intel_context *intel ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp; - - brw->metaops.attribs.Texture->CurrentUnit = 0; - brw->metaops.attribs.Texture->_EnabledUnits = 0; - brw->metaops.attribs.Texture->_EnabledCoordUnits = 0; - brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = 0; - brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = 0; - - brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM; -} - -static void meta_texture_blend_replace(struct intel_context *intel) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - brw->metaops.attribs.Texture->CurrentUnit = 0; - brw->metaops.attribs.Texture->_EnabledUnits = 1; - brw->metaops.attribs.Texture->_EnabledCoordUnits = 1; - brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = TEXTURE_2D_BIT; - brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = TEXTURE_2D_BIT; - brw->metaops.attribs.Texture->Unit[ 0 ].Current2D = - intel->frame_buffer_texobj; - brw->metaops.attribs.Texture->Unit[ 0 ]._Current = - intel->frame_buffer_texobj; - - brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM; -} - -static void meta_import_pixel_state(struct intel_context *intel) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - RESTORE(brw, Color, _NEW_COLOR); - RESTORE(brw, Depth, _NEW_DEPTH); - RESTORE(brw, Fog, _NEW_FOG); - RESTORE(brw, Scissor, _NEW_SCISSOR); - RESTORE(brw, Stencil, _NEW_STENCIL); - RESTORE(brw, Texture, _NEW_TEXTURE); - RESTORE(brw, FragmentProgram, _NEW_PROGRAM); -} - -static void meta_frame_buffer_texture( struct intel_context *intel, - GLint xoff, GLint yoff ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - struct intel_region *region = intel_drawbuf_region( intel ); - - INSTALL(brw, FragmentProgram, _NEW_PROGRAM); - - brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp_tex; - /* This is unfortunate, but seems to be necessary, since later on we - will end up calling _mesa_load_state_parameters to lookup the - local params (below), and that will want to look in ctx.FragmentProgram - instead of brw->attribs.FragmentProgram. */ - intel->ctx.FragmentProgram.Current = brw->metaops.fp_tex; - - brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 0 ] = xoff; - brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 1 ] = yoff; - brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 2 ] = 0.0; - brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 3 ] = 0.0; - brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 0 ] = - 1.0 / region->pitch; - brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 1 ] = - -1.0 / region->height; - brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 2 ] = 0.0; - brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 3 ] = 1.0; - - brw->state.dirty.mesa |= _NEW_PROGRAM; -} - - -static void meta_draw_region( struct intel_context *intel, - struct intel_region *draw_region, - struct intel_region *depth_region ) -{ - struct brw_context *brw = brw_context(&intel->ctx); - - if (!brw->metaops.saved_draw_region) { - brw->metaops.saved_draw_region = brw->state.draw_regions[0]; - brw->metaops.saved_nr_draw_regions = brw->state.nr_draw_regions; - brw->metaops.saved_depth_region = brw->state.depth_region; - } - - brw->state.draw_regions[0] = draw_region; - brw->state.nr_draw_regions = 1; - brw->state.depth_region = depth_region; - - if (intel->frame_buffer_texobj != NULL) - brw_FrameBufferTexDestroy(brw); - - if (draw_region) - brw_FrameBufferTexInit(brw, draw_region); - - brw->state.dirty.mesa |= _NEW_BUFFERS; -} - - -static void 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) -{ - GLcontext *ctx = &intel->ctx; - struct brw_context *brw = brw_context(&intel->ctx); - struct gl_client_array pos_array; - struct gl_client_array color_array; - struct gl_client_array *attribs[VERT_ATTRIB_MAX]; - struct _mesa_prim prim[1]; - GLfloat pos[4][3]; - - ctx->Driver.BufferData(ctx, - GL_ARRAY_BUFFER_ARB, - sizeof(pos) + sizeof(color), - NULL, - GL_DYNAMIC_DRAW_ARB, - brw->metaops.vbo); - - pos[0][0] = x0; - pos[0][1] = y0; - pos[0][2] = z; - - pos[1][0] = x1; - pos[1][1] = y0; - pos[1][2] = z; - - pos[2][0] = x1; - pos[2][1] = y1; - pos[2][2] = z; - - pos[3][0] = x0; - pos[3][1] = y1; - pos[3][2] = z; - - ctx->Driver.BufferSubData(ctx, - GL_ARRAY_BUFFER_ARB, - 0, - sizeof(pos), - pos, - brw->metaops.vbo); - - /* Convert incoming ARGB to required RGBA */ - /* Note this color is stored as GL_UNSIGNED_BYTE */ - color = (color & 0xff00ff00) | (((color >> 16) | (color << 16)) & 0xff00ff); - - ctx->Driver.BufferSubData(ctx, - GL_ARRAY_BUFFER_ARB, - sizeof(pos), - sizeof(color), - &color, - brw->metaops.vbo); - - /* Ignoring texture coords. - */ - - memset(attribs, 0, VERT_ATTRIB_MAX * sizeof(*attribs)); - - attribs[VERT_ATTRIB_POS] = &pos_array; - attribs[VERT_ATTRIB_POS]->Ptr = 0; - attribs[VERT_ATTRIB_POS]->Type = GL_FLOAT; - attribs[VERT_ATTRIB_POS]->Format = GL_RGBA; - attribs[VERT_ATTRIB_POS]->Enabled = 1; - attribs[VERT_ATTRIB_POS]->Size = 3; - attribs[VERT_ATTRIB_POS]->StrideB = 3 * sizeof(GLfloat); - attribs[VERT_ATTRIB_POS]->Stride = 3 * sizeof(GLfloat); - attribs[VERT_ATTRIB_POS]->_MaxElement = 4; - attribs[VERT_ATTRIB_POS]->Normalized = 0; - attribs[VERT_ATTRIB_POS]->BufferObj = brw->metaops.vbo; - - attribs[VERT_ATTRIB_COLOR0] = &color_array; - attribs[VERT_ATTRIB_COLOR0]->Ptr = (const GLubyte *)sizeof(pos); - attribs[VERT_ATTRIB_COLOR0]->Type = GL_UNSIGNED_BYTE; - attribs[VERT_ATTRIB_COLOR0]->Format = GL_RGBA; - attribs[VERT_ATTRIB_COLOR0]->Enabled = 1; - attribs[VERT_ATTRIB_COLOR0]->Size = 4; - attribs[VERT_ATTRIB_COLOR0]->StrideB = 0; - attribs[VERT_ATTRIB_COLOR0]->Stride = 0; - attribs[VERT_ATTRIB_COLOR0]->_MaxElement = 1; - attribs[VERT_ATTRIB_COLOR0]->Normalized = 1; - attribs[VERT_ATTRIB_COLOR0]->BufferObj = brw->metaops.vbo; - - /* Just ignoring texture coordinates for now. - */ - - memset(prim, 0, sizeof(*prim)); - - prim[0].mode = GL_TRIANGLE_FAN; - prim[0].begin = 1; - prim[0].end = 1; - prim[0].weak = 0; - prim[0].pad = 0; - prim[0].start = 0; - prim[0].count = 4; - - brw_draw_prims(&brw->intel.ctx, - (const struct gl_client_array **)attribs, - prim, 1, - NULL, - 0, - 3 ); -} - - -static void install_meta_state( struct intel_context *intel ) -{ - GLcontext *ctx = &intel->ctx; - struct brw_context *brw = brw_context(ctx); - GLuint i; - - if (!brw->metaops.vbo) { - init_metaops_state(brw); - } - - install_attribs(brw); - - meta_no_texture(&brw->intel); - meta_flat_shade(&brw->intel); - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - brw->metaops.restore_draw_buffers[i] - = ctx->DrawBuffer->_ColorDrawBufferIndexes[i]; - } - brw->metaops.restore_num_draw_buffers = ctx->DrawBuffer->_NumColorDrawBuffers; - - brw->metaops.restore_fp = ctx->FragmentProgram.Current; - - /* This works without adjusting refcounts. Fix later? - */ - brw->metaops.saved_draw_region = brw->state.draw_regions[0]; - brw->metaops.saved_nr_draw_regions = brw->state.nr_draw_regions; - brw->metaops.saved_depth_region = brw->state.depth_region; - brw->metaops.active = 1; - - brw->state.dirty.brw |= BRW_NEW_METAOPS; -} - -static void leave_meta_state( struct intel_context *intel ) -{ - GLcontext *ctx = &intel->ctx; - struct brw_context *brw = brw_context(ctx); - GLuint i; - - restore_attribs(brw); - - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - ctx->DrawBuffer->_ColorDrawBufferIndexes[i] - = brw->metaops.restore_draw_buffers[i]; - } - ctx->DrawBuffer->_NumColorDrawBuffers = brw->metaops.restore_num_draw_buffers; - - ctx->FragmentProgram.Current = brw->metaops.restore_fp; - - brw->state.draw_regions[0] = brw->metaops.saved_draw_region; - brw->state.nr_draw_regions = brw->metaops.saved_nr_draw_regions; - brw->state.depth_region = brw->metaops.saved_depth_region; - brw->metaops.saved_draw_region = NULL; - brw->metaops.saved_depth_region = NULL; - brw->metaops.active = 0; - - brw->state.dirty.mesa |= _NEW_BUFFERS; - brw->state.dirty.brw |= BRW_NEW_METAOPS; -} - - - -void brw_init_metaops( struct brw_context *brw ) -{ - init_attribs(brw); - - - brw->intel.vtbl.install_meta_state = install_meta_state; - brw->intel.vtbl.leave_meta_state = leave_meta_state; - brw->intel.vtbl.meta_no_depth_write = meta_no_depth_write; - brw->intel.vtbl.meta_no_stencil_write = meta_no_stencil_write; - brw->intel.vtbl.meta_stencil_replace = meta_stencil_replace; - brw->intel.vtbl.meta_depth_replace = meta_depth_replace; - brw->intel.vtbl.meta_color_mask = meta_color_mask; - brw->intel.vtbl.meta_no_texture = meta_no_texture; - brw->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state; - brw->intel.vtbl.meta_frame_buffer_texture = meta_frame_buffer_texture; - brw->intel.vtbl.meta_draw_region = meta_draw_region; - brw->intel.vtbl.meta_draw_quad = meta_draw_quad; - brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; -/* brw->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; */ -/* brw->intel.vtbl.meta_draw_format = set_draw_format; */ -} - -void brw_destroy_metaops( struct brw_context *brw ) -{ - GLcontext *ctx = &brw->intel.ctx; - - if (brw->metaops.vbo) - ctx->Driver.DeleteBuffer( ctx, brw->metaops.vbo ); - -/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp ); */ -/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp_tex ); */ -/* ctx->Driver.DeleteProgram( ctx, brw->metaops.vp ); */ -} diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 627705fa9b..f74ecf53a7 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -154,10 +154,7 @@ static void upload_pipelined_state_pointers(struct brw_context *brw ) OUT_RELOC(brw->gs.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); else OUT_BATCH(0); - if (!brw->metaops.active) - OUT_RELOC(brw->clip.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); - else - OUT_BATCH(0); + OUT_RELOC(brw->clip.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_RELOC(brw->wm.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_RELOC(brw->cc.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); @@ -186,7 +183,7 @@ static void upload_psp_urb_cbs(struct brw_context *brw ) const struct brw_tracked_state brw_psp_urb_cbs = { .dirty = { .mesa = 0, - .brw = BRW_NEW_URB_FENCE | BRW_NEW_METAOPS | BRW_NEW_BATCH, + .brw = BRW_NEW_URB_FENCE | BRW_NEW_BATCH, .cache = (CACHE_NEW_VS_UNIT | CACHE_NEW_GS_UNIT | CACHE_NEW_GS_PROG | diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 8fe7b22afb..d9b0479e02 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -56,25 +56,16 @@ static void upload_sf_vp(struct brw_context *brw) y_bias = ctx->DrawBuffer->Height; } - /* _NEW_VIEWPORT, BRW_NEW_METAOPS */ - - if (!brw->metaops.active) { - const GLfloat *v = ctx->Viewport._WindowMap.m; - - sfv.viewport.m00 = v[MAT_SX]; - sfv.viewport.m11 = v[MAT_SY] * y_scale; - sfv.viewport.m22 = v[MAT_SZ] * depth_scale; - sfv.viewport.m30 = v[MAT_TX]; - sfv.viewport.m31 = v[MAT_TY] * y_scale + y_bias; - sfv.viewport.m32 = v[MAT_TZ] * depth_scale; - } else { - sfv.viewport.m00 = 1; - sfv.viewport.m11 = - 1; - sfv.viewport.m22 = 1; - sfv.viewport.m30 = 0; - sfv.viewport.m31 = ctx->DrawBuffer->Height; - sfv.viewport.m32 = 0; - } + /* _NEW_VIEWPORT */ + + const GLfloat *v = ctx->Viewport._WindowMap.m; + + sfv.viewport.m00 = v[MAT_SX]; + sfv.viewport.m11 = v[MAT_SY] * y_scale; + sfv.viewport.m22 = v[MAT_SZ] * depth_scale; + sfv.viewport.m30 = v[MAT_TX]; + sfv.viewport.m31 = v[MAT_TY] * y_scale + y_bias; + sfv.viewport.m32 = v[MAT_TZ] * depth_scale; /* _NEW_SCISSOR */ @@ -108,7 +99,7 @@ const struct brw_tracked_state brw_sf_vp = { .dirty = { .mesa = (_NEW_VIEWPORT | _NEW_SCISSOR), - .brw = BRW_NEW_METAOPS, + .brw = 0, .cache = 0 }, .prepare = upload_sf_vp @@ -309,8 +300,7 @@ const struct brw_tracked_state brw_sf_unit = { _NEW_LINE | _NEW_POINT | _NEW_SCISSOR), - .brw = (BRW_NEW_URB_FENCE | - BRW_NEW_METAOPS), + .brw = BRW_NEW_URB_FENCE, .cache = (CACHE_NEW_SF_VP | CACHE_NEW_SF_PROG) }, diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 4845859b3e..e4b9731be5 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -233,7 +233,6 @@ static struct dirty_bit_map brw_bits[] = { DEFINE_BIT(BRW_NEW_WM_INPUT_DIMENSIONS), DEFINE_BIT(BRW_NEW_INPUT_VARYING), DEFINE_BIT(BRW_NEW_PSP), - DEFINE_BIT(BRW_NEW_METAOPS), DEFINE_BIT(BRW_NEW_FENCE), DEFINE_BIT(BRW_NEW_INDICES), DEFINE_BIT(BRW_NEW_VERTICES), diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 1db7ceebcf..8beb449bd5 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -101,11 +101,6 @@ static void brw_upload_vs_prog(struct brw_context *brw) key.copy_edgeflag = (brw->attribs.Polygon->FrontMode != GL_FILL || brw->attribs.Polygon->BackMode != GL_FILL); - /* BRW_NEW_METAOPS - */ - if (brw->metaops.active) - key.know_w_is_one = 1; - /* Make an early check for the key. */ dri_bo_unreference(brw->vs.prog_bo); @@ -123,7 +118,7 @@ static void brw_upload_vs_prog(struct brw_context *brw) const struct brw_tracked_state brw_vs_prog = { .dirty = { .mesa = _NEW_TRANSFORM | _NEW_POLYGON, - .brw = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_METAOPS, + .brw = BRW_NEW_VERTEX_PROGRAM, .cache = 0 }, .prepare = brw_upload_vs_prog diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h index 22388ec99d..99d0e93722 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.h +++ b/src/mesa/drivers/dri/i965/brw_vs.h @@ -43,7 +43,6 @@ struct brw_vs_prog_key { GLuint program_string_id; GLuint nr_userclip:4; GLuint copy_edgeflag:1; - GLuint know_w_is_one:1; GLuint pad:26; }; diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 174331a765..24b7dc30fe 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -871,21 +871,15 @@ static void emit_vertex_write( struct brw_vs_compile *c) } /* Build ndc coords */ - if (!c->key.know_w_is_one) { - ndc = get_tmp(c); - emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); - brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); - } - else { - ndc = pos; - } + ndc = get_tmp(c); + emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); + brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); /* Update the header for point size, user clipping flags, and -ve rhw * workaround. */ if ((c->prog_data.outputs_written & (1<key.nr_userclip || - (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one)) + c->key.nr_userclip || !BRW_IS_G4X(p->brw)) { struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD); GLuint i; @@ -916,7 +910,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) * Later, clipping will detect ucp[6] and ensure the primitive is * clipped against all fixed planes. */ - if (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one) { + if (!BRW_IS_G4X(p->brw)) { brw_CMP(p, vec8(brw_null_reg()), BRW_CONDITIONAL_L, diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index b4be144558..b501a59ccd 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -64,7 +64,6 @@ static void brw_destroy_context( struct intel_context *intel ) struct brw_context *brw = brw_context(&intel->ctx); int i; - brw_destroy_metaops(brw); brw_destroy_state(brw); brw_draw_destroy( brw ); diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 5e1d91a4c4..f95d055e62 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -65,7 +65,7 @@ void intel_clear_tris(GLcontext *ctx, GLbitfield mask) { struct intel_context *intel = intel_context(ctx); - GLfloat vertices[4][4]; + GLfloat vertices[4][3]; GLfloat color[4][4]; GLfloat dst_z; struct gl_framebuffer *fb = ctx->DrawBuffer; @@ -147,22 +147,18 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) vertices[0][0] = fb->_Xmin; vertices[0][1] = fb->_Ymin; vertices[0][2] = dst_z; - vertices[0][3] = 1.0; vertices[1][0] = fb->_Xmax; vertices[1][1] = fb->_Ymin; vertices[1][2] = dst_z; - vertices[1][3] = 1.0; vertices[2][0] = fb->_Xmax; vertices[2][1] = fb->_Ymax; vertices[2][2] = dst_z; - vertices[2][3] = 1.0; vertices[3][0] = fb->_Xmin; vertices[3][1] = fb->_Ymax; vertices[3][2] = dst_z; - vertices[3][3] = 1.0; _mesa_ColorPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &color); - _mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices); + _mesa_VertexPointer(3, GL_FLOAT, 3 * sizeof(GLfloat), &vertices); _mesa_Enable(GL_COLOR_ARRAY); _mesa_Enable(GL_VERTEX_ARRAY); -- cgit v1.2.3 From 052c1d66a1ab1f2665870dc77dab28d20416cdf1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Jan 2009 14:32:23 -0800 Subject: i965: Remove brw->attribs now that we can just always look in the GLcontext. --- src/mesa/drivers/dri/i965/brw_cc.c | 68 ++++++++++++------------ src/mesa/drivers/dri/i965/brw_clip.c | 40 +++++++------- src/mesa/drivers/dri/i965/brw_context.c | 25 --------- src/mesa/drivers/dri/i965/brw_context.h | 21 -------- src/mesa/drivers/dri/i965/brw_curbe.c | 15 +++--- src/mesa/drivers/dri/i965/brw_draw.c | 21 ++++---- src/mesa/drivers/dri/i965/brw_fallback.c | 4 +- src/mesa/drivers/dri/i965/brw_misc_state.c | 19 ++++--- src/mesa/drivers/dri/i965/brw_sf.c | 14 ++--- src/mesa/drivers/dri/i965/brw_sf_state.c | 19 +++---- src/mesa/drivers/dri/i965/brw_state_upload.c | 9 ++-- src/mesa/drivers/dri/i965/brw_tex.c | 3 +- src/mesa/drivers/dri/i965/brw_vs.c | 7 +-- src/mesa/drivers/dri/i965/brw_vs_constval.c | 3 +- src/mesa/drivers/dri/i965/brw_vs_state.c | 4 +- src/mesa/drivers/dri/i965/brw_wm.c | 35 ++++++------ src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 8 +-- src/mesa/drivers/dri/i965/brw_wm_state.c | 13 ++--- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 11 ++-- 19 files changed, 157 insertions(+), 182 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index abae4b3215..82370162f5 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -83,60 +83,60 @@ struct brw_cc_unit_key { static void cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) { - struct gl_stencil_attrib *stencil = brw->attribs.Stencil; - const unsigned back = stencil->_BackFace; + GLcontext *ctx = &brw->intel.ctx; + const unsigned back = ctx->Stencil._BackFace; memset(key, 0, sizeof(*key)); - key->stencil = stencil->Enabled; - key->stencil_two_side = stencil->_TestTwoSide; + key->stencil = ctx->Stencil.Enabled; + key->stencil_two_side = ctx->Stencil._TestTwoSide; if (key->stencil) { - key->stencil_func[0] = stencil->Function[0]; - key->stencil_fail_op[0] = stencil->FailFunc[0]; - key->stencil_pass_depth_fail_op[0] = stencil->ZFailFunc[0]; - key->stencil_pass_depth_pass_op[0] = stencil->ZPassFunc[0]; - key->stencil_ref[0] = stencil->Ref[0]; - key->stencil_write_mask[0] = stencil->WriteMask[0]; - key->stencil_test_mask[0] = stencil->ValueMask[0]; + key->stencil_func[0] = ctx->Stencil.Function[0]; + key->stencil_fail_op[0] = ctx->Stencil.FailFunc[0]; + key->stencil_pass_depth_fail_op[0] = ctx->Stencil.ZFailFunc[0]; + key->stencil_pass_depth_pass_op[0] = ctx->Stencil.ZPassFunc[0]; + key->stencil_ref[0] = ctx->Stencil.Ref[0]; + key->stencil_write_mask[0] = ctx->Stencil.WriteMask[0]; + key->stencil_test_mask[0] = ctx->Stencil.ValueMask[0]; } if (key->stencil_two_side) { - key->stencil_func[1] = stencil->Function[back]; - key->stencil_fail_op[1] = stencil->FailFunc[back]; - key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[back]; - key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[back]; - key->stencil_ref[1] = stencil->Ref[back]; - key->stencil_write_mask[1] = stencil->WriteMask[back]; - key->stencil_test_mask[1] = stencil->ValueMask[back]; + key->stencil_func[1] = ctx->Stencil.Function[back]; + key->stencil_fail_op[1] = ctx->Stencil.FailFunc[back]; + key->stencil_pass_depth_fail_op[1] = ctx->Stencil.ZFailFunc[back]; + key->stencil_pass_depth_pass_op[1] = ctx->Stencil.ZPassFunc[back]; + key->stencil_ref[1] = ctx->Stencil.Ref[back]; + key->stencil_write_mask[1] = ctx->Stencil.WriteMask[back]; + key->stencil_test_mask[1] = ctx->Stencil.ValueMask[back]; } - if (brw->attribs.Color->_LogicOpEnabled) - key->logic_op = brw->attribs.Color->LogicOp; + if (ctx->Color._LogicOpEnabled) + key->logic_op = ctx->Color.LogicOp; else key->logic_op = GL_COPY; - key->color_blend = brw->attribs.Color->BlendEnabled; + key->color_blend = ctx->Color.BlendEnabled; if (key->color_blend) { - key->blend_eq_rgb = brw->attribs.Color->BlendEquationRGB; - key->blend_eq_a = brw->attribs.Color->BlendEquationA; - key->blend_src_rgb = brw->attribs.Color->BlendSrcRGB; - key->blend_dst_rgb = brw->attribs.Color->BlendDstRGB; - key->blend_src_a = brw->attribs.Color->BlendSrcA; - key->blend_dst_a = brw->attribs.Color->BlendDstA; + key->blend_eq_rgb = ctx->Color.BlendEquationRGB; + key->blend_eq_a = ctx->Color.BlendEquationA; + key->blend_src_rgb = ctx->Color.BlendSrcRGB; + key->blend_dst_rgb = ctx->Color.BlendDstRGB; + key->blend_src_a = ctx->Color.BlendSrcA; + key->blend_dst_a = ctx->Color.BlendDstA; } - key->alpha_enabled = brw->attribs.Color->AlphaEnabled; + key->alpha_enabled = ctx->Color.AlphaEnabled; if (key->alpha_enabled) { - key->alpha_func = brw->attribs.Color->AlphaFunc; - key->alpha_ref = brw->attribs.Color->AlphaRef; + key->alpha_func = ctx->Color.AlphaFunc; + key->alpha_ref = ctx->Color.AlphaRef; } - key->dither = brw->attribs.Color->DitherFlag; + key->dither = ctx->Color.DitherFlag; - key->depth_test = brw->attribs.Depth->Test; + key->depth_test = ctx->Depth.Test; if (key->depth_test) { - key->depth_func = brw->attribs.Depth->Func; - key->depth_write = brw->attribs.Depth->Mask; + key->depth_func = ctx->Depth.Func; + key->depth_write = ctx->Depth.Mask; } } diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 38d8b704d7..5cffcebde4 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -145,14 +145,14 @@ static void upload_clip_prog(struct brw_context *brw) /* CACHE_NEW_VS_PROG */ key.attrs = brw->vs.prog_data->outputs_written; /* _NEW_LIGHT */ - key.do_flat_shading = (brw->attribs.Light->ShadeModel == GL_FLAT); + key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT); /* _NEW_TRANSFORM */ - key.nr_userclip = brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled); + key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled); key.clip_mode = BRW_CLIPMODE_NORMAL; /* _NEW_POLYGON */ if (key.primitive == GL_TRIANGLES) { - if (brw->attribs.Polygon->CullFaceMode == GL_FRONT_AND_BACK) + if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) key.clip_mode = BRW_CLIPMODE_REJECT_ALL; else { GLuint fill_front = CLIP_CULL; @@ -160,44 +160,44 @@ static void upload_clip_prog(struct brw_context *brw) GLuint offset_front = 0; GLuint offset_back = 0; - if (!brw->attribs.Polygon->CullFlag || - brw->attribs.Polygon->CullFaceMode != GL_FRONT) { - switch (brw->attribs.Polygon->FrontMode) { + if (!ctx->Polygon.CullFlag || + ctx->Polygon.CullFaceMode != GL_FRONT) { + switch (ctx->Polygon.FrontMode) { case GL_FILL: fill_front = CLIP_FILL; offset_front = 0; break; case GL_LINE: fill_front = CLIP_LINE; - offset_front = brw->attribs.Polygon->OffsetLine; + offset_front = ctx->Polygon.OffsetLine; break; case GL_POINT: fill_front = CLIP_POINT; - offset_front = brw->attribs.Polygon->OffsetPoint; + offset_front = ctx->Polygon.OffsetPoint; break; } } - if (!brw->attribs.Polygon->CullFlag || - brw->attribs.Polygon->CullFaceMode != GL_BACK) { - switch (brw->attribs.Polygon->BackMode) { + if (!ctx->Polygon.CullFlag || + ctx->Polygon.CullFaceMode != GL_BACK) { + switch (ctx->Polygon.BackMode) { case GL_FILL: fill_back = CLIP_FILL; offset_back = 0; break; case GL_LINE: fill_back = CLIP_LINE; - offset_back = brw->attribs.Polygon->OffsetLine; + offset_back = ctx->Polygon.OffsetLine; break; case GL_POINT: fill_back = CLIP_POINT; - offset_back = brw->attribs.Polygon->OffsetPoint; + offset_back = ctx->Polygon.OffsetPoint; break; } } - if (brw->attribs.Polygon->BackMode != GL_FILL || - brw->attribs.Polygon->FrontMode != GL_FILL) { + if (ctx->Polygon.BackMode != GL_FILL || + ctx->Polygon.FrontMode != GL_FILL) { key.do_unfilled = 1; /* Most cases the fixed function units will handle. Cases where @@ -207,17 +207,17 @@ static void upload_clip_prog(struct brw_context *brw) if (offset_back || offset_front) { /* _NEW_POLYGON, _NEW_BUFFERS */ - key.offset_units = brw->attribs.Polygon->OffsetUnits * brw->intel.polygon_offset_scale; - key.offset_factor = brw->attribs.Polygon->OffsetFactor * ctx->DrawBuffer->_MRD; + key.offset_units = ctx->Polygon.OffsetUnits * brw->intel.polygon_offset_scale; + key.offset_factor = ctx->Polygon.OffsetFactor * ctx->DrawBuffer->_MRD; } - switch (brw->attribs.Polygon->FrontFace) { + switch (ctx->Polygon.FrontFace) { case GL_CCW: key.fill_ccw = fill_front; key.fill_cw = fill_back; key.offset_ccw = offset_front; key.offset_cw = offset_back; - if (brw->attribs.Light->Model.TwoSide && + if (ctx->Light.Model.TwoSide && key.fill_cw != CLIP_CULL) key.copy_bfc_cw = 1; break; @@ -226,7 +226,7 @@ static void upload_clip_prog(struct brw_context *brw) key.fill_ccw = fill_back; key.offset_cw = offset_front; key.offset_ccw = offset_back; - if (brw->attribs.Light->Model.TwoSide && + if (ctx->Light.Model.TwoSide && key.fill_ccw != CLIP_CULL) key.copy_bfc_ccw = 1; break; diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index e33cbb9ce0..eaac6224f6 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -76,30 +76,6 @@ static void brwInitDriverFunctions( struct dd_function_table *functions ) functions->Viewport = intel_viewport; } - -static void brw_init_attribs( struct brw_context *brw ) -{ - GLcontext *ctx = &brw->intel.ctx; - - brw->attribs.Color = &ctx->Color; - brw->attribs.Depth = &ctx->Depth; - brw->attribs.Fog = &ctx->Fog; - brw->attribs.Hint = &ctx->Hint; - brw->attribs.Light = &ctx->Light; - brw->attribs.Line = &ctx->Line; - brw->attribs.Point = &ctx->Point; - brw->attribs.Polygon = &ctx->Polygon; - brw->attribs.Scissor = &ctx->Scissor; - brw->attribs.Stencil = &ctx->Stencil; - brw->attribs.Texture = &ctx->Texture; - brw->attribs.Transform = &ctx->Transform; - brw->attribs.Viewport = &ctx->Viewport; - brw->attribs.VertexProgram = &ctx->VertexProgram; - brw->attribs.FragmentProgram = &ctx->FragmentProgram; - brw->attribs.PolygonStipple = &ctx->PolygonStipple[0]; -} - - GLboolean brwCreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate) @@ -147,7 +123,6 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, /* ctx->Const.MaxNativeVertexProgramTemps = 32; */ - brw_init_attribs( brw ); brw_init_state( brw ); brw->state.dirty.mesa = ~0; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index fc0fda98cd..df90c2027f 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -302,26 +302,6 @@ struct brw_cache { }; - -struct brw_state_pointers { - struct gl_colorbuffer_attrib *Color; - struct gl_depthbuffer_attrib *Depth; - struct gl_fog_attrib *Fog; - struct gl_hint_attrib *Hint; - struct gl_light_attrib *Light; - struct gl_line_attrib *Line; - struct gl_point_attrib *Point; - struct gl_polygon_attrib *Polygon; - GLuint *PolygonStipple; - struct gl_scissor_attrib *Scissor; - struct gl_stencil_attrib *Stencil; - struct gl_texture_attrib *Texture; - struct gl_transform_attrib *Transform; - struct gl_viewport_attrib *Viewport; - struct gl_vertex_program_state *VertexProgram; - struct gl_fragment_program_state *FragmentProgram; -}; - /* Considered adding a member to this struct to document which flags * an update might raise so that ordering of the state atoms can be * checked or derived at runtime. Dropped the idea in favor of having @@ -456,7 +436,6 @@ struct brw_context int validated_bo_count; } state; - struct brw_state_pointers attribs; struct brw_cache cache; struct brw_cached_batch_item *cached_batch_items; diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index fbf473abf6..4eaaa5f871 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -48,6 +48,7 @@ */ static void calculate_curbe_offsets( struct brw_context *brw ) { + GLcontext *ctx = &brw->intel.ctx; /* CACHE_NEW_WM_PROG */ GLuint nr_fp_regs = (brw->wm.prog_data->nr_params + 15) / 16; @@ -58,8 +59,8 @@ static void calculate_curbe_offsets( struct brw_context *brw ) GLuint total_regs; /* _NEW_TRANSFORM */ - if (brw->attribs.Transform->ClipPlanesEnabled) { - GLuint nr_planes = 6 + brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled); + if (ctx->Transform.ClipPlanesEnabled) { + GLuint nr_planes = 6 + brw_count_bits(ctx->Transform.ClipPlanesEnabled); nr_clip_regs = (nr_planes * 4 + 15) / 16; } @@ -233,11 +234,11 @@ static void prepare_constant_buffer(struct brw_context *brw) */ assert(MAX_CLIP_PLANES == 6); for (j = 0; j < MAX_CLIP_PLANES; j++) { - if (brw->attribs.Transform->ClipPlanesEnabled & (1<attribs.Transform->_ClipUserPlane[j][0]; - buf[offset + i * 4 + 1] = brw->attribs.Transform->_ClipUserPlane[j][1]; - buf[offset + i * 4 + 2] = brw->attribs.Transform->_ClipUserPlane[j][2]; - buf[offset + i * 4 + 3] = brw->attribs.Transform->_ClipUserPlane[j][3]; + if (ctx->Transform.ClipPlanesEnabled & (1<Transform._ClipUserPlane[j][0]; + buf[offset + i * 4 + 1] = ctx->Transform._ClipUserPlane[j][1]; + buf[offset + i * 4 + 2] = ctx->Transform._ClipUserPlane[j][2]; + buf[offset + i * 4 + 3] = ctx->Transform._ClipUserPlane[j][3]; i++; } } diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 6a4be83dfb..99fd587e9f 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -84,15 +84,17 @@ static const GLenum reduced_prim[GL_POLYGON+1] = { */ static GLuint brw_set_prim(struct brw_context *brw, GLenum prim) { + GLcontext *ctx = &brw->intel.ctx; + if (INTEL_DEBUG & DEBUG_PRIMS) _mesa_printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim)); /* Slight optimization to avoid the GS program when not needed: */ if (prim == GL_QUAD_STRIP && - brw->attribs.Light->ShadeModel != GL_FLAT && - brw->attribs.Polygon->FrontMode == GL_FILL && - brw->attribs.Polygon->BackMode == GL_FILL) + ctx->Light.ShadeModel != GL_FLAT && + ctx->Polygon.FrontMode == GL_FILL && + ctx->Polygon.BackMode == GL_FILL) prim = GL_TRIANGLE_STRIP; if (prim != brw->primitive) { @@ -189,12 +191,13 @@ static GLboolean check_fallbacks( struct brw_context *brw, const struct _mesa_prim *prim, GLuint nr_prims ) { + GLcontext *ctx = &brw->intel.ctx; GLuint i; if (!brw->intel.strict_conformance) return GL_FALSE; - if (brw->attribs.Polygon->SmoothFlag) { + if (ctx->Polygon.SmoothFlag) { for (i = 0; i < nr_prims; i++) if (reduced_prim[prim[i].mode] == GL_TRIANGLES) return GL_TRUE; @@ -203,7 +206,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, /* BRW hardware will do AA lines, but they are non-conformant it * seems. TBD whether we keep this fallback: */ - if (brw->attribs.Line->SmoothFlag) { + if (ctx->Line.SmoothFlag) { for (i = 0; i < nr_prims; i++) if (reduced_prim[prim[i].mode] == GL_LINES) return GL_TRUE; @@ -212,7 +215,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, /* Stipple -- these fallbacks could be resolved with a little * bit of work? */ - if (brw->attribs.Line->StippleFlag) { + if (ctx->Line.StippleFlag) { for (i = 0; i < nr_prims; i++) { /* GS doesn't get enough information to know when to reset * the stipple counter?!? @@ -221,14 +224,14 @@ static GLboolean check_fallbacks( struct brw_context *brw, return GL_TRUE; if (prim[i].mode == GL_POLYGON && - (brw->attribs.Polygon->FrontMode == GL_LINE || - brw->attribs.Polygon->BackMode == GL_LINE)) + (ctx->Polygon.FrontMode == GL_LINE || + ctx->Polygon.BackMode == GL_LINE)) return GL_TRUE; } } - if (brw->attribs.Point->SmoothFlag) { + if (ctx->Point.SmoothFlag) { for (i = 0; i < nr_prims; i++) if (prim[i].mode == GL_POINTS) return GL_TRUE; diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index e1ff169f12..e63098fdd4 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -62,7 +62,7 @@ static GLboolean do_check_fallback(struct brw_context *brw) /* _NEW_TEXTURE: */ for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { - struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i]; + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; if (texUnit->_ReallyEnabled) { struct intel_texture_object *intelObj = intel_texture_object(texUnit->_Current); struct gl_texture_image *texImage = intelObj->base.Image[0][intelObj->firstLevel]; @@ -75,7 +75,7 @@ static GLboolean do_check_fallback(struct brw_context *brw) /* _NEW_STENCIL */ - if (brw->attribs.Stencil->Enabled && + if (ctx->Stencil.Enabled && !brw->intel.hw_stencil) { DBG("FALLBACK: stencil\n"); return GL_TRUE; diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index f74ecf53a7..9dcdad7b4e 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -48,15 +48,16 @@ static void upload_blend_constant_color(struct brw_context *brw) { + GLcontext *ctx = &brw->intel.ctx; struct brw_blend_constant_color bcc; memset(&bcc, 0, sizeof(bcc)); bcc.header.opcode = CMD_BLEND_CONSTANT_COLOR; bcc.header.length = sizeof(bcc)/4-2; - bcc.blend_constant_color[0] = brw->attribs.Color->BlendColor[0]; - bcc.blend_constant_color[1] = brw->attribs.Color->BlendColor[1]; - bcc.blend_constant_color[2] = brw->attribs.Color->BlendColor[2]; - bcc.blend_constant_color[3] = brw->attribs.Color->BlendColor[3]; + bcc.blend_constant_color[0] = ctx->Color.BlendColor[0]; + bcc.blend_constant_color[1] = ctx->Color.BlendColor[1]; + bcc.blend_constant_color[2] = ctx->Color.BlendColor[2]; + bcc.blend_constant_color[3] = ctx->Color.BlendColor[3]; BRW_CACHED_BATCH_STRUCT(brw, &bcc); } @@ -281,6 +282,7 @@ const struct brw_tracked_state brw_depthbuffer = { static void upload_polygon_stipple(struct brw_context *brw) { + GLcontext *ctx = &brw->intel.ctx; struct brw_polygon_stipple bps; GLuint i; @@ -289,7 +291,7 @@ static void upload_polygon_stipple(struct brw_context *brw) bps.header.length = sizeof(bps)/4-2; for (i = 0; i < 32; i++) - bps.stipple[i] = brw->attribs.PolygonStipple[31 - i]; /* invert */ + bps.stipple[i] = ctx->PolygonStipple[31 - i]; /* invert */ BRW_CACHED_BATCH_STRUCT(brw, &bps); } @@ -367,6 +369,7 @@ const struct brw_tracked_state brw_aa_line_parameters = { static void upload_line_stipple(struct brw_context *brw) { + GLcontext *ctx = &brw->intel.ctx; struct brw_line_stipple bls; GLfloat tmp; GLint tmpi; @@ -375,10 +378,10 @@ static void upload_line_stipple(struct brw_context *brw) bls.header.opcode = CMD_LINE_STIPPLE_PATTERN; bls.header.length = sizeof(bls)/4 - 2; - bls.bits0.pattern = brw->attribs.Line->StipplePattern; - bls.bits1.repeat_count = brw->attribs.Line->StippleFactor; + bls.bits0.pattern = ctx->Line.StipplePattern; + bls.bits1.repeat_count = ctx->Line.StippleFactor; - tmp = 1.0 / (GLfloat) brw->attribs.Line->StippleFactor; + tmp = 1.0 / (GLfloat) ctx->Line.StippleFactor; tmpi = tmp * (1<<13); diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index 1a11d54621..8c1711538a 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -46,6 +46,7 @@ static void compile_sf_prog( struct brw_context *brw, struct brw_sf_prog_key *key ) { + GLcontext *ctx = &brw->intel.ctx; struct brw_sf_compile c; const GLuint *program; GLuint program_size; @@ -74,7 +75,7 @@ static void compile_sf_prog( struct brw_context *brw, c.idx_to_attr[idx] = i; if (i >= VERT_RESULT_TEX0 && i <= VERT_RESULT_TEX7) { c.point_attrs[i].CoordReplace = - brw->attribs.Point->CoordReplace[i - VERT_RESULT_TEX0]; + ctx->Point.CoordReplace[i - VERT_RESULT_TEX0]; } else { c.point_attrs[i].CoordReplace = GL_FALSE; @@ -128,6 +129,7 @@ static void compile_sf_prog( struct brw_context *brw, */ static void upload_sf_prog(struct brw_context *brw) { + GLcontext *ctx = &brw->intel.ctx; struct brw_sf_prog_key key; memset(&key, 0, sizeof(key)); @@ -158,15 +160,15 @@ static void upload_sf_prog(struct brw_context *brw) break; } - key.do_point_sprite = brw->attribs.Point->PointSprite; - key.SpriteOrigin = brw->attribs.Point->SpriteOrigin; + key.do_point_sprite = ctx->Point.PointSprite; + key.SpriteOrigin = ctx->Point.SpriteOrigin; /* _NEW_LIGHT */ - key.do_flat_shading = (brw->attribs.Light->ShadeModel == GL_FLAT); - key.do_twoside_color = (brw->attribs.Light->Enabled && brw->attribs.Light->Model.TwoSide); + key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT); + key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide); /* _NEW_POLYGON */ if (key.do_twoside_color) - key.frontface_ccw = (brw->attribs.Polygon->FrontFace == GL_CCW); + key.frontface_ccw = (ctx->Polygon.FrontFace == GL_CCW); dri_bo_unreference(brw->sf.prog_bo); brw->sf.prog_bo = brw_search_cache(&brw->cache, BRW_SF_PROG, diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index d9b0479e02..e96d5354b3 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -124,6 +124,7 @@ struct brw_sf_unit_key { static void sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key) { + GLcontext *ctx = &brw->intel.ctx; memset(key, 0, sizeof(*key)); /* CACHE_NEW_SF_PROG */ @@ -135,20 +136,20 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key) key->urb_size = brw->urb.vsize; key->sfsize = brw->urb.sfsize; - key->scissor = brw->attribs.Scissor->Enabled; - key->front_face = brw->attribs.Polygon->FrontFace; + key->scissor = ctx->Scissor.Enabled; + key->front_face = ctx->Polygon.FrontFace; - if (brw->attribs.Polygon->CullFlag) - key->cull_face = brw->attribs.Polygon->CullFaceMode; + if (ctx->Polygon.CullFlag) + key->cull_face = ctx->Polygon.CullFaceMode; else key->cull_face = GL_NONE; - key->line_width = brw->attribs.Line->Width; - key->line_smooth = brw->attribs.Line->SmoothFlag; + key->line_width = ctx->Line.Width; + key->line_smooth = ctx->Line.SmoothFlag; - key->point_sprite = brw->attribs.Point->PointSprite; - key->point_size = brw->attribs.Point->Size; - key->point_attenuated = brw->attribs.Point->_Attenuated; + key->point_sprite = ctx->Point.PointSprite; + key->point_size = ctx->Point.Size; + key->point_attenuated = ctx->Point._Attenuated; key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; } diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index e4b9731be5..5de1450e61 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -297,6 +297,7 @@ brw_print_dirty_count(struct dirty_bit_map *bit_map, int32_t bits) */ void brw_validate_state( struct brw_context *brw ) { + GLcontext *ctx = &brw->intel.ctx; struct intel_context *intel = &brw->intel; struct brw_state_flags *state = &brw->state.dirty; GLuint i; @@ -313,13 +314,13 @@ void brw_validate_state( struct brw_context *brw ) state->brw |= ~0; } - if (brw->fragment_program != brw->attribs.FragmentProgram->_Current) { - brw->fragment_program = brw->attribs.FragmentProgram->_Current; + if (brw->fragment_program != ctx->FragmentProgram._Current) { + brw->fragment_program = ctx->FragmentProgram._Current; brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM; } - if (brw->vertex_program != brw->attribs.VertexProgram->_Current) { - brw->vertex_program = brw->attribs.VertexProgram->_Current; + if (brw->vertex_program != ctx->VertexProgram._Current) { + brw->vertex_program = ctx->VertexProgram._Current; brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM; } diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index 0bb6f176a0..ef99e9c1ae 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -86,11 +86,12 @@ void brw_FrameBufferTexDestroy( struct brw_context *brw ) */ void brw_validate_textures( struct brw_context *brw ) { + GLcontext *ctx = &brw->intel.ctx; struct intel_context *intel = &brw->intel; int i; for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { - struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i]; + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; if (texUnit->_ReallyEnabled) { intel_finalize_mipmap_tree(intel, i); diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 8beb449bd5..e3111c6680 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -85,6 +85,7 @@ static void do_vs_prog( struct brw_context *brw, static void brw_upload_vs_prog(struct brw_context *brw) { + GLcontext *ctx = &brw->intel.ctx; struct brw_vs_prog_key key; struct brw_vertex_program *vp = (struct brw_vertex_program *)brw->vertex_program; @@ -97,9 +98,9 @@ static void brw_upload_vs_prog(struct brw_context *brw) * the inputs it asks for, whether they are varying or not. */ key.program_string_id = vp->id; - key.nr_userclip = brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled); - key.copy_edgeflag = (brw->attribs.Polygon->FrontMode != GL_FILL || - brw->attribs.Polygon->BackMode != GL_FILL); + key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled); + key.copy_edgeflag = (ctx->Polygon.FrontMode != GL_FILL || + ctx->Polygon.BackMode != GL_FILL); /* Make an early check for the key. */ diff --git a/src/mesa/drivers/dri/i965/brw_vs_constval.c b/src/mesa/drivers/dri/i965/brw_vs_constval.c index 6fbac02de6..9977677fd7 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_constval.c +++ b/src/mesa/drivers/dri/i965/brw_vs_constval.c @@ -168,6 +168,7 @@ static GLuint get_input_size(struct brw_context *brw, */ static void calc_wm_input_sizes( struct brw_context *brw ) { + GLcontext *ctx = &brw->intel.ctx; /* BRW_NEW_VERTEX_PROGRAM */ struct brw_vertex_program *vp = (struct brw_vertex_program *)brw->vertex_program; @@ -179,7 +180,7 @@ static void calc_wm_input_sizes( struct brw_context *brw ) memset(&t, 0, sizeof(t)); /* _NEW_LIGHT */ - if (brw->attribs.Light->Model.TwoSide) + if (ctx->Light.Model.TwoSide) t.twoside = 1; for (i = 0; i < VERT_ATTRIB_MAX; i++) diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c index 942581696d..1a63766ea1 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_state.c @@ -49,6 +49,8 @@ struct brw_vs_unit_key { static void vs_unit_populate_key(struct brw_context *brw, struct brw_vs_unit_key *key) { + GLcontext *ctx = &brw->intel.ctx; + memset(key, 0, sizeof(*key)); /* CACHE_NEW_VS_PROG */ @@ -61,7 +63,7 @@ vs_unit_populate_key(struct brw_context *brw, struct brw_vs_unit_key *key) key->urb_size = brw->urb.vsize; /* BRW_NEW_CURBE_OFFSETS, _NEW_TRANSFORM */ - if (brw->attribs.Transform->ClipPlanesEnabled) { + if (ctx->Transform.ClipPlanesEnabled) { /* Note that we read in the userclip planes as well, hence * clip_start: */ diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 3ee0ead993..ea708a0681 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -157,6 +157,7 @@ static void do_wm_prog( struct brw_context *brw, static void brw_wm_populate_key( struct brw_context *brw, struct brw_wm_prog_key *key ) { + GLcontext *ctx = &brw->intel.ctx; /* BRW_NEW_FRAGMENT_PROGRAM */ struct brw_fragment_program *fp = (struct brw_fragment_program *)brw->fragment_program; @@ -170,50 +171,50 @@ static void brw_wm_populate_key( struct brw_context *brw, */ /* _NEW_COLOR */ if (fp->program.UsesKill || - brw->attribs.Color->AlphaEnabled) + ctx->Color.AlphaEnabled) lookup |= IZ_PS_KILL_ALPHATEST_BIT; if (fp->program.Base.OutputsWritten & (1<attribs.Depth->Test) + if (ctx->Depth.Test) lookup |= IZ_DEPTH_TEST_ENABLE_BIT; - if (brw->attribs.Depth->Test && - brw->attribs.Depth->Mask) /* ?? */ + if (ctx->Depth.Test && + ctx->Depth.Mask) /* ?? */ lookup |= IZ_DEPTH_WRITE_ENABLE_BIT; /* _NEW_STENCIL */ - if (brw->attribs.Stencil->Enabled) { + if (ctx->Stencil.Enabled) { lookup |= IZ_STENCIL_TEST_ENABLE_BIT; - if (brw->attribs.Stencil->WriteMask[0] || - brw->attribs.Stencil->WriteMask[brw->attribs.Stencil->_BackFace]) + if (ctx->Stencil.WriteMask[0] || + ctx->Stencil.WriteMask[ctx->Stencil._BackFace]) lookup |= IZ_STENCIL_WRITE_ENABLE_BIT; } line_aa = AA_NEVER; /* _NEW_LINE, _NEW_POLYGON, BRW_NEW_REDUCED_PRIMITIVE */ - if (brw->attribs.Line->SmoothFlag) { + if (ctx->Line.SmoothFlag) { if (brw->intel.reduced_primitive == GL_LINES) { line_aa = AA_ALWAYS; } else if (brw->intel.reduced_primitive == GL_TRIANGLES) { - if (brw->attribs.Polygon->FrontMode == GL_LINE) { + if (ctx->Polygon.FrontMode == GL_LINE) { line_aa = AA_SOMETIMES; - if (brw->attribs.Polygon->BackMode == GL_LINE || - (brw->attribs.Polygon->CullFlag && - brw->attribs.Polygon->CullFaceMode == GL_BACK)) + if (ctx->Polygon.BackMode == GL_LINE || + (ctx->Polygon.CullFlag && + ctx->Polygon.CullFaceMode == GL_BACK)) line_aa = AA_ALWAYS; } - else if (brw->attribs.Polygon->BackMode == GL_LINE) { + else if (ctx->Polygon.BackMode == GL_LINE) { line_aa = AA_SOMETIMES; - if ((brw->attribs.Polygon->CullFlag && - brw->attribs.Polygon->CullFaceMode == GL_FRONT)) + if ((ctx->Polygon.CullFlag && + ctx->Polygon.CullFaceMode == GL_FRONT)) line_aa = AA_ALWAYS; } } @@ -228,11 +229,11 @@ static void brw_wm_populate_key( struct brw_context *brw, key->projtex_mask = brw->wm.input_size_masks[4-1] >> (FRAG_ATTRIB_TEX0 - FRAG_ATTRIB_WPOS); /* _NEW_LIGHT */ - key->flat_shade = (brw->attribs.Light->ShadeModel == GL_FLAT); + key->flat_shade = (ctx->Light.ShadeModel == GL_FLAT); /* _NEW_TEXTURE */ for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { - const struct gl_texture_unit *unit = &brw->attribs.Texture->Unit[i]; + const struct gl_texture_unit *unit = &ctx->Texture.Unit[i]; if (unit->_ReallyEnabled) { const struct gl_texture_object *t = unit->_Current; 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 8c9cb78945..b6dac0d698 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -220,14 +220,15 @@ static void brw_wm_sampler_populate_key(struct brw_context *brw, struct wm_sampler_key *key) { + GLcontext *ctx = &brw->intel.ctx; int unit; memset(key, 0, sizeof(*key)); for (unit = 0; unit < BRW_MAX_TEX_UNIT; unit++) { - if (brw->attribs.Texture->Unit[unit]._ReallyEnabled) { + if (ctx->Texture.Unit[unit]._ReallyEnabled) { struct wm_sampler_entry *entry = &key->sampler[unit]; - struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[unit]; + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; struct gl_texture_object *texObj = texUnit->_Current; struct intel_texture_object *intelObj = intel_texture_object(texObj); struct gl_texture_image *firstImage = @@ -274,6 +275,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw, */ static void upload_wm_samplers( struct brw_context *brw ) { + GLcontext *ctx = &brw->intel.ctx; struct wm_sampler_key key; int i; @@ -317,7 +319,7 @@ static void upload_wm_samplers( struct brw_context *brw ) /* Emit SDC relocations */ for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { - if (!brw->attribs.Texture->Unit[i]._ReallyEnabled) + if (!ctx->Texture.Unit[i]._ReallyEnabled) continue; dri_bo_emit_reloc(brw->wm.sampler_bo, diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index 5302405eda..3c3b3473d6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -60,6 +60,7 @@ struct brw_wm_unit_key { static void wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) { + GLcontext *ctx = &brw->intel.ctx; const struct gl_fragment_program *fp = brw->fragment_program; struct intel_context *intel = &brw->intel; @@ -95,7 +96,7 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) key->sampler_count = brw->wm.sampler_count; /* _NEW_POLYGONSTIPPLE */ - key->polygon_stipple = brw->attribs.Polygon->StippleFlag; + key->polygon_stipple = ctx->Polygon.StippleFlag; /* BRW_NEW_FRAGMENT_PROGRAM */ key->uses_depth = (fp->Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0; @@ -105,19 +106,19 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) (fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) != 0; /* _NEW_COLOR */ - key->uses_kill = fp->UsesKill || brw->attribs.Color->AlphaEnabled; + key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled; key->is_glsl = brw_wm_is_glsl(fp); /* XXX: This needs a flag to indicate when it changes. */ key->stats_wm = intel->stats_wm; /* _NEW_LINE */ - key->line_stipple = brw->attribs.Line->StippleFlag; + key->line_stipple = ctx->Line.StippleFlag; /* _NEW_POLYGON */ - key->offset_enable = brw->attribs.Polygon->OffsetFill; - key->offset_units = brw->attribs.Polygon->OffsetUnits; - key->offset_factor = brw->attribs.Polygon->OffsetFactor; + key->offset_enable = ctx->Polygon.OffsetFill; + key->offset_units = ctx->Polygon.OffsetUnits; + key->offset_factor = ctx->Polygon.OffsetFactor; } static dri_bo * 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 06e71e6d69..d70f9c646c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -253,7 +253,7 @@ static void brw_update_texture_surface( GLcontext *ctx, GLuint unit ) { struct brw_context *brw = brw_context(ctx); - struct gl_texture_object *tObj = brw->attribs.Texture->Unit[unit]._Current; + struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; struct intel_texture_object *intelObj = intel_texture_object(tObj); struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel]; struct brw_wm_surface_key key; @@ -301,6 +301,7 @@ static void brw_update_region_surface(struct brw_context *brw, struct intel_region *region, unsigned int unit, GLboolean cached) { + GLcontext *ctx = &brw->intel.ctx; dri_bo *region_bo = NULL; struct { unsigned int surface_type; @@ -333,10 +334,10 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, key.height = 1; key.cpp = 4; } - memcpy(key.color_mask, brw->attribs.Color->ColorMask, + memcpy(key.color_mask, ctx->Color.ColorMask, sizeof(key.color_mask)); - key.color_blend = (!brw->attribs.Color->_LogicOpEnabled && - brw->attribs.Color->BlendEnabled); + key.color_blend = (!ctx->Color._LogicOpEnabled && + ctx->Color.BlendEnabled); dri_bo_unreference(brw->wm.surf_bo[unit]); brw->wm.surf_bo[unit] = NULL; @@ -459,7 +460,7 @@ static void prepare_wm_surfaces(struct brw_context *brw ) brw->wm.nr_surfaces = MAX_DRAW_BUFFERS; for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { - struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i]; + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; /* _NEW_TEXTURE, BRW_NEW_TEXDATA */ if(texUnit->_ReallyEnabled) { -- cgit v1.2.3 From 33d798c4eab57293336082c7d011aa27af693bbb Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 2 Feb 2009 15:39:30 -0800 Subject: r300: Move some registers around. This fixes r500 hangs. --- src/gallium/drivers/r300/r300_cs_inlines.h | 2 ++ src/gallium/drivers/r300/r300_surface.c | 11 ++++------- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index aa0e647008..71e6623699 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -27,8 +27,10 @@ #ifdef R300_CS_H #define R300_PACIFY do { \ + OUT_CS_REG(R300_SC_SCREENDOOR, 0x0); \ OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | \ (1 << 18) | (1 << 31)); \ + OUT_CS_REG(R300_SC_SCREENDOOR, 0xffffff); \ } while (0) diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 3ffaee54b6..4bccdbca29 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -151,9 +151,7 @@ OUT_CS_REG(0x4F30, 0x00000000); OUT_CS_REG(0x4F34, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); -OUT_CS_REG(R300_SC_SCREENDOOR, 0x00000000); R300_PACIFY; -OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x21030003); OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000000); OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688); @@ -263,9 +261,7 @@ OUT_CS_REG(R300_VAP_CNTL, 0xA | (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000); OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000); OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001); -OUT_CS_REG(R300_SC_SCREENDOOR, 0x00000000); R300_PACIFY; -OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); /* XXX translate these back into normal instructions */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); @@ -293,7 +289,8 @@ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); -OUT_CS_REG(R300_RB3D_COLORPITCH0, (w >> 1) | R300_COLOR_TILE_ENABLE | +/* XXX this should not be so rigid */ +OUT_CS_REG(R300_RB3D_COLORPITCH0, (w / 4) | R300_COLOR_TILE_ENABLE | R300_COLOR_FORMAT_ARGB8888); OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); /* XXX Packet3 */ @@ -311,8 +308,8 @@ OUT_CS_32F(b); OUT_CS_32F(1.0); /* XXX figure out why this is 0xA and not 0x2 */ -/* XXX OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA); -OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, +OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA); +/* XXX OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */ R300_PACIFY; -- cgit v1.2.3 From d2eff33ab7fda9527458ea35d9eb109ec2988490 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Feb 2009 12:24:41 -0700 Subject: mesa: make _mesa_fprint_program_opt() non-static --- src/mesa/shader/prog_print.c | 2 +- src/mesa/shader/prog_print.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 09019dffef..fa1d3614bf 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -731,7 +731,7 @@ _mesa_print_instruction(const struct prog_instruction *inst) /** * Print program, with options. */ -static void +void _mesa_fprint_program_opt(FILE *f, const struct gl_program *prog, gl_prog_print_mode mode, diff --git a/src/mesa/shader/prog_print.h b/src/mesa/shader/prog_print.h index a64a3126e8..aa7f902fee 100644 --- a/src/mesa/shader/prog_print.h +++ b/src/mesa/shader/prog_print.h @@ -62,8 +62,9 @@ extern void _mesa_print_program(const struct gl_program *prog); extern void -_mesa_print_program_opt(const struct gl_program *prog, gl_prog_print_mode mode, - GLboolean lineNumbers); +_mesa_fprint_program_opt(FILE *f, + const struct gl_program *prog, gl_prog_print_mode mode, + GLboolean lineNumbers); extern void _mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog); -- cgit v1.2.3 From e33edafb2c81decd05dccae06fe6f059f53e2f25 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Feb 2009 12:24:58 -0700 Subject: mesa: fix stand-alone glslcompiler --- src/mesa/drivers/glslcompiler/glslcompiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index 34cce977c8..918ec41856 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -227,7 +227,7 @@ PrintShaderInstructions(GLuint shader, FILE *f) GET_CURRENT_CONTEXT(ctx); struct gl_shader *sh = _mesa_lookup_shader(ctx, shader); struct gl_program *prog = sh->Program; - _mesa_print_program_opt(prog, Options.Mode, Options.LineNumbers); + _mesa_fprint_program_opt(stdout, prog, Options.Mode, Options.LineNumbers); } -- cgit v1.2.3 From 1cb7cd1292dc8592d4912194d91355eb61361be5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Feb 2009 16:29:08 -0700 Subject: glsl: update program->InputsRead when referencing input attributes This info will be used in the linker for allocating generic vertex attribs. --- src/mesa/shader/slang/slang_emit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index ea446fa5d4..2dd122c9a5 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2120,6 +2120,10 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) /* mark var as used */ _mesa_use_uniform(emitInfo->prog->Parameters, (char *) n->Var->a_name); } + else if (n->Store->File == PROGRAM_INPUT) { + assert(n->Store->Index >= 0); + emitInfo->prog->InputsRead |= (1 << n->Store->Index); + } if (n->Store->Index < 0) { /* probably ran out of registers */ -- cgit v1.2.3 From dea0d4d56326f148a42c766bdbaf1b5bb247cc59 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Feb 2009 16:33:08 -0700 Subject: mesa: fix GLSL issue preventing use of all 16 generic vertex attributes Only 15 actually worked before since we always reserved generic[0] as an alias for vertex position. The case of vertex attribute 0 is tricky. The spec says that there is no aliasing between generic vertex attributes 0..MAX_VERTEX_ATTRIBS-1 and the conventional attributes. But it also says that calls to glVertexAttrib(0, v) are equivalent to glVertex(v). The distinction seems to be in glVertex-mode versus vertex array mode. So update the VBO code so that if the shader uses generic[0] but not gl_Vertex, route the attribute data set with glVertex() to go to shader input generic[0]. No change needed for the glDrawArrays/Elements() path. This is a potentially risky change so regressions are possible. All the usual tests seem OK though. --- src/mesa/shader/slang/slang_link.c | 13 +++++++++++-- src/mesa/vbo/vbo_exec_api.c | 5 ++++- src/mesa/vbo/vbo_exec_draw.c | 13 +++++++++++++ src/mesa/vbo/vbo_save_draw.c | 18 +++++++++++++++++- 4 files changed, 45 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index c6d5cc0566..77bcda0871 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -318,7 +318,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg, { GLint attribMap[MAX_VERTEX_ATTRIBS]; GLuint i, j; - GLbitfield usedAttributes; + GLbitfield usedAttributes; /* generics only, not legacy attributes */ assert(origProg != linkedProg); assert(origProg->Target == GL_VERTEX_PROGRAM_ARB); @@ -342,6 +342,15 @@ _slang_resolve_attributes(struct gl_shader_program *shProg, usedAttributes |= (1 << attr); } + /* If gl_Vertex is used, that actually counts against the limit + * on generic vertex attributes. This avoids the ambiguity of + * whether glVertexAttrib4fv(0, v) sets legacy attribute 0 (vert pos) + * or generic attribute[0]. If gl_Vertex is used, we want the former. + */ + if (origProg->InputsRead & VERT_BIT_POS) { + usedAttributes |= 0x1; + } + /* initialize the generic attribute map entries to -1 */ for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) { attribMap[i] = -1; @@ -384,7 +393,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg, * Start at 1 since generic attribute 0 always aliases * glVertex/position. */ - for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) { + for (attr = 0; attr < MAX_VERTEX_ATTRIBS; attr++) { if (((1 << attr) & usedAttributes) == 0) break; } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index d48f5230cb..f6daa253fd 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -148,11 +148,14 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) /* Note: the exec->vtx.current[i] pointers point into the * ctx->Current.Attrib and ctx->Light.Material.Attrib arrays. */ + if (exec->vtx.attrptr[i]) { + COPY_CLEAN_4V(current, exec->vtx.attrsz[i], exec->vtx.attrptr[i]); - + } + /* Given that we explicitly state size here, there is no need * for the COPY_CLEAN above, could just copy 16 bytes and be * done. The only problem is when Mesa accesses ctx->Current diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 5b2e3550ca..7204aec1dc 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -175,7 +175,20 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr]; } map = vbo->map_vp_arb; + + /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read. + * In that case we effectively need to route the data from + * glVertexAttrib(0, val) calls to feed into the GENERIC0 input. + */ + if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 && + (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) { + exec->vtx.inputs[16] = exec->vtx.inputs[0]; + exec->vtx.attrsz[16] = exec->vtx.attrsz[0]; + exec->vtx.attrsz[0] = 0; + } break; + default: + assert(0); } /* Make all active attributes (including edgeflag) available as diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 6fa3f1a7e4..7ee0a9a33f 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -110,6 +110,9 @@ static void vbo_bind_vertex_list( GLcontext *ctx, GLuint data = node->buffer_offset; const GLuint *map; GLuint attr; + GLubyte node_attrsz[VBO_ATTRIB_MAX]; /* copy of node->attrsz[] */ + + memcpy(node_attrsz, node->attrsz, sizeof(node->attrsz)); /* Install the default (ie Current) attributes first, then overlay * all active ones. @@ -135,13 +138,26 @@ static void vbo_bind_vertex_list( GLcontext *ctx, save->inputs[attr + 16] = &vbo->generic_currval[attr]; } map = vbo->map_vp_arb; + + /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read. + * In that case we effectively need to route the data from + * glVertexAttrib(0, val) calls to feed into the GENERIC0 input. + */ + if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 && + (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) { + save->inputs[16] = save->inputs[0]; + node_attrsz[16] = node_attrsz[0]; + node_attrsz[0] = 0; + } break; + default: + assert(0); } for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { GLuint src = map[attr]; - if (node->attrsz[src]) { + if (node_attrsz[src]) { /* override the default array set above */ save->inputs[attr] = &arrays[attr]; -- cgit v1.2.3 From fa3c59136e9dd788ee7d3689b6cb89dd27040a9e Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 2 Feb 2009 16:13:41 -0800 Subject: r300: Take care of some XXXes. --- src/gallium/drivers/r300/r300_chipset.c | 3 ++- src/gallium/drivers/r300/r300_screen.c | 11 +++++------ src/gallium/drivers/r300/r300_winsys.h | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index 4c84be26ef..b0a7fe7d21 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -337,7 +337,8 @@ void r300_parse_chipset(struct r300_capabilities* caps) break; default: - /* XXX not an r300?! */ + debug_printf("r300: Warning: Unknown chipset 0x%x\n", + caps->pci_id); break; } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 99dcf38f43..8e77e0ddd9 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -81,12 +81,11 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) /* IN THEORY */ return 0; case PIPE_CAP_TWO_SIDED_STENCIL: - /* IN THEORY */ - /* if (r300screen->is_r500) { - * return 1; - * } else { - * return 0; - * } */ + if (r300screen->is_r500) { + return 1; + } else { + return 0; + } return 0; case PIPE_CAP_GLSL: /* IN THEORY */ diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index 867d65b7de..5a3a212892 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -64,7 +64,6 @@ struct r300_winsys { int line); /* Write a dword to the command buffer. */ - /* XXX is this an okay name for this handle? */ void (*write_cs_dword)(struct radeon_cs* cs, uint32_t dword); /* Write a relocated dword to the command buffer. */ -- cgit v1.2.3 From 3aabfa46083daf60859bb26b65568de4cf40915f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 2 Feb 2009 16:39:43 -0800 Subject: r300: Clear up XXX in r300_state. --- src/gallium/drivers/r300/r300_state.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 96fdce903e..37770cd5c6 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -56,7 +56,7 @@ static uint32_t translate_blend_function(int blend_func) { case PIPE_BLEND_MAX: return R300_COMB_FCN_MAX; default: - /* XXX should be unreachable, handle this */ + debug_printf("r300: Unknown blend function %d\n", blend_func); break; } return 0; @@ -102,7 +102,7 @@ static uint32_t translate_blend_factor(int blend_fact) { case PIPE_BLENDFACTOR_INV_SRC1_COLOR: case PIPE_BLENDFACTOR_INV_SRC1_ALPHA: */ default: - /* XXX the mythical 0x16 blend factor! */ + debug_printf("r300: Unknown blend factor %d\n", blend_fact); break; } return 0; @@ -231,7 +231,8 @@ static uint32_t translate_depth_stencil_function(int zs_func) { case PIPE_FUNC_ALWAYS: return R300_ZS_ALWAYS; default: - /* XXX shouldn't be reachable */ + debug_printf("r300: Unknown depth/stencil function %d\n", + zs_func); break; } return 0; @@ -256,7 +257,7 @@ static uint32_t translate_stencil_op(int s_op) { case PIPE_STENCIL_OP_INVERT: return R300_ZS_INVERT; default: - /* XXX shouldn't be reachable */ + debug_printf("r300: Unknown stencil op %d", s_op); break; } return 0; @@ -281,7 +282,7 @@ static uint32_t translate_alpha_function(int alpha_func) { case PIPE_FUNC_ALWAYS: return R300_FG_ALPHA_FUNC_ALWAYS; default: - /* XXX shouldn't be reachable */ + debug_printf("r300: Unknown alpha function %d", alpha_func); break; } return 0; @@ -557,7 +558,7 @@ static uint32_t translate_wrap(int wrap) { case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: return R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED; default: - /* XXX handle this? */ + debug_printf("r300: Unknown texture wrap %d", wrap); return 0; } } @@ -572,7 +573,7 @@ static uint32_t translate_tex_filters(int min, int mag, int mip) { case PIPE_TEX_FILTER_ANISO: retval |= R300_TX_MIN_FILTER_ANISO; default: - /* XXX WTF?! */ + debug_printf("r300: Unknown texture filter %d", min); break; } switch (mag) { @@ -583,7 +584,7 @@ static uint32_t translate_tex_filters(int min, int mag, int mip) { case PIPE_TEX_FILTER_ANISO: retval |= R300_TX_MAG_FILTER_ANISO; default: - /* XXX WTF?! */ + debug_printf("r300: Unknown texture filter %d", mag); break; } switch (mip) { @@ -594,7 +595,7 @@ static uint32_t translate_tex_filters(int min, int mag, int mip) { case PIPE_TEX_MIPFILTER_LINEAR: retval |= R300_TX_MIN_FILTER_MIP_LINEAR; default: - /* XXX WTF?! */ + debug_printf("r300: Unknown texture filter %d", mip); break; } -- cgit v1.2.3 From e1b04da9b35aad1f474f7396f206a7c124c6859b Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Tue, 3 Feb 2009 02:58:51 +0100 Subject: r300: fix compiler/linker errors --- src/gallium/drivers/r300/r300_chipset.c | 1 + src/gallium/drivers/r300/r300_screen.c | 2 +- src/gallium/drivers/r300/r300_state.c | 1 + src/gallium/drivers/r300/r300_surface.c | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index b0a7fe7d21..7def62422a 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -21,6 +21,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "r300_chipset.h" +#include "pipe/p_debug.h" /* r300_chipset: A file all to itself for deducing the various properties of * Radeons. */ diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 8e77e0ddd9..fd916fadbe 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -81,7 +81,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) /* IN THEORY */ return 0; case PIPE_CAP_TWO_SIDED_STENCIL: - if (r300screen->is_r500) { + if (r300screen->caps->is_r500) { return 1; } else { return 0; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 37770cd5c6..6bb8379dd5 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -22,6 +22,7 @@ #include "util/u_math.h" #include "util/u_pack_color.h" +#include "pipe/p_debug.h" #include "r300_context.h" #include "r300_reg.h" diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 4bccdbca29..e03f3de371 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -52,7 +52,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } -BEGIN_CS((caps->is_r500) ? 300 : 322); +BEGIN_CS((caps->is_r500) ? 309 : 322); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; @@ -289,7 +289,7 @@ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); -/* XXX this should not be so rigid */ +/* XXX this should not be so rigid and it still doesn't work right */ OUT_CS_REG(R300_RB3D_COLORPITCH0, (w / 4) | R300_COLOR_TILE_ENABLE | R300_COLOR_FORMAT_ARGB8888); OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); -- cgit v1.2.3 From e5018a5675603ec26e833bc0808e4150a6bba16a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 2 Feb 2009 20:33:57 -0800 Subject: r300: Add stubs for swtcl immediate emit. --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_context.c | 1 + src/gallium/drivers/r300/r300_swtcl_emit.c | 106 +++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 src/gallium/drivers/r300/r300_swtcl_emit.c (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 1d61b31605..8906d1227a 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -12,6 +12,7 @@ C_SOURCES = \ r300_screen.c \ r300_state.c \ r300_surface.c \ + r300_swtcl_emit.c \ r300_texture.c include ../../Makefile.template diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index e63e1278bf..7b605ae87a 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -50,6 +50,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.clear = r300_clear; r300->draw = draw_create(); + /*XXX draw_set_rasterize_stage(r300->draw, r300_draw_swtcl_stage(r300));*/ r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state); r300->scissor_state = CALLOC_STRUCT(r300_scissor_state); diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c new file mode 100644 index 0000000000..98340a7a7c --- /dev/null +++ b/src/gallium/drivers/r300/r300_swtcl_emit.c @@ -0,0 +1,106 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "draw/draw_pipe.h" +#include "util/u_memory.h" + +#include "r300_context.h" +#include "r300_reg.h" + +/* r300_swtcl_emit: Primitive vertex emission using an immediate + * vertex buffer and no HW TCL. */ + +struct swtcl_stage { + /* Parent class */ + struct draw_stage draw; + + struct r300_context* r300; +}; + +static INLINE struct swtcl_stage* swtcl_stage(struct draw_stage* draw) { + return (struct swtcl_stage*)draw; +} + +static INLINE void r300_emit_prim(struct draw_stage* draw, + struct prim_header* prim, + unsigned hwprim, + unsigned count) +{ + struct r300_context* r300 = swtcl_stage(draw)->r300; +} + +/* Just as an aside... + * + * Radeons can do many more primitives: + * - Line strip + * - Triangle fan + * - Triangle strip + * - Line loop + * - Quads + * - Quad strip + * - Polygons + * + * The following were just the only ones in Draw. */ + +static void r300_emit_point(struct draw_stage* draw, struct prim_header* prim) +{ + r300_emit_prim(draw, prim, R300_VAP_VF_CNTL__PRIM_POINTS, 1); +} + +static void r300_emit_line(struct draw_stage* draw, struct prim_header* prim) +{ + r300_emit_prim(draw, prim, R300_VAP_VF_CNTL__PRIM_LINES, 2); +} + +static void r300_emit_tri(struct draw_stage* draw, struct prim_header* prim) +{ + r300_emit_prim(draw, prim, R300_VAP_VF_CNTL__PRIM_TRIANGLES, 3); +} + +static void r300_swtcl_flush(struct draw_stage* draw, unsigned flags) +{ +} + +static void r300_reset_stipple(struct draw_stage* draw) +{ + /* XXX */ +} + +static void r300_swtcl_destroy(struct draw_stage* draw) +{ + FREE(draw); +} + +struct draw_stage* r300_draw_swtcl_stage(struct r300_context* r300) +{ + struct swtcl_stage* swtcl = CALLOC_STRUCT(swtcl_stage); + + swtcl->r300 = r300; + swtcl->draw.point = r300_emit_point; + swtcl->draw.line = r300_emit_line; + swtcl->draw.tri = r300_emit_tri; + swtcl->draw.flush = r300_swtcl_flush; + swtcl->draw.reset_stipple_counter = r300_reset_stipple; + swtcl->draw.destroy = r300_swtcl_destroy; + + return &swtcl->draw; +} -- cgit v1.2.3 From a47965588fdaa75166c48d50974b38fcbfd2a749 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 3 Feb 2009 20:07:42 +0000 Subject: mesa: fix offset problem with interleaved arrays --- src/mesa/state_tracker/st_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 630ad2bcdf..942f913ea2 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -379,7 +379,7 @@ setup_interleaved_attribs(GLcontext *ctx, else { vbuffer->buffer = NULL; pipe_buffer_reference(pipe->screen, &vbuffer->buffer, stobj->buffer); - vbuffer->buffer_offset = (unsigned) arrays[mesaAttr]->Ptr; + vbuffer->buffer_offset = (unsigned) low; } vbuffer->stride = stride; /* in bytes */ vbuffer->max_index = max_index; -- cgit v1.2.3 From b5d549e3514af1d299b27d80bd157a65f397fe15 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Feb 2009 09:21:32 -0700 Subject: mesa: simplify delete_wrapper() --- src/mesa/main/depthstencil.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index 9d208e2997..7be2aacaf2 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -62,15 +62,9 @@ nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) static void delete_wrapper(struct gl_renderbuffer *rb) { - struct gl_renderbuffer *dsrb = rb->Wrapped; - ASSERT(dsrb); ASSERT(rb->_ActualFormat == GL_DEPTH_COMPONENT24 || rb->_ActualFormat == GL_STENCIL_INDEX8_EXT); - /* decrement refcount on the wrapped buffer and delete it if necessary */ - dsrb->RefCount--; - if (dsrb->RefCount <= 0) { - dsrb->Delete(dsrb); - } + _mesa_reference_renderbuffer(&rb->Wrapped, NULL); _mesa_free(rb); } -- cgit v1.2.3 From 49e80bf6b163310f7cd776261872201eea57053a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Feb 2009 10:12:51 -0700 Subject: xlib: use MESA_GLX_FORCE_DIRECT to make glXIsDirect() always return True Some apps won't run w/ indirect rendering contexts. Also, consolidate some context-init code in new init_glx_context() function. --- src/mesa/drivers/x11/fakeglx.c | 45 +++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index ea3585258d..73fde865e3 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * - * 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"), @@ -1392,6 +1393,25 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) } +/** + * Init basic fields of a new fake_glx_context. + * If the MESA_GLX_FORCE_DIRECT env var is set, the context will be marked as + * a direct rendering context. Some apps won't run without this. + */ +static void +init_glx_context(struct fake_glx_context *glxCtx, Display *dpy) +{ + GLboolean direct = _mesa_getenv("MESA_GLX_FORCE_DIRECT") ? GL_TRUE : GL_FALSE; + glxCtx->xmesaContext->direct = direct; + glxCtx->glxContext.isDirect = direct; + glxCtx->glxContext.currentDpy = dpy; + glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */ + + assert((void *) glxCtx == (void *) &(glxCtx->glxContext)); +} + + + static GLXContext Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, GLXContext share_list, Bool direct ) @@ -1430,12 +1450,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, return NULL; } - glxCtx->xmesaContext->direct = GL_FALSE; - glxCtx->glxContext.isDirect = GL_FALSE; - glxCtx->glxContext.currentDpy = dpy; - glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */ - - assert((void *) glxCtx == (void *) &(glxCtx->glxContext)); + init_glx_context(glxCtx, dpy); return (GLXContext) glxCtx; } @@ -2441,12 +2456,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config, return NULL; } - glxCtx->xmesaContext->direct = GL_FALSE; - glxCtx->glxContext.isDirect = GL_FALSE; - glxCtx->glxContext.currentDpy = dpy; - glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */ - - assert((void *) glxCtx == (void *) &(glxCtx->glxContext)); + init_glx_context(glxCtx, dpy); return (GLXContext) glxCtx; } @@ -2664,12 +2674,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int re return NULL; } - glxCtx->xmesaContext->direct = GL_FALSE; - glxCtx->glxContext.isDirect = GL_FALSE; - glxCtx->glxContext.currentDpy = dpy; - glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */ - - assert((void *) glxCtx == (void *) &(glxCtx->glxContext)); + init_glx_context(glxCtx, dpy); return (GLXContext) glxCtx; } -- cgit v1.2.3 From 529d1d720e1422bad1880ef33fae1c9423112d2e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Feb 2009 19:29:11 -0800 Subject: swrast: Add support for x8r8g8b8 fbconfig. This lets swrast produce an fbconfig suitable for the root visual now that the server's not allowing mismatched fbconfigs. --- src/mesa/drivers/dri/swrast/swrast.c | 72 ++++++++++++++++++------------- src/mesa/drivers/dri/swrast/swrast_priv.h | 10 +++-- src/mesa/drivers/dri/swrast/swrast_span.c | 72 +++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 390b8f918a..a90b30b49d 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -164,17 +164,27 @@ swrastFillInModes(__DRIscreen *psp, depth_buffer_factor = 4; back_buffer_factor = 2; - if (pixel_bits == 8) { + switch (pixel_bits) { + case 8: fb_format = GL_RGB; fb_type = GL_UNSIGNED_BYTE_2_3_3_REV; - } - else if (pixel_bits == 16) { + break; + case 16: fb_format = GL_RGB; fb_type = GL_UNSIGNED_SHORT_5_6_5; - } - else { + break; + case 24: + fb_format = GL_BGR; + fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; + break; + case 32: fb_format = GL_BGRA; fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; + break; + default: + fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__, + pixel_bits); + return NULL; } configs = driCreateConfigs(fb_format, fb_type, @@ -196,7 +206,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, { static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; - const __DRIconfig **configs8, **configs16, **configs32; + const __DRIconfig **configs8, **configs16, **configs24, **configs32; (void) data; @@ -213,11 +223,12 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, configs8 = swrastFillInModes(psp, 8, 8, 0, 1); configs16 = swrastFillInModes(psp, 16, 16, 0, 1); + configs24 = swrastFillInModes(psp, 24, 24, 8, 1); configs32 = swrastFillInModes(psp, 32, 24, 8, 1); configs16 = driConcatConfigs(configs8, configs16); - - *driver_configs = driConcatConfigs(configs16, configs32); + configs24 = driConcatConfigs(configs16, configs24); + *driver_configs = driConcatConfigs(configs24, configs32); driInitExtensions( NULL, card_extensions, GL_FALSE ); @@ -249,19 +260,24 @@ static GLuint choose_pixel_format(const GLvisual *v) { if (v->rgbMode) { - int bpp = v->rgbBits; + int depth = v->rgbBits; - if (bpp == 32 + if (depth == 32 && v->redMask == 0xff0000 && v->greenMask == 0x00ff00 && v->blueMask == 0x0000ff) return PF_A8R8G8B8; - else if (bpp == 16 + else if (depth == 24 + && v->redMask == 0xff0000 + && v->greenMask == 0x00ff00 + && v->blueMask == 0x0000ff) + return PF_X8R8G8B8; + else if (depth == 16 && v->redMask == 0xf800 && v->greenMask == 0x07e0 && v->blueMask == 0x001f) return PF_R5G6B5; - else if (bpp == 8 + else if (depth == 8 && v->redMask == 0x07 && v->greenMask == 0x38 && v->blueMask == 0xc0) @@ -290,7 +306,6 @@ swrast_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb, GLenum internalFormat, GLuint width, GLuint height) { struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); - int bpp; unsigned mask = PITCH_ALIGN_BITS - 1; TRACE; @@ -299,23 +314,8 @@ swrast_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; - switch (internalFormat) { - case GL_RGB: - bpp = rb->RedBits + rb->GreenBits + rb->BlueBits; - break; - case GL_RGBA: - bpp = rb->RedBits + rb->GreenBits + rb->BlueBits + rb->AlphaBits; - break; - case GL_COLOR_INDEX8_EXT: - bpp = rb->IndexBits; - break; - default: - _mesa_problem( NULL, "unexpected format in %s", __FUNCTION__ ); - return GL_FALSE; - } - /* always pad to PITCH_ALIGN_BITS */ - xrb->pitch = ((width * bpp + mask) & ~mask) / 8; + xrb->pitch = ((width * xrb->bpp + mask) & ~mask) / 8; return GL_TRUE; } @@ -371,6 +371,17 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) 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.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.InternalFormat = GL_RGB; @@ -380,6 +391,7 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) 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.InternalFormat = GL_RGB; @@ -389,12 +401,14 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) 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.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: return NULL; diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index a707ffc40a..1a5fb31d5a 100644 --- a/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -90,6 +90,8 @@ struct swrast_renderbuffer { /* renderbuffer pitch (in bytes) */ GLuint pitch; + /* bits per pixel of storage */ + GLuint bpp; }; static INLINE __DRIcontext * @@ -115,10 +117,10 @@ swrast_renderbuffer(struct gl_renderbuffer *rb) * Pixel formats we support */ #define PF_CI8 1 /**< Color Index mode */ -#define PF_A8R8G8B8 2 /**< 32-bit TrueColor: 8-A, 8-R, 8-G, 8-B bits */ -#define PF_R5G6B5 3 /**< 16-bit TrueColor: 5-R, 6-G, 5-B bits */ -#define PF_R3G3B2 4 /**< 8-bit TrueColor: 3-R, 3-G, 2-B bits */ - +#define PF_A8R8G8B8 2 /**< 32bpp TrueColor: 8-A, 8-R, 8-G, 8-B bits */ +#define PF_R5G6B5 3 /**< 16bpp TrueColor: 5-R, 6-G, 5-B bits */ +#define PF_R3G3B2 4 /**< 8bpp TrueColor: 3-R, 3-G, 2-B bits */ +#define PF_X8R8G8B8 5 /**< 32bpp TrueColor: 8-R, 8-G, 8-B bits */ /** * Renderbuffer pitch alignment (in bits). diff --git a/src/mesa/drivers/dri/swrast/swrast_span.c b/src/mesa/drivers/dri/swrast/swrast_span.c index 5e990368b2..2d3c25dcbe 100644 --- a/src/mesa/drivers/dri/swrast/swrast_span.c +++ b/src/mesa/drivers/dri/swrast/swrast_span.c @@ -79,6 +79,24 @@ static const GLubyte kernel[16] = { DST[BCOMP] = SRC[0] +/* 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] +#define STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) \ + DST[3] = 0xff; \ + DST[2] = VALUE[RCOMP]; \ + DST[1] = VALUE[GCOMP]; \ + DST[0] = VALUE[BCOMP] +#define FETCH_PIXEL_X8R8G8B8(DST, SRC) \ + DST[ACOMP] = 0xff; \ + DST[RCOMP] = SRC[2]; \ + DST[GCOMP] = SRC[1]; \ + DST[BCOMP] = SRC[0] + + /* 16-bit BGR */ #define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \ do { \ @@ -139,6 +157,24 @@ static const GLubyte kernel[16] = { #include "swrast/s_spantemp.h" +/* 32-bit BGRX */ +#define NAME(FUNC) FUNC##_X8R8G8B8 +#define RB_TYPE GLubyte +#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 +#define STORE_PIXEL(DST, X, Y, VALUE) \ + STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) +#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ + STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) +#define FETCH_PIXEL(DST, SRC) \ + FETCH_PIXEL_X8R8G8B8(DST, SRC) + +#include "swrast/s_spantemp.h" + + /* 16-bit BGR */ #define NAME(FUNC) FUNC##_R5G6B5 #define RB_TYPE GLubyte @@ -210,6 +246,24 @@ static const GLubyte kernel[16] = { #include "swrast_spantemp.h" +/* 32-bit BGRX */ +#define NAME(FUNC) FUNC##_X8R8G8B8_front +#define RB_TYPE GLubyte +#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 +#define STORE_PIXEL(DST, X, Y, VALUE) \ + STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) +#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ + STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) +#define FETCH_PIXEL(DST, SRC) \ + FETCH_PIXEL_X8R8G8B8(DST, SRC) + +#include "swrast_spantemp.h" + + /* 16-bit BGR */ #define NAME(FUNC) FUNC##_R5G6B5_front #define RB_TYPE GLubyte @@ -279,6 +333,15 @@ swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb, xrb->Base.PutValues = put_values_A8R8G8B8; xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8; break; + case PF_X8R8G8B8: + xrb->Base.GetRow = get_row_X8R8G8B8; + xrb->Base.GetValues = get_values_X8R8G8B8; + xrb->Base.PutRow = put_row_X8R8G8B8; + xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8; + xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8; + xrb->Base.PutValues = put_values_X8R8G8B8; + xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8; + break; case PF_R5G6B5: xrb->Base.GetRow = get_row_R5G6B5; xrb->Base.GetValues = get_values_R5G6B5; @@ -334,6 +397,15 @@ swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb, xrb->Base.PutValues = put_values_A8R8G8B8_front; xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8_front; break; + case PF_X8R8G8B8: + xrb->Base.GetRow = get_row_X8R8G8B8_front; + xrb->Base.GetValues = get_values_X8R8G8B8_front; + xrb->Base.PutRow = put_row_X8R8G8B8_front; + xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8_front; + xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8_front; + xrb->Base.PutValues = put_values_X8R8G8B8_front; + xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8_front; + break; case PF_R5G6B5: xrb->Base.GetRow = get_row_R5G6B5_front; xrb->Base.GetValues = get_values_R5G6B5_front; -- cgit v1.2.3 From 8910da5b7a3b83d733f020dec906fe7b56c093c7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Feb 2009 20:04:24 -0800 Subject: intel: Fix commented-out glViewport in intel_meta_set_passthrough_transform. Too much commit -a while debugging. --- src/mesa/drivers/dri/intel/intel_pixel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index f440a7716c..5e32288844 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -183,7 +183,7 @@ intel_meta_set_passthrough_transform(struct intel_context *intel) intel->meta.saved_vp_height = ctx->Viewport.Height; intel->meta.saved_matrix_mode = ctx->Transform.MatrixMode; - /* _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height);*/ + _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height); _mesa_MatrixMode(GL_PROJECTION); _mesa_PushMatrix(); @@ -205,8 +205,8 @@ intel_meta_restore_transform(struct intel_context *intel) _mesa_MatrixMode(intel->meta.saved_matrix_mode); - /* _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y, - intel->meta.saved_vp_width, intel->meta.saved_vp_height);*/ + _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y, + intel->meta.saved_vp_width, intel->meta.saved_vp_height); } /** -- cgit v1.2.3 From f097465bb85d3ca212a23c2dcc9cf73988de9160 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 3 Feb 2009 22:55:30 -0800 Subject: r300: Moar swtcl emit. Still sucks, but getting there. --- src/gallium/drivers/r300/r300_swtcl_emit.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c index 98340a7a7c..f6e98d23e9 100644 --- a/src/gallium/drivers/r300/r300_swtcl_emit.c +++ b/src/gallium/drivers/r300/r300_swtcl_emit.c @@ -23,6 +23,7 @@ #include "draw/draw_pipe.h" #include "util/u_memory.h" +#include "r300_cs.h" #include "r300_context.h" #include "r300_reg.h" @@ -40,12 +41,34 @@ static INLINE struct swtcl_stage* swtcl_stage(struct draw_stage* draw) { return (struct swtcl_stage*)draw; } +static void r300_emit_vertex(struct r300_context* r300, + const struct vertex_header* vertex) +{ + /* XXX */ +} + static INLINE void r300_emit_prim(struct draw_stage* draw, struct prim_header* prim, unsigned hwprim, unsigned count) { struct r300_context* r300 = swtcl_stage(draw)->r300; + CS_LOCALS(r300); + int i; + + r300_emit_dirty_state(r300); + + /* XXX should be count * vtx size */ + BEGIN_CS(2 + count + 6); + OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, count)); + OUT_CS(hwprim | R300_PRIM_WALK_RING | + (count << R300_PRIM_NUM_VERTICES_SHIFT)); + + for (i = 0; i < count; i++) { + r300_emit_vertex(r300, prim->v[i]); + } + R300_PACIFY; + END_CS; } /* Just as an aside... @@ -63,17 +86,17 @@ static INLINE void r300_emit_prim(struct draw_stage* draw, static void r300_emit_point(struct draw_stage* draw, struct prim_header* prim) { - r300_emit_prim(draw, prim, R300_VAP_VF_CNTL__PRIM_POINTS, 1); + r300_emit_prim(draw, prim, R300_PRIM_TYPE_POINT, 1); } static void r300_emit_line(struct draw_stage* draw, struct prim_header* prim) { - r300_emit_prim(draw, prim, R300_VAP_VF_CNTL__PRIM_LINES, 2); + r300_emit_prim(draw, prim, R300_PRIM_TYPE_LINE, 2); } static void r300_emit_tri(struct draw_stage* draw, struct prim_header* prim) { - r300_emit_prim(draw, prim, R300_VAP_VF_CNTL__PRIM_TRIANGLES, 3); + r300_emit_prim(draw, prim, R300_PRIM_TYPE_TRI_LIST, 3); } static void r300_swtcl_flush(struct draw_stage* draw, unsigned flags) -- cgit v1.2.3 From 9f10b16790d7e4e224fc30cf105df944275d6353 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 4 Feb 2009 00:50:38 -0800 Subject: r300: A bit more cleanup and state handling. --- src/gallium/drivers/r300/r300_context.h | 20 +++++++++-------- src/gallium/drivers/r300/r300_state.c | 38 ++++++--------------------------- 2 files changed, 18 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 0cb0ec20d5..e0aad66018 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -87,15 +87,17 @@ struct r300_scissor_state { struct r300_texture_state { }; -#define R300_NEW_BLEND 0x0001 -#define R300_NEW_BLEND_COLOR 0x0002 -#define R300_NEW_DSA 0x0004 -#define R300_NEW_FRAGMENT_SHADER 0x0008 -#define R300_NEW_RASTERIZER 0x0010 -#define R300_NEW_SAMPLER 0x0020 -#define R300_NEW_SCISSOR 0x2000 -#define R300_NEW_VERTEX_SHADER 0x4000 -#define R300_NEW_KITCHEN_SINK 0x7fff +#define R300_NEW_BLEND 0x000001 +#define R300_NEW_BLEND_COLOR 0x000002 +#define R300_NEW_DSA 0x000004 +#define R300_NEW_FRAMEBUFFERS 0x000008 +#define R300_NEW_FRAGMENT_SHADER 0x000010 +#define R300_NEW_RASTERIZER 0x000020 +#define R300_NEW_SAMPLER 0x000040 +#define R300_NEW_SCISSOR 0x004000 +#define R300_NEW_TEXTURE 0x008000 +#define R300_NEW_VERTEX_SHADER 0x800000 +#define R300_NEW_KITCHEN_SINK 0xffffff struct r300_texture { /* Parent class */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 6bb8379dd5..b4b50ce1a9 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -394,7 +394,7 @@ static void r300->framebuffer_state = *state; - /* XXX do we need to mark dirty state? */ + r300->dirty_state |= R300_NEW_FRAMEBUFFERS; } /* Create fragment shader state. */ @@ -428,31 +428,6 @@ static void r300_set_polygon_stipple(struct pipe_context* pipe, /* XXX */ } -#if 0 -struct pipe_rasterizer_state -{ - unsigned flatshade:1; - unsigned light_twoside:1; - unsigned fill_cw:2; /**< PIPE_POLYGON_MODE_x */ - unsigned fill_ccw:2; /**< PIPE_POLYGON_MODE_x */ - unsigned scissor:1; - unsigned poly_smooth:1; - unsigned poly_stipple_enable:1; - unsigned point_smooth:1; - unsigned point_sprite:1; - unsigned multisample:1; /* XXX maybe more ms state in future */ - unsigned line_smooth:1; - unsigned line_last_pixel:1; - unsigned bypass_clipping:1; - unsigned bypass_vs:1; /**< Skip the vertex shader. Note that the shader is - still needed though, to indicate inputs/outputs */ - unsigned origin_lower_left:1; /**< Is (0,0) the lower-left corner? */ - unsigned flatshade_first:1; /**< take color attribute from the first vertex of a primitive */ - unsigned gl_rasterization_rules:1; /**< enable tweaks for GL rasterization? */ - ubyte sprite_coord_mode[PIPE_MAX_SHADER_OUTPUTS]; /**< PIPE_SPRITE_COORD_ */ -}; -#endif - static INLINE int pack_float_16_6x(float f) { return ((int)(f * 6.0) & 0xffff); } @@ -693,15 +668,16 @@ static void r300_set_sampler_textures(struct pipe_context* pipe, if (r300->textures[i] != (struct r300_texture*)texture[i]) { pipe_texture_reference((struct pipe_texture**)&r300->textures[i], texture[i]); - /* XXX NEW_TEXTURE instead? */ - r300->dirty_state |= (R300_NEW_SAMPLER << i); + r300->dirty_state |= (R300_NEW_TEXTURE << i); } } for (i = count; i < 8; i++) { - /* XXX also state change? */ - pipe_texture_reference((struct pipe_texture**)&r300->textures[i], - NULL); + if (r300->textures[i]) { + pipe_texture_reference((struct pipe_texture**)&r300->textures[i], + NULL); + r300->dirty_state |= (R300_NEW_TEXTURE << i); + } } r300->texture_count = count; -- cgit v1.2.3 From c10fb9579027ae34eda0c52acb353e8da5832495 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 4 Feb 2009 14:55:13 +1000 Subject: nouveau: link against libdrm_nouveau (installed with libdrm) --- src/gallium/drivers/nouveau/nouveau_bo.h | 53 - src/gallium/drivers/nouveau/nouveau_channel.h | 40 - src/gallium/drivers/nouveau/nouveau_class.h | 8006 -------------------- src/gallium/drivers/nouveau/nouveau_device.h | 30 - src/gallium/drivers/nouveau/nouveau_grobj.h | 35 - src/gallium/drivers/nouveau/nouveau_notifier.h | 43 - src/gallium/drivers/nouveau/nouveau_pushbuf.h | 32 - src/gallium/drivers/nouveau/nouveau_resource.h | 37 - src/gallium/drivers/nouveau/nouveau_stateobj.h | 5 +- src/gallium/drivers/nv50/nv50_state_validate.c | 12 +- src/gallium/drivers/nv50/nv50_tex.c | 6 +- src/gallium/winsys/drm/nouveau/common/Makefile | 13 +- src/gallium/winsys/drm/nouveau/common/nouveau_bo.c | 504 -- .../winsys/drm/nouveau/common/nouveau_channel.c | 126 - .../winsys/drm/nouveau/common/nouveau_context.c | 20 +- .../winsys/drm/nouveau/common/nouveau_context.h | 10 +- .../winsys/drm/nouveau/common/nouveau_device.c | 159 - .../winsys/drm/nouveau/common/nouveau_dma.c | 219 - .../winsys/drm/nouveau/common/nouveau_dma.h | 143 - .../winsys/drm/nouveau/common/nouveau_drmif.h | 313 - .../winsys/drm/nouveau/common/nouveau_fence.c | 217 - .../winsys/drm/nouveau/common/nouveau_grobj.c | 107 - .../winsys/drm/nouveau/common/nouveau_local.h | 96 - .../winsys/drm/nouveau/common/nouveau_notifier.c | 137 - .../winsys/drm/nouveau/common/nouveau_pushbuf.c | 270 - .../winsys/drm/nouveau/common/nouveau_resource.c | 116 - .../winsys/drm/nouveau/common/nouveau_winsys.c | 15 +- .../drm/nouveau/common/nouveau_winsys_pipe.c | 28 +- .../winsys/drm/nouveau/common/nv04_surface.c | 8 - .../winsys/drm/nouveau/common/nv50_surface.c | 3 +- src/gallium/winsys/drm/nouveau/dri/Makefile | 3 + .../winsys/drm/nouveau/dri/nouveau_context_dri.h | 2 - .../winsys/drm/nouveau/dri/nouveau_screen_dri.c | 2 +- 33 files changed, 48 insertions(+), 10762 deletions(-) delete mode 100644 src/gallium/drivers/nouveau/nouveau_bo.h delete mode 100644 src/gallium/drivers/nouveau/nouveau_channel.h delete mode 100644 src/gallium/drivers/nouveau/nouveau_class.h delete mode 100644 src/gallium/drivers/nouveau/nouveau_device.h delete mode 100644 src/gallium/drivers/nouveau/nouveau_grobj.h delete mode 100644 src/gallium/drivers/nouveau/nouveau_notifier.h delete mode 100644 src/gallium/drivers/nouveau/nouveau_pushbuf.h delete mode 100644 src/gallium/drivers/nouveau/nouveau_resource.h delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_bo.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_channel.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_device.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_dma.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_dma.h delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_fence.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c delete mode 100644 src/gallium/winsys/drm/nouveau/common/nouveau_resource.c (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_bo.h b/src/gallium/drivers/nouveau/nouveau_bo.h deleted file mode 100644 index 65b138283c..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_bo.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_BO_H__ -#define __NOUVEAU_BO_H__ - -/* Relocation/Buffer type flags */ -#define NOUVEAU_BO_VRAM (1 << 0) -#define NOUVEAU_BO_GART (1 << 1) -#define NOUVEAU_BO_RD (1 << 2) -#define NOUVEAU_BO_WR (1 << 3) -#define NOUVEAU_BO_RDWR (NOUVEAU_BO_RD | NOUVEAU_BO_WR) -#define NOUVEAU_BO_MAP (1 << 4) -#define NOUVEAU_BO_PIN (1 << 5) -#define NOUVEAU_BO_LOW (1 << 6) -#define NOUVEAU_BO_HIGH (1 << 7) -#define NOUVEAU_BO_OR (1 << 8) -#define NOUVEAU_BO_LOCAL (1 << 9) -#define NOUVEAU_BO_TILED (1 << 10) -#define NOUVEAU_BO_ZTILE (1 << 11) -#define NOUVEAU_BO_DUMMY (1 << 31) - -struct nouveau_bo { - struct nouveau_device *device; - uint64_t handle; - - uint64_t size; - void *map; - - uint32_t flags; - uint64_t offset; -}; - -#endif diff --git a/src/gallium/drivers/nouveau/nouveau_channel.h b/src/gallium/drivers/nouveau/nouveau_channel.h deleted file mode 100644 index cd99a676bd..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_channel.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_CHANNEL_H__ -#define __NOUVEAU_CHANNEL_H__ - -struct nouveau_channel { - struct nouveau_device *device; - int id; - - struct nouveau_pushbuf *pushbuf; - - struct nouveau_grobj *nullobj; - struct nouveau_grobj *vram; - struct nouveau_grobj *gart; - - void *user_private; - void (*hang_notify)(struct nouveau_channel *); -}; - -#endif diff --git a/src/gallium/drivers/nouveau/nouveau_class.h b/src/gallium/drivers/nouveau/nouveau_class.h deleted file mode 100644 index 3df3d7b2b8..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_class.h +++ /dev/null @@ -1,8006 +0,0 @@ -/************************************************************************* - - Autogenerated file, do not edit ! - -************************************************************************** - - Copyright (C) 2006-2008 : - Dmitry Baryshkov, - Laurent Carlier, - Matthieu Castet, - Dawid Gajownik, - Jeremy Kolb, - Stephane Loeuillet, - Patrice Mandin, - Stephane Marchesin, - Serge Martin, - Sylvain Munaut, - Simon Raffeiner, - Ben Skeggs, - Erik Waling, - koala_br, - -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 NOUVEAU_REG_H -#define NOUVEAU_REG_H 1 - - -#define NV01_ROOT 0x00000001 - - - -#define NV01_CONTEXT_DMA 0x00000002 - - - -#define NV01_DEVICE 0x00000003 - - - -#define NV01_TIMER 0x00000004 - -#define NV01_TIMER_SYNCHRONIZE 0x00000100 -#define NV01_TIMER_STOP_ALARM 0x00000104 -#define NV01_TIMER_DMA_NOTIFY 0x00000180 -#define NV01_TIMER_TIME(x) (0x00000300+((x)*4)) -#define NV01_TIMER_TIME__SIZE 0x00000002 -#define NV01_TIMER_ALARM_NOTIFY 0x00000308 - - -#define NV_IMAGE_STENCIL 0x00000010 - -#define NV_IMAGE_STENCIL_NOTIFY 0x00000104 -#define NV_IMAGE_STENCIL_DMA_NOTIFY 0x00000180 -#define NV_IMAGE_STENCIL_IMAGE_OUTPUT 0x00000200 -#define NV_IMAGE_STENCIL_IMAGE_INPUT(x) (0x00000204+((x)*4)) -#define NV_IMAGE_STENCIL_IMAGE_INPUT__SIZE 0x00000002 - - -#define NV_IMAGE_BLEND_AND 0x00000011 - -#define NV_IMAGE_BLEND_AND_NOP 0x00000100 -#define NV_IMAGE_BLEND_AND_NOTIFY 0x00000104 -#define NV_IMAGE_BLEND_AND_DMA_NOTIFY 0x00000180 -#define NV_IMAGE_BLEND_AND_IMAGE_OUTPUT 0x00000200 -#define NV_IMAGE_BLEND_AND_BETA_INPUT 0x00000204 -#define NV_IMAGE_BLEND_AND_IMAGE_INPUT 0x00000208 - - -#define NV01_CONTEXT_BETA1 0x00000012 - -#define NV01_CONTEXT_BETA1_NOP 0x00000100 -#define NV01_CONTEXT_BETA1_NOTIFY 0x00000104 -#define NV01_CONTEXT_BETA1_DMA_NOTIFY 0x00000180 -#define NV01_CONTEXT_BETA1_BETA_1D31 0x00000300 - - -#define NV_IMAGE_ROP_AND 0x00000013 - -#define NV_IMAGE_ROP_AND_NOTIFY 0x00000104 -#define NV_IMAGE_ROP_AND_DMA_NOTIFY 0x00000180 -#define NV_IMAGE_ROP_AND_IMAGE_OUTPUT 0x00000200 -#define NV_IMAGE_ROP_AND_ROP_INPUT 0x00000204 -#define NV_IMAGE_ROP_AND_IMAGE_INPUT(x) (0x00000208+((x)*4)) -#define NV_IMAGE_ROP_AND_IMAGE_INPUT__SIZE 0x00000002 - - -#define NV_IMAGE_COLOR_KEY 0x00000015 - - - -#define NV01_CONTEXT_COLOR_KEY 0x00000017 - -#define NV01_CONTEXT_COLOR_KEY_NOP 0x00000100 -#define NV01_CONTEXT_COLOR_KEY_NOTIFY 0x00000104 -#define NV01_CONTEXT_COLOR_KEY_DMA_NOTIFY 0x00000180 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT 0x00000300 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X16A8Y8 0x00000001 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X24Y8 0x00000002 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X16A1R5G5B5 0x00000003 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X17R5G5B5 0x00000004 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_A8R8G8B8 0x00000005 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X8R8G8B8 0x00000006 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_A16Y16 0x00000007 -#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X16Y16 0x00000008 -#define NV01_CONTEXT_COLOR_KEY_COLOR 0x00000304 - - -#define NV01_CONTEXT_PATTERN 0x00000018 - -#define NV01_CONTEXT_PATTERN_NOP 0x00000100 -#define NV01_CONTEXT_PATTERN_NOTIFY 0x00000104 -#define NV01_CONTEXT_PATTERN_DMA_NOTIFY 0x00000180 -#define NV01_CONTEXT_PATTERN_COLOR_FORMAT 0x00000300 -#define NV01_CONTEXT_PATTERN_MONOCHROME_FORMAT 0x00000304 -#define NV01_CONTEXT_PATTERN_SHAPE 0x00000308 -#define NV01_CONTEXT_PATTERN_COLOR(x) (0x00000310+((x)*4)) -#define NV01_CONTEXT_PATTERN_COLOR__SIZE 0x00000002 -#define NV01_CONTEXT_PATTERN_PATTERN(x) (0x00000318+((x)*4)) -#define NV01_CONTEXT_PATTERN_PATTERN__SIZE 0x00000002 - - -#define NV01_CONTEXT_CLIP_RECTANGLE 0x00000019 - -#define NV01_CONTEXT_CLIP_RECTANGLE_NOP 0x00000100 -#define NV01_CONTEXT_CLIP_RECTANGLE_NOTIFY 0x00000104 -#define NV01_CONTEXT_CLIP_RECTANGLE_DMA_NOTIFY 0x00000180 -#define NV01_CONTEXT_CLIP_RECTANGLE_POINT 0x00000300 -#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_X_SHIFT 0 -#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_X_MASK 0x0000ffff -#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_Y_SHIFT 16 -#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_Y_MASK 0xffff0000 -#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE 0x00000304 -#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_W_SHIFT 0 -#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_W_MASK 0x0000ffff -#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_H_SHIFT 16 -#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_H_MASK 0xffff0000 - - -#define NV01_RENDER_SOLID_LINE 0x0000001c - -#define NV01_RENDER_SOLID_LINE_NOP 0x00000100 -#define NV01_RENDER_SOLID_LINE_NOTIFY 0x00000104 -#define NV01_RENDER_SOLID_LINE_PATCH 0x0000010c -#define NV01_RENDER_SOLID_LINE_DMA_NOTIFY 0x00000180 -#define NV01_RENDER_SOLID_LINE_CLIP_RECTANGLE 0x00000184 -#define NV01_RENDER_SOLID_LINE_PATTERN 0x00000188 -#define NV01_RENDER_SOLID_LINE_ROP 0x0000018c -#define NV01_RENDER_SOLID_LINE_BETA1 0x00000190 -#define NV01_RENDER_SOLID_LINE_SURFACE 0x00000194 -#define NV01_RENDER_SOLID_LINE_OPERATION 0x000002fc -#define NV01_RENDER_SOLID_LINE_OPERATION_SRCCOPY_AND 0x00000000 -#define NV01_RENDER_SOLID_LINE_OPERATION_ROP_AND 0x00000001 -#define NV01_RENDER_SOLID_LINE_OPERATION_BLEND_AND 0x00000002 -#define NV01_RENDER_SOLID_LINE_OPERATION_SRCCOPY 0x00000003 -#define NV01_RENDER_SOLID_LINE_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV01_RENDER_SOLID_LINE_OPERATION_BLEND_PREMULT 0x00000005 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT 0x00000300 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X16A8Y8 0x00000001 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X24Y8 0x00000002 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X16A1R5G5B5 0x00000003 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X17R5G5B5 0x00000004 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_A8R8G8B8 0x00000005 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X8R8G8B8 0x00000006 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_A16Y16 0x00000007 -#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X16Y16 0x00000008 -#define NV01_RENDER_SOLID_LINE_COLOR 0x00000304 -#define NV01_RENDER_SOLID_LINE_LINE_POINT0(x) (0x00000400+((x)*8)) -#define NV01_RENDER_SOLID_LINE_LINE_POINT0__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_LINE_POINT0_X_SHIFT 0 -#define NV01_RENDER_SOLID_LINE_LINE_POINT0_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_LINE_LINE_POINT0_Y_SHIFT 16 -#define NV01_RENDER_SOLID_LINE_LINE_POINT0_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_LINE_LINE_POINT1(x) (0x00000404+((x)*8)) -#define NV01_RENDER_SOLID_LINE_LINE_POINT1__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_LINE_POINT1_X_SHIFT 0 -#define NV01_RENDER_SOLID_LINE_LINE_POINT1_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_LINE_LINE_POINT1_Y_SHIFT 16 -#define NV01_RENDER_SOLID_LINE_LINE_POINT1_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_X(x) (0x00000480+((x)*16)) -#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_X__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_Y(x) (0x00000484+((x)*16)) -#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_Y__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_X(x) (0x00000488+((x)*16)) -#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_X__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_Y(x) (0x0000048c+((x)*16)) -#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_Y__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_POLYLINE(x) (0x00000500+((x)*4)) -#define NV01_RENDER_SOLID_LINE_POLYLINE__SIZE 0x00000020 -#define NV01_RENDER_SOLID_LINE_POLYLINE_X_SHIFT 0 -#define NV01_RENDER_SOLID_LINE_POLYLINE_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_LINE_POLYLINE_Y_SHIFT 16 -#define NV01_RENDER_SOLID_LINE_POLYLINE_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_X(x) (0x00000580+((x)*8)) -#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_X__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_Y(x) (0x00000584+((x)*8)) -#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_Y__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_COLOR(x) (0x00000600+((x)*8)) -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_COLOR__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT(x) (0x00000604+((x)*8)) -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT__SIZE 0x00000010 -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_X_SHIFT 0 -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_Y_SHIFT 16 -#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_Y_MASK 0xffff0000 - - -#define NV01_RENDER_SOLID_TRIANGLE 0x0000001d - -#define NV01_RENDER_SOLID_TRIANGLE_NOP 0x00000100 -#define NV01_RENDER_SOLID_TRIANGLE_NOTIFY 0x00000104 -#define NV01_RENDER_SOLID_TRIANGLE_PATCH 0x0000010c -#define NV01_RENDER_SOLID_TRIANGLE_DMA_NOTIFY 0x00000180 -#define NV01_RENDER_SOLID_TRIANGLE_CLIP_RECTANGLE 0x00000184 -#define NV01_RENDER_SOLID_TRIANGLE_PATTERN 0x00000188 -#define NV01_RENDER_SOLID_TRIANGLE_ROP 0x0000018c -#define NV01_RENDER_SOLID_TRIANGLE_BETA1 0x00000190 -#define NV01_RENDER_SOLID_TRIANGLE_SURFACE 0x00000194 -#define NV01_RENDER_SOLID_TRIANGLE_OPERATION 0x000002fc -#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_SRCCOPY_AND 0x00000000 -#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_ROP_AND 0x00000001 -#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_BLEND_AND 0x00000002 -#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_SRCCOPY 0x00000003 -#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_BLEND_PREMULT 0x00000005 -#define NV01_RENDER_SOLID_TRIANGLE_COLOR_FORMAT 0x00000300 -#define NV01_RENDER_SOLID_TRIANGLE_COLOR 0x00000304 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0 0x00000310 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1 0x00000314 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2 0x00000318 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT0_X 0x00000320 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT0_Y 0x00000324 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT1_X 0x00000328 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT1_Y 0x0000032c -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT2_X 0x00000330 -#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT2_Y 0x00000334 -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH(x) (0x00000400+((x)*4)) -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH__SIZE 0x00000020 -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_X(x) (0x00000480+((x)*8)) -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_X__SIZE 0x00000010 -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_Y(x) (0x00000484+((x)*8)) -#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_Y__SIZE 0x00000010 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_COLOR(x) (0x00000500+((x)*16)) -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_COLOR__SIZE 0x00000008 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0(x) (0x00000504+((x)*16)) -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0__SIZE 0x00000008 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1(x) (0x00000508+((x)*16)) -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1__SIZE 0x00000008 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2(x) (0x0000050c+((x)*16)) -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2__SIZE 0x00000008 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_COLOR(x) (0x00000580+((x)*8)) -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_COLOR__SIZE 0x00000010 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT(x) (0x00000584+((x)*8)) -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT__SIZE 0x00000010 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_X_SHIFT 0 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_Y_SHIFT 16 -#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_Y_MASK 0xffff0000 - - -#define NV01_RENDER_SOLID_RECTANGLE 0x0000001e - -#define NV01_RENDER_SOLID_RECTANGLE_NOP 0x00000100 -#define NV01_RENDER_SOLID_RECTANGLE_NOTIFY 0x00000104 -#define NV01_RENDER_SOLID_RECTANGLE_PATCH 0x0000010c -#define NV01_RENDER_SOLID_RECTANGLE_DMA_NOTIFY 0x00000180 -#define NV01_RENDER_SOLID_RECTANGLE_CLIP_RECTANGLE 0x00000184 -#define NV01_RENDER_SOLID_RECTANGLE_PATTERN 0x00000188 -#define NV01_RENDER_SOLID_RECTANGLE_ROP 0x0000018c -#define NV01_RENDER_SOLID_RECTANGLE_BETA1 0x00000190 -#define NV01_RENDER_SOLID_RECTANGLE_SURFACE 0x00000194 -#define NV01_RENDER_SOLID_RECTANGLE_OPERATION 0x000002fc -#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_SRCCOPY_AND 0x00000000 -#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_ROP_AND 0x00000001 -#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_BLEND_AND 0x00000002 -#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_SRCCOPY 0x00000003 -#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_BLEND_PREMULT 0x00000005 -#define NV01_RENDER_SOLID_RECTANGLE_COLOR_FORMAT 0x00000300 -#define NV01_RENDER_SOLID_RECTANGLE_COLOR 0x00000304 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT(x) (0x00000400+((x)*8)) -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT__SIZE 0x00000010 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_X_SHIFT 0 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_X_MASK 0x0000ffff -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_Y_SHIFT 16 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_Y_MASK 0xffff0000 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE(x) (0x00000404+((x)*8)) -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE__SIZE 0x00000010 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_W_SHIFT 0 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_W_MASK 0x0000ffff -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_H_SHIFT 16 -#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_H_MASK 0xffff0000 - - -#define NV01_IMAGE_BLIT 0x0000001f - -#define NV01_IMAGE_BLIT_NOP 0x00000100 -#define NV01_IMAGE_BLIT_NOTIFY 0x00000104 -#define NV01_IMAGE_BLIT_PATCH 0x0000010c -#define NV01_IMAGE_BLIT_DMA_NOTIFY 0x00000180 -#define NV01_IMAGE_BLIT_COLOR_KEY 0x00000184 -#define NV01_IMAGE_BLIT_CLIP_RECTANGLE 0x00000188 -#define NV01_IMAGE_BLIT_PATTERN 0x0000018c -#define NV01_IMAGE_BLIT_ROP 0x00000190 -#define NV01_IMAGE_BLIT_BETA1 0x00000194 -#define NV01_IMAGE_BLIT_SURFACE 0x0000019c -#define NV01_IMAGE_BLIT_OPERATION 0x000002fc -#define NV01_IMAGE_BLIT_IMAGE_INPUT 0x00000204 -#define NV01_IMAGE_BLIT_POINT_IN 0x00000300 -#define NV01_IMAGE_BLIT_POINT_IN_X_SHIFT 0 -#define NV01_IMAGE_BLIT_POINT_IN_X_MASK 0x0000ffff -#define NV01_IMAGE_BLIT_POINT_IN_Y_SHIFT 16 -#define NV01_IMAGE_BLIT_POINT_IN_Y_MASK 0xffff0000 -#define NV01_IMAGE_BLIT_POINT_OUT 0x00000304 -#define NV01_IMAGE_BLIT_POINT_OUT_X_SHIFT 0 -#define NV01_IMAGE_BLIT_POINT_OUT_X_MASK 0x0000ffff -#define NV01_IMAGE_BLIT_POINT_OUT_Y_SHIFT 16 -#define NV01_IMAGE_BLIT_POINT_OUT_Y_MASK 0xffff0000 -#define NV01_IMAGE_BLIT_SIZE 0x00000308 -#define NV01_IMAGE_BLIT_SIZE_W_SHIFT 0 -#define NV01_IMAGE_BLIT_SIZE_W_MASK 0x0000ffff -#define NV01_IMAGE_BLIT_SIZE_H_SHIFT 16 -#define NV01_IMAGE_BLIT_SIZE_H_MASK 0xffff0000 - - -#define NV01_IMAGE_FROM_CPU 0x00000021 - -#define NV01_IMAGE_FROM_CPU_NOP 0x00000100 -#define NV01_IMAGE_FROM_CPU_NOTIFY 0x00000104 -#define NV01_IMAGE_FROM_CPU_PATCH 0x0000010c -#define NV01_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180 -#define NV01_IMAGE_FROM_CPU_COLOR_KEY 0x00000184 -#define NV01_IMAGE_FROM_CPU_CLIP_RECTANGLE 0x00000188 -#define NV01_IMAGE_FROM_CPU_PATTERN 0x0000018c -#define NV01_IMAGE_FROM_CPU_ROP 0x00000190 -#define NV01_IMAGE_FROM_CPU_BETA1 0x00000194 -#define NV01_IMAGE_FROM_CPU_SURFACE 0x00000198 -#define NV01_IMAGE_FROM_CPU_OPERATION 0x000002fc -#define NV01_IMAGE_FROM_CPU_OPERATION_SRCCOPY_AND 0x00000000 -#define NV01_IMAGE_FROM_CPU_OPERATION_ROP_AND 0x00000001 -#define NV01_IMAGE_FROM_CPU_OPERATION_BLEND_AND 0x00000002 -#define NV01_IMAGE_FROM_CPU_OPERATION_SRCCOPY 0x00000003 -#define NV01_IMAGE_FROM_CPU_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV01_IMAGE_FROM_CPU_OPERATION_BLEND_PREMULT 0x00000005 -#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT 0x00000300 -#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_Y8 0x00000001 -#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_A1R5G5B5 0x00000002 -#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_X1R5G5B5 0x00000003 -#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_A8R8G8B8 0x00000004 -#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_X8R8G8B8 0x00000005 -#define NV01_IMAGE_FROM_CPU_POINT 0x00000304 -#define NV01_IMAGE_FROM_CPU_POINT_X_SHIFT 0 -#define NV01_IMAGE_FROM_CPU_POINT_X_MASK 0x0000ffff -#define NV01_IMAGE_FROM_CPU_POINT_Y_SHIFT 16 -#define NV01_IMAGE_FROM_CPU_POINT_Y_MASK 0xffff0000 -#define NV01_IMAGE_FROM_CPU_SIZE_OUT 0x00000308 -#define NV01_IMAGE_FROM_CPU_SIZE_OUT_W_SHIFT 0 -#define NV01_IMAGE_FROM_CPU_SIZE_OUT_W_MASK 0x0000ffff -#define NV01_IMAGE_FROM_CPU_SIZE_OUT_H_SHIFT 16 -#define NV01_IMAGE_FROM_CPU_SIZE_OUT_H_MASK 0xffff0000 -#define NV01_IMAGE_FROM_CPU_SIZE_IN 0x0000030c -#define NV01_IMAGE_FROM_CPU_SIZE_IN_W_SHIFT 0 -#define NV01_IMAGE_FROM_CPU_SIZE_IN_W_MASK 0x0000ffff -#define NV01_IMAGE_FROM_CPU_SIZE_IN_H_SHIFT 16 -#define NV01_IMAGE_FROM_CPU_SIZE_IN_H_MASK 0xffff0000 -#define NV01_IMAGE_FROM_CPU_COLOR(x) (0x00000400+((x)*4)) -#define NV01_IMAGE_FROM_CPU_COLOR__SIZE 0x00000020 - - -#define NV01_NULL 0x00000030 - - - -#define NV03_STRETCHED_IMAGE_FROM_CPU 0x00000036 - -#define NV03_STRETCHED_IMAGE_FROM_CPU_NOP 0x00000100 -#define NV03_STRETCHED_IMAGE_FROM_CPU_NOTIFY 0x00000104 -#define NV03_STRETCHED_IMAGE_FROM_CPU_PATCH 0x0000010c -#define NV03_STRETCHED_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180 -#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR_KEY 0x00000184 -#define NV03_STRETCHED_IMAGE_FROM_CPU_PATTERN 0x00000188 -#define NV03_STRETCHED_IMAGE_FROM_CPU_ROP 0x0000018c -#define NV03_STRETCHED_IMAGE_FROM_CPU_BETA1 0x00000190 -#define NV03_STRETCHED_IMAGE_FROM_CPU_SURFACE 0x00000194 -#define NV03_STRETCHED_IMAGE_FROM_CPU_OPERATION 0x000002fc -#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR_FORMAT 0x00000300 -#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN 0x00000304 -#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_W_SHIFT 0 -#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_W_MASK 0x0000ffff -#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_H_SHIFT 16 -#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_H_MASK 0xffff0000 -#define NV03_STRETCHED_IMAGE_FROM_CPU_DX_DU 0x00000308 -#define NV03_STRETCHED_IMAGE_FROM_CPU_DY_DV 0x0000030c -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT 0x00000310 -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_X_SHIFT 0 -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_X_MASK 0x0000ffff -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_Y_SHIFT 16 -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_Y_MASK 0xffff0000 -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE 0x00000314 -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_W_SHIFT 0 -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_W_MASK 0x0000ffff -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_H_SHIFT 16 -#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_H_MASK 0xffff0000 -#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4 0x00000318 -#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_X_SHIFT 0 -#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_X_MASK 0x0000ffff -#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_Y_SHIFT 16 -#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_Y_MASK 0xffff0000 -#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR(x) (0x00000400+((x)*4)) -#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR__SIZE 0x00000020 - - -#define NV03_SCALED_IMAGE_FROM_MEMORY 0x00000037 - -#define NV03_SCALED_IMAGE_FROM_MEMORY_NOP 0x00000100 -#define NV03_SCALED_IMAGE_FROM_MEMORY_NOTIFY 0x00000104 -#define NV03_SCALED_IMAGE_FROM_MEMORY_DMA_NOTIFY 0x00000180 -#define NV03_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE 0x00000184 -#define NV03_SCALED_IMAGE_FROM_MEMORY_PATTERN 0x00000188 -#define NV03_SCALED_IMAGE_FROM_MEMORY_ROP 0x0000018c -#define NV03_SCALED_IMAGE_FROM_MEMORY_BETA1 0x00000190 -#define NV03_SCALED_IMAGE_FROM_MEMORY_SURFACE 0x00000194 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT 0x00000300 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5 0x00000001 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X1R5G5B5 0x00000002 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8 0x00000003 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8 0x00000004 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_V8YB8U8YA8 0x00000005 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_YB8V8YA8U8 0x00000006 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5 0x00000007 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_Y8 0x00000008 -#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8 0x00000009 -#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION 0x00000304 -#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_AND 0x00000000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_ROP_AND 0x00000001 -#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_AND 0x00000002 -#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY 0x00000003 -#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_PREMULT 0x00000005 -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT 0x00000308 -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_SHIFT 0 -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_MASK 0x0000ffff -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_SHIFT 16 -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_MASK 0xffff0000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE 0x0000030c -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_SHIFT 0 -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_MASK 0x0000ffff -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_SHIFT 16 -#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_MASK 0xffff0000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT 0x00000310 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_X_SHIFT 0 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_X_MASK 0x0000ffff -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_Y_SHIFT 16 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_Y_MASK 0xffff0000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE 0x00000314 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_W_SHIFT 0 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_W_MASK 0x0000ffff -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_H_SHIFT 16 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_H_MASK 0xffff0000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_DELTA_DU_DX 0x00000318 -#define NV03_SCALED_IMAGE_FROM_MEMORY_DELTA_DV_DY 0x0000031c -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE 0x00000400 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_W_SHIFT 0 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_W_MASK 0x0000ffff -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_H_SHIFT 16 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_H_MASK 0xffff0000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT 0x00000404 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_PITCH_SHIFT 0 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_PITCH_MASK 0x0000ffff -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_SHIFT 16 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_MASK 0x00ff0000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_CENTER 0x00010000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_CORNER 0x00020000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_INTERPOLATOR_SHIFT 24 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_INTERPOLATOR_MASK 0xff000000 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_OFFSET 0x00000408 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT 0x0000040c -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_U_SHIFT 0 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_U_MASK 0x0000ffff -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_V_SHIFT 16 -#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_V_MASK 0xffff0000 - - -#define NV04_DVD_SUBPICTURE 0x00000038 - -#define NV04_DVD_SUBPICTURE_NOP 0x00000100 -#define NV04_DVD_SUBPICTURE_NOTIFY 0x00000104 -#define NV04_DVD_SUBPICTURE_WAIT_FOR_IDLE 0x00000108 -#define NV04_DVD_SUBPICTURE_DMA_NOTIFY 0x00000180 -#define NV04_DVD_SUBPICTURE_DMA_OVERLAY 0x00000184 -#define NV04_DVD_SUBPICTURE_DMA_IMAGEIN 0x00000188 -#define NV04_DVD_SUBPICTURE_DMA_IMAGEOUT 0x0000018c -#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT 0x00000300 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_X_SHIFT 0 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_X_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_Y_SHIFT 16 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_Y_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE 0x00000304 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_W_SHIFT 0 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_W_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_H_SHIFT 16 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_H_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT 0x00000308 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_PITCH_SHIFT 0 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_PITCH_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_COLOR_SHIFT 16 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_COLOR_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_IMAGEOUT_OFFSET 0x0000030c -#define NV04_DVD_SUBPICTURE_IMAGEIN_DELTA_DU_DX 0x00000310 -#define NV04_DVD_SUBPICTURE_IMAGEIN_DELTA_DV_DY 0x00000314 -#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE 0x00000318 -#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_W_SHIFT 0 -#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_W_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_H_SHIFT 16 -#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_H_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT 0x0000031c -#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_PITCH_SHIFT 0 -#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_PITCH_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_COLOR_SHIFT 16 -#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_COLOR_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_IMAGEIN_OFFSET 0x00000320 -#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT 0x00000324 -#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_U_SHIFT 0 -#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_U_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_V_SHIFT 16 -#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_V_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_OVERLAY_DELTA_DU_DX 0x00000328 -#define NV04_DVD_SUBPICTURE_OVERLAY_DELTA_DV_DY 0x0000032c -#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE 0x00000330 -#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_W_SHIFT 0 -#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_W_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_H_SHIFT 16 -#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_H_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT 0x00000334 -#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_PITCH_SHIFT 0 -#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_PITCH_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_COLOR_SHIFT 16 -#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_COLOR_MASK 0xffff0000 -#define NV04_DVD_SUBPICTURE_OVERLAY_OFFSET 0x00000338 -#define NV04_DVD_SUBPICTURE_OVERLAY_POINT 0x0000033c -#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_U_SHIFT 0 -#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_U_MASK 0x0000ffff -#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_V_SHIFT 16 -#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_V_MASK 0xffff0000 - - -#define NV04_MEMORY_TO_MEMORY_FORMAT 0x00000039 - -#define NV04_MEMORY_TO_MEMORY_FORMAT_NOP 0x00000100 -#define NV04_MEMORY_TO_MEMORY_FORMAT_NOTIFY 0x00000104 -#define NV04_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY 0x00000180 -#define NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN 0x00000184 -#define NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_OUT 0x00000188 -#define NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN 0x0000030c -#define NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_OUT 0x00000310 -#define NV04_MEMORY_TO_MEMORY_FORMAT_PITCH_IN 0x00000314 -#define NV04_MEMORY_TO_MEMORY_FORMAT_PITCH_OUT 0x00000318 -#define NV04_MEMORY_TO_MEMORY_FORMAT_LINE_LENGTH_IN 0x0000031c -#define NV04_MEMORY_TO_MEMORY_FORMAT_LINE_COUNT 0x00000320 -#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT 0x00000324 -#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_INPUT_INC_SHIFT 0 -#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_INPUT_INC_MASK 0x0000000f -#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_OUTPUT_INC_SHIFT 8 -#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_OUTPUT_INC_MASK 0x00000f00 -#define NV04_MEMORY_TO_MEMORY_FORMAT_BUF_NOTIFY 0x00000328 - - -#define NV01_MEMORY_LOCAL_BANKED 0x0000003d - - - -#define NV01_MAPPING_SYSTEM 0x0000003e - - - -#define NV03_MEMORY_LOCAL_CURSOR 0x0000003f - - - -#define NV01_MEMORY_LOCAL_LINEAR 0x00000040 - - - -#define NV01_MAPPING_LOCAL 0x00000041 - - - -#define NV04_CONTEXT_SURFACES_2D 0x00000042 - -#define NV04_CONTEXT_SURFACES_2D_NOP 0x00000100 -#define NV04_CONTEXT_SURFACES_2D_NOTIFY 0x00000104 -#define NV04_CONTEXT_SURFACES_2D_PM_TRIGGER 0x00000140 -#define NV04_CONTEXT_SURFACES_2D_DMA_NOTIFY 0x00000180 -#define NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE 0x00000184 -#define NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_DESTIN 0x00000188 -#define NV04_CONTEXT_SURFACES_2D_FORMAT 0x00000300 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_Y8 0x00000001 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1R5G5B5_Z1R5G5B5 0x00000002 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1R5G5B5_X1R5G5B5 0x00000003 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5 0x00000004 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_Y16 0x00000005 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_X8R8G8B8_Z8R8G8B8 0x00000006 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_X8R8G8B8_X8R8G8B8 0x00000007 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1A7R8G8B8_Z1A7R8G8B8 0x00000008 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1A7R8G8B8_X1A7R8G8B8 0x00000009 -#define NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8 0x0000000a -#define NV04_CONTEXT_SURFACES_2D_FORMAT_Y32 0x0000000b -#define NV04_CONTEXT_SURFACES_2D_PITCH 0x00000304 -#define NV04_CONTEXT_SURFACES_2D_PITCH_SOURCE_SHIFT 0 -#define NV04_CONTEXT_SURFACES_2D_PITCH_SOURCE_MASK 0x0000ffff -#define NV04_CONTEXT_SURFACES_2D_PITCH_DESTIN_SHIFT 16 -#define NV04_CONTEXT_SURFACES_2D_PITCH_DESTIN_MASK 0xffff0000 -#define NV04_CONTEXT_SURFACES_2D_OFFSET_SOURCE 0x00000308 -#define NV04_CONTEXT_SURFACES_2D_OFFSET_DESTIN 0x0000030c - - -#define NV03_CONTEXT_ROP 0x00000043 - -#define NV03_CONTEXT_ROP_NOP 0x00000100 -#define NV03_CONTEXT_ROP_NOTIFY 0x00000104 -#define NV03_CONTEXT_ROP_DMA_NOTIFY 0x00000180 -#define NV03_CONTEXT_ROP_ROP 0x00000300 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_SHIFT 0 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_MASK 0x0000000f -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_CLEAR 0x00000000 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_NOR 0x00000001 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_AND_INVERTED 0x00000002 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_COPY_INVERTED 0x00000003 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_AND_REVERSE 0x00000004 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_INVERT 0x00000005 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_XOR 0x00000006 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_NAND 0x00000007 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_AND 0x00000008 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_EQUI 0x00000009 -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_NOOP 0x0000000a -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_OR_INVERTED 0x0000000b -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_COPY 0x0000000c -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_OR_REVERSE 0x0000000d -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_OR 0x0000000e -#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_SET 0x0000000f -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_SHIFT 4 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_MASK 0x000000f0 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_CLEAR 0x00000000 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_NOR 0x00000010 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_AND_INVERTED 0x00000020 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_COPY_INVERTED 0x00000030 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_AND_REVERSE 0x00000040 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_INVERT 0x00000050 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_XOR 0x00000060 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_NAND 0x00000070 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_AND 0x00000080 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_EQUI 0x00000090 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_NOOP 0x000000a0 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_OR_INVERTED 0x000000b0 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_COPY 0x000000c0 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_OR_REVERSE 0x000000d0 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_OR 0x000000e0 -#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_SET 0x000000f0 - - -#define NV04_IMAGE_PATTERN 0x00000044 - -#define NV04_IMAGE_PATTERN_NOP 0x00000100 -#define NV04_IMAGE_PATTERN_NOTIFY 0x00000104 -#define NV04_IMAGE_PATTERN_DMA_NOTIFY 0x00000180 -#define NV04_IMAGE_PATTERN_COLOR_FORMAT 0x00000300 -#define NV04_IMAGE_PATTERN_COLOR_FORMAT_A16R5G6B5 0x00000001 -#define NV04_IMAGE_PATTERN_COLOR_FORMAT_X16A1R5G5B5 0x00000002 -#define NV04_IMAGE_PATTERN_COLOR_FORMAT_A8R8G8B8 0x00000003 -#define NV04_IMAGE_PATTERN_MONOCHROME_FORMAT 0x00000304 -#define NV04_IMAGE_PATTERN_MONOCHROME_FORMAT_CGA6 0x00000001 -#define NV04_IMAGE_PATTERN_MONOCHROME_FORMAT_LE 0x00000002 -#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE 0x00000308 -#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE_8X8 0x00000000 -#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE_64X1 0x00000001 -#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE_1X64 0x00000002 -#define NV04_IMAGE_PATTERN_PATTERN_SELECT 0x0000030c -#define NV04_IMAGE_PATTERN_PATTERN_SELECT_MONO 0x00000001 -#define NV04_IMAGE_PATTERN_PATTERN_SELECT_COLOR 0x00000002 -#define NV04_IMAGE_PATTERN_MONOCHROME_COLOR0 0x00000310 -#define NV04_IMAGE_PATTERN_MONOCHROME_COLOR1 0x00000314 -#define NV04_IMAGE_PATTERN_MONOCHROME_PATTERN0 0x00000318 -#define NV04_IMAGE_PATTERN_MONOCHROME_PATTERN1 0x0000031c -#define NV04_IMAGE_PATTERN_PATTERN_Y8(x) (0x00000400+((x)*4)) -#define NV04_IMAGE_PATTERN_PATTERN_Y8__SIZE 0x00000010 -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y0_SHIFT 0 -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y0_MASK 0x000000ff -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y1_SHIFT 8 -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y1_MASK 0x0000ff00 -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y2_SHIFT 16 -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y2_MASK 0x00ff0000 -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y3_SHIFT 24 -#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y3_MASK 0xff000000 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5(x) (0x00000500+((x)*4)) -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5__SIZE 0x00000020 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B0_SHIFT 0 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B0_MASK 0x0000001f -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G0_SHIFT 5 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G0_MASK 0x000007e0 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R0_SHIFT 11 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R0_MASK 0x0000f800 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B1_SHIFT 16 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B1_MASK 0x001f0000 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G1_SHIFT 21 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G1_MASK 0x07e00000 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R1_SHIFT 27 -#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R1_MASK 0xf8000000 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5(x) (0x00000600+((x)*4)) -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5__SIZE 0x00000020 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B0_SHIFT 0 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B0_MASK 0x0000001f -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G0_SHIFT 5 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G0_MASK 0x000003e0 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R0_SHIFT 10 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R0_MASK 0x00007c00 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B1_SHIFT 16 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B1_MASK 0x001f0000 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G1_SHIFT 21 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G1_MASK 0x03e00000 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R1_SHIFT 26 -#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R1_MASK 0x7c000000 -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8(x) (0x00000700+((x)*4)) -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8__SIZE 0x00000040 -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_B_SHIFT 0 -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_B_MASK 0x000000ff -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_G_SHIFT 8 -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_G_MASK 0x0000ff00 -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_R_SHIFT 16 -#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_R_MASK 0x00ff0000 - - -#define NV03_VIDEO_LUT_CURSOR_DAC 0x00000046 - -#define NV03_VIDEO_LUT_CURSOR_DAC_SYNCHRONIZE 0x00000100 -#define NV03_VIDEO_LUT_CURSOR_DAC_STOP_IMAGE 0x00000104 -#define NV03_VIDEO_LUT_CURSOR_DAC_STOP_CURSOR 0x00000108 -#define NV03_VIDEO_LUT_CURSOR_DAC_STOP_DAC 0x0000010c -#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_NOTIFY 0x00000180 -#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_IMAGE(x) (0x00000184+((x)*4)) -#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_IMAGE__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_LUT(x) (0x0000018c+((x)*4)) -#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_LUT__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_CURSOR(x) (0x00000194+((x)*4)) -#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_CURSOR__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_GET 0x000002fc -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_OFFSET(x) (0x00000300+((x)*8)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_OFFSET__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT(x) (0x00000304+((x)*8)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_PITCH_SHIFT 0 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_PITCH_MASK 0x0000ffff -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_COLOR_SHIFT 16 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_COLOR_MASK 0x0fff0000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_NOTIFY_SHIFT 28 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_NOTIFY_MASK 0xf0000000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_OFFSET(x) (0x00000340+((x)*12)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_OFFSET__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT(x) (0x00000344+((x)*12)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_X_SHIFT 0 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_X_MASK 0x0000ffff -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_Y_SHIFT 16 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_Y_MASK 0xffff0000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_FORMAT(x) (0x00000348+((x)*12)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_FORMAT__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A 0x00000358 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_X_SHIFT 0 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_X_MASK 0x0000ffff -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_Y_SHIFT 16 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_Y_MASK 0xffff0000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE(x) (0x00000380+((x)*16)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_W_SHIFT 0 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_W_MASK 0x0000ffff -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_H_SHIFT 16 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_H_MASK 0xffff0000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC(x) (0x00000384+((x)*16)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_START_SHIFT 0 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_START_MASK 0x0000ffff -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_WIDTH_SHIFT 16 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_WIDTH_MASK 0x0fff0000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_POLARITY_SHIFT 28 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_POLARITY_MASK 0xf0000000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC(x) (0x00000388+((x)*16)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_START_SHIFT 0 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_START_MASK 0x0000ffff -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_WIDTH_SHIFT 16 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_WIDTH_MASK 0x0fff0000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_POLARITY_SHIFT 28 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_POLARITY_MASK 0xf0000000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE(x) (0x0000038c+((x)*16)) -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE__SIZE 0x00000002 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_WIDTH_SHIFT 0 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_WIDTH_MASK 0x0000ffff -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_HEIGHT_SHIFT 16 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_HEIGHT_MASK 0x0fff0000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_NOTIFY_SHIFT 28 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_NOTIFY_MASK 0xf0000000 -#define NV03_VIDEO_LUT_CURSOR_DAC_SET_PIXEL_CLOCK 0x000003a0 - - -#define NV03_DX3_TEXTURED_TRIANGLE 0x00000048 - -#define NV03_DX3_TEXTURED_TRIANGLE_NOP 0x00000100 -#define NV03_DX3_TEXTURED_TRIANGLE_NOTIFY 0x00000104 -#define NV03_DX3_TEXTURED_TRIANGLE_PATCH 0x0000010c -#define NV03_DX3_TEXTURED_TRIANGLE_DMA_NOTIFY 0x00000180 -#define NV03_DX3_TEXTURED_TRIANGLE_DMA_TEXTURE 0x00000184 -#define NV03_DX3_TEXTURED_TRIANGLE_CLIP_RECTANGLE 0x00000188 -#define NV03_DX3_TEXTURED_TRIANGLE_SURFACE 0x0000018c -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_OFFSET 0x00000304 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT 0x00000308 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_MASK_SHIFT 0 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_MASK_MASK 0x0000ffff -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_ENABLE_SHIFT 16 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_ENABLE_MASK 0x000f0000 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_SHIFT 20 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_MASK 0x00f00000 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MIN_SHIFT 24 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MIN_MASK 0x0f000000 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MAX_SHIFT 28 -#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MAX_MASK 0xf0000000 -#define NV03_DX3_TEXTURED_TRIANGLE_FILTER 0x0000030c -#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_X_SHIFT 0 -#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_X_MASK 0x0000001f -#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_Y_SHIFT 8 -#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_Y_MASK 0x00001f00 -#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SIZE_ADJUST_SHIFT 16 -#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SIZE_ADJUST_MASK 0x00ff0000 -#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR 0x00000310 -#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_B_SHIFT 0 -#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_B_MASK 0x000000ff -#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_G_SHIFT 8 -#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_G_MASK 0x0000ff00 -#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_R_SHIFT 16 -#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_R_MASK 0x00ff0000 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT 0x00000314 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_INTERPOLATOR_SHIFT 0 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_INTERPOLATOR_MASK 0x0000000f -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_U_SHIFT 4 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_U_MASK 0x00000030 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_V_SHIFT 6 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_V_MASK 0x000000c0 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_SOURCE_COLOR_SHIFT 8 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_SOURCE_COLOR_MASK 0x00000f00 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_CULLING_SHIFT 12 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_CULLING_MASK 0x00007000 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_PERSPECTIVE_ENABLE (1 << 15) -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_FUNC_SHIFT 16 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_FUNC_MASK 0x000f0000 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_WRITE_ENABLE_SHIFT 20 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_WRITE_ENABLE_MASK 0x00f00000 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_COLOR_WRITE_ENABLE_SHIFT 24 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_COLOR_WRITE_ENABLE_MASK 0x07000000 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_ROP_SHIFT 27 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_ROP_MASK 0x18000000 -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_BETA (1 << 29) -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_DST_BLEND (1 << 30) -#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_SRC_BLEND (1 << 31) -#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL 0x00000318 -#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_REF_SHIFT 0 -#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_REF_MASK 0x000000ff -#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_FUNC_SHIFT 8 -#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_FUNC_MASK 0xffffff00 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR(x) (0x00001000+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR__SIZE 0x00000040 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I0_SHIFT 0 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I0_MASK 0x0000000f -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I1_SHIFT 4 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I1_MASK 0x000000f0 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I2_SHIFT 8 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I2_MASK 0x00000f00 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I3_SHIFT 12 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I3_MASK 0x0000f000 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I4_SHIFT 16 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I4_MASK 0x000f0000 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I5_SHIFT 20 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I5_MASK 0x00f00000 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_FOG_SHIFT 24 -#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_FOG_MASK 0xff000000 -#define NV03_DX3_TEXTURED_TRIANGLE_COLOR(x) (0x00001004+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_COLOR__SIZE 0x00000040 -#define NV03_DX3_TEXTURED_TRIANGLE_X(x) (0x00001008+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_X__SIZE 0x00000040 -#define NV03_DX3_TEXTURED_TRIANGLE_Y(x) (0x0000100c+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_Y__SIZE 0x00000040 -#define NV03_DX3_TEXTURED_TRIANGLE_Z(x) (0x00001010+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_Z__SIZE 0x00000040 -#define NV03_DX3_TEXTURED_TRIANGLE_M(x) (0x00001014+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_M__SIZE 0x00000040 -#define NV03_DX3_TEXTURED_TRIANGLE_U(x) (0x00001018+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_U__SIZE 0x00000040 -#define NV03_DX3_TEXTURED_TRIANGLE_V(x) (0x0000101c+((x)*32)) -#define NV03_DX3_TEXTURED_TRIANGLE_V__SIZE 0x00000040 - - -#define NV04_GDI_RECTANGLE_TEXT 0x0000004a - -#define NV04_GDI_RECTANGLE_TEXT_NOP 0x00000100 -#define NV04_GDI_RECTANGLE_TEXT_NOTIFY 0x00000104 -#define NV04_GDI_RECTANGLE_TEXT_PATCH 0x0000010c -#define NV04_GDI_RECTANGLE_TEXT_PM_TRIGGER 0x00000140 -#define NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY 0x00000180 -#define NV04_GDI_RECTANGLE_TEXT_DMA_FONTS 0x00000184 -#define NV04_GDI_RECTANGLE_TEXT_PATTERN 0x00000188 -#define NV04_GDI_RECTANGLE_TEXT_ROP 0x0000018c -#define NV04_GDI_RECTANGLE_TEXT_BETA1 0x00000190 -#define NV04_GDI_RECTANGLE_TEXT_BETA4 0x00000194 -#define NV04_GDI_RECTANGLE_TEXT_SURFACE 0x00000198 -#define NV04_GDI_RECTANGLE_TEXT_OPERATION 0x000002fc -#define NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY_AND 0x00000000 -#define NV04_GDI_RECTANGLE_TEXT_OPERATION_ROP_AND 0x00000001 -#define NV04_GDI_RECTANGLE_TEXT_OPERATION_BLEND_AND 0x00000002 -#define NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY 0x00000003 -#define NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV04_GDI_RECTANGLE_TEXT_OPERATION_BLEND_PREMULT 0x00000005 -#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT 0x00000300 -#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5 0x00000001 -#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_X16A1R5G5B5 0x00000002 -#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8 0x00000003 -#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT 0x00000304 -#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_CGA6 0x00000001 -#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE 0x00000002 -#define NV04_GDI_RECTANGLE_TEXT_COLOR1_A 0x000003fc -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT(x) (0x00000400+((x)*8)) -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT__SIZE 0x00000020 -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE(x) (0x00000404+((x)*8)) -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE__SIZE 0x00000020 -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0 0x000005f4 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_L_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_L_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_T_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_T_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1 0x000005f8 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_R_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_R_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_B_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_B_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_COLOR1_B 0x000005fc -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0(x) (0x00000600+((x)*8)) -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0__SIZE 0x00000020 -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1(x) (0x00000604+((x)*8)) -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1__SIZE 0x00000020 -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0 0x000007ec -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1 0x000007f0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_COLOR1_C 0x000007f4 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_C 0x000007f8 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_W_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_W_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_H_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_H_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_POINT_C 0x000007fc -#define NV04_GDI_RECTANGLE_TEXT_POINT_C_X_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_POINT_C_X_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_POINT_C_Y_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_POINT_C_Y_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C(x) (0x00000800+((x)*4)) -#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C__SIZE 0x00000080 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0 0x00000be4 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1 0x00000be8 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_COLOR0_E 0x00000bec -#define NV04_GDI_RECTANGLE_TEXT_COLOR1_E 0x00000bf0 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E 0x00000bf4 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E 0x00000bf8 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_POINT_E 0x00000bfc -#define NV04_GDI_RECTANGLE_TEXT_POINT_E_X_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_POINT_E_X_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_POINT_E_Y_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_POINT_E_Y_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E(x) (0x00000c00+((x)*4)) -#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E__SIZE 0x00000080 -#define NV04_GDI_RECTANGLE_TEXT_FONT_F 0x00000ff0 -#define NV04_GDI_RECTANGLE_TEXT_FONT_F_OFFSET_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_FONT_F_OFFSET_MASK 0x0fffffff -#define NV04_GDI_RECTANGLE_TEXT_FONT_F_PITCH_SHIFT 28 -#define NV04_GDI_RECTANGLE_TEXT_FONT_F_PITCH_MASK 0xf0000000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0 0x00000ff4 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_L_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_L_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_T_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_T_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1 0x00000ff8 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_R_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_R_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_B_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_B_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_COLOR1_F 0x00000ffc -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F(x) (0x00001000+((x)*4)) -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F__SIZE 0x00000100 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_INDEX_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_INDEX_MASK 0x000000ff -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_X_SHIFT 8 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_X_MASK 0x000fff00 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_Y_SHIFT 20 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_Y_MASK 0xfff00000 -#define NV04_GDI_RECTANGLE_TEXT_FONT_G 0x000017f0 -#define NV04_GDI_RECTANGLE_TEXT_FONT_G_OFFSET_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_FONT_G_OFFSET_MASK 0x0fffffff -#define NV04_GDI_RECTANGLE_TEXT_FONT_G_PITCH_SHIFT 28 -#define NV04_GDI_RECTANGLE_TEXT_FONT_G_PITCH_MASK 0xf0000000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0 0x000017f4 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_L_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_L_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_T_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_T_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1 0x000017f8 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_R_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_R_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_B_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_B_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_COLOR1_G 0x000017fc -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT(x) (0x00001800+((x)*8)) -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT__SIZE 0x00000100 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_X_SHIFT 0 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_X_MASK 0x0000ffff -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_Y_SHIFT 16 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_Y_MASK 0xffff0000 -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_INDEX(x) (0x00001804+((x)*8)) -#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_INDEX__SIZE 0x00000100 - - -#define NV03_GDI_RECTANGLE_TEXT 0x0000004b - -#define NV03_GDI_RECTANGLE_TEXT_NOP 0x00000100 -#define NV03_GDI_RECTANGLE_TEXT_NOTIFY 0x00000104 -#define NV03_GDI_RECTANGLE_TEXT_DMA_NOTIFY 0x00000180 -#define NV03_GDI_RECTANGLE_TEXT_PATTERN 0x00000184 -#define NV03_GDI_RECTANGLE_TEXT_ROP 0x00000188 -#define NV03_GDI_RECTANGLE_TEXT_BETA1 0x0000018c -#define NV03_GDI_RECTANGLE_TEXT_SURFACE 0x00000190 -#define NV03_GDI_RECTANGLE_TEXT_OPERATION 0x000002fc -#define NV03_GDI_RECTANGLE_TEXT_COLOR_FORMAT 0x00000300 -#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT 0x00000304 -#define NV03_GDI_RECTANGLE_TEXT_COLOR1_A 0x000003fc -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT 0x00000400 -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE 0x00000404 -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B 0x000007f4 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_L_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_L_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_T_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_T_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B 0x000007f8 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_R_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_R_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_B_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_B_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_COLOR1_B 0x000007fc -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0 0x00000800 -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1 0x00000804 -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0 0x00000bec -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1 0x00000bf0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_COLOR1_C 0x00000bf4 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_C 0x00000bf8 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_W_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_W_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_H_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_H_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_POINT_C 0x00000bfc -#define NV03_GDI_RECTANGLE_TEXT_POINT_C_X_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_POINT_C_X_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_POINT_C_Y_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_POINT_C_Y_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C(x) (0x00000c00+((x)*4)) -#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C__SIZE 0x00000020 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0 0x00000fe8 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_L_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_L_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_T_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_T_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1 0x00000fec -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_R_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_R_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_B_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_B_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_COLOR1_D 0x00000ff0 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D 0x00000ff4 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_W_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_W_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_H_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_H_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D 0x00000ff8 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_W_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_W_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_H_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_H_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_POINT_D 0x00000ffc -#define NV03_GDI_RECTANGLE_TEXT_POINT_D_X_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_POINT_D_X_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_POINT_D_Y_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_POINT_D_Y_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_D(x) (0x00001000+((x)*4)) -#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_D__SIZE 0x00000020 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0 0x000013e4 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1 0x000013e8 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_COLOR0_E 0x000013ec -#define NV03_GDI_RECTANGLE_TEXT_COLOR1_E 0x000013f0 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E 0x000013f4 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E 0x000013f8 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_POINT_E 0x000013fc -#define NV03_GDI_RECTANGLE_TEXT_POINT_E_X_SHIFT 0 -#define NV03_GDI_RECTANGLE_TEXT_POINT_E_X_MASK 0x0000ffff -#define NV03_GDI_RECTANGLE_TEXT_POINT_E_Y_SHIFT 16 -#define NV03_GDI_RECTANGLE_TEXT_POINT_E_Y_MASK 0xffff0000 -#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E(x) (0x00001400+((x)*4)) -#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E__SIZE 0x00000020 - - -#define NV04_SWIZZLED_SURFACE 0x00000052 - -#define NV04_SWIZZLED_SURFACE_NOP 0x00000100 -#define NV04_SWIZZLED_SURFACE_NOTIFY 0x00000104 -#define NV04_SWIZZLED_SURFACE_DMA_NOTIFY 0x00000180 -#define NV04_SWIZZLED_SURFACE_DMA_IMAGE 0x00000184 -#define NV04_SWIZZLED_SURFACE_FORMAT 0x00000300 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_SHIFT 0 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_MASK 0x000000ff -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y8 0x00000001 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1R5G5B5_Z1R5G5B5 0x00000002 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1R5G5B5_X1R5G5B5 0x00000003 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_R5G6B5 0x00000004 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y16 0x00000005 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X8R8G8B8_Z8R8G8B8 0x00000006 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X8R8G8B8_X8R8G8B8 0x00000007 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1A7R8G8B8_Z1A7R8G8B8 0x00000008 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1A7R8G8B8_X1A7R8G8B8 0x00000009 -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_A8R8G8B8 0x0000000a -#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y32 0x0000000b -#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT 16 -#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_MASK 0x00ff0000 -#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT 24 -#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_MASK 0xff000000 -#define NV04_SWIZZLED_SURFACE_OFFSET 0x00000304 - - -#define NV04_CONTEXT_SURFACES_3D 0x00000053 - -#define NV04_CONTEXT_SURFACES_3D_NOP 0x00000100 -#define NV04_CONTEXT_SURFACES_3D_NOTIFY 0x00000104 -#define NV04_CONTEXT_SURFACES_3D_DMA_NOTIFY 0x00000180 -#define NV04_CONTEXT_SURFACES_3D_DMA_COLOR 0x00000184 -#define NV04_CONTEXT_SURFACES_3D_DMA_ZETA 0x00000188 -#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL 0x000002f8 -#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_X_SHIFT 0 -#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_X_MASK 0x0000ffff -#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_W_SHIFT 16 -#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_W_MASK 0xffff0000 -#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL 0x000002fc -#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_Y_SHIFT 0 -#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_Y_MASK 0x0000ffff -#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_H_SHIFT 16 -#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_H_MASK 0xffff0000 -#define NV04_CONTEXT_SURFACES_3D_FORMAT 0x00000300 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_SHIFT 0 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_MASK 0x000000ff -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1R5G5B5_Z1R5G5B5 0x00000001 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1R5G5B5_X1R5G5B5 0x00000002 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5 0x00000003 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_Z8R8G8B8 0x00000004 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8 0x00000005 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1A7R8G8B8_Z1A7R8G8B8 0x00000006 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1A7R8G8B8_X1A7R8G8B8 0x00000007 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8 0x00000008 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_SHIFT 8 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_MASK 0x0000ff00 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_PITCH 0x00000100 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_SWIZZLE 0x00000200 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_U_SHIFT 16 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_U_MASK 0x00ff0000 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_V_SHIFT 24 -#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_V_MASK 0xff000000 -#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE 0x00000304 -#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_W_SHIFT 0 -#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_W_MASK 0x0000ffff -#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_H_SHIFT 16 -#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_H_MASK 0xffff0000 -#define NV04_CONTEXT_SURFACES_3D_PITCH 0x00000308 -#define NV04_CONTEXT_SURFACES_3D_PITCH_COLOR_SHIFT 0 -#define NV04_CONTEXT_SURFACES_3D_PITCH_COLOR_MASK 0x0000ffff -#define NV04_CONTEXT_SURFACES_3D_PITCH_ZETA_SHIFT 16 -#define NV04_CONTEXT_SURFACES_3D_PITCH_ZETA_MASK 0xffff0000 -#define NV04_CONTEXT_SURFACES_3D_OFFSET_COLOR 0x0000030c -#define NV04_CONTEXT_SURFACES_3D_OFFSET_ZETA 0x00000310 - - -#define NV04_DX5_TEXTURED_TRIANGLE 0x00000054 - -#define NV04_DX5_TEXTURED_TRIANGLE_NOP 0x00000100 -#define NV04_DX5_TEXTURED_TRIANGLE_NOTIFY 0x00000104 -#define NV04_DX5_TEXTURED_TRIANGLE_DMA_NOTIFY 0x00000180 -#define NV04_DX5_TEXTURED_TRIANGLE_DMA_A 0x00000184 -#define NV04_DX5_TEXTURED_TRIANGLE_DMA_B 0x00000188 -#define NV04_DX5_TEXTURED_TRIANGLE_SURFACE 0x0000018c -#define NV04_DX5_TEXTURED_TRIANGLE_COLORKEY 0x00000300 -#define NV04_DX5_TEXTURED_TRIANGLE_OFFSET 0x00000304 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT 0x00000308 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_DMA_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_DMA_MASK 0x00000003 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_KEY_MATCH_SHIFT 2 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_KEY_MATCH_MASK 0x0000000c -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_SHIFT 4 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_MASK 0x00000030 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_CENTER 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_CORNER 0x00000020 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_SHIFT 6 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_MASK 0x000000c0 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_CENTER 0x00000040 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_CORNER 0x00000080 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_MASK 0x00000f00 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_Y8 0x00000100 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_A1R5G5B5 0x00000200 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_X1R5G5B5 0x00000300 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_A4R4G4B4 0x00000400 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_R5G6B5 0x00000500 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_A8R8G8B8 0x00000600 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_X8R8G8B8 0x00000700 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_MIPMAP_LEVELS_SHIFT 12 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_MIPMAP_LEVELS_MASK 0x0000f000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_U_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_U_MASK 0x000f0000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_V_SHIFT 20 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_V_MASK 0x00f00000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_SHIFT 24 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_MASK 0x07000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_REPEAT 0x01000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_MIRRORED_REPEAT 0x02000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_CLAMP_TO_EDGE 0x03000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_CLAMP_TO_BORDER 0x04000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_CLAMP 0x05000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_WRAPU (1 << 27) -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_SHIFT 28 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_MASK 0x70000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_REPEAT 0x10000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_MIRRORED_REPEAT 0x20000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_CLAMP_TO_EDGE 0x30000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_CLAMP_TO_BORDER 0x40000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_CLAMP 0x50000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_WRAPV (1 << 31) -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER 0x0000030c -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_X_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_X_MASK 0x000000ff -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_Y_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_Y_MASK 0x00007f00 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MIPMAP_DITHER_ENABLE (1 << 15) -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MIPMAP_LODBIAS_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MIPMAP_LODBIAS_MASK 0x00ff0000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_SHIFT 24 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_MASK 0x07000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_NEAREST 0x01000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_LINEAR 0x02000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x03000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x04000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x05000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x06000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_ANISOTROPIC_MINIFY_ENABLE (1 << 27) -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_SHIFT 28 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_MASK 0x70000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_NEAREST 0x10000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_LINEAR 0x20000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_ANISOTROPIC_MAGNIFY_ENABLE (1 << 31) -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND 0x00000310 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_MAP_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_MAP_MASK 0x0000000f -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_MASK_BIT_SHIFT 4 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_MASK_BIT_MASK 0x00000030 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_SHIFT 6 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_MASK 0x000000c0 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_FLAT 0x00000040 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_GOURAUD 0x00000080 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_PHONG 0x000000c0 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_MASK 0x00000f00 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE_SHIFT 12 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE_MASK 0x0000f000 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE_MASK 0x000f0000 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_ALPHA_ENABLE_SHIFT 20 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_ALPHA_ENABLE_MASK 0x00f00000 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SRC_SHIFT 24 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SRC_MASK 0x0f000000 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_DST_SHIFT 28 -#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_DST_MASK 0xf0000000 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL 0x00000314 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_REF_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_REF_MASK 0x000000ff -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_FUNC_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_FUNC_MASK 0x00000f00 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_TEST_ENABLE (1 << 12) -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ORIGIN (1 << 13) -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_ENABLE_SHIFT 14 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_ENABLE_MASK 0x0000c000 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FUNC_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FUNC_MASK 0x000f0000 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_CULL_MODE_SHIFT 20 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_CULL_MODE_MASK 0x00300000 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_DITHER_ENABLE (1 << 22) -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_PERSPECTIVE_ENABLE (1 << 23) -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_WRITE_ENABLE_SHIFT 24 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_WRITE_ENABLE_MASK 0x3f000000 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FORMAT_SHIFT 30 -#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FORMAT_MASK 0xc0000000 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR 0x00000318 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_B_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_B_MASK 0x000000ff -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_G_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_G_MASK 0x0000ff00 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_R_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_R_MASK 0x00ff0000 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_A_SHIFT 24 -#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_A_MASK 0xff000000 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(x) (0x00000400+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SY(x) (0x00000404+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SY__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SZ(x) (0x00000408+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SZ__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_RHW(x) (0x0000040c+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_RHW__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR(x) (0x00000410+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_B_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_B_MASK 0x000000ff -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_G_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_G_MASK 0x0000ff00 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_R_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_R_MASK 0x00ff0000 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_A_SHIFT 24 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_A_MASK 0xff000000 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR(x) (0x00000414+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_B_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_B_MASK 0x000000ff -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_G_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_G_MASK 0x0000ff00 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_R_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_R_MASK 0x00ff0000 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_FOG_SHIFT 24 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_FOG_MASK 0xff000000 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TU(x) (0x00000418+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TU__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TV(x) (0x0000041c+((x)*32)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TV__SIZE 0x00000010 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE(x) (0x00000600+((x)*4)) -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE__SIZE 0x00000040 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I0_SHIFT 0 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I0_MASK 0x0000000f -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I1_SHIFT 4 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I1_MASK 0x000000f0 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I2_SHIFT 8 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I2_MASK 0x00000f00 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I3_SHIFT 12 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I3_MASK 0x0000f000 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I4_SHIFT 16 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I4_MASK 0x000f0000 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I5_SHIFT 20 -#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I5_MASK 0x00f00000 - - -#define NV04_DX6_MULTITEX_TRIANGLE 0x00000055 - -#define NV04_DX6_MULTITEX_TRIANGLE_NOP 0x00000100 -#define NV04_DX6_MULTITEX_TRIANGLE_NOTIFY 0x00000104 -#define NV04_DX6_MULTITEX_TRIANGLE_DMA_NOTIFY 0x00000180 -#define NV04_DX6_MULTITEX_TRIANGLE_DMA_A 0x00000184 -#define NV04_DX6_MULTITEX_TRIANGLE_DMA_B 0x00000188 -#define NV04_DX6_MULTITEX_TRIANGLE_SURFACE 0x0000018c -#define NV04_DX6_MULTITEX_TRIANGLE_OFFSET(x) (0x00000308+((x)*4)) -#define NV04_DX6_MULTITEX_TRIANGLE_OFFSET__SIZE 0x00000002 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT(x) (0x00000310+((x)*4)) -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT__SIZE 0x00000002 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_DMA_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_DMA_MASK 0x0000000f -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_ZOH_SHIFT 4 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_ZOH_MASK 0x00000030 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_FOH_SHIFT 6 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_FOH_MASK 0x000000c0 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_COLOR_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_COLOR_MASK 0x00000f00 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_MIPMAP_LEVELS_SHIFT 12 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_MIPMAP_LEVELS_MASK 0x0000f000 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_U_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_U_MASK 0x000f0000 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_V_SHIFT 20 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_V_MASK 0x00f00000 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSU_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSU_MASK 0x07000000 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_WRAPU (1 << 27) -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSV_SHIFT 28 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSV_MASK 0x70000000 -#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_WRAPV (1 << 31) -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER(x) (0x00000318+((x)*4)) -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER__SIZE 0x00000002 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_X_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_X_MASK 0x000000ff -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_Y_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_Y_MASK 0x00007f00 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MIPMAP_DITHER_ENABLE (1 << 15) -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MIPMAP_LODBIAS_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MIPMAP_LODBIAS_MASK 0x00ff0000 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MINIFY_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MINIFY_MASK 0x07000000 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_ANISOTROPIC_MINIFY_ENABLE (1 << 27) -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MAGNIFY_SHIFT 28 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MAGNIFY_MASK 0x70000000 -#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_ANISOTROPIC_MAGNIFY_ENABLE (1 << 31) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA 0x00000320 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE0 (1 << 0) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA0 (1 << 1) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT0_SHIFT 2 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT0_MASK 0x000000fc -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE1 (1 << 8) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA1 (1 << 9) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT1_SHIFT 10 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT1_MASK 0x0000fc00 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE2 (1 << 16) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA2 (1 << 17) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT2_SHIFT 18 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT2_MASK 0x00fc0000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE3 (1 << 24) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA3 (1 << 25) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT3_SHIFT 26 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT3_MASK 0x1c000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_OPERATION_SHIFT 29 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_OPERATION_MASK 0xe0000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR 0x00000324 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE0 (1 << 0) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA0 (1 << 1) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT0_SHIFT 2 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT0_MASK 0x000000fc -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE1 (1 << 8) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA1 (1 << 9) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT1_SHIFT 10 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT1_MASK 0x0000fc00 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE2 (1 << 16) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA2 (1 << 17) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT2_SHIFT 18 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT2_MASK 0x00fc0000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE3 (1 << 24) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA3 (1 << 25) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT3_SHIFT 26 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT3_MASK 0x1c000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_OPERATION_SHIFT 29 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_OPERATION_MASK 0xe0000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA 0x0000032c -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE0 (1 << 0) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA0 (1 << 1) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT0_SHIFT 2 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT0_MASK 0x000000fc -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE1 (1 << 8) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA1 (1 << 9) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT1_SHIFT 10 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT1_MASK 0x0000fc00 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE2 (1 << 16) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA2 (1 << 17) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT2_SHIFT 18 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT2_MASK 0x00fc0000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE3 (1 << 24) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA3 (1 << 25) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT3_SHIFT 26 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT3_MASK 0x1c000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_OPERATION_SHIFT 29 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_OPERATION_MASK 0xe0000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR 0x00000330 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE0 (1 << 0) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA0 (1 << 1) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT0_SHIFT 2 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT0_MASK 0x000000fc -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE1 (1 << 8) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA1 (1 << 9) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT1_SHIFT 10 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT1_MASK 0x0000fc00 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE2 (1 << 16) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA2 (1 << 17) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT2_SHIFT 18 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT2_MASK 0x00fc0000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE3 (1 << 24) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA3 (1 << 25) -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT3_SHIFT 26 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT3_MASK 0x1c000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_OPERATION_SHIFT 29 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_OPERATION_MASK 0xe0000000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR 0x00000334 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_B_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_B_MASK 0x000000ff -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_G_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_G_MASK 0x0000ff00 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_R_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_R_MASK 0x00ff0000 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_A_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_A_MASK 0xff000000 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND 0x00000338 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_MASK_BIT_SHIFT 4 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_MASK_BIT_MASK 0x00000030 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_SHIFT 6 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_MASK 0x000000c0 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_MASK 0x00000f00 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE_SHIFT 12 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE_MASK 0x0000f000 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_FOG_ENABLE_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_FOG_ENABLE_MASK 0x000f0000 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_ALPHA_ENABLE_SHIFT 20 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_ALPHA_ENABLE_MASK 0x00f00000 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SRC_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SRC_MASK 0x0f000000 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_DST_SHIFT 28 -#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_DST_MASK 0xf0000000 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0 0x0000033c -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_REF_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_REF_MASK 0x000000ff -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_FUNC_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_FUNC_MASK 0x00000f00 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_TEST_ENABLE (1 << 12) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ORIGIN (1 << 13) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_ENABLE_SHIFT 14 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_ENABLE_MASK 0x0000c000 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FUNC_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FUNC_MASK 0x000f0000 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_CULL_MODE_SHIFT 20 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_CULL_MODE_MASK 0x00300000 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_DITHER_ENABLE (1 << 22) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_PERSPECTIVE_ENABLE (1 << 23) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_WRITE_ENABLE (1 << 24) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_STENCIL_WRITE_ENABLE (1 << 25) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_WRITE_ENABLE (1 << 26) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_RED_WRITE_ENABLE (1 << 27) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_GREEN_WRITE_ENABLE (1 << 28) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_BLUE_WRITE_ENABLE (1 << 29) -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FORMAT_SHIFT 30 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FORMAT_MASK 0xc0000000 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1 0x00000340 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_TEST_ENABLE_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_TEST_ENABLE_MASK 0x0000000f -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_FUNC_SHIFT 4 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_FUNC_MASK 0x000000f0 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_REF_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_REF_MASK 0x0000ff00 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_READ_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_READ_MASK 0x00ff0000 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_WRITE_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_WRITE_MASK 0xff000000 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2 0x00000344 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_FAIL_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_FAIL_MASK 0x0000000f -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZFAIL_SHIFT 4 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZFAIL_MASK 0x000000f0 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZPASS_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZPASS_MASK 0x00000f00 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR 0x00000348 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_B_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_B_MASK 0x000000ff -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_G_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_G_MASK 0x0000ff00 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_R_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_R_MASK 0x00ff0000 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_A_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_A_MASK 0xff000000 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SX(x) (0x00000400+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SX__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SY(x) (0x00000404+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SY__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SZ(x) (0x00000408+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SZ__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_RHW(x) (0x0000040c+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_RHW__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR(x) (0x00000410+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_B_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_B_MASK 0x000000ff -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_G_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_G_MASK 0x0000ff00 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_R_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_R_MASK 0x00ff0000 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_A_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_A_MASK 0xff000000 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR(x) (0x00000414+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_B_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_B_MASK 0x000000ff -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_G_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_G_MASK 0x0000ff00 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_R_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_R_MASK 0x00ff0000 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_FOG_SHIFT 24 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_FOG_MASK 0xff000000 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU0(x) (0x00000418+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU0__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV0(x) (0x0000041c+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV0__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU1(x) (0x00000420+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU1__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV1(x) (0x00000424+((x)*40)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV1__SIZE 0x00000008 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE(x) (0x00000540+((x)*4)) -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE__SIZE 0x00000030 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I0_SHIFT 0 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I0_MASK 0x0000000f -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I1_SHIFT 4 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I1_MASK 0x000000f0 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I2_SHIFT 8 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I2_MASK 0x00000f00 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I3_SHIFT 12 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I3_MASK 0x0000f000 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I4_SHIFT 16 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I4_MASK 0x000f0000 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I5_SHIFT 20 -#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I5_MASK 0x00f00000 - - -#define NV10_DX5_TEXTURED_TRIANGLE 0x00000094 - - - -#define NV10TCL 0x00000056 - -#define NV10TCL_NOP 0x00000100 -#define NV10TCL_NOTIFY 0x00000104 -#define NV10TCL_DMA_NOTIFY 0x00000180 -#define NV10TCL_DMA_IN_MEMORY0 0x00000184 -#define NV10TCL_DMA_IN_MEMORY1 0x00000188 -#define NV10TCL_DMA_VTXBUF0 0x0000018c -#define NV10TCL_DMA_IN_MEMORY2 0x00000194 -#define NV10TCL_DMA_IN_MEMORY3 0x00000198 -#define NV10TCL_RT_HORIZ 0x00000200 -#define NV10TCL_RT_HORIZ_X_SHIFT 0 -#define NV10TCL_RT_HORIZ_X_MASK 0x0000ffff -#define NV10TCL_RT_HORIZ_W_SHIFT 16 -#define NV10TCL_RT_HORIZ_W_MASK 0xffff0000 -#define NV10TCL_RT_VERT 0x00000204 -#define NV10TCL_RT_VERT_Y_SHIFT 0 -#define NV10TCL_RT_VERT_Y_MASK 0x0000ffff -#define NV10TCL_RT_VERT_H_SHIFT 16 -#define NV10TCL_RT_VERT_H_MASK 0xffff0000 -#define NV10TCL_RT_FORMAT 0x00000208 -#define NV10TCL_RT_FORMAT_TYPE_SHIFT 8 -#define NV10TCL_RT_FORMAT_TYPE_MASK 0x00000f00 -#define NV10TCL_RT_FORMAT_TYPE_LINEAR 0x00000100 -#define NV10TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200 -#define NV10TCL_RT_FORMAT_COLOR_SHIFT 0 -#define NV10TCL_RT_FORMAT_COLOR_MASK 0x0000001f -#define NV10TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003 -#define NV10TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005 -#define NV10TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008 -#define NV10TCL_RT_FORMAT_COLOR_B8 0x00000009 -#define NV10TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d -#define NV10TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f -#define NV10TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010 -#define NV10TCL_RT_PITCH 0x0000020c -#define NV10TCL_RT_PITCH_COLOR_PITCH_SHIFT 0 -#define NV10TCL_RT_PITCH_COLOR_PITCH_MASK 0x0000ffff -#define NV10TCL_RT_PITCH_ZETA_PITCH_SHIFT 16 -#define NV10TCL_RT_PITCH_ZETA_PITCH_MASK 0xffff0000 -#define NV10TCL_COLOR_OFFSET 0x00000210 -#define NV10TCL_ZETA_OFFSET 0x00000214 -#define NV10TCL_TX_OFFSET(x) (0x00000218+((x)*4)) -#define NV10TCL_TX_OFFSET__SIZE 0x00000002 -#define NV10TCL_TX_FORMAT(x) (0x00000220+((x)*4)) -#define NV10TCL_TX_FORMAT__SIZE 0x00000002 -#define NV10TCL_TX_FORMAT_DMA0 (1 << 0) -#define NV10TCL_TX_FORMAT_DMA1 (1 << 1) -#define NV10TCL_TX_FORMAT_CUBE_MAP (1 << 2) -#define NV10TCL_TX_FORMAT_FORMAT_SHIFT 7 -#define NV10TCL_TX_FORMAT_FORMAT_MASK 0x00000780 -#define NV10TCL_TX_FORMAT_FORMAT_L8 0x00000000 -#define NV10TCL_TX_FORMAT_FORMAT_A8 0x00000080 -#define NV10TCL_TX_FORMAT_FORMAT_A1R5G5B5 0x00000100 -#define NV10TCL_TX_FORMAT_FORMAT_A8_RECT 0x00000180 -#define NV10TCL_TX_FORMAT_FORMAT_A4R4G4B4 0x00000200 -#define NV10TCL_TX_FORMAT_FORMAT_R5G6B5 0x00000280 -#define NV10TCL_TX_FORMAT_FORMAT_A8R8G8B8 0x00000300 -#define NV10TCL_TX_FORMAT_FORMAT_X8R8G8B8 0x00000380 -#define NV10TCL_TX_FORMAT_FORMAT_INDEX8 0x00000580 -#define NV10TCL_TX_FORMAT_FORMAT_DXT1 0x00000600 -#define NV10TCL_TX_FORMAT_FORMAT_DXT3 0x00000700 -#define NV10TCL_TX_FORMAT_FORMAT_DXT5 0x00000780 -#define NV10TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT 0x00000800 -#define NV10TCL_TX_FORMAT_FORMAT_R5G6B5_RECT 0x00000880 -#define NV10TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT 0x00000900 -#define NV10TCL_TX_FORMAT_FORMAT_L8_RECT 0x00000980 -#define NV10TCL_TX_FORMAT_FORMAT_A8L8 0x00000d00 -#define NV10TCL_TX_FORMAT_FORMAT_A8_RECT2 0x00000d80 -#define NV10TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT 0x00000e80 -#define NV10TCL_TX_FORMAT_FORMAT_R8G8B8_RECT 0x00000f00 -#define NV10TCL_TX_FORMAT_FORMAT_L8A8_RECT 0x00001000 -#define NV10TCL_TX_FORMAT_FORMAT_DSDT 0x00001400 -#define NV10TCL_TX_FORMAT_FORMAT_A16 0x00001900 -#define NV10TCL_TX_FORMAT_FORMAT_HILO16 0x00001980 -#define NV10TCL_TX_FORMAT_FORMAT_A16_RECT 0x00001a80 -#define NV10TCL_TX_FORMAT_FORMAT_HILO16_RECT 0x00001b00 -#define NV10TCL_TX_FORMAT_FORMAT_HILO8 0x00002200 -#define NV10TCL_TX_FORMAT_FORMAT_SIGNED_HILO8 0x00002280 -#define NV10TCL_TX_FORMAT_FORMAT_HILO8_RECT 0x00002300 -#define NV10TCL_TX_FORMAT_FORMAT_SIGNED_HILO8_RECT 0x00002380 -#define NV10TCL_TX_FORMAT_FORMAT_FLOAT_RGBA16_NV 0x00002500 -#define NV10TCL_TX_FORMAT_FORMAT_FLOAT_RGBA32_NV 0x00002580 -#define NV10TCL_TX_FORMAT_FORMAT_FLOAT_R32_NV 0x00002600 -#define NV10TCL_TX_FORMAT_NPOT (1 << 11) -#define NV10TCL_TX_FORMAT_MIPMAP (1 << 15) -#define NV10TCL_TX_FORMAT_BASE_SIZE_U_SHIFT 16 -#define NV10TCL_TX_FORMAT_BASE_SIZE_U_MASK 0x000f0000 -#define NV10TCL_TX_FORMAT_BASE_SIZE_V_SHIFT 20 -#define NV10TCL_TX_FORMAT_BASE_SIZE_V_MASK 0x00f00000 -#define NV10TCL_TX_FORMAT_WRAP_S_SHIFT 24 -#define NV10TCL_TX_FORMAT_WRAP_S_MASK 0x0f000000 -#define NV10TCL_TX_FORMAT_WRAP_S_REPEAT 0x01000000 -#define NV10TCL_TX_FORMAT_WRAP_S_MIRRORED_REPEAT 0x02000000 -#define NV10TCL_TX_FORMAT_WRAP_S_CLAMP_TO_EDGE 0x03000000 -#define NV10TCL_TX_FORMAT_WRAP_S_CLAMP_TO_BORDER 0x04000000 -#define NV10TCL_TX_FORMAT_WRAP_S_CLAMP 0x05000000 -#define NV10TCL_TX_FORMAT_WRAP_T_SHIFT 28 -#define NV10TCL_TX_FORMAT_WRAP_T_MASK 0xf0000000 -#define NV10TCL_TX_FORMAT_WRAP_T_REPEAT 0x10000000 -#define NV10TCL_TX_FORMAT_WRAP_T_MIRRORED_REPEAT 0x20000000 -#define NV10TCL_TX_FORMAT_WRAP_T_CLAMP_TO_EDGE 0x30000000 -#define NV10TCL_TX_FORMAT_WRAP_T_CLAMP_TO_BORDER 0x40000000 -#define NV10TCL_TX_FORMAT_WRAP_T_CLAMP 0x50000000 -#define NV10TCL_TX_ENABLE(x) (0x00000228+((x)*4)) -#define NV10TCL_TX_ENABLE__SIZE 0x00000002 -#define NV10TCL_TX_ENABLE_ANISOTROPY_SHIFT 4 -#define NV10TCL_TX_ENABLE_ANISOTROPY_MASK 0x00000030 -#define NV10TCL_TX_ENABLE_MIPMAP_MAX_LOD_SHIFT 14 -#define NV10TCL_TX_ENABLE_MIPMAP_MAX_LOD_MASK 0x0003c000 -#define NV10TCL_TX_ENABLE_MIPMAP_MIN_LOD_SHIFT 26 -#define NV10TCL_TX_ENABLE_MIPMAP_MIN_LOD_MASK 0x3c000000 -#define NV10TCL_TX_ENABLE_ENABLE (1 << 30) -#define NV10TCL_TX_NPOT_PITCH(x) (0x00000230+((x)*4)) -#define NV10TCL_TX_NPOT_PITCH__SIZE 0x00000002 -#define NV10TCL_TX_NPOT_PITCH_PITCH_SHIFT 16 -#define NV10TCL_TX_NPOT_PITCH_PITCH_MASK 0xffff0000 -#define NV10TCL_TX_NPOT_SIZE(x) (0x00000240+((x)*4)) -#define NV10TCL_TX_NPOT_SIZE__SIZE 0x00000002 -#define NV10TCL_TX_NPOT_SIZE_H_SHIFT 0 -#define NV10TCL_TX_NPOT_SIZE_H_MASK 0x0000ffff -#define NV10TCL_TX_NPOT_SIZE_W_SHIFT 16 -#define NV10TCL_TX_NPOT_SIZE_W_MASK 0xffff0000 -#define NV10TCL_TX_FILTER(x) (0x00000248+((x)*4)) -#define NV10TCL_TX_FILTER__SIZE 0x00000002 -#define NV10TCL_TX_FILTER_LOD_BIAS_SHIFT 8 -#define NV10TCL_TX_FILTER_LOD_BIAS_MASK 0x00000f00 -#define NV10TCL_TX_FILTER_MINIFY_SHIFT 24 -#define NV10TCL_TX_FILTER_MINIFY_MASK 0x0f000000 -#define NV10TCL_TX_FILTER_MINIFY_NEAREST 0x01000000 -#define NV10TCL_TX_FILTER_MINIFY_LINEAR 0x02000000 -#define NV10TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x03000000 -#define NV10TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x04000000 -#define NV10TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x05000000 -#define NV10TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x06000000 -#define NV10TCL_TX_FILTER_MAGNIFY_SHIFT 28 -#define NV10TCL_TX_FILTER_MAGNIFY_MASK 0xf0000000 -#define NV10TCL_TX_FILTER_MAGNIFY_NEAREST 0x10000000 -#define NV10TCL_TX_FILTER_MAGNIFY_LINEAR 0x20000000 -#define NV10TCL_TX_PALETTE_OFFSET(x) (0x00000250+((x)*4)) -#define NV10TCL_TX_PALETTE_OFFSET__SIZE 0x00000002 -#define NV10TCL_RC_IN_ALPHA(x) (0x00000260+((x)*4)) -#define NV10TCL_RC_IN_ALPHA__SIZE 0x00000002 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_SHIFT 0 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_MASK 0x0000000f -#define NV10TCL_RC_IN_ALPHA_D_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_FOG 0x00000003 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE0_NV 0x0000000c -#define NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV 0x0000000d -#define NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV10TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE (1 << 4) -#define NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE 0x00000000 -#define NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_SHIFT 5 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_MASK 0x000000e0 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV10TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_SHIFT 8 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_MASK 0x00000f00 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_FOG 0x00000300 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE0_NV 0x00000c00 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV 0x00000d00 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV10TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE (1 << 12) -#define NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE 0x00000000 -#define NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_SHIFT 13 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_MASK 0x0000e000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV10TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_SHIFT 16 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_MASK 0x000f0000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_FOG 0x00030000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE0_NV 0x000c0000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV 0x000d0000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV10TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE (1 << 20) -#define NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE 0x00000000 -#define NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_SHIFT 21 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_MASK 0x00e00000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV10TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_SHIFT 24 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_MASK 0x0f000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_FOG 0x03000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE0_NV 0x0c000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV 0x0d000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV10TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE (1 << 28) -#define NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE 0x00000000 -#define NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_SHIFT 29 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_MASK 0xe0000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV10TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV10TCL_RC_IN_RGB(x) (0x00000268+((x)*4)) -#define NV10TCL_RC_IN_RGB__SIZE 0x00000002 -#define NV10TCL_RC_IN_RGB_D_INPUT_SHIFT 0 -#define NV10TCL_RC_IN_RGB_D_INPUT_MASK 0x0000000f -#define NV10TCL_RC_IN_RGB_D_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV10TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV10TCL_RC_IN_RGB_D_INPUT_FOG 0x00000003 -#define NV10TCL_RC_IN_RGB_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV10TCL_RC_IN_RGB_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV10TCL_RC_IN_RGB_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV10TCL_RC_IN_RGB_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV10TCL_RC_IN_RGB_D_INPUT_SPARE0_NV 0x0000000c -#define NV10TCL_RC_IN_RGB_D_INPUT_SPARE1_NV 0x0000000d -#define NV10TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV10TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE (1 << 4) -#define NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV10TCL_RC_IN_RGB_D_MAPPING_SHIFT 5 -#define NV10TCL_RC_IN_RGB_D_MAPPING_MASK 0x000000e0 -#define NV10TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV10TCL_RC_IN_RGB_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV10TCL_RC_IN_RGB_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV10TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV10TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV10TCL_RC_IN_RGB_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV10TCL_RC_IN_RGB_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV10TCL_RC_IN_RGB_C_INPUT_SHIFT 8 -#define NV10TCL_RC_IN_RGB_C_INPUT_MASK 0x00000f00 -#define NV10TCL_RC_IN_RGB_C_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV10TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV10TCL_RC_IN_RGB_C_INPUT_FOG 0x00000300 -#define NV10TCL_RC_IN_RGB_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV10TCL_RC_IN_RGB_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV10TCL_RC_IN_RGB_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV10TCL_RC_IN_RGB_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV10TCL_RC_IN_RGB_C_INPUT_SPARE0_NV 0x00000c00 -#define NV10TCL_RC_IN_RGB_C_INPUT_SPARE1_NV 0x00000d00 -#define NV10TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV10TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE (1 << 12) -#define NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_SHIFT 13 -#define NV10TCL_RC_IN_RGB_C_MAPPING_MASK 0x0000e000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV10TCL_RC_IN_RGB_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV10TCL_RC_IN_RGB_B_INPUT_SHIFT 16 -#define NV10TCL_RC_IN_RGB_B_INPUT_MASK 0x000f0000 -#define NV10TCL_RC_IN_RGB_B_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV10TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV10TCL_RC_IN_RGB_B_INPUT_FOG 0x00030000 -#define NV10TCL_RC_IN_RGB_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV10TCL_RC_IN_RGB_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV10TCL_RC_IN_RGB_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV10TCL_RC_IN_RGB_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV10TCL_RC_IN_RGB_B_INPUT_SPARE0_NV 0x000c0000 -#define NV10TCL_RC_IN_RGB_B_INPUT_SPARE1_NV 0x000d0000 -#define NV10TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV10TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE (1 << 20) -#define NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_SHIFT 21 -#define NV10TCL_RC_IN_RGB_B_MAPPING_MASK 0x00e00000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV10TCL_RC_IN_RGB_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV10TCL_RC_IN_RGB_A_INPUT_SHIFT 24 -#define NV10TCL_RC_IN_RGB_A_INPUT_MASK 0x0f000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_FOG 0x03000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_SPARE0_NV 0x0c000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_SPARE1_NV 0x0d000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV10TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE (1 << 28) -#define NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_SHIFT 29 -#define NV10TCL_RC_IN_RGB_A_MAPPING_MASK 0xe0000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV10TCL_RC_IN_RGB_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV10TCL_RC_COLOR(x) (0x00000270+((x)*4)) -#define NV10TCL_RC_COLOR__SIZE 0x00000002 -#define NV10TCL_RC_COLOR_B_SHIFT 0 -#define NV10TCL_RC_COLOR_B_MASK 0x000000ff -#define NV10TCL_RC_COLOR_G_SHIFT 8 -#define NV10TCL_RC_COLOR_G_MASK 0x0000ff00 -#define NV10TCL_RC_COLOR_R_SHIFT 16 -#define NV10TCL_RC_COLOR_R_MASK 0x00ff0000 -#define NV10TCL_RC_COLOR_A_SHIFT 24 -#define NV10TCL_RC_COLOR_A_MASK 0xff000000 -#define NV10TCL_RC_OUT_ALPHA(x) (0x00000278+((x)*4)) -#define NV10TCL_RC_OUT_ALPHA__SIZE 0x00000002 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SHIFT 0 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_MASK 0x0000000f -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_ZERO 0x00000000 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_FOG 0x00000003 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE0_ARB 0x00000008 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE1_ARB 0x00000009 -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_NV 0x0000000c -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV 0x0000000d -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV 0x0000000f -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT 4 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK 0x000000f0 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO 0x00000000 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_FOG 0x00000030 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE0_ARB 0x00000080 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE1_ARB 0x00000090 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_NV 0x000000c0 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV 0x000000d0 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0 -#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV 0x000000f0 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT 8 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK 0x00000f00 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO 0x00000000 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_FOG 0x00000300 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE0_ARB 0x00000800 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE1_ARB 0x00000900 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_NV 0x00000c00 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV 0x00000d00 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00 -#define NV10TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT (1 << 12) -#define NV10TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT (1 << 13) -#define NV10TCL_RC_OUT_ALPHA_MUX_SUM (1 << 14) -#define NV10TCL_RC_OUT_ALPHA_BIAS (1 << 15) -#define NV10TCL_RC_OUT_ALPHA_BIAS_NONE 0x00000000 -#define NV10TCL_RC_OUT_ALPHA_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000 -#define NV10TCL_RC_OUT_ALPHA_SCALE_SHIFT 17 -#define NV10TCL_RC_OUT_ALPHA_SCALE_MASK 0x00000000 -#define NV10TCL_RC_OUT_ALPHA_SCALE_NONE 0x00000000 -#define NV10TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_TWO_NV 0x00020000 -#define NV10TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_FOUR_NV 0x00040000 -#define NV10TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000 -#define NV10TCL_RC_OUT_RGB(x) (0x00000280+((x)*4)) -#define NV10TCL_RC_OUT_RGB__SIZE 0x00000002 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SHIFT 0 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_MASK 0x0000000f -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_ZERO 0x00000000 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_FOG 0x00000003 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE0_ARB 0x00000008 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE1_ARB 0x00000009 -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_NV 0x0000000c -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV 0x0000000d -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV 0x0000000f -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT 4 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_MASK 0x000000f0 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_ZERO 0x00000000 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_FOG 0x00000030 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE0_ARB 0x00000080 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE1_ARB 0x00000090 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_NV 0x000000c0 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV 0x000000d0 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0 -#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV 0x000000f0 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT 8 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_MASK 0x00000f00 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO 0x00000000 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_FOG 0x00000300 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE0_ARB 0x00000800 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE1_ARB 0x00000900 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_NV 0x00000c00 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV 0x00000d00 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00 -#define NV10TCL_RC_OUT_RGB_CD_DOT_PRODUCT (1 << 12) -#define NV10TCL_RC_OUT_RGB_AB_DOT_PRODUCT (1 << 13) -#define NV10TCL_RC_OUT_RGB_MUX_SUM (1 << 14) -#define NV10TCL_RC_OUT_RGB_BIAS (1 << 15) -#define NV10TCL_RC_OUT_RGB_BIAS_NONE 0x00000000 -#define NV10TCL_RC_OUT_RGB_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000 -#define NV10TCL_RC_OUT_RGB_SCALE_SHIFT 17 -#define NV10TCL_RC_OUT_RGB_SCALE_MASK 0x00000000 -#define NV10TCL_RC_OUT_RGB_SCALE_NONE 0x00000000 -#define NV10TCL_RC_OUT_RGB_SCALE_SCALE_BY_TWO_NV 0x00020000 -#define NV10TCL_RC_OUT_RGB_SCALE_SCALE_BY_FOUR_NV 0x00040000 -#define NV10TCL_RC_OUT_RGB_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000 -#define NV10TCL_RC_OUT_RGB_OPERATION_SHIFT 27 -#define NV10TCL_RC_OUT_RGB_OPERATION_MASK 0x38000000 -#define NV10TCL_RC_FINAL0 0x00000288 -#define NV10TCL_RC_FINAL0_D_INPUT_SHIFT 0 -#define NV10TCL_RC_FINAL0_D_INPUT_MASK 0x0000000f -#define NV10TCL_RC_FINAL0_D_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV10TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV10TCL_RC_FINAL0_D_INPUT_FOG 0x00000003 -#define NV10TCL_RC_FINAL0_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV10TCL_RC_FINAL0_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV10TCL_RC_FINAL0_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV10TCL_RC_FINAL0_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV10TCL_RC_FINAL0_D_INPUT_SPARE0_NV 0x0000000c -#define NV10TCL_RC_FINAL0_D_INPUT_SPARE1_NV 0x0000000d -#define NV10TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV10TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV10TCL_RC_FINAL0_D_COMPONENT_USAGE (1 << 4) -#define NV10TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV10TCL_RC_FINAL0_D_MAPPING_SHIFT 5 -#define NV10TCL_RC_FINAL0_D_MAPPING_MASK 0x000000e0 -#define NV10TCL_RC_FINAL0_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_FINAL0_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV10TCL_RC_FINAL0_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV10TCL_RC_FINAL0_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV10TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV10TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV10TCL_RC_FINAL0_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV10TCL_RC_FINAL0_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV10TCL_RC_FINAL0_C_INPUT_SHIFT 8 -#define NV10TCL_RC_FINAL0_C_INPUT_MASK 0x00000f00 -#define NV10TCL_RC_FINAL0_C_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV10TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV10TCL_RC_FINAL0_C_INPUT_FOG 0x00000300 -#define NV10TCL_RC_FINAL0_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV10TCL_RC_FINAL0_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV10TCL_RC_FINAL0_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV10TCL_RC_FINAL0_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV10TCL_RC_FINAL0_C_INPUT_SPARE0_NV 0x00000c00 -#define NV10TCL_RC_FINAL0_C_INPUT_SPARE1_NV 0x00000d00 -#define NV10TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV10TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV10TCL_RC_FINAL0_C_COMPONENT_USAGE (1 << 12) -#define NV10TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV10TCL_RC_FINAL0_C_MAPPING_SHIFT 13 -#define NV10TCL_RC_FINAL0_C_MAPPING_MASK 0x0000e000 -#define NV10TCL_RC_FINAL0_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_FINAL0_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV10TCL_RC_FINAL0_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV10TCL_RC_FINAL0_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV10TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV10TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV10TCL_RC_FINAL0_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV10TCL_RC_FINAL0_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV10TCL_RC_FINAL0_B_INPUT_SHIFT 16 -#define NV10TCL_RC_FINAL0_B_INPUT_MASK 0x000f0000 -#define NV10TCL_RC_FINAL0_B_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV10TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV10TCL_RC_FINAL0_B_INPUT_FOG 0x00030000 -#define NV10TCL_RC_FINAL0_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV10TCL_RC_FINAL0_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV10TCL_RC_FINAL0_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV10TCL_RC_FINAL0_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV10TCL_RC_FINAL0_B_INPUT_SPARE0_NV 0x000c0000 -#define NV10TCL_RC_FINAL0_B_INPUT_SPARE1_NV 0x000d0000 -#define NV10TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV10TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV10TCL_RC_FINAL0_B_COMPONENT_USAGE (1 << 20) -#define NV10TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV10TCL_RC_FINAL0_B_MAPPING_SHIFT 21 -#define NV10TCL_RC_FINAL0_B_MAPPING_MASK 0x00e00000 -#define NV10TCL_RC_FINAL0_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_FINAL0_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV10TCL_RC_FINAL0_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV10TCL_RC_FINAL0_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV10TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV10TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV10TCL_RC_FINAL0_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV10TCL_RC_FINAL0_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV10TCL_RC_FINAL0_A_INPUT_SHIFT 24 -#define NV10TCL_RC_FINAL0_A_INPUT_MASK 0x0f000000 -#define NV10TCL_RC_FINAL0_A_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV10TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV10TCL_RC_FINAL0_A_INPUT_FOG 0x03000000 -#define NV10TCL_RC_FINAL0_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV10TCL_RC_FINAL0_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV10TCL_RC_FINAL0_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV10TCL_RC_FINAL0_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV10TCL_RC_FINAL0_A_INPUT_SPARE0_NV 0x0c000000 -#define NV10TCL_RC_FINAL0_A_INPUT_SPARE1_NV 0x0d000000 -#define NV10TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV10TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV10TCL_RC_FINAL0_A_COMPONENT_USAGE (1 << 28) -#define NV10TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_SHIFT 29 -#define NV10TCL_RC_FINAL0_A_MAPPING_MASK 0xe0000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV10TCL_RC_FINAL0_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV10TCL_RC_FINAL1 0x0000028c -#define NV10TCL_RC_FINAL1_COLOR_SUM_CLAMP (1 << 7) -#define NV10TCL_RC_FINAL1_G_INPUT_SHIFT 8 -#define NV10TCL_RC_FINAL1_G_INPUT_MASK 0x00000f00 -#define NV10TCL_RC_FINAL1_G_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV10TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV10TCL_RC_FINAL1_G_INPUT_FOG 0x00000300 -#define NV10TCL_RC_FINAL1_G_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV10TCL_RC_FINAL1_G_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV10TCL_RC_FINAL1_G_INPUT_TEXTURE0_ARB 0x00000800 -#define NV10TCL_RC_FINAL1_G_INPUT_TEXTURE1_ARB 0x00000900 -#define NV10TCL_RC_FINAL1_G_INPUT_SPARE0_NV 0x00000c00 -#define NV10TCL_RC_FINAL1_G_INPUT_SPARE1_NV 0x00000d00 -#define NV10TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV10TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV10TCL_RC_FINAL1_G_COMPONENT_USAGE (1 << 12) -#define NV10TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV10TCL_RC_FINAL1_G_MAPPING_SHIFT 13 -#define NV10TCL_RC_FINAL1_G_MAPPING_MASK 0x0000e000 -#define NV10TCL_RC_FINAL1_G_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_FINAL1_G_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV10TCL_RC_FINAL1_G_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV10TCL_RC_FINAL1_G_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV10TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV10TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV10TCL_RC_FINAL1_G_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV10TCL_RC_FINAL1_G_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV10TCL_RC_FINAL1_F_INPUT_SHIFT 16 -#define NV10TCL_RC_FINAL1_F_INPUT_MASK 0x000f0000 -#define NV10TCL_RC_FINAL1_F_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV10TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV10TCL_RC_FINAL1_F_INPUT_FOG 0x00030000 -#define NV10TCL_RC_FINAL1_F_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV10TCL_RC_FINAL1_F_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV10TCL_RC_FINAL1_F_INPUT_TEXTURE0_ARB 0x00080000 -#define NV10TCL_RC_FINAL1_F_INPUT_TEXTURE1_ARB 0x00090000 -#define NV10TCL_RC_FINAL1_F_INPUT_SPARE0_NV 0x000c0000 -#define NV10TCL_RC_FINAL1_F_INPUT_SPARE1_NV 0x000d0000 -#define NV10TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV10TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV10TCL_RC_FINAL1_F_COMPONENT_USAGE (1 << 20) -#define NV10TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV10TCL_RC_FINAL1_F_MAPPING_SHIFT 21 -#define NV10TCL_RC_FINAL1_F_MAPPING_MASK 0x00e00000 -#define NV10TCL_RC_FINAL1_F_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_FINAL1_F_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV10TCL_RC_FINAL1_F_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV10TCL_RC_FINAL1_F_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV10TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV10TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV10TCL_RC_FINAL1_F_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV10TCL_RC_FINAL1_F_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV10TCL_RC_FINAL1_E_INPUT_SHIFT 24 -#define NV10TCL_RC_FINAL1_E_INPUT_MASK 0x0f000000 -#define NV10TCL_RC_FINAL1_E_INPUT_ZERO 0x00000000 -#define NV10TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV10TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV10TCL_RC_FINAL1_E_INPUT_FOG 0x03000000 -#define NV10TCL_RC_FINAL1_E_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV10TCL_RC_FINAL1_E_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV10TCL_RC_FINAL1_E_INPUT_TEXTURE0_ARB 0x08000000 -#define NV10TCL_RC_FINAL1_E_INPUT_TEXTURE1_ARB 0x09000000 -#define NV10TCL_RC_FINAL1_E_INPUT_SPARE0_NV 0x0c000000 -#define NV10TCL_RC_FINAL1_E_INPUT_SPARE1_NV 0x0d000000 -#define NV10TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV10TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV10TCL_RC_FINAL1_E_COMPONENT_USAGE (1 << 28) -#define NV10TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB 0x00000000 -#define NV10TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_SHIFT 29 -#define NV10TCL_RC_FINAL1_E_MAPPING_MASK 0xe0000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV10TCL_RC_FINAL1_E_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV10TCL_LIGHT_MODEL 0x00000294 -#define NV10TCL_LIGHT_MODEL_COLOR_CONTROL (1 << 1) -#define NV10TCL_LIGHT_MODEL_LOCAL_VIEWER (1 << 16) -#define NV10TCL_COLOR_MATERIAL_ENABLE 0x00000298 -#define NV10TCL_COLOR_MATERIAL_ENABLE_SPECULAR (1 << 0) -#define NV10TCL_COLOR_MATERIAL_ENABLE_DIFFUSE (1 << 1) -#define NV10TCL_COLOR_MATERIAL_ENABLE_AMBIENT (1 << 2) -#define NV10TCL_COLOR_MATERIAL_ENABLE_EMISSION (1 << 3) -#define NV10TCL_FOG_MODE 0x0000029c -#define NV10TCL_FOG_MODE_EXP 0x00000800 -#define NV10TCL_FOG_MODE_EXP_2 0x00000802 -#define NV10TCL_FOG_MODE_EXP2 0x00000803 -#define NV10TCL_FOG_MODE_LINEAR 0x00000804 -#define NV10TCL_FOG_MODE_LINEAR_2 0x00002601 -#define NV10TCL_FOG_COORD_DIST 0x000002a0 -#define NV10TCL_FOG_COORD_DIST_COORD_FALSE 0x00000000 -#define NV10TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_RADIAL_NV 0x00000001 -#define NV10TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_PLANE_ABSOLUTE_NV 0x00000002 -#define NV10TCL_FOG_COORD_DIST_COORD_FOG 0x00000003 -#define NV10TCL_FOG_ENABLE 0x000002a4 -#define NV10TCL_FOG_COLOR 0x000002a8 -#define NV10TCL_FOG_COLOR_R_SHIFT 0 -#define NV10TCL_FOG_COLOR_R_MASK 0x000000ff -#define NV10TCL_FOG_COLOR_G_SHIFT 8 -#define NV10TCL_FOG_COLOR_G_MASK 0x0000ff00 -#define NV10TCL_FOG_COLOR_B_SHIFT 16 -#define NV10TCL_FOG_COLOR_B_MASK 0x00ff0000 -#define NV10TCL_FOG_COLOR_A_SHIFT 24 -#define NV10TCL_FOG_COLOR_A_MASK 0xff000000 -#define NV10TCL_VIEWPORT_CLIP_MODE 0x000002b4 -#define NV10TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*4)) -#define NV10TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008 -#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_L_SHIFT 0 -#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_L_MASK 0x000007ff -#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_LEFT_ENABLE (1 << 11) -#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_R_SHIFT 16 -#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_R_MASK 0x07ff0000 -#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_RIGHT_ENABLE (1 << 27) -#define NV10TCL_VIEWPORT_CLIP_VERT(x) (0x000002e0+((x)*4)) -#define NV10TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008 -#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_T_SHIFT 0 -#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_T_MASK 0x000007ff -#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_TOP_ENABLE (1 << 11) -#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_B_SHIFT 16 -#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_B_MASK 0x07ff0000 -#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_BOTTOM_ENABLE (1 << 27) -#define NV10TCL_ALPHA_FUNC_ENABLE 0x00000300 -#define NV10TCL_BLEND_FUNC_ENABLE 0x00000304 -#define NV10TCL_CULL_FACE_ENABLE 0x00000308 -#define NV10TCL_DEPTH_TEST_ENABLE 0x0000030c -#define NV10TCL_DITHER_ENABLE 0x00000310 -#define NV10TCL_LIGHTING_ENABLE 0x00000314 -#define NV10TCL_POINT_PARAMETERS_ENABLE 0x00000318 -#define NV10TCL_POINT_SMOOTH_ENABLE 0x0000031c -#define NV10TCL_LINE_SMOOTH_ENABLE 0x00000320 -#define NV10TCL_POLYGON_SMOOTH_ENABLE 0x00000324 -#define NV10TCL_VERTEX_WEIGHT_ENABLE 0x00000328 -#define NV10TCL_STENCIL_ENABLE 0x0000032c -#define NV10TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000330 -#define NV10TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000334 -#define NV10TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000338 -#define NV10TCL_ALPHA_FUNC_FUNC 0x0000033c -#define NV10TCL_ALPHA_FUNC_FUNC_NEVER 0x00000200 -#define NV10TCL_ALPHA_FUNC_FUNC_LESS 0x00000201 -#define NV10TCL_ALPHA_FUNC_FUNC_EQUAL 0x00000202 -#define NV10TCL_ALPHA_FUNC_FUNC_LEQUAL 0x00000203 -#define NV10TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204 -#define NV10TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204 -#define NV10TCL_ALPHA_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV10TCL_ALPHA_FUNC_FUNC_GEQUAL 0x00000206 -#define NV10TCL_ALPHA_FUNC_FUNC_ALWAYS 0x00000207 -#define NV10TCL_ALPHA_FUNC_REF 0x00000340 -#define NV10TCL_BLEND_FUNC_SRC 0x00000344 -#define NV10TCL_BLEND_FUNC_SRC_ZERO 0x00000000 -#define NV10TCL_BLEND_FUNC_SRC_ONE 0x00000001 -#define NV10TCL_BLEND_FUNC_SRC_SRC_COLOR 0x00000300 -#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV10TCL_BLEND_FUNC_SRC_SRC_ALPHA 0x00000302 -#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV10TCL_BLEND_FUNC_SRC_DST_ALPHA 0x00000304 -#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV10TCL_BLEND_FUNC_SRC_DST_COLOR 0x00000306 -#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_COLOR 0x00000307 -#define NV10TCL_BLEND_FUNC_SRC_SRC_ALPHA_SATURATE 0x00000308 -#define NV10TCL_BLEND_FUNC_SRC_CONSTANT_COLOR 0x00008001 -#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV10TCL_BLEND_FUNC_SRC_CONSTANT_ALPHA 0x00008003 -#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV10TCL_BLEND_FUNC_DST 0x00000348 -#define NV10TCL_BLEND_FUNC_DST_ZERO 0x00000000 -#define NV10TCL_BLEND_FUNC_DST_ONE 0x00000001 -#define NV10TCL_BLEND_FUNC_DST_SRC_COLOR 0x00000300 -#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV10TCL_BLEND_FUNC_DST_SRC_ALPHA 0x00000302 -#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV10TCL_BLEND_FUNC_DST_DST_ALPHA 0x00000304 -#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV10TCL_BLEND_FUNC_DST_DST_COLOR 0x00000306 -#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_DST_COLOR 0x00000307 -#define NV10TCL_BLEND_FUNC_DST_SRC_ALPHA_SATURATE 0x00000308 -#define NV10TCL_BLEND_FUNC_DST_CONSTANT_COLOR 0x00008001 -#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV10TCL_BLEND_FUNC_DST_CONSTANT_ALPHA 0x00008003 -#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV10TCL_BLEND_COLOR 0x0000034c -#define NV10TCL_BLEND_COLOR_B_SHIFT 0 -#define NV10TCL_BLEND_COLOR_B_MASK 0x000000ff -#define NV10TCL_BLEND_COLOR_G_SHIFT 8 -#define NV10TCL_BLEND_COLOR_G_MASK 0x0000ff00 -#define NV10TCL_BLEND_COLOR_R_SHIFT 16 -#define NV10TCL_BLEND_COLOR_R_MASK 0x00ff0000 -#define NV10TCL_BLEND_COLOR_A_SHIFT 24 -#define NV10TCL_BLEND_COLOR_A_MASK 0xff000000 -#define NV10TCL_BLEND_EQUATION 0x00000350 -#define NV10TCL_BLEND_EQUATION_FUNC_ADD 0x00008006 -#define NV10TCL_BLEND_EQUATION_MIN 0x00008007 -#define NV10TCL_BLEND_EQUATION_MAX 0x00008008 -#define NV10TCL_BLEND_EQUATION_FUNC_SUBTRACT 0x0000800a -#define NV10TCL_BLEND_EQUATION_FUNC_REVERSE_SUBTRACT 0x0000800b -#define NV10TCL_DEPTH_FUNC 0x00000354 -#define NV10TCL_DEPTH_FUNC_NEVER 0x00000200 -#define NV10TCL_DEPTH_FUNC_LESS 0x00000201 -#define NV10TCL_DEPTH_FUNC_EQUAL 0x00000202 -#define NV10TCL_DEPTH_FUNC_LEQUAL 0x00000203 -#define NV10TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV10TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV10TCL_DEPTH_FUNC_NOTEQUAL 0x00000205 -#define NV10TCL_DEPTH_FUNC_GEQUAL 0x00000206 -#define NV10TCL_DEPTH_FUNC_ALWAYS 0x00000207 -#define NV10TCL_COLOR_MASK 0x00000358 -#define NV10TCL_COLOR_MASK_B (1 << 0) -#define NV10TCL_COLOR_MASK_G (1 << 8) -#define NV10TCL_COLOR_MASK_R (1 << 16) -#define NV10TCL_COLOR_MASK_A (1 << 24) -#define NV10TCL_DEPTH_WRITE_ENABLE 0x0000035c -#define NV10TCL_STENCIL_MASK 0x00000360 -#define NV10TCL_STENCIL_FUNC_FUNC 0x00000364 -#define NV10TCL_STENCIL_FUNC_FUNC_NEVER 0x00000200 -#define NV10TCL_STENCIL_FUNC_FUNC_LESS 0x00000201 -#define NV10TCL_STENCIL_FUNC_FUNC_EQUAL 0x00000202 -#define NV10TCL_STENCIL_FUNC_FUNC_LEQUAL 0x00000203 -#define NV10TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204 -#define NV10TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204 -#define NV10TCL_STENCIL_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV10TCL_STENCIL_FUNC_FUNC_GEQUAL 0x00000206 -#define NV10TCL_STENCIL_FUNC_FUNC_ALWAYS 0x00000207 -#define NV10TCL_STENCIL_FUNC_REF 0x00000368 -#define NV10TCL_STENCIL_FUNC_MASK 0x0000036c -#define NV10TCL_STENCIL_OP_FAIL 0x00000370 -#define NV10TCL_STENCIL_OP_FAIL_ZERO 0x00000000 -#define NV10TCL_STENCIL_OP_FAIL_INVERT 0x0000150a -#define NV10TCL_STENCIL_OP_FAIL_KEEP 0x00001e00 -#define NV10TCL_STENCIL_OP_FAIL_REPLACE 0x00001e01 -#define NV10TCL_STENCIL_OP_FAIL_INCR 0x00001e02 -#define NV10TCL_STENCIL_OP_FAIL_DECR 0x00001e03 -#define NV10TCL_STENCIL_OP_FAIL_INCR_WRAP 0x00008507 -#define NV10TCL_STENCIL_OP_FAIL_DECR_WRAP 0x00008508 -#define NV10TCL_STENCIL_OP_ZFAIL 0x00000374 -#define NV10TCL_STENCIL_OP_ZFAIL_ZERO 0x00000000 -#define NV10TCL_STENCIL_OP_ZFAIL_INVERT 0x0000150a -#define NV10TCL_STENCIL_OP_ZFAIL_KEEP 0x00001e00 -#define NV10TCL_STENCIL_OP_ZFAIL_REPLACE 0x00001e01 -#define NV10TCL_STENCIL_OP_ZFAIL_INCR 0x00001e02 -#define NV10TCL_STENCIL_OP_ZFAIL_DECR 0x00001e03 -#define NV10TCL_STENCIL_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV10TCL_STENCIL_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV10TCL_STENCIL_OP_ZPASS 0x00000378 -#define NV10TCL_STENCIL_OP_ZPASS_ZERO 0x00000000 -#define NV10TCL_STENCIL_OP_ZPASS_INVERT 0x0000150a -#define NV10TCL_STENCIL_OP_ZPASS_KEEP 0x00001e00 -#define NV10TCL_STENCIL_OP_ZPASS_REPLACE 0x00001e01 -#define NV10TCL_STENCIL_OP_ZPASS_INCR 0x00001e02 -#define NV10TCL_STENCIL_OP_ZPASS_DECR 0x00001e03 -#define NV10TCL_STENCIL_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV10TCL_STENCIL_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV10TCL_SHADE_MODEL 0x0000037c -#define NV10TCL_SHADE_MODEL_FLAT 0x00001d00 -#define NV10TCL_SHADE_MODEL_SMOOTH 0x00001d01 -#define NV10TCL_LINE_WIDTH 0x00000380 -#define NV10TCL_POLYGON_OFFSET_FACTOR 0x00000384 -#define NV10TCL_POLYGON_OFFSET_UNITS 0x00000388 -#define NV10TCL_POLYGON_MODE_FRONT 0x0000038c -#define NV10TCL_POLYGON_MODE_FRONT_POINT 0x00001b00 -#define NV10TCL_POLYGON_MODE_FRONT_LINE 0x00001b01 -#define NV10TCL_POLYGON_MODE_FRONT_FILL 0x00001b02 -#define NV10TCL_POLYGON_MODE_BACK 0x00000390 -#define NV10TCL_POLYGON_MODE_BACK_POINT 0x00001b00 -#define NV10TCL_POLYGON_MODE_BACK_LINE 0x00001b01 -#define NV10TCL_POLYGON_MODE_BACK_FILL 0x00001b02 -#define NV10TCL_DEPTH_RANGE_NEAR 0x00000394 -#define NV10TCL_DEPTH_RANGE_FAR 0x00000398 -#define NV10TCL_CULL_FACE 0x0000039c -#define NV10TCL_CULL_FACE_FRONT 0x00000404 -#define NV10TCL_CULL_FACE_BACK 0x00000405 -#define NV10TCL_CULL_FACE_FRONT_AND_BACK 0x00000408 -#define NV10TCL_FRONT_FACE 0x000003a0 -#define NV10TCL_FRONT_FACE_CW 0x00000900 -#define NV10TCL_FRONT_FACE_CCW 0x00000901 -#define NV10TCL_NORMALIZE_ENABLE 0x000003a4 -#define NV10TCL_COLOR_MATERIAL_R 0x000003a8 -#define NV10TCL_COLOR_MATERIAL_G 0x000003ac -#define NV10TCL_COLOR_MATERIAL_B 0x000003b0 -#define NV10TCL_COLOR_MATERIAL_A 0x000003b4 -#define NV10TCL_COLOR_CONTROL 0x000003b8 -#define NV10TCL_ENABLED_LIGHTS 0x000003bc -#define NV10TCL_ENABLED_LIGHTS_LIGHT0 (1 << 0) -#define NV10TCL_ENABLED_LIGHTS_LIGHT1 (1 << 2) -#define NV10TCL_ENABLED_LIGHTS_LIGHT2 (1 << 4) -#define NV10TCL_ENABLED_LIGHTS_LIGHT3 (1 << 6) -#define NV10TCL_ENABLED_LIGHTS_LIGHT4 (1 << 8) -#define NV10TCL_ENABLED_LIGHTS_LIGHT5 (1 << 10) -#define NV10TCL_ENABLED_LIGHTS_LIGHT6 (1 << 12) -#define NV10TCL_ENABLED_LIGHTS_LIGHT7 (1 << 14) -#define NV10TCL_TX_GEN_S(x) (0x000003c0+((x)*16)) -#define NV10TCL_TX_GEN_S__SIZE 0x00000002 -#define NV10TCL_TX_GEN_S_FALSE 0x00000000 -#define NV10TCL_TX_GEN_S_EYE_LINEAR 0x00002400 -#define NV10TCL_TX_GEN_S_OBJECT_LINEAR 0x00002401 -#define NV10TCL_TX_GEN_S_SPHERE_MAP 0x00002402 -#define NV10TCL_TX_GEN_S_NORMAL_MAP 0x00008511 -#define NV10TCL_TX_GEN_S_REFLECTION_MAP 0x00008512 -#define NV10TCL_TX_GEN_T(x) (0x000003c4+((x)*16)) -#define NV10TCL_TX_GEN_T__SIZE 0x00000002 -#define NV10TCL_TX_GEN_T_FALSE 0x00000000 -#define NV10TCL_TX_GEN_T_EYE_LINEAR 0x00002400 -#define NV10TCL_TX_GEN_T_OBJECT_LINEAR 0x00002401 -#define NV10TCL_TX_GEN_T_SPHERE_MAP 0x00002402 -#define NV10TCL_TX_GEN_T_NORMAL_MAP 0x00008511 -#define NV10TCL_TX_GEN_T_REFLECTION_MAP 0x00008512 -#define NV10TCL_TX_GEN_R(x) (0x000003c8+((x)*16)) -#define NV10TCL_TX_GEN_R__SIZE 0x00000002 -#define NV10TCL_TX_GEN_R_FALSE 0x00000000 -#define NV10TCL_TX_GEN_R_EYE_LINEAR 0x00002400 -#define NV10TCL_TX_GEN_R_OBJECT_LINEAR 0x00002401 -#define NV10TCL_TX_GEN_R_SPHERE_MAP 0x00002402 -#define NV10TCL_TX_GEN_R_NORMAL_MAP 0x00008511 -#define NV10TCL_TX_GEN_R_REFLECTION_MAP 0x00008512 -#define NV10TCL_TX_GEN_Q(x) (0x000003cc+((x)*16)) -#define NV10TCL_TX_GEN_Q__SIZE 0x00000002 -#define NV10TCL_TX_GEN_Q_FALSE 0x00000000 -#define NV10TCL_TX_GEN_Q_EYE_LINEAR 0x00002400 -#define NV10TCL_TX_GEN_Q_OBJECT_LINEAR 0x00002401 -#define NV10TCL_TX_GEN_Q_SPHERE_MAP 0x00002402 -#define NV10TCL_TX_GEN_Q_NORMAL_MAP 0x00008511 -#define NV10TCL_TX_GEN_Q_REFLECTION_MAP 0x00008512 -#define NV10TCL_TX_MATRIX_ENABLE(x) (0x000003e0+((x)*4)) -#define NV10TCL_TX_MATRIX_ENABLE__SIZE 0x00000002 -#define NV10TCL_VIEW_MATRIX_ENABLE 0x000003e8 -#define NV10TCL_VIEW_MATRIX_ENABLE_MODELVIEW1 (1 << 0) -#define NV10TCL_VIEW_MATRIX_ENABLE_MODELVIEW0 (1 << 1) -#define NV10TCL_VIEW_MATRIX_ENABLE_PROJECTION (1 << 2) -#define NV10TCL_POINT_SIZE 0x000003ec -#define NV10TCL_MODELVIEW0_MATRIX(x) (0x00000400+((x)*4)) -#define NV10TCL_MODELVIEW0_MATRIX__SIZE 0x00000010 -#define NV10TCL_MODELVIEW1_MATRIX(x) (0x00000440+((x)*4)) -#define NV10TCL_MODELVIEW1_MATRIX__SIZE 0x00000010 -#define NV10TCL_INVERSE_MODELVIEW0_MATRIX(x) (0x00000480+((x)*4)) -#define NV10TCL_INVERSE_MODELVIEW0_MATRIX__SIZE 0x00000010 -#define NV10TCL_INVERSE_MODELVIEW1_MATRIX(x) (0x000004c0+((x)*4)) -#define NV10TCL_INVERSE_MODELVIEW1_MATRIX__SIZE 0x00000010 -#define NV10TCL_PROJECTION_MATRIX(x) (0x00000500+((x)*4)) -#define NV10TCL_PROJECTION_MATRIX__SIZE 0x00000010 -#define NV10TCL_TX0_MATRIX(x) (0x00000540+((x)*4)) -#define NV10TCL_TX0_MATRIX__SIZE 0x00000010 -#define NV10TCL_TX1_MATRIX(x) (0x00000580+((x)*4)) -#define NV10TCL_TX1_MATRIX__SIZE 0x00000010 -#define NV10TCL_CLIP_PLANE_A(x) (0x00000600+((x)*16)) -#define NV10TCL_CLIP_PLANE_A__SIZE 0x00000008 -#define NV10TCL_CLIP_PLANE_B(x) (0x00000604+((x)*16)) -#define NV10TCL_CLIP_PLANE_B__SIZE 0x00000008 -#define NV10TCL_CLIP_PLANE_C(x) (0x00000608+((x)*16)) -#define NV10TCL_CLIP_PLANE_C__SIZE 0x00000008 -#define NV10TCL_CLIP_PLANE_D(x) (0x0000060c+((x)*16)) -#define NV10TCL_CLIP_PLANE_D__SIZE 0x00000008 -#define NV10TCL_FOG_EQUATION_CONSTANT 0x00000680 -#define NV10TCL_FOG_EQUATION_LINEAR 0x00000684 -#define NV10TCL_FOG_EQUATION_QUADRATIC 0x00000688 -#define NV10TCL_FRONT_MATERIAL_SHININESS(x) (0x000006a0+((x)*4)) -#define NV10TCL_FRONT_MATERIAL_SHININESS__SIZE 0x00000006 -#define NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000006c4 -#define NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000006c8 -#define NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000006cc -#define NV10TCL_VIEWPORT_SCALE_X 0x000006e8 -#define NV10TCL_VIEWPORT_SCALE_Y 0x000006ec -#define NV10TCL_VIEWPORT_SCALE_Z 0x000006f0 -#define NV10TCL_VIEWPORT_SCALE_W 0x000006f4 -#define NV10TCL_POINT_PARAMETER(x) (0x000006f8+((x)*4)) -#define NV10TCL_POINT_PARAMETER__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(x) (0x00000800+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(x) (0x00000804+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(x) (0x00000808+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(x) (0x0000080c+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(x) (0x00000810+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(x) (0x00000814+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(x) (0x00000818+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(x) (0x0000081c+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G__SIZE 0x00000008 -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(x) (0x00000820+((x)*128)) -#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B__SIZE 0x00000008 -#define NV10TCL_LIGHT_HALF_VECTOR_X(x) (0x00000828+((x)*128)) -#define NV10TCL_LIGHT_HALF_VECTOR_X__SIZE 0x00000008 -#define NV10TCL_LIGHT_HALF_VECTOR_Y(x) (0x0000082c+((x)*128)) -#define NV10TCL_LIGHT_HALF_VECTOR_Y__SIZE 0x00000008 -#define NV10TCL_LIGHT_HALF_VECTOR_Z(x) (0x00000830+((x)*128)) -#define NV10TCL_LIGHT_HALF_VECTOR_Z__SIZE 0x00000008 -#define NV10TCL_LIGHT_DIRECTION_X(x) (0x00000834+((x)*128)) -#define NV10TCL_LIGHT_DIRECTION_X__SIZE 0x00000008 -#define NV10TCL_LIGHT_DIRECTION_Y(x) (0x00000838+((x)*128)) -#define NV10TCL_LIGHT_DIRECTION_Y__SIZE 0x00000008 -#define NV10TCL_LIGHT_DIRECTION_Z(x) (0x0000083c+((x)*128)) -#define NV10TCL_LIGHT_DIRECTION_Z__SIZE 0x00000008 -#define NV10TCL_LIGHT_SPOT_CUTOFF_A(x) (0x00000840+((x)*128)) -#define NV10TCL_LIGHT_SPOT_CUTOFF_A__SIZE 0x00000008 -#define NV10TCL_LIGHT_SPOT_CUTOFF_B(x) (0x00000844+((x)*128)) -#define NV10TCL_LIGHT_SPOT_CUTOFF_B__SIZE 0x00000008 -#define NV10TCL_LIGHT_SPOT_CUTOFF_C(x) (0x00000848+((x)*128)) -#define NV10TCL_LIGHT_SPOT_CUTOFF_C__SIZE 0x00000008 -#define NV10TCL_LIGHT_SPOT_DIR_X(x) (0x0000084c+((x)*128)) -#define NV10TCL_LIGHT_SPOT_DIR_X__SIZE 0x00000008 -#define NV10TCL_LIGHT_SPOT_DIR_Y(x) (0x00000850+((x)*128)) -#define NV10TCL_LIGHT_SPOT_DIR_Y__SIZE 0x00000008 -#define NV10TCL_LIGHT_SPOT_DIR_Z(x) (0x00000854+((x)*128)) -#define NV10TCL_LIGHT_SPOT_DIR_Z__SIZE 0x00000008 -#define NV10TCL_LIGHT_SPOT_CUTOFF_D(x) (0x00000858+((x)*128)) -#define NV10TCL_LIGHT_SPOT_CUTOFF_D__SIZE 0x00000008 -#define NV10TCL_LIGHT_POSITION_X(x) (0x0000085c+((x)*128)) -#define NV10TCL_LIGHT_POSITION_X__SIZE 0x00000008 -#define NV10TCL_LIGHT_POSITION_Y(x) (0x00000860+((x)*128)) -#define NV10TCL_LIGHT_POSITION_Y__SIZE 0x00000008 -#define NV10TCL_LIGHT_POSITION_Z(x) (0x00000864+((x)*128)) -#define NV10TCL_LIGHT_POSITION_Z__SIZE 0x00000008 -#define NV10TCL_LIGHT_ATTENUATION_CONSTANT(x) (0x00000868+((x)*128)) -#define NV10TCL_LIGHT_ATTENUATION_CONSTANT__SIZE 0x00000008 -#define NV10TCL_LIGHT_ATTENUATION_LINEAR(x) (0x0000086c+((x)*128)) -#define NV10TCL_LIGHT_ATTENUATION_LINEAR__SIZE 0x00000008 -#define NV10TCL_LIGHT_ATTENUATION_QUADRATIC(x) (0x00000870+((x)*128)) -#define NV10TCL_LIGHT_ATTENUATION_QUADRATIC__SIZE 0x00000008 -#define NV10TCL_VERTEX_POS_3F_X 0x00000c00 -#define NV10TCL_VERTEX_POS_3F_Y 0x00000c04 -#define NV10TCL_VERTEX_POS_3F_Z 0x00000c08 -#define NV10TCL_VERTEX_POS_4F_X 0x00000c18 -#define NV10TCL_VERTEX_POS_4F_Y 0x00000c1c -#define NV10TCL_VERTEX_POS_4F_Z 0x00000c20 -#define NV10TCL_VERTEX_POS_4F_W 0x00000c24 -#define NV10TCL_VERTEX_NOR_3F_X 0x00000c30 -#define NV10TCL_VERTEX_NOR_3F_Y 0x00000c34 -#define NV10TCL_VERTEX_NOR_3F_Z 0x00000c38 -#define NV10TCL_VERTEX_NOR_3I_XY 0x00000c40 -#define NV10TCL_VERTEX_NOR_3I_XY_X_SHIFT 0 -#define NV10TCL_VERTEX_NOR_3I_XY_X_MASK 0x0000ffff -#define NV10TCL_VERTEX_NOR_3I_XY_Y_SHIFT 16 -#define NV10TCL_VERTEX_NOR_3I_XY_Y_MASK 0xffff0000 -#define NV10TCL_VERTEX_NOR_3I_Z 0x00000c44 -#define NV10TCL_VERTEX_NOR_3I_Z_Z_SHIFT 0 -#define NV10TCL_VERTEX_NOR_3I_Z_Z_MASK 0x0000ffff -#define NV10TCL_VERTEX_COL_4F_R 0x00000c50 -#define NV10TCL_VERTEX_COL_4F_G 0x00000c54 -#define NV10TCL_VERTEX_COL_4F_B 0x00000c58 -#define NV10TCL_VERTEX_COL_4F_A 0x00000c5c -#define NV10TCL_VERTEX_COL_3F_R 0x00000c60 -#define NV10TCL_VERTEX_COL_3F_G 0x00000c64 -#define NV10TCL_VERTEX_COL_3F_B 0x00000c68 -#define NV10TCL_VERTEX_COL_4I 0x00000c6c -#define NV10TCL_VERTEX_COL_4I_R_SHIFT 0 -#define NV10TCL_VERTEX_COL_4I_R_MASK 0x000000ff -#define NV10TCL_VERTEX_COL_4I_G_SHIFT 8 -#define NV10TCL_VERTEX_COL_4I_G_MASK 0x0000ff00 -#define NV10TCL_VERTEX_COL_4I_B_SHIFT 16 -#define NV10TCL_VERTEX_COL_4I_B_MASK 0x00ff0000 -#define NV10TCL_VERTEX_COL_4I_A_SHIFT 24 -#define NV10TCL_VERTEX_COL_4I_A_MASK 0xff000000 -#define NV10TCL_VERTEX_COL2_3F_R 0x00000c80 -#define NV10TCL_VERTEX_COL2_3F_G 0x00000c84 -#define NV10TCL_VERTEX_COL2_3F_B 0x00000c88 -#define NV10TCL_VERTEX_COL2_3I 0x00000c8c -#define NV10TCL_VERTEX_COL2_3I_R_SHIFT 0 -#define NV10TCL_VERTEX_COL2_3I_R_MASK 0x000000ff -#define NV10TCL_VERTEX_COL2_3I_G_SHIFT 8 -#define NV10TCL_VERTEX_COL2_3I_G_MASK 0x0000ff00 -#define NV10TCL_VERTEX_COL2_3I_B_SHIFT 16 -#define NV10TCL_VERTEX_COL2_3I_B_MASK 0x00ff0000 -#define NV10TCL_VERTEX_TX0_2F_S 0x00000c90 -#define NV10TCL_VERTEX_TX0_2F_T 0x00000c94 -#define NV10TCL_VERTEX_TX0_2I 0x00000c98 -#define NV10TCL_VERTEX_TX0_2I_S_SHIFT 0 -#define NV10TCL_VERTEX_TX0_2I_S_MASK 0x0000ffff -#define NV10TCL_VERTEX_TX0_2I_T_SHIFT 16 -#define NV10TCL_VERTEX_TX0_2I_T_MASK 0xffff0000 -#define NV10TCL_VERTEX_TX0_4F_S 0x00000ca0 -#define NV10TCL_VERTEX_TX0_4F_T 0x00000ca4 -#define NV10TCL_VERTEX_TX0_4F_R 0x00000ca8 -#define NV10TCL_VERTEX_TX0_4F_Q 0x00000cac -#define NV10TCL_VERTEX_TX0_4I_ST 0x00000cb0 -#define NV10TCL_VERTEX_TX0_4I_ST_S_SHIFT 0 -#define NV10TCL_VERTEX_TX0_4I_ST_S_MASK 0x0000ffff -#define NV10TCL_VERTEX_TX0_4I_ST_T_SHIFT 16 -#define NV10TCL_VERTEX_TX0_4I_ST_T_MASK 0xffff0000 -#define NV10TCL_VERTEX_TX0_4I_RQ 0x00000cb4 -#define NV10TCL_VERTEX_TX0_4I_RQ_R_SHIFT 0 -#define NV10TCL_VERTEX_TX0_4I_RQ_R_MASK 0x0000ffff -#define NV10TCL_VERTEX_TX0_4I_RQ_Q_SHIFT 16 -#define NV10TCL_VERTEX_TX0_4I_RQ_Q_MASK 0xffff0000 -#define NV10TCL_VERTEX_TX1_2F_S 0x00000cb8 -#define NV10TCL_VERTEX_TX1_2F_T 0x00000cbc -#define NV10TCL_VERTEX_TX1_2I 0x00000cc0 -#define NV10TCL_VERTEX_TX1_2I_S_SHIFT 0 -#define NV10TCL_VERTEX_TX1_2I_S_MASK 0x0000ffff -#define NV10TCL_VERTEX_TX1_2I_T_SHIFT 16 -#define NV10TCL_VERTEX_TX1_2I_T_MASK 0xffff0000 -#define NV10TCL_VERTEX_TX1_4F_S 0x00000cc8 -#define NV10TCL_VERTEX_TX1_4F_T 0x00000ccc -#define NV10TCL_VERTEX_TX1_4F_R 0x00000cd0 -#define NV10TCL_VERTEX_TX1_4F_Q 0x00000cd4 -#define NV10TCL_VERTEX_TX1_4I_ST 0x00000cd8 -#define NV10TCL_VERTEX_TX1_4I_ST_S_SHIFT 0 -#define NV10TCL_VERTEX_TX1_4I_ST_S_MASK 0x0000ffff -#define NV10TCL_VERTEX_TX1_4I_ST_T_SHIFT 16 -#define NV10TCL_VERTEX_TX1_4I_ST_T_MASK 0xffff0000 -#define NV10TCL_VERTEX_TX1_4I_RQ 0x00000cdc -#define NV10TCL_VERTEX_TX1_4I_RQ_R_SHIFT 0 -#define NV10TCL_VERTEX_TX1_4I_RQ_R_MASK 0x0000ffff -#define NV10TCL_VERTEX_TX1_4I_RQ_Q_SHIFT 16 -#define NV10TCL_VERTEX_TX1_4I_RQ_Q_MASK 0xffff0000 -#define NV10TCL_VERTEX_FOG_1F 0x00000ce0 -#define NV10TCL_VERTEX_WGH_1F 0x00000ce4 -#define NV10TCL_EDGEFLAG_ENABLE 0x00000cec -#define NV10TCL_VERTEX_ARRAY_VALIDATE 0x00000cf0 -#define NV10TCL_VERTEX_ARRAY_ATTRIB_OFFSET(x) (0x00000d00+((x)*8)) -#define NV10TCL_VERTEX_ARRAY_ATTRIB_OFFSET__SIZE 0x00000008 -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT(x) (0x00000d04+((x)*8)) -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT__SIZE 0x00000008 -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_POS 0x00000d00 -#define NV10TCL_VERTEX_ARRAY_FORMAT_POS 0x00000d04 -#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_COL 0x00000d08 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL 0x00000d0c -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_COL2 0x00000d10 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2 0x00000d14 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_TX0 0x00000d18 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0 0x00000d1c -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_TX1 0x00000d20 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1 0x00000d24 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_NOR 0x00000d28 -#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR 0x00000d2c -#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_WGH 0x00000d30 -#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH 0x00000d34 -#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_ARRAY_OFFSET_FOG 0x00000d38 -#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG 0x00000d3c -#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_TYPE_SHIFT 0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_TYPE_MASK 0x0000000f -#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_FIELDS_SHIFT 4 -#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_FIELDS_MASK 0x000000f0 -#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_STRIDE_SHIFT 8 -#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_STRIDE_MASK 0x0000ff00 -#define NV10TCL_VERTEX_BEGIN_END 0x00000dfc -#define NV10TCL_VERTEX_BEGIN_END_STOP 0x00000000 -#define NV10TCL_VERTEX_BEGIN_END_POINTS 0x00000001 -#define NV10TCL_VERTEX_BEGIN_END_LINES 0x00000002 -#define NV10TCL_VERTEX_BEGIN_END_LINE_LOOP 0x00000003 -#define NV10TCL_VERTEX_BEGIN_END_LINE_STRIP 0x00000004 -#define NV10TCL_VERTEX_BEGIN_END_TRIANGLES 0x00000005 -#define NV10TCL_VERTEX_BEGIN_END_TRIANGLE_STRIP 0x00000006 -#define NV10TCL_VERTEX_BEGIN_END_TRIANGLE_FAN 0x00000007 -#define NV10TCL_VERTEX_BEGIN_END_QUADS 0x00000008 -#define NV10TCL_VERTEX_BEGIN_END_QUAD_STRIP 0x00000009 -#define NV10TCL_VERTEX_BEGIN_END_POLYGON 0x0000000a -#define NV10TCL_VB_ELEMENT_U16 0x00000e00 -#define NV10TCL_VB_ELEMENT_U16_I0_SHIFT 0 -#define NV10TCL_VB_ELEMENT_U16_I0_MASK 0x0000ffff -#define NV10TCL_VB_ELEMENT_U16_I1_SHIFT 16 -#define NV10TCL_VB_ELEMENT_U16_I1_MASK 0xffff0000 -#define NV10TCL_VB_ELEMENT_U32 0x00001100 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END 0x000013fc -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_STOP 0x00000000 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_POINTS 0x00000001 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_LINES 0x00000002 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_LINE_LOOP 0x00000003 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_LINE_STRIP 0x00000004 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_TRIANGLES 0x00000005 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_TRIANGLE_STRIP 0x00000006 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_TRIANGLE_FAN 0x00000007 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_QUADS 0x00000008 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_QUAD_STRIP 0x00000009 -#define NV10TCL_VERTEX_BUFFER_BEGIN_END_POLYGON 0x0000000a -#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS 0x00001400 -#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_FIRST_SHIFT 0 -#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_FIRST_MASK 0x0000ffff -#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_LAST_SHIFT 24 -#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_LAST_MASK 0xff000000 -#define NV10TCL_VERTEX_ARRAY_DATA 0x00001800 - - -#define NV04_CONTEXT_COLOR_KEY 0x00000057 - - - -#define NV03_CONTEXT_SURFACES_2D 0x00000058 - -#define NV03_CONTEXT_SURFACES_2D_SYNCHRONIZE 0x00000100 -#define NV03_CONTEXT_SURFACES_2D_DMA_NOTIFY 0x00000180 -#define NV03_CONTEXT_SURFACES_2D_DMA_SOURCE 0x00000184 -#define NV03_CONTEXT_SURFACES_2D_DMA_DESTIN 0x00000188 -#define NV03_CONTEXT_SURFACES_2D_COLOR_FORMAT 0x00000300 -#define NV03_CONTEXT_SURFACES_2D_PITCH 0x00000304 -#define NV03_CONTEXT_SURFACES_2D_PITCH_SOURCE_SHIFT 0 -#define NV03_CONTEXT_SURFACES_2D_PITCH_SOURCE_MASK 0x0000ffff -#define NV03_CONTEXT_SURFACES_2D_PITCH_DESTIN_SHIFT 16 -#define NV03_CONTEXT_SURFACES_2D_PITCH_DESTIN_MASK 0xffff0000 -#define NV03_CONTEXT_SURFACES_2D_OFFSET_SOURCE 0x00000308 -#define NV03_CONTEXT_SURFACES_2D_OFFSET_DESTIN 0x0000030c - - -#define NV03_CONTEXT_SURFACES_3D 0x0000005a - -#define NV03_CONTEXT_SURFACES_3D_SYNCHRONIZE 0x00000100 -#define NV03_CONTEXT_SURFACES_3D_DMA_NOTIFY 0x00000180 -#define NV03_CONTEXT_SURFACES_3D_DMA_SURFACE 0x00000184 -#define NV03_CONTEXT_SURFACES_3D_PITCH 0x00000300 -#define NV03_CONTEXT_SURFACES_3D_OFFSET_COLOR 0x00000304 -#define NV03_CONTEXT_SURFACES_3D_OFFSET_ZETA 0x00000308 - - -#define NV04_RENDER_SOLID_LINE 0x0000005c - -#define NV04_RENDER_SOLID_LINE_SURFACE 0x00000198 - - -#define NV04_RENDER_SOLID_TRIANGLE 0x0000005d - - - -#define NV04_RENDER_SOLID_RECTANGLE 0x0000005e - -#define NV04_RENDER_SOLID_RECTANGLE_SURFACE 0x00000198 - - -#define NV04_IMAGE_BLIT 0x0000005f - -#define NV04_IMAGE_BLIT_NOP 0x00000100 -#define NV04_IMAGE_BLIT_NOTIFY 0x00000104 -#define NV04_IMAGE_BLIT_DMA_NOTIFY 0x00000180 -#define NV04_IMAGE_BLIT_COLOR_KEY 0x00000184 -#define NV04_IMAGE_BLIT_CLIP_RECTANGLE 0x00000188 -#define NV04_IMAGE_BLIT_PATTERN 0x0000018c -#define NV04_IMAGE_BLIT_ROP 0x00000190 -#define NV04_IMAGE_BLIT_BETA4 0x00000198 -#define NV04_IMAGE_BLIT_SURFACE 0x0000019c -#define NV04_IMAGE_BLIT_OPERATION 0x000002fc -#define NV04_IMAGE_BLIT_OPERATION_SRCCOPY_AND 0x00000000 -#define NV04_IMAGE_BLIT_OPERATION_ROP_AND 0x00000001 -#define NV04_IMAGE_BLIT_OPERATION_BLEND_AND 0x00000002 -#define NV04_IMAGE_BLIT_OPERATION_SRCCOPY 0x00000003 -#define NV04_IMAGE_BLIT_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV04_IMAGE_BLIT_OPERATION_BLEND_PREMULT 0x00000005 - - -#define NV04_INDEXED_IMAGE_FROM_CPU 0x00000060 - -#define NV04_INDEXED_IMAGE_FROM_CPU_NOP 0x00000100 -#define NV04_INDEXED_IMAGE_FROM_CPU_NOTIFY 0x00000104 -#define NV04_INDEXED_IMAGE_FROM_CPU_PATCH 0x0000010c -#define NV04_INDEXED_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180 -#define NV04_INDEXED_IMAGE_FROM_CPU_DMA_LUT 0x00000184 -#define NV04_INDEXED_IMAGE_FROM_CPU_COLOR_FORMAT 0x000003e8 -#define NV04_INDEXED_IMAGE_FROM_CPU_INDEX_FORMAT 0x000003ec -#define NV04_INDEXED_IMAGE_FROM_CPU_LUT_OFFSET 0x000003f0 -#define NV04_INDEXED_IMAGE_FROM_CPU_POINT 0x000003f4 -#define NV04_INDEXED_IMAGE_FROM_CPU_SIZE_OUT 0x000003f8 -#define NV04_INDEXED_IMAGE_FROM_CPU_SIZE_IN 0x000003fc -#define NV04_INDEXED_IMAGE_FROM_CPU_COLOR 0x00000400 - - -#define NV04_IMAGE_FROM_CPU 0x00000061 - -#define NV04_IMAGE_FROM_CPU_BETA4 0x00000198 -#define NV04_IMAGE_FROM_CPU_SURFACE 0x0000019c - - -#define NV10_CONTEXT_SURFACES_2D 0x00000062 - - - -#define NV05_SCALED_IMAGE_FROM_MEMORY 0x00000063 - -#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION 0x000002fc -#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_DITHER 0x00000000 -#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE 0x00000001 -#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_SUBTR_TRUNCATE 0x00000002 - - -#define NV01_IMAGE_SRCCOPY_AND 0x00000064 - -#define NV01_IMAGE_SRCCOPY_AND_NOTIFY 0x00000104 -#define NV01_IMAGE_SRCCOPY_AND_DMA_NOTIFY 0x00000180 -#define NV01_IMAGE_SRCCOPY_AND_IMAGE_OUTPUT 0x00000200 -#define NV01_IMAGE_SRCCOPY_AND_IMAGE_INPUT 0x00000204 - - -#define NV05_INDEXED_IMAGE_FROM_CPU 0x00000064 - -#define NV05_INDEXED_IMAGE_FROM_CPU_COLOR_KEY 0x00000188 -#define NV05_INDEXED_IMAGE_FROM_CPU_CLIP_RECTANGLE 0x0000018c -#define NV05_INDEXED_IMAGE_FROM_CPU_PATTERN 0x00000190 -#define NV05_INDEXED_IMAGE_FROM_CPU_ROP 0x00000194 -#define NV05_INDEXED_IMAGE_FROM_CPU_BETA1 0x00000198 -#define NV05_INDEXED_IMAGE_FROM_CPU_BETA4 0x0000019c -#define NV05_INDEXED_IMAGE_FROM_CPU_SURFACE 0x000001a0 -#define NV05_INDEXED_IMAGE_FROM_CPU_COLOR_CONVERSION 0x000003e0 -#define NV05_INDEXED_IMAGE_FROM_CPU_OPERATION 0x000003e4 -#define NV05_INDEXED_IMAGE_FROM_CPU_INDICES 0x00000400 - - -#define NV05_IMAGE_FROM_CPU 0x00000065 - -#define NV05_IMAGE_FROM_CPU_BETA4 0x00000198 -#define NV05_IMAGE_FROM_CPU_SURFACE 0x0000019c - - -#define NV05_STRETCHED_IMAGE_FROM_CPU 0x00000066 - -#define NV05_STRETCHED_IMAGE_FROM_CPU_BETA4 0x00000194 -#define NV05_STRETCHED_IMAGE_FROM_CPU_SURFACE 0x00000198 -#define NV05_STRETCHED_IMAGE_FROM_CPU_COLOR_CONVERSION 0x000002f8 - - -#define NV04_IMAGE_BLEND_PREMULT 0x00000067 - -#define NV04_IMAGE_BLEND_PREMULT_NOP 0x00000100 -#define NV04_IMAGE_BLEND_PREMULT_NOTIFY 0x00000104 -#define NV04_IMAGE_BLEND_PREMULT_DMA_NOTIFY 0x00000180 -#define NV04_IMAGE_BLEND_PREMULT_IMAGE_OUTPUT 0x00000200 -#define NV04_IMAGE_BLEND_PREMULT_BETA_INPUT 0x00000204 -#define NV04_IMAGE_BLEND_PREMULT_IMAGE_INPUT 0x00000208 - - -#define NV03_CHANNEL_PIO 0x0000006a - - - -#define NV03_CHANNEL_DMA 0x0000006b - - - -#define NV04_BETA_SOLID 0x00000072 - -#define NV04_BETA_SOLID_NOP 0x00000100 -#define NV04_BETA_SOLID_NOTIFY 0x00000104 -#define NV04_BETA_SOLID_DMA_NOTIFY 0x00000180 -#define NV04_BETA_SOLID_BETA_OUTPUT 0x00000200 -#define NV04_BETA_SOLID_BETA_FACTOR 0x00000300 - - -#define NV04_STRETCHED_IMAGE_FROM_CPU 0x00000076 - - - -#define NV04_SCALED_IMAGE_FROM_MEMORY 0x00000077 - -#define NV04_SCALED_IMAGE_FROM_MEMORY_NOP 0x00000100 -#define NV04_SCALED_IMAGE_FROM_MEMORY_NOTIFY 0x00000104 -#define NV04_SCALED_IMAGE_FROM_MEMORY_DMA_NOTIFY 0x00000180 -#define NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE 0x00000184 -#define NV04_SCALED_IMAGE_FROM_MEMORY_PATTERN 0x00000188 -#define NV04_SCALED_IMAGE_FROM_MEMORY_ROP 0x0000018c -#define NV04_SCALED_IMAGE_FROM_MEMORY_BETA1 0x00000190 -#define NV04_SCALED_IMAGE_FROM_MEMORY_BETA4 0x00000194 -#define NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE 0x00000198 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION 0x000002fc -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_DITHER 0x00000000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE 0x00000001 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_SUBTR_TRUNCATE 0x00000002 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT 0x00000300 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5 0x00000001 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X1R5G5B5 0x00000002 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8 0x00000003 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8 0x00000004 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_V8YB8U8YA8 0x00000005 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_YB8V8YA8U8 0x00000006 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5 0x00000007 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_Y8 0x00000008 -#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8 0x00000009 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION 0x00000304 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_AND 0x00000000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_ROP_AND 0x00000001 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_AND 0x00000002 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY 0x00000003 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_PREMULT 0x00000005 -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT 0x00000308 -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_SHIFT 0 -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_MASK 0x0000ffff -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_SHIFT 16 -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_MASK 0xffff0000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE 0x0000030c -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_SHIFT 0 -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_MASK 0x0000ffff -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_SHIFT 16 -#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_MASK 0xffff0000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT 0x00000310 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_X_SHIFT 0 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_X_MASK 0x0000ffff -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_Y_SHIFT 16 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_Y_MASK 0xffff0000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE 0x00000314 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_W_SHIFT 0 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_W_MASK 0x0000ffff -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_H_SHIFT 16 -#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_H_MASK 0xffff0000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_DU_DX 0x00000318 -#define NV04_SCALED_IMAGE_FROM_MEMORY_DV_DY 0x0000031c -#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE 0x00000400 -#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_W_SHIFT 0 -#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_W_MASK 0x0000ffff -#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_H_SHIFT 16 -#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_H_MASK 0xffff0000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT 0x00000404 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_PITCH_SHIFT 0 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_PITCH_MASK 0x0000ffff -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_SHIFT 16 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_MASK 0x00ff0000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER 0x00010000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CORNER 0x00020000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_SHIFT 24 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_MASK 0xff000000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE 0x00000000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_BILINEAR 0x01000000 -#define NV04_SCALED_IMAGE_FROM_MEMORY_ADDRESS 0x00000408 -#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT 0x0000040c -#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_X_SHIFT 0 -#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_X_MASK 0x0000ffff -#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_Y_SHIFT 16 -#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_Y_MASK 0xffff0000 - - -#define NV10_TEXTURE_FROM_CPU 0x0000007b - -#define NV10_TEXTURE_FROM_CPU_NOP 0x00000100 -#define NV10_TEXTURE_FROM_CPU_NOTIFY 0x00000104 -#define NV10_TEXTURE_FROM_CPU_WAIT_FOR_IDLE 0x00000108 -#define NV10_TEXTURE_FROM_CPU_PM_TRIGGER 0x00000140 -#define NV10_TEXTURE_FROM_CPU_DMA_NOTIFY 0x00000180 -#define NV10_TEXTURE_FROM_CPU_SURFACE 0x00000184 -#define NV10_TEXTURE_FROM_CPU_COLOR_FORMAT 0x00000300 -#define NV10_TEXTURE_FROM_CPU_POINT 0x00000304 -#define NV10_TEXTURE_FROM_CPU_POINT_X_SHIFT 0 -#define NV10_TEXTURE_FROM_CPU_POINT_X_MASK 0x0000ffff -#define NV10_TEXTURE_FROM_CPU_POINT_Y_SHIFT 16 -#define NV10_TEXTURE_FROM_CPU_POINT_Y_MASK 0xffff0000 -#define NV10_TEXTURE_FROM_CPU_SIZE 0x00000308 -#define NV10_TEXTURE_FROM_CPU_SIZE_W_SHIFT 0 -#define NV10_TEXTURE_FROM_CPU_SIZE_W_MASK 0x0000ffff -#define NV10_TEXTURE_FROM_CPU_SIZE_H_SHIFT 16 -#define NV10_TEXTURE_FROM_CPU_SIZE_H_MASK 0xffff0000 -#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL 0x0000030c -#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_X_SHIFT 0 -#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_X_MASK 0x0000ffff -#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_W_SHIFT 16 -#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_W_MASK 0xffff0000 -#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL 0x00000310 -#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_Y_SHIFT 0 -#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_Y_MASK 0x0000ffff -#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_H_SHIFT 16 -#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_H_MASK 0xffff0000 -#define NV10_TEXTURE_FROM_CPU_COLOR(x) (0x00000400+((x)*4)) -#define NV10_TEXTURE_FROM_CPU_COLOR__SIZE 0x00000700 - - -#define NV10_VIDEO_DISPLAY 0x0000007c - - - -#define NV10_DVD_SUBPICTURE 0x00000088 - - - -#define NV10_SCALED_IMAGE_FROM_MEMORY 0x00000089 - -#define NV10_SCALED_IMAGE_FROM_MEMORY_WAIT_FOR_IDLE 0x00000108 - - -#define NV10_IMAGE_FROM_CPU 0x0000008a - -#define NV10_IMAGE_FROM_CPU_COLOR_CONVERSION 0x000002f8 - - -#define NV10_CONTEXT_SURFACES_3D 0x00000093 - - - -#define NV10_DX5_TEXTURE_TRIANGLE 0x00000094 - - - -#define NV10_DX6_MULTI_TEXTURE_TRIANGLE 0x00000095 - - - -#define NV11TCL 0x00000096 - -#define NV11TCL_COLOR_LOGIC_OP_ENABLE 0x00000d40 -#define NV11TCL_COLOR_LOGIC_OP_OP 0x00000d44 -#define NV11TCL_COLOR_LOGIC_OP_OP_CLEAR 0x00001500 -#define NV11TCL_COLOR_LOGIC_OP_OP_AND 0x00001501 -#define NV11TCL_COLOR_LOGIC_OP_OP_AND_REVERSE 0x00001502 -#define NV11TCL_COLOR_LOGIC_OP_OP_COPY 0x00001503 -#define NV11TCL_COLOR_LOGIC_OP_OP_AND_INVERTED 0x00001504 -#define NV11TCL_COLOR_LOGIC_OP_OP_NOOP 0x00001505 -#define NV11TCL_COLOR_LOGIC_OP_OP_XOR 0x00001506 -#define NV11TCL_COLOR_LOGIC_OP_OP_OR 0x00001507 -#define NV11TCL_COLOR_LOGIC_OP_OP_NOR 0x00001508 -#define NV11TCL_COLOR_LOGIC_OP_OP_EQUIV 0x00001509 -#define NV11TCL_COLOR_LOGIC_OP_OP_INVERT 0x0000150a -#define NV11TCL_COLOR_LOGIC_OP_OP_OR_REVERSE 0x0000150b -#define NV11TCL_COLOR_LOGIC_OP_OP_COPY_INVERTED 0x0000150c -#define NV11TCL_COLOR_LOGIC_OP_OP_OR_INVERTED 0x0000150d -#define NV11TCL_COLOR_LOGIC_OP_OP_NAND 0x0000150e -#define NV11TCL_COLOR_LOGIC_OP_OP_SET 0x0000150f - - -#define NV20TCL 0x00000097 - -#define NV20TCL_NOP 0x00000100 -#define NV20TCL_NOTIFY 0x00000104 -#define NV20TCL_DMA_NOTIFY 0x00000180 -#define NV20TCL_DMA_TEXTURE0 0x00000184 -#define NV20TCL_DMA_TEXTURE1 0x00000188 -#define NV20TCL_DMA_COLOR 0x00000194 -#define NV20TCL_DMA_ZETA 0x00000198 -#define NV20TCL_DMA_VTXBUF0 0x0000019c -#define NV20TCL_DMA_VTXBUF1 0x000001a0 -#define NV20TCL_DMA_FENCE 0x000001a4 -#define NV20TCL_DMA_QUERY 0x000001a8 -#define NV20TCL_RT_HORIZ 0x00000200 -#define NV20TCL_RT_HORIZ_X_SHIFT 0 -#define NV20TCL_RT_HORIZ_X_MASK 0x0000ffff -#define NV20TCL_RT_HORIZ_W_SHIFT 16 -#define NV20TCL_RT_HORIZ_W_MASK 0xffff0000 -#define NV20TCL_RT_VERT 0x00000204 -#define NV20TCL_RT_VERT_Y_SHIFT 0 -#define NV20TCL_RT_VERT_Y_MASK 0x0000ffff -#define NV20TCL_RT_VERT_H_SHIFT 16 -#define NV20TCL_RT_VERT_H_MASK 0xffff0000 -#define NV20TCL_RT_FORMAT 0x00000208 -#define NV20TCL_RT_FORMAT_TYPE_SHIFT 8 -#define NV20TCL_RT_FORMAT_TYPE_MASK 0x00000f00 -#define NV20TCL_RT_FORMAT_TYPE_LINEAR 0x00000100 -#define NV20TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200 -#define NV20TCL_RT_FORMAT_COLOR_SHIFT 0 -#define NV20TCL_RT_FORMAT_COLOR_MASK 0x0000001f -#define NV20TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003 -#define NV20TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005 -#define NV20TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008 -#define NV20TCL_RT_FORMAT_COLOR_B8 0x00000009 -#define NV20TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d -#define NV20TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f -#define NV20TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010 -#define NV20TCL_RT_PITCH 0x0000020c -#define NV20TCL_RT_PITCH_COLOR_PITCH_SHIFT 0 -#define NV20TCL_RT_PITCH_COLOR_PITCH_MASK 0x0000ffff -#define NV20TCL_RT_PITCH_ZETA_PITCH_SHIFT 16 -#define NV20TCL_RT_PITCH_ZETA_PITCH_MASK 0xffff0000 -#define NV20TCL_COLOR_OFFSET 0x00000210 -#define NV20TCL_ZETA_OFFSET 0x00000214 -#define NV20TCL_RC_IN_ALPHA(x) (0x00000260+((x)*4)) -#define NV20TCL_RC_IN_ALPHA__SIZE 0x00000008 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_SHIFT 0 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_MASK 0x0000000f -#define NV20TCL_RC_IN_ALPHA_D_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_FOG 0x00000003 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE0_NV 0x0000000c -#define NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV 0x0000000d -#define NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV20TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE (1 << 4) -#define NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE 0x00000000 -#define NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_SHIFT 5 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_MASK 0x000000e0 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV20TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_SHIFT 8 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_MASK 0x00000f00 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_FOG 0x00000300 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE0_NV 0x00000c00 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV 0x00000d00 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV20TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE (1 << 12) -#define NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE 0x00000000 -#define NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_SHIFT 13 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_MASK 0x0000e000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV20TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_SHIFT 16 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_MASK 0x000f0000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_FOG 0x00030000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE0_NV 0x000c0000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV 0x000d0000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV20TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE (1 << 20) -#define NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE 0x00000000 -#define NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_SHIFT 21 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_MASK 0x00e00000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV20TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_SHIFT 24 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_MASK 0x0f000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_FOG 0x03000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE0_NV 0x0c000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV 0x0d000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV20TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE (1 << 28) -#define NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE 0x00000000 -#define NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_SHIFT 29 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_MASK 0xe0000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV20TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV20TCL_RC_FINAL0 0x00000288 -#define NV20TCL_RC_FINAL0_D_INPUT_SHIFT 0 -#define NV20TCL_RC_FINAL0_D_INPUT_MASK 0x0000000f -#define NV20TCL_RC_FINAL0_D_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV20TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV20TCL_RC_FINAL0_D_INPUT_FOG 0x00000003 -#define NV20TCL_RC_FINAL0_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV20TCL_RC_FINAL0_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV20TCL_RC_FINAL0_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV20TCL_RC_FINAL0_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV20TCL_RC_FINAL0_D_INPUT_SPARE0_NV 0x0000000c -#define NV20TCL_RC_FINAL0_D_INPUT_SPARE1_NV 0x0000000d -#define NV20TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV20TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV20TCL_RC_FINAL0_D_COMPONENT_USAGE (1 << 4) -#define NV20TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV20TCL_RC_FINAL0_D_MAPPING_SHIFT 5 -#define NV20TCL_RC_FINAL0_D_MAPPING_MASK 0x000000e0 -#define NV20TCL_RC_FINAL0_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_FINAL0_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV20TCL_RC_FINAL0_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV20TCL_RC_FINAL0_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV20TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV20TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV20TCL_RC_FINAL0_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV20TCL_RC_FINAL0_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV20TCL_RC_FINAL0_C_INPUT_SHIFT 8 -#define NV20TCL_RC_FINAL0_C_INPUT_MASK 0x00000f00 -#define NV20TCL_RC_FINAL0_C_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV20TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV20TCL_RC_FINAL0_C_INPUT_FOG 0x00000300 -#define NV20TCL_RC_FINAL0_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV20TCL_RC_FINAL0_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV20TCL_RC_FINAL0_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV20TCL_RC_FINAL0_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV20TCL_RC_FINAL0_C_INPUT_SPARE0_NV 0x00000c00 -#define NV20TCL_RC_FINAL0_C_INPUT_SPARE1_NV 0x00000d00 -#define NV20TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV20TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV20TCL_RC_FINAL0_C_COMPONENT_USAGE (1 << 12) -#define NV20TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV20TCL_RC_FINAL0_C_MAPPING_SHIFT 13 -#define NV20TCL_RC_FINAL0_C_MAPPING_MASK 0x0000e000 -#define NV20TCL_RC_FINAL0_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_FINAL0_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV20TCL_RC_FINAL0_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV20TCL_RC_FINAL0_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV20TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV20TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV20TCL_RC_FINAL0_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV20TCL_RC_FINAL0_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV20TCL_RC_FINAL0_B_INPUT_SHIFT 16 -#define NV20TCL_RC_FINAL0_B_INPUT_MASK 0x000f0000 -#define NV20TCL_RC_FINAL0_B_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV20TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV20TCL_RC_FINAL0_B_INPUT_FOG 0x00030000 -#define NV20TCL_RC_FINAL0_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV20TCL_RC_FINAL0_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV20TCL_RC_FINAL0_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV20TCL_RC_FINAL0_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV20TCL_RC_FINAL0_B_INPUT_SPARE0_NV 0x000c0000 -#define NV20TCL_RC_FINAL0_B_INPUT_SPARE1_NV 0x000d0000 -#define NV20TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV20TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV20TCL_RC_FINAL0_B_COMPONENT_USAGE (1 << 20) -#define NV20TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV20TCL_RC_FINAL0_B_MAPPING_SHIFT 21 -#define NV20TCL_RC_FINAL0_B_MAPPING_MASK 0x00e00000 -#define NV20TCL_RC_FINAL0_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_FINAL0_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV20TCL_RC_FINAL0_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV20TCL_RC_FINAL0_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV20TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV20TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV20TCL_RC_FINAL0_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV20TCL_RC_FINAL0_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV20TCL_RC_FINAL0_A_INPUT_SHIFT 24 -#define NV20TCL_RC_FINAL0_A_INPUT_MASK 0x0f000000 -#define NV20TCL_RC_FINAL0_A_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV20TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV20TCL_RC_FINAL0_A_INPUT_FOG 0x03000000 -#define NV20TCL_RC_FINAL0_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV20TCL_RC_FINAL0_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV20TCL_RC_FINAL0_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV20TCL_RC_FINAL0_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV20TCL_RC_FINAL0_A_INPUT_SPARE0_NV 0x0c000000 -#define NV20TCL_RC_FINAL0_A_INPUT_SPARE1_NV 0x0d000000 -#define NV20TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV20TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV20TCL_RC_FINAL0_A_COMPONENT_USAGE (1 << 28) -#define NV20TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_SHIFT 29 -#define NV20TCL_RC_FINAL0_A_MAPPING_MASK 0xe0000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV20TCL_RC_FINAL0_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV20TCL_RC_FINAL1 0x0000028c -#define NV20TCL_RC_FINAL1_COLOR_SUM_CLAMP (1 << 7) -#define NV20TCL_RC_FINAL1_G_INPUT_SHIFT 8 -#define NV20TCL_RC_FINAL1_G_INPUT_MASK 0x00000f00 -#define NV20TCL_RC_FINAL1_G_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV20TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV20TCL_RC_FINAL1_G_INPUT_FOG 0x00000300 -#define NV20TCL_RC_FINAL1_G_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV20TCL_RC_FINAL1_G_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV20TCL_RC_FINAL1_G_INPUT_TEXTURE0_ARB 0x00000800 -#define NV20TCL_RC_FINAL1_G_INPUT_TEXTURE1_ARB 0x00000900 -#define NV20TCL_RC_FINAL1_G_INPUT_SPARE0_NV 0x00000c00 -#define NV20TCL_RC_FINAL1_G_INPUT_SPARE1_NV 0x00000d00 -#define NV20TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV20TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV20TCL_RC_FINAL1_G_COMPONENT_USAGE (1 << 12) -#define NV20TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV20TCL_RC_FINAL1_G_MAPPING_SHIFT 13 -#define NV20TCL_RC_FINAL1_G_MAPPING_MASK 0x0000e000 -#define NV20TCL_RC_FINAL1_G_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_FINAL1_G_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV20TCL_RC_FINAL1_G_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV20TCL_RC_FINAL1_G_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV20TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV20TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV20TCL_RC_FINAL1_G_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV20TCL_RC_FINAL1_G_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV20TCL_RC_FINAL1_F_INPUT_SHIFT 16 -#define NV20TCL_RC_FINAL1_F_INPUT_MASK 0x000f0000 -#define NV20TCL_RC_FINAL1_F_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV20TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV20TCL_RC_FINAL1_F_INPUT_FOG 0x00030000 -#define NV20TCL_RC_FINAL1_F_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV20TCL_RC_FINAL1_F_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV20TCL_RC_FINAL1_F_INPUT_TEXTURE0_ARB 0x00080000 -#define NV20TCL_RC_FINAL1_F_INPUT_TEXTURE1_ARB 0x00090000 -#define NV20TCL_RC_FINAL1_F_INPUT_SPARE0_NV 0x000c0000 -#define NV20TCL_RC_FINAL1_F_INPUT_SPARE1_NV 0x000d0000 -#define NV20TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV20TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV20TCL_RC_FINAL1_F_COMPONENT_USAGE (1 << 20) -#define NV20TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV20TCL_RC_FINAL1_F_MAPPING_SHIFT 21 -#define NV20TCL_RC_FINAL1_F_MAPPING_MASK 0x00e00000 -#define NV20TCL_RC_FINAL1_F_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_FINAL1_F_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV20TCL_RC_FINAL1_F_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV20TCL_RC_FINAL1_F_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV20TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV20TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV20TCL_RC_FINAL1_F_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV20TCL_RC_FINAL1_F_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV20TCL_RC_FINAL1_E_INPUT_SHIFT 24 -#define NV20TCL_RC_FINAL1_E_INPUT_MASK 0x0f000000 -#define NV20TCL_RC_FINAL1_E_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV20TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV20TCL_RC_FINAL1_E_INPUT_FOG 0x03000000 -#define NV20TCL_RC_FINAL1_E_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV20TCL_RC_FINAL1_E_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV20TCL_RC_FINAL1_E_INPUT_TEXTURE0_ARB 0x08000000 -#define NV20TCL_RC_FINAL1_E_INPUT_TEXTURE1_ARB 0x09000000 -#define NV20TCL_RC_FINAL1_E_INPUT_SPARE0_NV 0x0c000000 -#define NV20TCL_RC_FINAL1_E_INPUT_SPARE1_NV 0x0d000000 -#define NV20TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV20TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV20TCL_RC_FINAL1_E_COMPONENT_USAGE (1 << 28) -#define NV20TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_SHIFT 29 -#define NV20TCL_RC_FINAL1_E_MAPPING_MASK 0xe0000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV20TCL_RC_FINAL1_E_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV20TCL_LIGHT_CONTROL 0x00000294 -#define NV20TCL_FOG_MODE 0x0000029c -#define NV20TCL_FOG_MODE_EXP 0x00000800 -#define NV20TCL_FOG_MODE_EXP_2 0x00000802 -#define NV20TCL_FOG_MODE_EXP2 0x00000803 -#define NV20TCL_FOG_MODE_LINEAR 0x00000804 -#define NV20TCL_FOG_MODE_LINEAR_2 0x00002601 -#define NV20TCL_FOG_COORD_DIST 0x000002a0 -#define NV20TCL_FOG_COORD_DIST_COORD_FALSE 0x00000000 -#define NV20TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_RADIAL_NV 0x00000001 -#define NV20TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_PLANE_ABSOLUTE_NV 0x00000002 -#define NV20TCL_FOG_COORD_DIST_COORD_FOG 0x00000003 -#define NV20TCL_FOG_ENABLE 0x000002a4 -#define NV20TCL_FOG_COLOR 0x000002a8 -#define NV20TCL_FOG_COLOR_R_SHIFT 0 -#define NV20TCL_FOG_COLOR_R_MASK 0x000000ff -#define NV20TCL_FOG_COLOR_G_SHIFT 8 -#define NV20TCL_FOG_COLOR_G_MASK 0x0000ff00 -#define NV20TCL_FOG_COLOR_B_SHIFT 16 -#define NV20TCL_FOG_COLOR_B_MASK 0x00ff0000 -#define NV20TCL_FOG_COLOR_A_SHIFT 24 -#define NV20TCL_FOG_COLOR_A_MASK 0xff000000 -#define NV20TCL_VIEWPORT_CLIP_MODE 0x000002b4 -#define NV20TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*4)) -#define NV20TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008 -#define NV20TCL_VIEWPORT_CLIP_VERT(x) (0x000002e0+((x)*4)) -#define NV20TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008 -#define NV20TCL_ALPHA_FUNC_ENABLE 0x00000300 -#define NV20TCL_BLEND_FUNC_ENABLE 0x00000304 -#define NV20TCL_CULL_FACE_ENABLE 0x00000308 -#define NV20TCL_DEPTH_TEST_ENABLE 0x0000030c -#define NV20TCL_DITHER_ENABLE 0x00000310 -#define NV20TCL_LIGHTING_ENABLE 0x00000314 -#define NV20TCL_POINT_PARAMETERS_ENABLE 0x00000318 -#define NV20TCL_POINT_SMOOTH_ENABLE 0x0000031c -#define NV20TCL_LINE_SMOOTH_ENABLE 0x00000320 -#define NV20TCL_POLYGON_SMOOTH_ENABLE 0x00000324 -#define NV20TCL_STENCIL_ENABLE 0x0000032c -#define NV20TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000330 -#define NV20TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000334 -#define NV20TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000338 -#define NV20TCL_ALPHA_FUNC_FUNC 0x0000033c -#define NV20TCL_ALPHA_FUNC_FUNC_NEVER 0x00000200 -#define NV20TCL_ALPHA_FUNC_FUNC_LESS 0x00000201 -#define NV20TCL_ALPHA_FUNC_FUNC_EQUAL 0x00000202 -#define NV20TCL_ALPHA_FUNC_FUNC_LEQUAL 0x00000203 -#define NV20TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204 -#define NV20TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204 -#define NV20TCL_ALPHA_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV20TCL_ALPHA_FUNC_FUNC_GEQUAL 0x00000206 -#define NV20TCL_ALPHA_FUNC_FUNC_ALWAYS 0x00000207 -#define NV20TCL_ALPHA_FUNC_REF 0x00000340 -#define NV20TCL_BLEND_FUNC_SRC 0x00000344 -#define NV20TCL_BLEND_FUNC_SRC_ZERO 0x00000000 -#define NV20TCL_BLEND_FUNC_SRC_ONE 0x00000001 -#define NV20TCL_BLEND_FUNC_SRC_SRC_COLOR 0x00000300 -#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV20TCL_BLEND_FUNC_SRC_SRC_ALPHA 0x00000302 -#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV20TCL_BLEND_FUNC_SRC_DST_ALPHA 0x00000304 -#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV20TCL_BLEND_FUNC_SRC_DST_COLOR 0x00000306 -#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_COLOR 0x00000307 -#define NV20TCL_BLEND_FUNC_SRC_SRC_ALPHA_SATURATE 0x00000308 -#define NV20TCL_BLEND_FUNC_SRC_CONSTANT_COLOR 0x00008001 -#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV20TCL_BLEND_FUNC_SRC_CONSTANT_ALPHA 0x00008003 -#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV20TCL_BLEND_FUNC_DST 0x00000348 -#define NV20TCL_BLEND_FUNC_DST_ZERO 0x00000000 -#define NV20TCL_BLEND_FUNC_DST_ONE 0x00000001 -#define NV20TCL_BLEND_FUNC_DST_SRC_COLOR 0x00000300 -#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV20TCL_BLEND_FUNC_DST_SRC_ALPHA 0x00000302 -#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV20TCL_BLEND_FUNC_DST_DST_ALPHA 0x00000304 -#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV20TCL_BLEND_FUNC_DST_DST_COLOR 0x00000306 -#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_DST_COLOR 0x00000307 -#define NV20TCL_BLEND_FUNC_DST_SRC_ALPHA_SATURATE 0x00000308 -#define NV20TCL_BLEND_FUNC_DST_CONSTANT_COLOR 0x00008001 -#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV20TCL_BLEND_FUNC_DST_CONSTANT_ALPHA 0x00008003 -#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV20TCL_BLEND_COLOR 0x0000034c -#define NV20TCL_BLEND_COLOR_B_SHIFT 0 -#define NV20TCL_BLEND_COLOR_B_MASK 0x000000ff -#define NV20TCL_BLEND_COLOR_G_SHIFT 8 -#define NV20TCL_BLEND_COLOR_G_MASK 0x0000ff00 -#define NV20TCL_BLEND_COLOR_R_SHIFT 16 -#define NV20TCL_BLEND_COLOR_R_MASK 0x00ff0000 -#define NV20TCL_BLEND_COLOR_A_SHIFT 24 -#define NV20TCL_BLEND_COLOR_A_MASK 0xff000000 -#define NV20TCL_BLEND_EQUATION 0x00000350 -#define NV20TCL_BLEND_EQUATION_FUNC_ADD 0x00008006 -#define NV20TCL_BLEND_EQUATION_MIN 0x00008007 -#define NV20TCL_BLEND_EQUATION_MAX 0x00008008 -#define NV20TCL_BLEND_EQUATION_FUNC_SUBTRACT 0x0000800a -#define NV20TCL_BLEND_EQUATION_FUNC_REVERSE_SUBTRACT 0x0000800b -#define NV20TCL_DEPTH_FUNC 0x00000354 -#define NV20TCL_DEPTH_FUNC_NEVER 0x00000200 -#define NV20TCL_DEPTH_FUNC_LESS 0x00000201 -#define NV20TCL_DEPTH_FUNC_EQUAL 0x00000202 -#define NV20TCL_DEPTH_FUNC_LEQUAL 0x00000203 -#define NV20TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV20TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV20TCL_DEPTH_FUNC_NOTEQUAL 0x00000205 -#define NV20TCL_DEPTH_FUNC_GEQUAL 0x00000206 -#define NV20TCL_DEPTH_FUNC_ALWAYS 0x00000207 -#define NV20TCL_COLOR_MASK 0x00000358 -#define NV20TCL_COLOR_MASK_B (1 << 0) -#define NV20TCL_COLOR_MASK_G (1 << 8) -#define NV20TCL_COLOR_MASK_R (1 << 16) -#define NV20TCL_COLOR_MASK_A (1 << 24) -#define NV20TCL_DEPTH_WRITE_ENABLE 0x0000035c -#define NV20TCL_STENCIL_MASK 0x00000360 -#define NV20TCL_STENCIL_FUNC_FUNC 0x00000364 -#define NV20TCL_STENCIL_FUNC_FUNC_NEVER 0x00000200 -#define NV20TCL_STENCIL_FUNC_FUNC_LESS 0x00000201 -#define NV20TCL_STENCIL_FUNC_FUNC_EQUAL 0x00000202 -#define NV20TCL_STENCIL_FUNC_FUNC_LEQUAL 0x00000203 -#define NV20TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204 -#define NV20TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204 -#define NV20TCL_STENCIL_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV20TCL_STENCIL_FUNC_FUNC_GEQUAL 0x00000206 -#define NV20TCL_STENCIL_FUNC_FUNC_ALWAYS 0x00000207 -#define NV20TCL_STENCIL_FUNC_REF 0x00000368 -#define NV20TCL_STENCIL_FUNC_MASK 0x0000036c -#define NV20TCL_STENCIL_OP_FAIL 0x00000370 -#define NV20TCL_STENCIL_OP_FAIL_ZERO 0x00000000 -#define NV20TCL_STENCIL_OP_FAIL_INVERT 0x0000150a -#define NV20TCL_STENCIL_OP_FAIL_KEEP 0x00001e00 -#define NV20TCL_STENCIL_OP_FAIL_REPLACE 0x00001e01 -#define NV20TCL_STENCIL_OP_FAIL_INCR 0x00001e02 -#define NV20TCL_STENCIL_OP_FAIL_DECR 0x00001e03 -#define NV20TCL_STENCIL_OP_FAIL_INCR_WRAP 0x00008507 -#define NV20TCL_STENCIL_OP_FAIL_DECR_WRAP 0x00008508 -#define NV20TCL_STENCIL_OP_ZFAIL 0x00000374 -#define NV20TCL_STENCIL_OP_ZFAIL_ZERO 0x00000000 -#define NV20TCL_STENCIL_OP_ZFAIL_INVERT 0x0000150a -#define NV20TCL_STENCIL_OP_ZFAIL_KEEP 0x00001e00 -#define NV20TCL_STENCIL_OP_ZFAIL_REPLACE 0x00001e01 -#define NV20TCL_STENCIL_OP_ZFAIL_INCR 0x00001e02 -#define NV20TCL_STENCIL_OP_ZFAIL_DECR 0x00001e03 -#define NV20TCL_STENCIL_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV20TCL_STENCIL_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV20TCL_STENCIL_OP_ZPASS 0x00000378 -#define NV20TCL_STENCIL_OP_ZPASS_ZERO 0x00000000 -#define NV20TCL_STENCIL_OP_ZPASS_INVERT 0x0000150a -#define NV20TCL_STENCIL_OP_ZPASS_KEEP 0x00001e00 -#define NV20TCL_STENCIL_OP_ZPASS_REPLACE 0x00001e01 -#define NV20TCL_STENCIL_OP_ZPASS_INCR 0x00001e02 -#define NV20TCL_STENCIL_OP_ZPASS_DECR 0x00001e03 -#define NV20TCL_STENCIL_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV20TCL_STENCIL_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV20TCL_SHADE_MODEL 0x0000037c -#define NV20TCL_SHADE_MODEL_FLAT 0x00001d00 -#define NV20TCL_SHADE_MODEL_SMOOTH 0x00001d01 -#define NV20TCL_LINE_WIDTH 0x00000380 -#define NV20TCL_POLYGON_OFFSET_FACTOR 0x00000384 -#define NV20TCL_POLYGON_OFFSET_UNITS 0x00000388 -#define NV20TCL_POLYGON_MODE_FRONT 0x0000038c -#define NV20TCL_POLYGON_MODE_FRONT_POINT 0x00001b00 -#define NV20TCL_POLYGON_MODE_FRONT_LINE 0x00001b01 -#define NV20TCL_POLYGON_MODE_FRONT_FILL 0x00001b02 -#define NV20TCL_POLYGON_MODE_BACK 0x00000390 -#define NV20TCL_POLYGON_MODE_BACK_POINT 0x00001b00 -#define NV20TCL_POLYGON_MODE_BACK_LINE 0x00001b01 -#define NV20TCL_POLYGON_MODE_BACK_FILL 0x00001b02 -#define NV20TCL_DEPTH_RANGE_NEAR 0x00000394 -#define NV20TCL_DEPTH_RANGE_FAR 0x00000398 -#define NV20TCL_CULL_FACE 0x0000039c -#define NV20TCL_CULL_FACE_FRONT 0x00000404 -#define NV20TCL_CULL_FACE_BACK 0x00000405 -#define NV20TCL_CULL_FACE_FRONT_AND_BACK 0x00000408 -#define NV20TCL_FRONT_FACE 0x000003a0 -#define NV20TCL_FRONT_FACE_CW 0x00000900 -#define NV20TCL_FRONT_FACE_CCW 0x00000901 -#define NV20TCL_NORMALIZE_ENABLE 0x000003a4 -#define NV20TCL_COLOR_MATERIAL_FRONT_R 0x000003a8 -#define NV20TCL_COLOR_MATERIAL_FRONT_G 0x000003ac -#define NV20TCL_COLOR_MATERIAL_FRONT_B 0x000003b0 -#define NV20TCL_COLOR_MATERIAL_FRONT_A 0x000003b4 -#define NV20TCL_SEPARATE_SPECULAR_ENABLE 0x000003b8 -#define NV20TCL_ENABLED_LIGHTS 0x000003bc -#define NV20TCL_TX_GEN_S(x) (0x000003c0+((x)*16)) -#define NV20TCL_TX_GEN_S__SIZE 0x00000004 -#define NV20TCL_TX_GEN_S_FALSE 0x00000000 -#define NV20TCL_TX_GEN_S_EYE_LINEAR 0x00002400 -#define NV20TCL_TX_GEN_S_OBJECT_LINEAR 0x00002401 -#define NV20TCL_TX_GEN_S_SPHERE_MAP 0x00002402 -#define NV20TCL_TX_GEN_S_NORMAL_MAP 0x00008511 -#define NV20TCL_TX_GEN_S_REFLECTION_MAP 0x00008512 -#define NV20TCL_TX_GEN_T(x) (0x000003c4+((x)*16)) -#define NV20TCL_TX_GEN_T__SIZE 0x00000004 -#define NV20TCL_TX_GEN_T_FALSE 0x00000000 -#define NV20TCL_TX_GEN_T_EYE_LINEAR 0x00002400 -#define NV20TCL_TX_GEN_T_OBJECT_LINEAR 0x00002401 -#define NV20TCL_TX_GEN_T_SPHERE_MAP 0x00002402 -#define NV20TCL_TX_GEN_T_NORMAL_MAP 0x00008511 -#define NV20TCL_TX_GEN_T_REFLECTION_MAP 0x00008512 -#define NV20TCL_TX_GEN_R(x) (0x000003c8+((x)*16)) -#define NV20TCL_TX_GEN_R__SIZE 0x00000004 -#define NV20TCL_TX_GEN_R_FALSE 0x00000000 -#define NV20TCL_TX_GEN_R_EYE_LINEAR 0x00002400 -#define NV20TCL_TX_GEN_R_OBJECT_LINEAR 0x00002401 -#define NV20TCL_TX_GEN_R_SPHERE_MAP 0x00002402 -#define NV20TCL_TX_GEN_R_NORMAL_MAP 0x00008511 -#define NV20TCL_TX_GEN_R_REFLECTION_MAP 0x00008512 -#define NV20TCL_TX_GEN_Q(x) (0x000003cc+((x)*16)) -#define NV20TCL_TX_GEN_Q__SIZE 0x00000004 -#define NV20TCL_TX_GEN_Q_FALSE 0x00000000 -#define NV20TCL_TX_GEN_Q_EYE_LINEAR 0x00002400 -#define NV20TCL_TX_GEN_Q_OBJECT_LINEAR 0x00002401 -#define NV20TCL_TX_GEN_Q_SPHERE_MAP 0x00002402 -#define NV20TCL_TX_GEN_Q_NORMAL_MAP 0x00008511 -#define NV20TCL_TX_GEN_Q_REFLECTION_MAP 0x00008512 -#define NV20TCL_TX_MATRIX_ENABLE(x) (0x00000420+((x)*4)) -#define NV20TCL_TX_MATRIX_ENABLE__SIZE 0x00000004 -#define NV20TCL_POINT_SIZE 0x0000043c -#define NV20TCL_MODELVIEW0_MATRIX(x) (0x00000480+((x)*4)) -#define NV20TCL_MODELVIEW0_MATRIX__SIZE 0x00000010 -#define NV20TCL_MODELVIEW1_MATRIX(x) (0x000004c0+((x)*4)) -#define NV20TCL_MODELVIEW1_MATRIX__SIZE 0x00000010 -#define NV20TCL_MODELVIEW2_MATRIX(x) (0x00000500+((x)*4)) -#define NV20TCL_MODELVIEW2_MATRIX__SIZE 0x00000010 -#define NV20TCL_MODELVIEW3_MATRIX(x) (0x00000540+((x)*4)) -#define NV20TCL_MODELVIEW3_MATRIX__SIZE 0x00000010 -#define NV20TCL_INVERSE_MODELVIEW0_MATRIX(x) (0x00000580+((x)*4)) -#define NV20TCL_INVERSE_MODELVIEW0_MATRIX__SIZE 0x00000010 -#define NV20TCL_INVERSE_MODELVIEW1_MATRIX(x) (0x000005c0+((x)*4)) -#define NV20TCL_INVERSE_MODELVIEW1_MATRIX__SIZE 0x00000010 -#define NV20TCL_INVERSE_MODELVIEW2_MATRIX(x) (0x00000600+((x)*4)) -#define NV20TCL_INVERSE_MODELVIEW2_MATRIX__SIZE 0x00000010 -#define NV20TCL_INVERSE_MODELVIEW3_MATRIX(x) (0x00000640+((x)*4)) -#define NV20TCL_INVERSE_MODELVIEW3_MATRIX__SIZE 0x00000010 -#define NV20TCL_PROJECTION_MATRIX(x) (0x00000680+((x)*4)) -#define NV20TCL_PROJECTION_MATRIX__SIZE 0x00000010 -#define NV20TCL_TX0_MATRIX(x) (0x000006c0+((x)*4)) -#define NV20TCL_TX0_MATRIX__SIZE 0x00000010 -#define NV20TCL_TX1_MATRIX(x) (0x00000700+((x)*4)) -#define NV20TCL_TX1_MATRIX__SIZE 0x00000010 -#define NV20TCL_TX2_MATRIX(x) (0x00000740+((x)*4)) -#define NV20TCL_TX2_MATRIX__SIZE 0x00000010 -#define NV20TCL_TX3_MATRIX(x) (0x00000780+((x)*4)) -#define NV20TCL_TX3_MATRIX__SIZE 0x00000010 -#define NV20TCL_TX0_CLIP_PLANE_A(x) (0x00000840+((x)*16)) -#define NV20TCL_TX0_CLIP_PLANE_A__SIZE 0x00000004 -#define NV20TCL_TX0_CLIP_PLANE_B(x) (0x00000844+((x)*16)) -#define NV20TCL_TX0_CLIP_PLANE_B__SIZE 0x00000004 -#define NV20TCL_TX0_CLIP_PLANE_C(x) (0x00000848+((x)*16)) -#define NV20TCL_TX0_CLIP_PLANE_C__SIZE 0x00000004 -#define NV20TCL_TX0_CLIP_PLANE_D(x) (0x0000084c+((x)*16)) -#define NV20TCL_TX0_CLIP_PLANE_D__SIZE 0x00000004 -#define NV20TCL_TX1_CLIP_PLANE_A(x) (0x00000880+((x)*16)) -#define NV20TCL_TX1_CLIP_PLANE_A__SIZE 0x00000004 -#define NV20TCL_TX1_CLIP_PLANE_B(x) (0x00000884+((x)*16)) -#define NV20TCL_TX1_CLIP_PLANE_B__SIZE 0x00000004 -#define NV20TCL_TX1_CLIP_PLANE_C(x) (0x00000888+((x)*16)) -#define NV20TCL_TX1_CLIP_PLANE_C__SIZE 0x00000004 -#define NV20TCL_TX1_CLIP_PLANE_D(x) (0x0000088c+((x)*16)) -#define NV20TCL_TX1_CLIP_PLANE_D__SIZE 0x00000004 -#define NV20TCL_TX2_CLIP_PLANE_A(x) (0x000008c0+((x)*16)) -#define NV20TCL_TX2_CLIP_PLANE_A__SIZE 0x00000004 -#define NV20TCL_TX2_CLIP_PLANE_B(x) (0x000008c4+((x)*16)) -#define NV20TCL_TX2_CLIP_PLANE_B__SIZE 0x00000004 -#define NV20TCL_TX2_CLIP_PLANE_C(x) (0x000008c8+((x)*16)) -#define NV20TCL_TX2_CLIP_PLANE_C__SIZE 0x00000004 -#define NV20TCL_TX2_CLIP_PLANE_D(x) (0x000008cc+((x)*16)) -#define NV20TCL_TX2_CLIP_PLANE_D__SIZE 0x00000004 -#define NV20TCL_TX3_CLIP_PLANE_A(x) (0x00000900+((x)*16)) -#define NV20TCL_TX3_CLIP_PLANE_A__SIZE 0x00000004 -#define NV20TCL_TX3_CLIP_PLANE_B(x) (0x00000904+((x)*16)) -#define NV20TCL_TX3_CLIP_PLANE_B__SIZE 0x00000004 -#define NV20TCL_TX3_CLIP_PLANE_C(x) (0x00000908+((x)*16)) -#define NV20TCL_TX3_CLIP_PLANE_C__SIZE 0x00000004 -#define NV20TCL_TX3_CLIP_PLANE_D(x) (0x0000090c+((x)*16)) -#define NV20TCL_TX3_CLIP_PLANE_D__SIZE 0x00000004 -#define NV20TCL_FOG_EQUATION_CONSTANT 0x000009c0 -#define NV20TCL_FOG_EQUATION_LINEAR 0x000009c4 -#define NV20TCL_FOG_EQUATION_QUADRATIC 0x000009c8 -#define NV20TCL_FRONT_MATERIAL_SHININESS(x) (0x000009e0+((x)*4)) -#define NV20TCL_FRONT_MATERIAL_SHININESS__SIZE 0x00000006 -#define NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x00000a10 -#define NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x00000a14 -#define NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x00000a18 -#define NV20TCL_VIEWPORT_SCALE0_X 0x00000a20 -#define NV20TCL_VIEWPORT_SCALE0_Y 0x00000a24 -#define NV20TCL_VIEWPORT_SCALE0_Z 0x00000a28 -#define NV20TCL_VIEWPORT_SCALE0_W 0x00000a2c -#define NV20TCL_POINT_PARAMETER(x) (0x00000a30+((x)*4)) -#define NV20TCL_POINT_PARAMETER__SIZE 0x00000008 -#define NV20TCL_RC_CONSTANT_COLOR0(x) (0x00000a60+((x)*4)) -#define NV20TCL_RC_CONSTANT_COLOR0__SIZE 0x00000008 -#define NV20TCL_RC_CONSTANT_COLOR0_B_SHIFT 0 -#define NV20TCL_RC_CONSTANT_COLOR0_B_MASK 0x000000ff -#define NV20TCL_RC_CONSTANT_COLOR0_G_SHIFT 8 -#define NV20TCL_RC_CONSTANT_COLOR0_G_MASK 0x0000ff00 -#define NV20TCL_RC_CONSTANT_COLOR0_R_SHIFT 16 -#define NV20TCL_RC_CONSTANT_COLOR0_R_MASK 0x00ff0000 -#define NV20TCL_RC_CONSTANT_COLOR0_A_SHIFT 24 -#define NV20TCL_RC_CONSTANT_COLOR0_A_MASK 0xff000000 -#define NV20TCL_RC_CONSTANT_COLOR1(x) (0x00000a80+((x)*4)) -#define NV20TCL_RC_CONSTANT_COLOR1__SIZE 0x00000008 -#define NV20TCL_RC_CONSTANT_COLOR1_B_SHIFT 0 -#define NV20TCL_RC_CONSTANT_COLOR1_B_MASK 0x000000ff -#define NV20TCL_RC_CONSTANT_COLOR1_G_SHIFT 8 -#define NV20TCL_RC_CONSTANT_COLOR1_G_MASK 0x0000ff00 -#define NV20TCL_RC_CONSTANT_COLOR1_R_SHIFT 16 -#define NV20TCL_RC_CONSTANT_COLOR1_R_MASK 0x00ff0000 -#define NV20TCL_RC_CONSTANT_COLOR1_A_SHIFT 24 -#define NV20TCL_RC_CONSTANT_COLOR1_A_MASK 0xff000000 -#define NV20TCL_RC_OUT_ALPHA(x) (0x00000aa0+((x)*4)) -#define NV20TCL_RC_OUT_ALPHA__SIZE 0x00000008 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SHIFT 0 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_MASK 0x0000000f -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_ZERO 0x00000000 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_FOG 0x00000003 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE0_ARB 0x00000008 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE1_ARB 0x00000009 -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_NV 0x0000000c -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV 0x0000000d -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV 0x0000000f -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT 4 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK 0x000000f0 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO 0x00000000 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_FOG 0x00000030 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE0_ARB 0x00000080 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE1_ARB 0x00000090 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_NV 0x000000c0 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV 0x000000d0 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0 -#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV 0x000000f0 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT 8 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK 0x00000f00 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO 0x00000000 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_FOG 0x00000300 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE0_ARB 0x00000800 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE1_ARB 0x00000900 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_NV 0x00000c00 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV 0x00000d00 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00 -#define NV20TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT (1 << 12) -#define NV20TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT (1 << 13) -#define NV20TCL_RC_OUT_ALPHA_MUX_SUM (1 << 14) -#define NV20TCL_RC_OUT_ALPHA_BIAS (1 << 15) -#define NV20TCL_RC_OUT_ALPHA_BIAS_NONE 0x00000000 -#define NV20TCL_RC_OUT_ALPHA_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000 -#define NV20TCL_RC_OUT_ALPHA_SCALE_SHIFT 17 -#define NV20TCL_RC_OUT_ALPHA_SCALE_MASK 0x00000000 -#define NV20TCL_RC_OUT_ALPHA_SCALE_NONE 0x00000000 -#define NV20TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_TWO_NV 0x00020000 -#define NV20TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_FOUR_NV 0x00040000 -#define NV20TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000 -#define NV20TCL_RC_IN_RGB(x) (0x00000ac0+((x)*4)) -#define NV20TCL_RC_IN_RGB__SIZE 0x00000008 -#define NV20TCL_RC_IN_RGB_D_INPUT_SHIFT 0 -#define NV20TCL_RC_IN_RGB_D_INPUT_MASK 0x0000000f -#define NV20TCL_RC_IN_RGB_D_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV20TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV20TCL_RC_IN_RGB_D_INPUT_FOG 0x00000003 -#define NV20TCL_RC_IN_RGB_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV20TCL_RC_IN_RGB_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV20TCL_RC_IN_RGB_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV20TCL_RC_IN_RGB_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV20TCL_RC_IN_RGB_D_INPUT_SPARE0_NV 0x0000000c -#define NV20TCL_RC_IN_RGB_D_INPUT_SPARE1_NV 0x0000000d -#define NV20TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV20TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE (1 << 4) -#define NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV20TCL_RC_IN_RGB_D_MAPPING_SHIFT 5 -#define NV20TCL_RC_IN_RGB_D_MAPPING_MASK 0x000000e0 -#define NV20TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV20TCL_RC_IN_RGB_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV20TCL_RC_IN_RGB_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV20TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV20TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV20TCL_RC_IN_RGB_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV20TCL_RC_IN_RGB_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV20TCL_RC_IN_RGB_C_INPUT_SHIFT 8 -#define NV20TCL_RC_IN_RGB_C_INPUT_MASK 0x00000f00 -#define NV20TCL_RC_IN_RGB_C_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV20TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV20TCL_RC_IN_RGB_C_INPUT_FOG 0x00000300 -#define NV20TCL_RC_IN_RGB_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV20TCL_RC_IN_RGB_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV20TCL_RC_IN_RGB_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV20TCL_RC_IN_RGB_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV20TCL_RC_IN_RGB_C_INPUT_SPARE0_NV 0x00000c00 -#define NV20TCL_RC_IN_RGB_C_INPUT_SPARE1_NV 0x00000d00 -#define NV20TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV20TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE (1 << 12) -#define NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_SHIFT 13 -#define NV20TCL_RC_IN_RGB_C_MAPPING_MASK 0x0000e000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV20TCL_RC_IN_RGB_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV20TCL_RC_IN_RGB_B_INPUT_SHIFT 16 -#define NV20TCL_RC_IN_RGB_B_INPUT_MASK 0x000f0000 -#define NV20TCL_RC_IN_RGB_B_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV20TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV20TCL_RC_IN_RGB_B_INPUT_FOG 0x00030000 -#define NV20TCL_RC_IN_RGB_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV20TCL_RC_IN_RGB_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV20TCL_RC_IN_RGB_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV20TCL_RC_IN_RGB_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV20TCL_RC_IN_RGB_B_INPUT_SPARE0_NV 0x000c0000 -#define NV20TCL_RC_IN_RGB_B_INPUT_SPARE1_NV 0x000d0000 -#define NV20TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV20TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE (1 << 20) -#define NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_SHIFT 21 -#define NV20TCL_RC_IN_RGB_B_MAPPING_MASK 0x00e00000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV20TCL_RC_IN_RGB_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV20TCL_RC_IN_RGB_A_INPUT_SHIFT 24 -#define NV20TCL_RC_IN_RGB_A_INPUT_MASK 0x0f000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_ZERO 0x00000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_FOG 0x03000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_SPARE0_NV 0x0c000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_SPARE1_NV 0x0d000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV20TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE (1 << 28) -#define NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB 0x00000000 -#define NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_SHIFT 29 -#define NV20TCL_RC_IN_RGB_A_MAPPING_MASK 0xe0000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV20TCL_RC_IN_RGB_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV20TCL_VIEWPORT_SCALE1_X 0x00000af0 -#define NV20TCL_VIEWPORT_SCALE1_Y 0x00000af4 -#define NV20TCL_VIEWPORT_SCALE1_Z 0x00000af8 -#define NV20TCL_VIEWPORT_SCALE1_W 0x00000afc -#define NV20TCL_VP_UPLOAD_INST(x) (0x00000b00+((x)*4)) -#define NV20TCL_VP_UPLOAD_INST__SIZE 0x00000004 -#define NV20TCL_VP_UPLOAD_CONST(x) (0x00000b80+((x)*4)) -#define NV20TCL_VP_UPLOAD_CONST__SIZE 0x00000004 -#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_R(x) (0x00000c00+((x)*64)) -#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008 -#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_G(x) (0x00000c04+((x)*64)) -#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008 -#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_B(x) (0x00000c08+((x)*64)) -#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(x) (0x00001000+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(x) (0x00001004+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(x) (0x00001008+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(x) (0x0000100c+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(x) (0x00001010+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(x) (0x00001014+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(x) (0x00001018+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(x) (0x0000101c+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G__SIZE 0x00000008 -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(x) (0x00001020+((x)*128)) -#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B__SIZE 0x00000008 -#define NV20TCL_LIGHT_HALF_VECTOR_X(x) (0x00001028+((x)*128)) -#define NV20TCL_LIGHT_HALF_VECTOR_X__SIZE 0x00000008 -#define NV20TCL_LIGHT_HALF_VECTOR_Y(x) (0x0000102c+((x)*128)) -#define NV20TCL_LIGHT_HALF_VECTOR_Y__SIZE 0x00000008 -#define NV20TCL_LIGHT_HALF_VECTOR_Z(x) (0x00001030+((x)*128)) -#define NV20TCL_LIGHT_HALF_VECTOR_Z__SIZE 0x00000008 -#define NV20TCL_LIGHT_DIRECTION_X(x) (0x00001034+((x)*128)) -#define NV20TCL_LIGHT_DIRECTION_X__SIZE 0x00000008 -#define NV20TCL_LIGHT_DIRECTION_Y(x) (0x00001038+((x)*128)) -#define NV20TCL_LIGHT_DIRECTION_Y__SIZE 0x00000008 -#define NV20TCL_LIGHT_DIRECTION_Z(x) (0x0000103c+((x)*128)) -#define NV20TCL_LIGHT_DIRECTION_Z__SIZE 0x00000008 -#define NV20TCL_LIGHT_POSITION_X(x) (0x0000105c+((x)*128)) -#define NV20TCL_LIGHT_POSITION_X__SIZE 0x00000008 -#define NV20TCL_LIGHT_POSITION_Y(x) (0x00001060+((x)*128)) -#define NV20TCL_LIGHT_POSITION_Y__SIZE 0x00000008 -#define NV20TCL_LIGHT_POSITION_Z(x) (0x00001064+((x)*128)) -#define NV20TCL_LIGHT_POSITION_Z__SIZE 0x00000008 -#define NV20TCL_LIGHT_CONSTANT_ATTENUATION(x) (0x00001068+((x)*128)) -#define NV20TCL_LIGHT_CONSTANT_ATTENUATION__SIZE 0x00000008 -#define NV20TCL_LIGHT_LINEAR_ATTENUATION(x) (0x0000106c+((x)*128)) -#define NV20TCL_LIGHT_LINEAR_ATTENUATION__SIZE 0x00000008 -#define NV20TCL_LIGHT_QUADRATIC_ATTENUATION(x) (0x00001070+((x)*128)) -#define NV20TCL_LIGHT_QUADRATIC_ATTENUATION__SIZE 0x00000008 -#define NV20TCL_POLYGON_STIPPLE_ENABLE 0x0000147c -#define NV20TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001480+((x)*4)) -#define NV20TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020 -#define NV20TCL_VERTEX_POS_3F_X 0x00001500 -#define NV20TCL_VERTEX_POS_3F_Y 0x00001504 -#define NV20TCL_VERTEX_POS_3F_Z 0x00001508 -#define NV20TCL_VERTEX_POS_4F_X 0x00001518 -#define NV20TCL_VERTEX_POS_4F_Y 0x0000151c -#define NV20TCL_VERTEX_POS_4F_Z 0x00001520 -#define NV20TCL_VERTEX_POS_3I_XY 0x00001528 -#define NV20TCL_VERTEX_POS_3I_XY_X_SHIFT 0 -#define NV20TCL_VERTEX_POS_3I_XY_X_MASK 0x0000ffff -#define NV20TCL_VERTEX_POS_3I_XY_Y_SHIFT 16 -#define NV20TCL_VERTEX_POS_3I_XY_Y_MASK 0xffff0000 -#define NV20TCL_VERTEX_POS_3I_Z 0x0000152c -#define NV20TCL_VERTEX_POS_3I_Z_Z_SHIFT 0 -#define NV20TCL_VERTEX_POS_3I_Z_Z_MASK 0x0000ffff -#define NV20TCL_VERTEX_NOR_3F_X 0x00001530 -#define NV20TCL_VERTEX_NOR_3F_Y 0x00001534 -#define NV20TCL_VERTEX_NOR_3F_Z 0x00001538 -#define NV20TCL_VERTEX_NOR_3I_XY 0x00001540 -#define NV20TCL_VERTEX_NOR_3I_XY_X_SHIFT 0 -#define NV20TCL_VERTEX_NOR_3I_XY_X_MASK 0x0000ffff -#define NV20TCL_VERTEX_NOR_3I_XY_Y_SHIFT 16 -#define NV20TCL_VERTEX_NOR_3I_XY_Y_MASK 0xffff0000 -#define NV20TCL_VERTEX_NOR_3I_Z 0x00001544 -#define NV20TCL_VERTEX_NOR_3I_Z_Z_SHIFT 0 -#define NV20TCL_VERTEX_NOR_3I_Z_Z_MASK 0x0000ffff -#define NV20TCL_VERTEX_COL_4F_X 0x00001550 -#define NV20TCL_VERTEX_COL_4F_Y 0x00001554 -#define NV20TCL_VERTEX_COL_4F_Z 0x00001558 -#define NV20TCL_VERTEX_COL_4F_W 0x0000155c -#define NV20TCL_VERTEX_COL_3F_X 0x00001560 -#define NV20TCL_VERTEX_COL_3F_Y 0x00001564 -#define NV20TCL_VERTEX_COL_3F_Z 0x00001568 -#define NV20TCL_VERTEX_COL_4I 0x0000156c -#define NV20TCL_VERTEX_COL_4I_R_SHIFT 0 -#define NV20TCL_VERTEX_COL_4I_R_MASK 0x000000ff -#define NV20TCL_VERTEX_COL_4I_G_SHIFT 8 -#define NV20TCL_VERTEX_COL_4I_G_MASK 0x0000ff00 -#define NV20TCL_VERTEX_COL_4I_B_SHIFT 16 -#define NV20TCL_VERTEX_COL_4I_B_MASK 0x00ff0000 -#define NV20TCL_VERTEX_COL_4I_A_SHIFT 24 -#define NV20TCL_VERTEX_COL_4I_A_MASK 0xff000000 -#define NV20TCL_VERTEX_COL2_3F_X 0x00001580 -#define NV20TCL_VERTEX_COL2_3F_Y 0x00001584 -#define NV20TCL_VERTEX_COL2_3F_Z 0x00001588 -#define NV20TCL_VERTEX_COL2_4I 0x0000158c -#define NV20TCL_VERTEX_COL2_4I_R_SHIFT 0 -#define NV20TCL_VERTEX_COL2_4I_R_MASK 0x000000ff -#define NV20TCL_VERTEX_COL2_4I_G_SHIFT 8 -#define NV20TCL_VERTEX_COL2_4I_G_MASK 0x0000ff00 -#define NV20TCL_VERTEX_COL2_4I_B_SHIFT 16 -#define NV20TCL_VERTEX_COL2_4I_B_MASK 0x00ff0000 -#define NV20TCL_VERTEX_COL2_4I_A_SHIFT 24 -#define NV20TCL_VERTEX_COL2_4I_A_MASK 0xff000000 -#define NV20TCL_VERTEX_TX0_2F_S 0x00001590 -#define NV20TCL_VERTEX_TX0_2F_T 0x00001594 -#define NV20TCL_VERTEX_TX0_2I 0x00001598 -#define NV20TCL_VERTEX_TX0_2I_S_SHIFT 0 -#define NV20TCL_VERTEX_TX0_2I_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX0_2I_T_SHIFT 16 -#define NV20TCL_VERTEX_TX0_2I_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX0_4F_S 0x000015a0 -#define NV20TCL_VERTEX_TX0_4F_T 0x000015a4 -#define NV20TCL_VERTEX_TX0_4F_R 0x000015a8 -#define NV20TCL_VERTEX_TX0_4F_Q 0x000015ac -#define NV20TCL_VERTEX_TX0_4I_ST 0x000015b0 -#define NV20TCL_VERTEX_TX0_4I_ST_S_SHIFT 0 -#define NV20TCL_VERTEX_TX0_4I_ST_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX0_4I_ST_T_SHIFT 16 -#define NV20TCL_VERTEX_TX0_4I_ST_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX0_4I_RQ 0x000015b4 -#define NV20TCL_VERTEX_TX0_4I_RQ_R_SHIFT 0 -#define NV20TCL_VERTEX_TX0_4I_RQ_R_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX0_4I_RQ_Q_SHIFT 16 -#define NV20TCL_VERTEX_TX0_4I_RQ_Q_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX1_2F_S 0x000015b8 -#define NV20TCL_VERTEX_TX1_2F_T 0x000015bc -#define NV20TCL_VERTEX_TX1_2I 0x000015c0 -#define NV20TCL_VERTEX_TX1_2I_S_SHIFT 0 -#define NV20TCL_VERTEX_TX1_2I_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX1_2I_T_SHIFT 16 -#define NV20TCL_VERTEX_TX1_2I_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX1_4F_S 0x000015c8 -#define NV20TCL_VERTEX_TX1_4F_T 0x000015cc -#define NV20TCL_VERTEX_TX1_4F_R 0x000015d0 -#define NV20TCL_VERTEX_TX1_4F_Q 0x000015d4 -#define NV20TCL_VERTEX_TX1_4I_ST 0x000015d8 -#define NV20TCL_VERTEX_TX1_4I_ST_S_SHIFT 0 -#define NV20TCL_VERTEX_TX1_4I_ST_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX1_4I_ST_T_SHIFT 16 -#define NV20TCL_VERTEX_TX1_4I_ST_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX1_4I_RQ 0x000015dc -#define NV20TCL_VERTEX_TX1_4I_RQ_R_SHIFT 0 -#define NV20TCL_VERTEX_TX1_4I_RQ_R_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX1_4I_RQ_Q_SHIFT 16 -#define NV20TCL_VERTEX_TX1_4I_RQ_Q_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX2_2F_S 0x000015e0 -#define NV20TCL_VERTEX_TX2_2F_T 0x000015e4 -#define NV20TCL_VERTEX_TX2_2I 0x000015e8 -#define NV20TCL_VERTEX_TX2_2I_S_SHIFT 0 -#define NV20TCL_VERTEX_TX2_2I_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX2_2I_T_SHIFT 16 -#define NV20TCL_VERTEX_TX2_2I_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX2_4F_S 0x000015f0 -#define NV20TCL_VERTEX_TX2_4F_T 0x000015f4 -#define NV20TCL_VERTEX_TX2_4F_R 0x000015f8 -#define NV20TCL_VERTEX_TX2_4F_Q 0x000015fc -#define NV20TCL_VERTEX_TX2_4I_ST 0x00001600 -#define NV20TCL_VERTEX_TX2_4I_ST_S_SHIFT 0 -#define NV20TCL_VERTEX_TX2_4I_ST_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX2_4I_ST_T_SHIFT 16 -#define NV20TCL_VERTEX_TX2_4I_ST_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX2_4I_RQ 0x00001604 -#define NV20TCL_VERTEX_TX2_4I_RQ_R_SHIFT 0 -#define NV20TCL_VERTEX_TX2_4I_RQ_R_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX2_4I_RQ_Q_SHIFT 16 -#define NV20TCL_VERTEX_TX2_4I_RQ_Q_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX3_2F_S 0x00001608 -#define NV20TCL_VERTEX_TX3_2F_T 0x0000160c -#define NV20TCL_VERTEX_TX3_2I 0x00001610 -#define NV20TCL_VERTEX_TX3_2I_S_SHIFT 0 -#define NV20TCL_VERTEX_TX3_2I_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX3_2I_T_SHIFT 16 -#define NV20TCL_VERTEX_TX3_2I_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX3_4F_S 0x00001620 -#define NV20TCL_VERTEX_TX3_4F_T 0x00001624 -#define NV20TCL_VERTEX_TX3_4F_R 0x00001628 -#define NV20TCL_VERTEX_TX3_4F_Q 0x0000162c -#define NV20TCL_VERTEX_TX3_4I_ST 0x00001630 -#define NV20TCL_VERTEX_TX3_4I_ST_S_SHIFT 0 -#define NV20TCL_VERTEX_TX3_4I_ST_S_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX3_4I_ST_T_SHIFT 16 -#define NV20TCL_VERTEX_TX3_4I_ST_T_MASK 0xffff0000 -#define NV20TCL_VERTEX_TX3_4I_RQ 0x00001634 -#define NV20TCL_VERTEX_TX3_4I_RQ_R_SHIFT 0 -#define NV20TCL_VERTEX_TX3_4I_RQ_R_MASK 0x0000ffff -#define NV20TCL_VERTEX_TX3_4I_RQ_Q_SHIFT 16 -#define NV20TCL_VERTEX_TX3_4I_RQ_Q_MASK 0xffff0000 -#define NV20TCL_VERTEX_FOG_1F 0x00001698 -#define NV20TCL_EDGEFLAG_ENABLE 0x000016bc -#define NV20TCL_VTXBUF_ADDRESS(x) (0x00001720+((x)*4)) -#define NV20TCL_VTXBUF_ADDRESS__SIZE 0x00000010 -#define NV20TCL_VTXBUF_ADDRESS_DMA1 (1 << 31) -#define NV20TCL_VTXBUF_ADDRESS_OFFSET_SHIFT 0 -#define NV20TCL_VTXBUF_ADDRESS_OFFSET_MASK 0x0fffffff -#define NV20TCL_VTXFMT(x) (0x00001760+((x)*4)) -#define NV20TCL_VTXFMT__SIZE 0x00000010 -#define NV20TCL_VTXFMT_TYPE_SHIFT 0 -#define NV20TCL_VTXFMT_TYPE_MASK 0x0000000f -#define NV20TCL_VTXFMT_TYPE_FLOAT 0x00000002 -#define NV20TCL_VTXFMT_TYPE_UBYTE 0x00000004 -#define NV20TCL_VTXFMT_TYPE_USHORT 0x00000005 -#define NV20TCL_VTXFMT_SIZE_SHIFT 4 -#define NV20TCL_VTXFMT_SIZE_MASK 0x000000f0 -#define NV20TCL_VTXFMT_STRIDE_SHIFT 8 -#define NV20TCL_VTXFMT_STRIDE_MASK 0x0000ff00 -#define NV20TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000017a0 -#define NV20TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000017a4 -#define NV20TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000017a8 -#define NV20TCL_COLOR_MATERIAL_BACK_A 0x000017ac -#define NV20TCL_COLOR_MATERIAL_BACK_R 0x000017b0 -#define NV20TCL_COLOR_MATERIAL_BACK_G 0x000017b4 -#define NV20TCL_COLOR_MATERIAL_BACK_B 0x000017b8 -#define NV20TCL_COLOR_LOGIC_OP_ENABLE 0x000017bc -#define NV20TCL_COLOR_LOGIC_OP_OP 0x000017c0 -#define NV20TCL_COLOR_LOGIC_OP_OP_CLEAR 0x00001500 -#define NV20TCL_COLOR_LOGIC_OP_OP_AND 0x00001501 -#define NV20TCL_COLOR_LOGIC_OP_OP_AND_REVERSE 0x00001502 -#define NV20TCL_COLOR_LOGIC_OP_OP_COPY 0x00001503 -#define NV20TCL_COLOR_LOGIC_OP_OP_AND_INVERTED 0x00001504 -#define NV20TCL_COLOR_LOGIC_OP_OP_NOOP 0x00001505 -#define NV20TCL_COLOR_LOGIC_OP_OP_XOR 0x00001506 -#define NV20TCL_COLOR_LOGIC_OP_OP_OR 0x00001507 -#define NV20TCL_COLOR_LOGIC_OP_OP_NOR 0x00001508 -#define NV20TCL_COLOR_LOGIC_OP_OP_EQUIV 0x00001509 -#define NV20TCL_COLOR_LOGIC_OP_OP_INVERT 0x0000150a -#define NV20TCL_COLOR_LOGIC_OP_OP_OR_REVERSE 0x0000150b -#define NV20TCL_COLOR_LOGIC_OP_OP_COPY_INVERTED 0x0000150c -#define NV20TCL_COLOR_LOGIC_OP_OP_OR_INVERTED 0x0000150d -#define NV20TCL_COLOR_LOGIC_OP_OP_NAND 0x0000150e -#define NV20TCL_COLOR_LOGIC_OP_OP_SET 0x0000150f -#define NV20TCL_LIGHT_MODEL_TWO_SIDE_ENABLE 0x000017c4 -#define NV20TCL_TX_SHADER_CULL_MODE 0x000017f8 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_S (1 << 0) -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_S_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_S_LESS 0x00000001 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_T (1 << 1) -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_T_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_T_LESS 0x00000002 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_R (1 << 2) -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_R_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_R_LESS 0x00000004 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_Q (1 << 3) -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_Q_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX0_Q_LESS 0x00000008 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_S (1 << 4) -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_S_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_S_LESS 0x00000010 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_T (1 << 5) -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_T_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_T_LESS 0x00000020 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_R (1 << 6) -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_R_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_R_LESS 0x00000040 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_Q (1 << 7) -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_Q_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX1_Q_LESS 0x00000080 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_S (1 << 8) -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_S_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_S_LESS 0x00000100 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_T (1 << 9) -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_T_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_T_LESS 0x00000200 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_R (1 << 10) -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_R_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_R_LESS 0x00000400 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_Q (1 << 11) -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_Q_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX2_Q_LESS 0x00000800 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_S (1 << 12) -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_S_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_S_LESS 0x00001000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_T (1 << 13) -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_T_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_T_LESS 0x00002000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_R (1 << 14) -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_R_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_R_LESS 0x00004000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_Q (1 << 15) -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_Q_GEQUAL 0x00000000 -#define NV20TCL_TX_SHADER_CULL_MODE_TX3_Q_LESS 0x00008000 -#define NV20TCL_VERTEX_BEGIN_END 0x000017fc -#define NV20TCL_VERTEX_BEGIN_END_STOP 0x00000000 -#define NV20TCL_VERTEX_BEGIN_END_POINTS 0x00000001 -#define NV20TCL_VERTEX_BEGIN_END_LINES 0x00000002 -#define NV20TCL_VERTEX_BEGIN_END_LINE_LOOP 0x00000003 -#define NV20TCL_VERTEX_BEGIN_END_LINE_STRIP 0x00000004 -#define NV20TCL_VERTEX_BEGIN_END_TRIANGLES 0x00000005 -#define NV20TCL_VERTEX_BEGIN_END_TRIANGLE_STRIP 0x00000006 -#define NV20TCL_VERTEX_BEGIN_END_TRIANGLE_FAN 0x00000007 -#define NV20TCL_VERTEX_BEGIN_END_QUADS 0x00000008 -#define NV20TCL_VERTEX_BEGIN_END_QUAD_STRIP 0x00000009 -#define NV20TCL_VERTEX_BEGIN_END_POLYGON 0x0000000a -#define NV20TCL_VB_ELEMENT_U16 0x00001800 -#define NV20TCL_VB_ELEMENT_U16_I0_SHIFT 0 -#define NV20TCL_VB_ELEMENT_U16_I0_MASK 0x0000ffff -#define NV20TCL_VB_ELEMENT_U16_I1_SHIFT 16 -#define NV20TCL_VB_ELEMENT_U16_I1_MASK 0xffff0000 -#define NV20TCL_VB_VERTEX_BATCH 0x00001810 -#define NV20TCL_VB_VERTEX_BATCH_OFFSET_SHIFT 0 -#define NV20TCL_VB_VERTEX_BATCH_OFFSET_MASK 0x00ffffff -#define NV20TCL_VB_VERTEX_BATCH_COUNT_SHIFT 24 -#define NV20TCL_VB_VERTEX_BATCH_COUNT_MASK 0xff000000 -#define NV20TCL_VERTEX_DATA 0x00001818 -#define NV20TCL_TX_SHADER_CONST_EYE_X 0x0000181c -#define NV20TCL_TX_SHADER_CONST_EYE_Y 0x00001820 -#define NV20TCL_TX_SHADER_CONST_EYE_Z 0x00001824 -#define NV20TCL_VTX_ATTR_4F_X(x) (0x00001a00+((x)*16)) -#define NV20TCL_VTX_ATTR_4F_X__SIZE 0x00000010 -#define NV20TCL_VTX_ATTR_4F_Y(x) (0x00001a04+((x)*16)) -#define NV20TCL_VTX_ATTR_4F_Y__SIZE 0x00000010 -#define NV20TCL_VTX_ATTR_4F_Z(x) (0x00001a08+((x)*16)) -#define NV20TCL_VTX_ATTR_4F_Z__SIZE 0x00000010 -#define NV20TCL_VTX_ATTR_4F_W(x) (0x00001a0c+((x)*16)) -#define NV20TCL_VTX_ATTR_4F_W__SIZE 0x00000010 -#define NV20TCL_TX_OFFSET(x) (0x00001b00+((x)*64)) -#define NV20TCL_TX_OFFSET__SIZE 0x00000004 -#define NV20TCL_TX_FORMAT(x) (0x00001b04+((x)*64)) -#define NV20TCL_TX_FORMAT__SIZE 0x00000004 -#define NV20TCL_TX_FORMAT_DMA0 (1 << 0) -#define NV20TCL_TX_FORMAT_DMA1 (1 << 1) -#define NV20TCL_TX_FORMAT_CUBIC (1 << 2) -#define NV20TCL_TX_FORMAT_NO_BORDER (1 << 3) -#define NV20TCL_TX_FORMAT_DIMS_SHIFT 4 -#define NV20TCL_TX_FORMAT_DIMS_MASK 0x000000f0 -#define NV20TCL_TX_FORMAT_DIMS_1D 0x00000010 -#define NV20TCL_TX_FORMAT_DIMS_2D 0x00000020 -#define NV20TCL_TX_FORMAT_DIMS_3D 0x00000030 -#define NV20TCL_TX_FORMAT_FORMAT_SHIFT 8 -#define NV20TCL_TX_FORMAT_FORMAT_MASK 0x0000ff00 -#define NV20TCL_TX_FORMAT_FORMAT_L8 0x00000000 -#define NV20TCL_TX_FORMAT_FORMAT_A8 0x00000100 -#define NV20TCL_TX_FORMAT_FORMAT_A1R5G5B5 0x00000200 -#define NV20TCL_TX_FORMAT_FORMAT_A8_RECT 0x00000300 -#define NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4 0x00000400 -#define NV20TCL_TX_FORMAT_FORMAT_R5G6B5 0x00000500 -#define NV20TCL_TX_FORMAT_FORMAT_A8R8G8B8 0x00000600 -#define NV20TCL_TX_FORMAT_FORMAT_X8R8G8B8 0x00000700 -#define NV20TCL_TX_FORMAT_FORMAT_INDEX8 0x00000b00 -#define NV20TCL_TX_FORMAT_FORMAT_DXT1 0x00000c00 -#define NV20TCL_TX_FORMAT_FORMAT_DXT3 0x00000e00 -#define NV20TCL_TX_FORMAT_FORMAT_DXT5 0x00000f00 -#define NV20TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT 0x00001000 -#define NV20TCL_TX_FORMAT_FORMAT_R5G6B5_RECT 0x00001100 -#define NV20TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT 0x00001200 -#define NV20TCL_TX_FORMAT_FORMAT_L8_RECT 0x00001300 -#define NV20TCL_TX_FORMAT_FORMAT_A8L8 0x00001a00 -#define NV20TCL_TX_FORMAT_FORMAT_A8_RECT2 0x00001b00 -#define NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT 0x00001d00 -#define NV20TCL_TX_FORMAT_FORMAT_R8G8B8_RECT 0x00001e00 -#define NV20TCL_TX_FORMAT_FORMAT_L8A8_RECT 0x00002000 -#define NV20TCL_TX_FORMAT_FORMAT_DSDT 0x00002800 -#define NV20TCL_TX_FORMAT_FORMAT_A16 0x00003200 -#define NV20TCL_TX_FORMAT_FORMAT_HILO16 0x00003300 -#define NV20TCL_TX_FORMAT_FORMAT_A16_RECT 0x00003500 -#define NV20TCL_TX_FORMAT_FORMAT_HILO16_RECT 0x00003600 -#define NV20TCL_TX_FORMAT_FORMAT_HILO8 0x00004400 -#define NV20TCL_TX_FORMAT_FORMAT_SIGNED_HILO8 0x00004500 -#define NV20TCL_TX_FORMAT_FORMAT_HILO8_RECT 0x00004600 -#define NV20TCL_TX_FORMAT_FORMAT_SIGNED_HILO8_RECT 0x00004700 -#define NV20TCL_TX_FORMAT_FORMAT_FLOAT_RGBA16_NV 0x00004a00 -#define NV20TCL_TX_FORMAT_FORMAT_FLOAT_RGBA32_NV 0x00004b00 -#define NV20TCL_TX_FORMAT_FORMAT_FLOAT_R32_NV 0x00004c00 -#define NV20TCL_TX_FORMAT_MIPMAP (1 << 19) -#define NV20TCL_TX_FORMAT_BASE_SIZE_U_SHIFT 20 -#define NV20TCL_TX_FORMAT_BASE_SIZE_U_MASK 0x00f00000 -#define NV20TCL_TX_FORMAT_BASE_SIZE_V_SHIFT 24 -#define NV20TCL_TX_FORMAT_BASE_SIZE_V_MASK 0x0f000000 -#define NV20TCL_TX_FORMAT_BASE_SIZE_W_SHIFT 28 -#define NV20TCL_TX_FORMAT_BASE_SIZE_W_MASK 0xf0000000 -#define NV20TCL_TX_WRAP(x) (0x00001b08+((x)*64)) -#define NV20TCL_TX_WRAP__SIZE 0x00000004 -#define NV20TCL_TX_WRAP_S_SHIFT 0 -#define NV20TCL_TX_WRAP_S_MASK 0x000000ff -#define NV20TCL_TX_WRAP_S_REPEAT 0x00000001 -#define NV20TCL_TX_WRAP_S_MIRRORED_REPEAT 0x00000002 -#define NV20TCL_TX_WRAP_S_CLAMP_TO_EDGE 0x00000003 -#define NV20TCL_TX_WRAP_S_CLAMP_TO_BORDER 0x00000004 -#define NV20TCL_TX_WRAP_S_CLAMP 0x00000005 -#define NV20TCL_TX_WRAP_T_SHIFT 8 -#define NV20TCL_TX_WRAP_T_MASK 0x00000f00 -#define NV20TCL_TX_WRAP_T_REPEAT 0x00000100 -#define NV20TCL_TX_WRAP_T_MIRRORED_REPEAT 0x00000200 -#define NV20TCL_TX_WRAP_T_CLAMP_TO_EDGE 0x00000300 -#define NV20TCL_TX_WRAP_T_CLAMP_TO_BORDER 0x00000400 -#define NV20TCL_TX_WRAP_T_CLAMP 0x00000500 -#define NV20TCL_TX_WRAP_R_SHIFT 16 -#define NV20TCL_TX_WRAP_R_MASK 0x000f0000 -#define NV20TCL_TX_WRAP_R_REPEAT 0x00010000 -#define NV20TCL_TX_WRAP_R_MIRRORED_REPEAT 0x00020000 -#define NV20TCL_TX_WRAP_R_CLAMP_TO_EDGE 0x00030000 -#define NV20TCL_TX_WRAP_R_CLAMP_TO_BORDER 0x00040000 -#define NV20TCL_TX_WRAP_R_CLAMP 0x00050000 -#define NV20TCL_TX_ENABLE(x) (0x00001b0c+((x)*64)) -#define NV20TCL_TX_ENABLE__SIZE 0x00000004 -#define NV20TCL_TX_ENABLE_ANISO_SHIFT 4 -#define NV20TCL_TX_ENABLE_ANISO_MASK 0x00000030 -#define NV20TCL_TX_ENABLE_ANISO_NONE 0x00000000 -#define NV20TCL_TX_ENABLE_ANISO_2X 0x00000010 -#define NV20TCL_TX_ENABLE_ANISO_4X 0x00000020 -#define NV20TCL_TX_ENABLE_ANISO_8X 0x00000030 -#define NV20TCL_TX_ENABLE_MIPMAP_MAX_LOD_SHIFT 14 -#define NV20TCL_TX_ENABLE_MIPMAP_MAX_LOD_MASK 0x0003c000 -#define NV20TCL_TX_ENABLE_MIPMAP_MIN_LOD_SHIFT 26 -#define NV20TCL_TX_ENABLE_MIPMAP_MIN_LOD_MASK 0x3c000000 -#define NV20TCL_TX_ENABLE_ENABLE (1 << 30) -#define NV20TCL_TX_SWIZZLE(x) (0x00001b10+((x)*64)) -#define NV20TCL_TX_SWIZZLE__SIZE 0x00000004 -#define NV20TCL_TX_SWIZZLE_RECT_PITCH_SHIFT 16 -#define NV20TCL_TX_SWIZZLE_RECT_PITCH_MASK 0xffff0000 -#define NV20TCL_TX_FILTER(x) (0x00001b14+((x)*64)) -#define NV20TCL_TX_FILTER__SIZE 0x00000004 -#define NV20TCL_TX_FILTER_LOD_BIAS_SHIFT 8 -#define NV20TCL_TX_FILTER_LOD_BIAS_MASK 0x00000f00 -#define NV20TCL_TX_FILTER_MINIFY_SHIFT 16 -#define NV20TCL_TX_FILTER_MINIFY_MASK 0x000f0000 -#define NV20TCL_TX_FILTER_MINIFY_NEAREST 0x00010000 -#define NV20TCL_TX_FILTER_MINIFY_LINEAR 0x00020000 -#define NV20TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x00030000 -#define NV20TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x00040000 -#define NV20TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x00050000 -#define NV20TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x00060000 -#define NV20TCL_TX_FILTER_MAGNIFY_SHIFT 24 -#define NV20TCL_TX_FILTER_MAGNIFY_MASK 0x0f000000 -#define NV20TCL_TX_FILTER_MAGNIFY_NEAREST 0x01000000 -#define NV20TCL_TX_FILTER_MAGNIFY_LINEAR 0x02000000 -#define NV20TCL_TX_NPOT_SIZE(x) (0x00001b1c+((x)*64)) -#define NV20TCL_TX_NPOT_SIZE__SIZE 0x00000004 -#define NV20TCL_TX_NPOT_SIZE_H_SHIFT 0 -#define NV20TCL_TX_NPOT_SIZE_H_MASK 0x0000ffff -#define NV20TCL_TX_NPOT_SIZE_W_SHIFT 16 -#define NV20TCL_TX_NPOT_SIZE_W_MASK 0xffff0000 -#define NV20TCL_TX_PALETTE_OFFSET(x) (0x00001b20+((x)*64)) -#define NV20TCL_TX_PALETTE_OFFSET__SIZE 0x00000004 -#define NV20TCL_TX_BORDER_COLOR(x) (0x00001b24+((x)*64)) -#define NV20TCL_TX_BORDER_COLOR__SIZE 0x00000004 -#define NV20TCL_TX_BORDER_COLOR_B_SHIFT 0 -#define NV20TCL_TX_BORDER_COLOR_B_MASK 0x000000ff -#define NV20TCL_TX_BORDER_COLOR_G_SHIFT 8 -#define NV20TCL_TX_BORDER_COLOR_G_MASK 0x0000ff00 -#define NV20TCL_TX_BORDER_COLOR_R_SHIFT 16 -#define NV20TCL_TX_BORDER_COLOR_R_MASK 0x00ff0000 -#define NV20TCL_TX_BORDER_COLOR_A_SHIFT 24 -#define NV20TCL_TX_BORDER_COLOR_A_MASK 0xff000000 -#define NV20TCL_TX_SHADER_OFFSET_MATRIX00(x) (0x00001b28+((x)*64)) -#define NV20TCL_TX_SHADER_OFFSET_MATRIX00__SIZE 0x00000004 -#define NV20TCL_TX_SHADER_OFFSET_MATRIX01(x) (0x00001b2c+((x)*64)) -#define NV20TCL_TX_SHADER_OFFSET_MATRIX01__SIZE 0x00000004 -#define NV20TCL_TX_SHADER_OFFSET_MATRIX11(x) (0x00001b30+((x)*64)) -#define NV20TCL_TX_SHADER_OFFSET_MATRIX11__SIZE 0x00000004 -#define NV20TCL_TX_SHADER_OFFSET_MATRIX10(x) (0x00001b34+((x)*64)) -#define NV20TCL_TX_SHADER_OFFSET_MATRIX10__SIZE 0x00000004 -#define NV20TCL_DEPTH_UNK17D8 0x00001d78 -#define NV20TCL_DEPTH_UNK17D8_CLAMP_SHIFT 4 -#define NV20TCL_DEPTH_UNK17D8_CLAMP_MASK 0x000000f0 -#define NV20TCL_MULTISAMPLE_CONTROL 0x00001d7c -#define NV20TCL_CLEAR_DEPTH_VALUE 0x00001d8c -#define NV20TCL_CLEAR_VALUE 0x00001d90 -#define NV20TCL_CLEAR_BUFFERS 0x00001d94 -#define NV20TCL_CLEAR_BUFFERS_COLOR_A (1 << 7) -#define NV20TCL_CLEAR_BUFFERS_COLOR_B (1 << 6) -#define NV20TCL_CLEAR_BUFFERS_COLOR_G (1 << 5) -#define NV20TCL_CLEAR_BUFFERS_COLOR_R (1 << 4) -#define NV20TCL_CLEAR_BUFFERS_STENCIL (1 << 1) -#define NV20TCL_CLEAR_BUFFERS_DEPTH (1 << 0) -#define NV20TCL_RC_COLOR0 0x00001e20 -#define NV20TCL_RC_COLOR0_B_SHIFT 0 -#define NV20TCL_RC_COLOR0_B_MASK 0x000000ff -#define NV20TCL_RC_COLOR0_G_SHIFT 8 -#define NV20TCL_RC_COLOR0_G_MASK 0x0000ff00 -#define NV20TCL_RC_COLOR0_R_SHIFT 16 -#define NV20TCL_RC_COLOR0_R_MASK 0x00ff0000 -#define NV20TCL_RC_COLOR0_A_SHIFT 24 -#define NV20TCL_RC_COLOR0_A_MASK 0xff000000 -#define NV20TCL_RC_COLOR1 0x00001e24 -#define NV20TCL_RC_COLOR1_B_SHIFT 0 -#define NV20TCL_RC_COLOR1_B_MASK 0x000000ff -#define NV20TCL_RC_COLOR1_G_SHIFT 8 -#define NV20TCL_RC_COLOR1_G_MASK 0x0000ff00 -#define NV20TCL_RC_COLOR1_R_SHIFT 16 -#define NV20TCL_RC_COLOR1_R_MASK 0x00ff0000 -#define NV20TCL_RC_COLOR1_A_SHIFT 24 -#define NV20TCL_RC_COLOR1_A_MASK 0xff000000 -#define NV20TCL_BACK_MATERIAL_SHININESS(x) (0x00001e28+((x)*4)) -#define NV20TCL_BACK_MATERIAL_SHININESS__SIZE 0x00000006 -#define NV20TCL_RC_OUT_RGB(x) (0x00001e40+((x)*4)) -#define NV20TCL_RC_OUT_RGB__SIZE 0x00000008 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SHIFT 0 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_MASK 0x0000000f -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_ZERO 0x00000000 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_FOG 0x00000003 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE0_ARB 0x00000008 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE1_ARB 0x00000009 -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_NV 0x0000000c -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV 0x0000000d -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV 0x0000000f -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT 4 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_MASK 0x000000f0 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_ZERO 0x00000000 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_FOG 0x00000030 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE0_ARB 0x00000080 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE1_ARB 0x00000090 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_NV 0x000000c0 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV 0x000000d0 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0 -#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV 0x000000f0 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT 8 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_MASK 0x00000f00 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO 0x00000000 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_FOG 0x00000300 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE0_ARB 0x00000800 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE1_ARB 0x00000900 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_NV 0x00000c00 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV 0x00000d00 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00 -#define NV20TCL_RC_OUT_RGB_CD_DOT_PRODUCT (1 << 12) -#define NV20TCL_RC_OUT_RGB_AB_DOT_PRODUCT (1 << 13) -#define NV20TCL_RC_OUT_RGB_MUX_SUM (1 << 14) -#define NV20TCL_RC_OUT_RGB_BIAS (1 << 15) -#define NV20TCL_RC_OUT_RGB_BIAS_NONE 0x00000000 -#define NV20TCL_RC_OUT_RGB_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000 -#define NV20TCL_RC_OUT_RGB_SCALE_SHIFT 17 -#define NV20TCL_RC_OUT_RGB_SCALE_MASK 0x00000000 -#define NV20TCL_RC_OUT_RGB_SCALE_NONE 0x00000000 -#define NV20TCL_RC_OUT_RGB_SCALE_SCALE_BY_TWO_NV 0x00020000 -#define NV20TCL_RC_OUT_RGB_SCALE_SCALE_BY_FOUR_NV 0x00040000 -#define NV20TCL_RC_OUT_RGB_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000 -#define NV20TCL_RC_ENABLE 0x00001e60 -#define NV20TCL_RC_ENABLE_NUM_COMBINERS_SHIFT 0 -#define NV20TCL_RC_ENABLE_NUM_COMBINERS_MASK 0x0000000f -#define NV20TCL_TX_RCOMP 0x00001e6c -#define NV20TCL_TX_RCOMP_NEVER 0x00000000 -#define NV20TCL_TX_RCOMP_GREATER 0x00000001 -#define NV20TCL_TX_RCOMP_EQUAL 0x00000002 -#define NV20TCL_TX_RCOMP_GEQUAL 0x00000003 -#define NV20TCL_TX_RCOMP_LESS 0x00000004 -#define NV20TCL_TX_RCOMP_NOTEQUAL 0x00000005 -#define NV20TCL_TX_RCOMP_LEQUAL 0x00000006 -#define NV20TCL_TX_RCOMP_ALWAYS 0x00000007 -#define NV20TCL_TX_SHADER_OP 0x00001e70 -#define NV20TCL_TX_SHADER_OP_TX0_SHIFT 0 -#define NV20TCL_TX_SHADER_OP_TX0_MASK 0x0000001f -#define NV20TCL_TX_SHADER_OP_TX0_NONE 0x00000000 -#define NV20TCL_TX_SHADER_OP_TX0_TEXTURE_2D 0x00000001 -#define NV20TCL_TX_SHADER_OP_TX0_PASS_THROUGH 0x00000004 -#define NV20TCL_TX_SHADER_OP_TX0_CULL_FRAGMENT 0x00000005 -#define NV20TCL_TX_SHADER_OP_TX0_OFFSET_TEXTURE_2D 0x00000006 -#define NV20TCL_TX_SHADER_OP_TX0_DOT_PRODUCT_TEXTURE_2D 0x00000009 -#define NV20TCL_TX_SHADER_OP_TX0_DOT_PRODUCT_DEPTH_REPLACE 0x0000000a -#define NV20TCL_TX_SHADER_OP_TX0_DEPENDANT_AR_TEXTURE_2D 0x0000000f -#define NV20TCL_TX_SHADER_OP_TX0_DEPENDANT_GB_TEXTURE_2D 0x00000010 -#define NV20TCL_TX_SHADER_OP_TX0_DOT_PRODUCT 0x00000011 -#define NV20TCL_TX_SHADER_OP_TX1_SHIFT 5 -#define NV20TCL_TX_SHADER_OP_TX1_MASK 0x000003e0 -#define NV20TCL_TX_SHADER_OP_TX1_NONE 0x00000000 -#define NV20TCL_TX_SHADER_OP_TX1_TEXTURE_2D 0x00000020 -#define NV20TCL_TX_SHADER_OP_TX1_PASS_THROUGH 0x00000080 -#define NV20TCL_TX_SHADER_OP_TX1_CULL_FRAGMENT 0x000000a0 -#define NV20TCL_TX_SHADER_OP_TX1_OFFSET_TEXTURE_2D 0x000000c0 -#define NV20TCL_TX_SHADER_OP_TX1_DOT_PRODUCT_TEXTURE_2D 0x00000120 -#define NV20TCL_TX_SHADER_OP_TX1_DOT_PRODUCT_DEPTH_REPLACE 0x00000140 -#define NV20TCL_TX_SHADER_OP_TX1_DEPENDANT_AR_TEXTURE_2D 0x000001e0 -#define NV20TCL_TX_SHADER_OP_TX1_DEPENDANT_GB_TEXTURE_2D 0x00000200 -#define NV20TCL_TX_SHADER_OP_TX1_DOT_PRODUCT 0x00000220 -#define NV20TCL_TX_SHADER_OP_TX2_SHIFT 10 -#define NV20TCL_TX_SHADER_OP_TX2_MASK 0x00007c00 -#define NV20TCL_TX_SHADER_OP_TX2_NONE 0x00000000 -#define NV20TCL_TX_SHADER_OP_TX2_TEXTURE_2D 0x00000400 -#define NV20TCL_TX_SHADER_OP_TX2_PASS_THROUGH 0x00001000 -#define NV20TCL_TX_SHADER_OP_TX2_CULL_FRAGMENT 0x00001400 -#define NV20TCL_TX_SHADER_OP_TX2_OFFSET_TEXTURE_2D 0x00001800 -#define NV20TCL_TX_SHADER_OP_TX2_DOT_PRODUCT_TEXTURE_2D 0x00002400 -#define NV20TCL_TX_SHADER_OP_TX2_DOT_PRODUCT_DEPTH_REPLACE 0x00002800 -#define NV20TCL_TX_SHADER_OP_TX2_DEPENDANT_AR_TEXTURE_2D 0x00003c00 -#define NV20TCL_TX_SHADER_OP_TX2_DEPENDANT_GB_TEXTURE_2D 0x00004000 -#define NV20TCL_TX_SHADER_OP_TX2_DOT_PRODUCT 0x00004400 -#define NV20TCL_TX_SHADER_OP_TX3_SHIFT 15 -#define NV20TCL_TX_SHADER_OP_TX3_MASK 0x000f8000 -#define NV20TCL_TX_SHADER_OP_TX3_NONE 0x00000000 -#define NV20TCL_TX_SHADER_OP_TX3_TEXTURE_2D 0x00008000 -#define NV20TCL_TX_SHADER_OP_TX3_PASS_THROUGH 0x00020000 -#define NV20TCL_TX_SHADER_OP_TX3_CULL_FRAGMENT 0x00028000 -#define NV20TCL_TX_SHADER_OP_TX3_OFFSET_TEXTURE_2D 0x00030000 -#define NV20TCL_TX_SHADER_OP_TX3_DOT_PRODUCT_TEXTURE_2D 0x00048000 -#define NV20TCL_TX_SHADER_OP_TX3_DOT_PRODUCT_DEPTH_REPLACE 0x00050000 -#define NV20TCL_TX_SHADER_OP_TX3_DEPENDANT_AR_TEXTURE_2D 0x00078000 -#define NV20TCL_TX_SHADER_OP_TX3_DEPENDANT_GB_TEXTURE_2D 0x00080000 -#define NV20TCL_TX_SHADER_OP_TX3_DOT_PRODUCT 0x00088000 -#define NV20TCL_TX_SHADER_DOTMAPPING 0x00001e74 -#define NV20TCL_TX_SHADER_DOTMAPPING_TX0_SHIFT 0 -#define NV20TCL_TX_SHADER_DOTMAPPING_TX0_MASK 0x0000000f -#define NV20TCL_TX_SHADER_DOTMAPPING_TX1_SHIFT 4 -#define NV20TCL_TX_SHADER_DOTMAPPING_TX1_MASK 0x000000f0 -#define NV20TCL_TX_SHADER_DOTMAPPING_TX2_SHIFT 8 -#define NV20TCL_TX_SHADER_DOTMAPPING_TX2_MASK 0x00000f00 -#define NV20TCL_TX_SHADER_DOTMAPPING_TX3_SHIFT 12 -#define NV20TCL_TX_SHADER_DOTMAPPING_TX3_MASK 0x0000f000 -#define NV20TCL_TX_SHADER_PREVIOUS 0x00001e78 -#define NV20TCL_TX_SHADER_PREVIOUS_TX0_SHIFT 8 -#define NV20TCL_TX_SHADER_PREVIOUS_TX0_MASK 0x00000f00 -#define NV20TCL_TX_SHADER_PREVIOUS_TX1_SHIFT 12 -#define NV20TCL_TX_SHADER_PREVIOUS_TX1_MASK 0x0000f000 -#define NV20TCL_TX_SHADER_PREVIOUS_TX2_SHIFT 16 -#define NV20TCL_TX_SHADER_PREVIOUS_TX2_MASK 0x00030000 -#define NV20TCL_TX_SHADER_PREVIOUS_TX3_SHIFT 20 -#define NV20TCL_TX_SHADER_PREVIOUS_TX3_MASK 0x00300000 -#define NV20TCL_ENGINE 0x00001e94 -#define NV20TCL_ENGINE_VP (1 << 1) -#define NV20TCL_ENGINE_FIXED (1 << 2) -#define NV20TCL_VP_UPLOAD_FROM_ID 0x00001e9c -#define NV20TCL_VP_START_FROM_ID 0x00001ea0 -#define NV20TCL_VP_UPLOAD_CONST_ID 0x00001ea4 -#define NV20TCL_VIEWPORT_TRANSLATE_X 0x00001f00 -#define NV20TCL_VIEWPORT_TRANSLATE_Y 0x00001f04 -#define NV20TCL_VIEWPORT_TRANSLATE_Z 0x00001f08 -#define NV20TCL_VIEWPORT_TRANSLATE_W 0x00001f0c - - -#define NV17TCL 0x00000099 - -#define NV17TCL_DMA_IN_MEMORY4 0x000001ac -#define NV17TCL_DMA_IN_MEMORY5 0x000001b0 -#define NV17TCL_COLOR_MASK_ENABLE 0x000002bc -#define NV17TCL_LMA_DEPTH_BUFFER_PITCH 0x00000d5c -#define NV17TCL_LMA_DEPTH_BUFFER_OFFSET 0x00000d60 -#define NV17TCL_LMA_DEPTH_FILL_VALUE 0x00000d68 -#define NV17TCL_LMA_DEPTH_BUFFER_CLEAR 0x00000d6c -#define NV17TCL_LMA_DEPTH_ENABLE 0x00001658 - - -#define NV20_SWIZZLED_SURFACE 0x0000009e - - - -#define NV12_IMAGE_BLIT 0x0000009f - - - -#define NV30_CONTEXT_SURFACES_2D 0x00000362 - - - -#define NV30_STRETCHED_IMAGE_FROM_CPU 0x00000366 - - - -#define NV30_TEXTURE_FROM_CPU 0x0000037b - - - -#define NV30_SCALED_IMAGE_FROM_MEMORY 0x00000389 - - - -#define NV30_IMAGE_FROM_CPU 0x0000038a - - - -#define NV30TCL 0x00000397 - - - -#define NV30_SWIZZLED_SURFACE 0x0000039e - - - -#define NV35TCL 0x00000497 - - - -#define NV25TCL 0x00000597 - -#define NV25TCL_DMA_IN_MEMORY4 0x0000019c -#define NV25TCL_DMA_IN_MEMORY5 0x000001a0 -#define NV25TCL_DMA_IN_MEMORY8 0x000001ac -#define NV25TCL_DMA_IN_MEMORY9 0x000001b0 - - -#define NV34TCL 0x00000697 - -#define NV34TCL_NOP 0x00000100 -#define NV34TCL_NOTIFY 0x00000104 -#define NV34TCL_DMA_NOTIFY 0x00000180 -#define NV34TCL_DMA_TEXTURE0 0x00000184 -#define NV34TCL_DMA_TEXTURE1 0x00000188 -#define NV34TCL_DMA_COLOR1 0x0000018c -#define NV34TCL_DMA_COLOR0 0x00000194 -#define NV34TCL_DMA_ZETA 0x00000198 -#define NV34TCL_DMA_VTXBUF0 0x0000019c -#define NV34TCL_DMA_VTXBUF1 0x000001a0 -#define NV34TCL_DMA_FENCE 0x000001a4 -#define NV34TCL_DMA_QUERY 0x000001a8 -#define NV34TCL_DMA_IN_MEMORY7 0x000001ac -#define NV34TCL_DMA_IN_MEMORY8 0x000001b0 -#define NV34TCL_RT_HORIZ 0x00000200 -#define NV34TCL_RT_HORIZ_X_SHIFT 0 -#define NV34TCL_RT_HORIZ_X_MASK 0x0000ffff -#define NV34TCL_RT_HORIZ_W_SHIFT 16 -#define NV34TCL_RT_HORIZ_W_MASK 0xffff0000 -#define NV34TCL_RT_VERT 0x00000204 -#define NV34TCL_RT_VERT_Y_SHIFT 0 -#define NV34TCL_RT_VERT_Y_MASK 0x0000ffff -#define NV34TCL_RT_VERT_H_SHIFT 16 -#define NV34TCL_RT_VERT_H_MASK 0xffff0000 -#define NV34TCL_RT_FORMAT 0x00000208 -#define NV34TCL_RT_FORMAT_TYPE_SHIFT 8 -#define NV34TCL_RT_FORMAT_TYPE_MASK 0x00000f00 -#define NV34TCL_RT_FORMAT_TYPE_LINEAR 0x00000100 -#define NV34TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200 -#define NV34TCL_RT_FORMAT_ZETA_SHIFT 5 -#define NV34TCL_RT_FORMAT_ZETA_MASK 0x000000e0 -#define NV34TCL_RT_FORMAT_ZETA_Z16 0x00000020 -#define NV34TCL_RT_FORMAT_ZETA_Z24S8 0x00000040 -#define NV34TCL_RT_FORMAT_COLOR_SHIFT 0 -#define NV34TCL_RT_FORMAT_COLOR_MASK 0x0000001f -#define NV34TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003 -#define NV34TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005 -#define NV34TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008 -#define NV34TCL_RT_FORMAT_COLOR_B8 0x00000009 -#define NV34TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d -#define NV34TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f -#define NV34TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010 -#define NV34TCL_COLOR0_PITCH 0x0000020c -#define NV34TCL_COLOR0_PITCH_COLOR0_SHIFT 0 -#define NV34TCL_COLOR0_PITCH_COLOR0_MASK 0x0000ffff -#define NV34TCL_COLOR0_PITCH_ZETA_SHIFT 16 -#define NV34TCL_COLOR0_PITCH_ZETA_MASK 0xffff0000 -#define NV34TCL_COLOR0_OFFSET 0x00000210 -#define NV34TCL_ZETA_OFFSET 0x00000214 -#define NV34TCL_COLOR1_OFFSET 0x00000218 -#define NV34TCL_COLOR1_PITCH 0x0000021c -#define NV34TCL_RT_ENABLE 0x00000220 -#define NV34TCL_RT_ENABLE_MRT (1 << 4) -#define NV34TCL_RT_ENABLE_COLOR1 (1 << 1) -#define NV34TCL_RT_ENABLE_COLOR0 (1 << 0) -#define NV34TCL_LMA_DEPTH_PITCH 0x0000022c -#define NV34TCL_LMA_DEPTH_OFFSET 0x00000230 -#define NV34TCL_TX_UNITS_ENABLE 0x0000023c -#define NV34TCL_TX_UNITS_ENABLE_TX0 (1 << 0) -#define NV34TCL_TX_UNITS_ENABLE_TX1 (1 << 1) -#define NV34TCL_TX_UNITS_ENABLE_TX2 (1 << 2) -#define NV34TCL_TX_UNITS_ENABLE_TX3 (1 << 3) -#define NV34TCL_TX_UNITS_ENABLE_TX4 (1 << 4) -#define NV34TCL_TX_UNITS_ENABLE_TX5 (1 << 5) -#define NV34TCL_TX_UNITS_ENABLE_TX6 (1 << 6) -#define NV34TCL_TX_UNITS_ENABLE_TX7 (1 << 7) -#define NV34TCL_TX_MATRIX_ENABLE(x) (0x00000240+((x)*4)) -#define NV34TCL_TX_MATRIX_ENABLE__SIZE 0x00000008 -#define NV34TCL_VIEWPORT_TX_ORIGIN 0x000002b8 -#define NV34TCL_VIEWPORT_TX_ORIGIN_X_SHIFT 0 -#define NV34TCL_VIEWPORT_TX_ORIGIN_X_MASK 0x0000ffff -#define NV34TCL_VIEWPORT_TX_ORIGIN_Y_SHIFT 16 -#define NV34TCL_VIEWPORT_TX_ORIGIN_Y_MASK 0xffff0000 -#define NV34TCL_VIEWPORT_CLIP_MODE 0x000002bc -#define NV34TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*8)) -#define NV34TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008 -#define NV34TCL_VIEWPORT_CLIP_HORIZ_L_SHIFT 0 -#define NV34TCL_VIEWPORT_CLIP_HORIZ_L_MASK 0x0000ffff -#define NV34TCL_VIEWPORT_CLIP_HORIZ_R_SHIFT 16 -#define NV34TCL_VIEWPORT_CLIP_HORIZ_R_MASK 0xffff0000 -#define NV34TCL_VIEWPORT_CLIP_VERT(x) (0x000002c4+((x)*8)) -#define NV34TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008 -#define NV34TCL_VIEWPORT_CLIP_VERT_T_SHIFT 0 -#define NV34TCL_VIEWPORT_CLIP_VERT_T_MASK 0x0000ffff -#define NV34TCL_VIEWPORT_CLIP_VERT_D_SHIFT 16 -#define NV34TCL_VIEWPORT_CLIP_VERT_D_MASK 0xffff0000 -#define NV34TCL_DITHER_ENABLE 0x00000300 -#define NV34TCL_ALPHA_FUNC_ENABLE 0x00000304 -#define NV34TCL_ALPHA_FUNC_FUNC 0x00000308 -#define NV34TCL_ALPHA_FUNC_FUNC_NEVER 0x00000200 -#define NV34TCL_ALPHA_FUNC_FUNC_LESS 0x00000201 -#define NV34TCL_ALPHA_FUNC_FUNC_EQUAL 0x00000202 -#define NV34TCL_ALPHA_FUNC_FUNC_LEQUAL 0x00000203 -#define NV34TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204 -#define NV34TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204 -#define NV34TCL_ALPHA_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV34TCL_ALPHA_FUNC_FUNC_GEQUAL 0x00000206 -#define NV34TCL_ALPHA_FUNC_FUNC_ALWAYS 0x00000207 -#define NV34TCL_ALPHA_FUNC_REF 0x0000030c -#define NV34TCL_BLEND_FUNC_ENABLE 0x00000310 -#define NV34TCL_BLEND_FUNC_SRC 0x00000314 -#define NV34TCL_BLEND_FUNC_SRC_RGB_SHIFT 0 -#define NV34TCL_BLEND_FUNC_SRC_RGB_MASK 0x0000ffff -#define NV34TCL_BLEND_FUNC_SRC_RGB_ZERO 0x00000000 -#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE 0x00000001 -#define NV34TCL_BLEND_FUNC_SRC_RGB_SRC_COLOR 0x00000300 -#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV34TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA 0x00000302 -#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV34TCL_BLEND_FUNC_SRC_RGB_DST_ALPHA 0x00000304 -#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV34TCL_BLEND_FUNC_SRC_RGB_DST_COLOR 0x00000306 -#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_COLOR 0x00000307 -#define NV34TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA_SATURATE 0x00000308 -#define NV34TCL_BLEND_FUNC_SRC_RGB_CONSTANT_COLOR 0x00008001 -#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV34TCL_BLEND_FUNC_SRC_RGB_CONSTANT_ALPHA 0x00008003 -#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SHIFT 16 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_MASK 0xffff0000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ZERO 0x00000000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE 0x00010000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SRC_COLOR 0x03000000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA 0x03020000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_DST_ALPHA 0x03040000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_DST_COLOR 0x03060000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_COLOR 0x03070000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA_SATURATE 0x03080000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_COLOR 0x80010000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_ALPHA 0x80030000 -#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000 -#define NV34TCL_BLEND_FUNC_DST 0x00000318 -#define NV34TCL_BLEND_FUNC_DST_RGB_SHIFT 0 -#define NV34TCL_BLEND_FUNC_DST_RGB_MASK 0x0000ffff -#define NV34TCL_BLEND_FUNC_DST_RGB_ZERO 0x00000000 -#define NV34TCL_BLEND_FUNC_DST_RGB_ONE 0x00000001 -#define NV34TCL_BLEND_FUNC_DST_RGB_SRC_COLOR 0x00000300 -#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV34TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA 0x00000302 -#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV34TCL_BLEND_FUNC_DST_RGB_DST_ALPHA 0x00000304 -#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV34TCL_BLEND_FUNC_DST_RGB_DST_COLOR 0x00000306 -#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_COLOR 0x00000307 -#define NV34TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA_SATURATE 0x00000308 -#define NV34TCL_BLEND_FUNC_DST_RGB_CONSTANT_COLOR 0x00008001 -#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV34TCL_BLEND_FUNC_DST_RGB_CONSTANT_ALPHA 0x00008003 -#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_SHIFT 16 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_MASK 0xffff0000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ZERO 0x00000000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE 0x00010000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_SRC_COLOR 0x03000000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA 0x03020000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_DST_ALPHA 0x03040000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_DST_COLOR 0x03060000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_COLOR 0x03070000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA_SATURATE 0x03080000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_COLOR 0x80010000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_ALPHA 0x80030000 -#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000 -#define NV34TCL_BLEND_COLOR 0x0000031c -#define NV34TCL_BLEND_COLOR_B_SHIFT 0 -#define NV34TCL_BLEND_COLOR_B_MASK 0x000000ff -#define NV34TCL_BLEND_COLOR_G_SHIFT 8 -#define NV34TCL_BLEND_COLOR_G_MASK 0x0000ff00 -#define NV34TCL_BLEND_COLOR_R_SHIFT 16 -#define NV34TCL_BLEND_COLOR_R_MASK 0x00ff0000 -#define NV34TCL_BLEND_COLOR_A_SHIFT 24 -#define NV34TCL_BLEND_COLOR_A_MASK 0xff000000 -#define NV34TCL_BLEND_EQUATION 0x00000320 -#define NV34TCL_BLEND_EQUATION_FUNC_ADD 0x00008006 -#define NV34TCL_BLEND_EQUATION_MIN 0x00008007 -#define NV34TCL_BLEND_EQUATION_MAX 0x00008008 -#define NV34TCL_BLEND_EQUATION_FUNC_SUBTRACT 0x0000800a -#define NV34TCL_BLEND_EQUATION_FUNC_REVERSE_SUBTRACT 0x0000800b -#define NV34TCL_COLOR_MASK 0x00000324 -#define NV34TCL_COLOR_MASK_B_SHIFT 0 -#define NV34TCL_COLOR_MASK_B_MASK 0x000000ff -#define NV34TCL_COLOR_MASK_G_SHIFT 8 -#define NV34TCL_COLOR_MASK_G_MASK 0x0000ff00 -#define NV34TCL_COLOR_MASK_R_SHIFT 16 -#define NV34TCL_COLOR_MASK_R_MASK 0x00ff0000 -#define NV34TCL_COLOR_MASK_A_SHIFT 24 -#define NV34TCL_COLOR_MASK_A_MASK 0xff000000 -#define NV34TCL_STENCIL_BACK_ENABLE 0x00000328 -#define NV34TCL_STENCIL_BACK_MASK 0x0000032c -#define NV34TCL_STENCIL_BACK_FUNC_FUNC 0x00000330 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_NEVER 0x00000200 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_LESS 0x00000201 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_EQUAL 0x00000202 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_LEQUAL 0x00000203 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_GEQUAL 0x00000206 -#define NV34TCL_STENCIL_BACK_FUNC_FUNC_ALWAYS 0x00000207 -#define NV34TCL_STENCIL_BACK_FUNC_REF 0x00000334 -#define NV34TCL_STENCIL_BACK_FUNC_MASK 0x00000338 -#define NV34TCL_STENCIL_BACK_OP_FAIL 0x0000033c -#define NV34TCL_STENCIL_BACK_OP_FAIL_ZERO 0x00000000 -#define NV34TCL_STENCIL_BACK_OP_FAIL_INVERT 0x0000150a -#define NV34TCL_STENCIL_BACK_OP_FAIL_KEEP 0x00001e00 -#define NV34TCL_STENCIL_BACK_OP_FAIL_REPLACE 0x00001e01 -#define NV34TCL_STENCIL_BACK_OP_FAIL_INCR 0x00001e02 -#define NV34TCL_STENCIL_BACK_OP_FAIL_DECR 0x00001e03 -#define NV34TCL_STENCIL_BACK_OP_FAIL_INCR_WRAP 0x00008507 -#define NV34TCL_STENCIL_BACK_OP_FAIL_DECR_WRAP 0x00008508 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL 0x00000340 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_ZERO 0x00000000 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_INVERT 0x0000150a -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_KEEP 0x00001e00 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_REPLACE 0x00001e01 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_INCR 0x00001e02 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_DECR 0x00001e03 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV34TCL_STENCIL_BACK_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV34TCL_STENCIL_BACK_OP_ZPASS 0x00000344 -#define NV34TCL_STENCIL_BACK_OP_ZPASS_ZERO 0x00000000 -#define NV34TCL_STENCIL_BACK_OP_ZPASS_INVERT 0x0000150a -#define NV34TCL_STENCIL_BACK_OP_ZPASS_KEEP 0x00001e00 -#define NV34TCL_STENCIL_BACK_OP_ZPASS_REPLACE 0x00001e01 -#define NV34TCL_STENCIL_BACK_OP_ZPASS_INCR 0x00001e02 -#define NV34TCL_STENCIL_BACK_OP_ZPASS_DECR 0x00001e03 -#define NV34TCL_STENCIL_BACK_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV34TCL_STENCIL_BACK_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV34TCL_STENCIL_FRONT_ENABLE 0x00000348 -#define NV34TCL_STENCIL_FRONT_MASK 0x0000034c -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC 0x00000350 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_NEVER 0x00000200 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_LESS 0x00000201 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_EQUAL 0x00000202 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_LEQUAL 0x00000203 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_GEQUAL 0x00000206 -#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_ALWAYS 0x00000207 -#define NV34TCL_STENCIL_FRONT_FUNC_REF 0x00000354 -#define NV34TCL_STENCIL_FRONT_FUNC_MASK 0x00000358 -#define NV34TCL_STENCIL_FRONT_OP_FAIL 0x0000035c -#define NV34TCL_STENCIL_FRONT_OP_FAIL_ZERO 0x00000000 -#define NV34TCL_STENCIL_FRONT_OP_FAIL_INVERT 0x0000150a -#define NV34TCL_STENCIL_FRONT_OP_FAIL_KEEP 0x00001e00 -#define NV34TCL_STENCIL_FRONT_OP_FAIL_REPLACE 0x00001e01 -#define NV34TCL_STENCIL_FRONT_OP_FAIL_INCR 0x00001e02 -#define NV34TCL_STENCIL_FRONT_OP_FAIL_DECR 0x00001e03 -#define NV34TCL_STENCIL_FRONT_OP_FAIL_INCR_WRAP 0x00008507 -#define NV34TCL_STENCIL_FRONT_OP_FAIL_DECR_WRAP 0x00008508 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL 0x00000360 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_ZERO 0x00000000 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_INVERT 0x0000150a -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_KEEP 0x00001e00 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_REPLACE 0x00001e01 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_INCR 0x00001e02 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_DECR 0x00001e03 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS 0x00000364 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_ZERO 0x00000000 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_INVERT 0x0000150a -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_KEEP 0x00001e00 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_REPLACE 0x00001e01 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_INCR 0x00001e02 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_DECR 0x00001e03 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV34TCL_STENCIL_FRONT_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV34TCL_SHADE_MODEL 0x00000368 -#define NV34TCL_SHADE_MODEL_FLAT 0x00001d00 -#define NV34TCL_SHADE_MODEL_SMOOTH 0x00001d01 -#define NV34TCL_FOG_ENABLE 0x0000036c -#define NV34TCL_FOG_COLOR 0x00000370 -#define NV34TCL_FOG_COLOR_R_SHIFT 0 -#define NV34TCL_FOG_COLOR_R_MASK 0x000000ff -#define NV34TCL_FOG_COLOR_G_SHIFT 8 -#define NV34TCL_FOG_COLOR_G_MASK 0x0000ff00 -#define NV34TCL_FOG_COLOR_B_SHIFT 16 -#define NV34TCL_FOG_COLOR_B_MASK 0x00ff0000 -#define NV34TCL_FOG_COLOR_A_SHIFT 24 -#define NV34TCL_FOG_COLOR_A_MASK 0xff000000 -#define NV34TCL_COLOR_LOGIC_OP_ENABLE 0x00000374 -#define NV34TCL_COLOR_LOGIC_OP_OP 0x00000378 -#define NV34TCL_COLOR_LOGIC_OP_OP_CLEAR 0x00001500 -#define NV34TCL_COLOR_LOGIC_OP_OP_AND 0x00001501 -#define NV34TCL_COLOR_LOGIC_OP_OP_AND_REVERSE 0x00001502 -#define NV34TCL_COLOR_LOGIC_OP_OP_COPY 0x00001503 -#define NV34TCL_COLOR_LOGIC_OP_OP_AND_INVERTED 0x00001504 -#define NV34TCL_COLOR_LOGIC_OP_OP_NOOP 0x00001505 -#define NV34TCL_COLOR_LOGIC_OP_OP_XOR 0x00001506 -#define NV34TCL_COLOR_LOGIC_OP_OP_OR 0x00001507 -#define NV34TCL_COLOR_LOGIC_OP_OP_NOR 0x00001508 -#define NV34TCL_COLOR_LOGIC_OP_OP_EQUIV 0x00001509 -#define NV34TCL_COLOR_LOGIC_OP_OP_INVERT 0x0000150a -#define NV34TCL_COLOR_LOGIC_OP_OP_OR_REVERSE 0x0000150b -#define NV34TCL_COLOR_LOGIC_OP_OP_COPY_INVERTED 0x0000150c -#define NV34TCL_COLOR_LOGIC_OP_OP_OR_INVERTED 0x0000150d -#define NV34TCL_COLOR_LOGIC_OP_OP_NAND 0x0000150e -#define NV34TCL_COLOR_LOGIC_OP_OP_SET 0x0000150f -#define NV34TCL_NORMALIZE_ENABLE 0x0000037c -#define NV34TCL_COLOR_MATERIAL 0x00000390 -#define NV34TCL_COLOR_MATERIAL_FRONT_EMISSION_ENABLE (1 << 0) -#define NV34TCL_COLOR_MATERIAL_FRONT_AMBIENT_ENABLE (1 << 2) -#define NV34TCL_COLOR_MATERIAL_FRONT_DIFFUSE_ENABLE (1 << 4) -#define NV34TCL_COLOR_MATERIAL_FRONT_SPECULAR_ENABLE (1 << 6) -#define NV34TCL_COLOR_MATERIAL_BACK_EMISSION_ENABLE (1 << 8) -#define NV34TCL_COLOR_MATERIAL_BACK_AMBIENT_ENABLE (1 << 10) -#define NV34TCL_COLOR_MATERIAL_BACK_DIFFUSE_ENABLE (1 << 12) -#define NV34TCL_COLOR_MATERIAL_BACK_SPECULAR_ENABLE (1 << 14) -#define NV34TCL_DEPTH_RANGE_NEAR 0x00000394 -#define NV34TCL_DEPTH_RANGE_FAR 0x00000398 -#define NV34TCL_COLOR_MATERIAL_FRONT_R 0x000003a0 -#define NV34TCL_COLOR_MATERIAL_FRONT_G 0x000003a4 -#define NV34TCL_COLOR_MATERIAL_FRONT_B 0x000003a8 -#define NV34TCL_COLOR_MATERIAL_FRONT_A 0x000003b4 -#define NV34TCL_LINE_WIDTH 0x000003b8 -#define NV34TCL_LINE_SMOOTH_ENABLE 0x000003bc -#define NV34TCL_TX_GEN_S(x) (0x00000400+((x)*16)) -#define NV34TCL_TX_GEN_S__SIZE 0x00000008 -#define NV34TCL_TX_GEN_S_FALSE 0x00000000 -#define NV34TCL_TX_GEN_S_EYE_LINEAR 0x00002400 -#define NV34TCL_TX_GEN_S_OBJECT_LINEAR 0x00002401 -#define NV34TCL_TX_GEN_S_SPHERE_MAP 0x00002402 -#define NV34TCL_TX_GEN_S_NORMAL_MAP 0x00008511 -#define NV34TCL_TX_GEN_S_REFLECTION_MAP 0x00008512 -#define NV34TCL_TX_GEN_T(x) (0x00000404+((x)*16)) -#define NV34TCL_TX_GEN_T__SIZE 0x00000008 -#define NV34TCL_TX_GEN_T_FALSE 0x00000000 -#define NV34TCL_TX_GEN_T_EYE_LINEAR 0x00002400 -#define NV34TCL_TX_GEN_T_OBJECT_LINEAR 0x00002401 -#define NV34TCL_TX_GEN_T_SPHERE_MAP 0x00002402 -#define NV34TCL_TX_GEN_T_NORMAL_MAP 0x00008511 -#define NV34TCL_TX_GEN_T_REFLECTION_MAP 0x00008512 -#define NV34TCL_TX_GEN_R(x) (0x00000408+((x)*16)) -#define NV34TCL_TX_GEN_R__SIZE 0x00000008 -#define NV34TCL_TX_GEN_R_FALSE 0x00000000 -#define NV34TCL_TX_GEN_R_EYE_LINEAR 0x00002400 -#define NV34TCL_TX_GEN_R_OBJECT_LINEAR 0x00002401 -#define NV34TCL_TX_GEN_R_SPHERE_MAP 0x00002402 -#define NV34TCL_TX_GEN_R_NORMAL_MAP 0x00008511 -#define NV34TCL_TX_GEN_R_REFLECTION_MAP 0x00008512 -#define NV34TCL_TX_GEN_Q(x) (0x0000040c+((x)*16)) -#define NV34TCL_TX_GEN_Q__SIZE 0x00000008 -#define NV34TCL_TX_GEN_Q_FALSE 0x00000000 -#define NV34TCL_TX_GEN_Q_EYE_LINEAR 0x00002400 -#define NV34TCL_TX_GEN_Q_OBJECT_LINEAR 0x00002401 -#define NV34TCL_TX_GEN_Q_SPHERE_MAP 0x00002402 -#define NV34TCL_TX_GEN_Q_NORMAL_MAP 0x00008511 -#define NV34TCL_TX_GEN_Q_REFLECTION_MAP 0x00008512 -#define NV34TCL_MODELVIEW_MATRIX(x) (0x00000480+((x)*4)) -#define NV34TCL_MODELVIEW_MATRIX__SIZE 0x00000010 -#define NV34TCL_INVERSE_MODELVIEW_MATRIX(x) (0x00000580+((x)*4)) -#define NV34TCL_INVERSE_MODELVIEW_MATRIX__SIZE 0x0000000c -#define NV34TCL_PROJECTION_MATRIX(x) (0x00000680+((x)*4)) -#define NV34TCL_PROJECTION_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX0_MATRIX(x) (0x000006c0+((x)*4)) -#define NV34TCL_TX0_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX1_MATRIX(x) (0x00000700+((x)*4)) -#define NV34TCL_TX1_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX2_MATRIX(x) (0x00000740+((x)*4)) -#define NV34TCL_TX2_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX3_MATRIX(x) (0x00000780+((x)*4)) -#define NV34TCL_TX3_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX4_MATRIX(x) (0x000007c0+((x)*4)) -#define NV34TCL_TX4_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX5_MATRIX(x) (0x00000800+((x)*4)) -#define NV34TCL_TX5_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX6_MATRIX(x) (0x00000840+((x)*4)) -#define NV34TCL_TX6_MATRIX__SIZE 0x00000010 -#define NV34TCL_TX7_MATRIX(x) (0x00000880+((x)*4)) -#define NV34TCL_TX7_MATRIX__SIZE 0x00000010 -#define NV34TCL_SCISSOR_HORIZ 0x000008c0 -#define NV34TCL_SCISSOR_HORIZ_X_SHIFT 0 -#define NV34TCL_SCISSOR_HORIZ_X_MASK 0x0000ffff -#define NV34TCL_SCISSOR_HORIZ_W_SHIFT 16 -#define NV34TCL_SCISSOR_HORIZ_W_MASK 0xffff0000 -#define NV34TCL_SCISSOR_VERT 0x000008c4 -#define NV34TCL_SCISSOR_VERT_Y_SHIFT 0 -#define NV34TCL_SCISSOR_VERT_Y_MASK 0x0000ffff -#define NV34TCL_SCISSOR_VERT_H_SHIFT 16 -#define NV34TCL_SCISSOR_VERT_H_MASK 0xffff0000 -#define NV34TCL_FOG_COORD_DIST 0x000008c8 -#define NV34TCL_FOG_COORD_DIST_COORD_FALSE 0x00000000 -#define NV34TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_RADIAL_NV 0x00000001 -#define NV34TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_PLANE_ABSOLUTE_NV 0x00000002 -#define NV34TCL_FOG_COORD_DIST_COORD_FOG 0x00000003 -#define NV34TCL_FOG_MODE 0x000008cc -#define NV34TCL_FOG_MODE_EXP 0x00000800 -#define NV34TCL_FOG_MODE_EXP_2 0x00000802 -#define NV34TCL_FOG_MODE_EXP2 0x00000803 -#define NV34TCL_FOG_MODE_LINEAR 0x00000804 -#define NV34TCL_FOG_MODE_LINEAR_2 0x00002601 -#define NV34TCL_FOG_EQUATION_CONSTANT 0x000008d0 -#define NV34TCL_FOG_EQUATION_LINEAR 0x000008d4 -#define NV34TCL_FOG_EQUATION_QUADRATIC 0x000008d8 -#define NV34TCL_FP_ACTIVE_PROGRAM 0x000008e4 -#define NV34TCL_FP_ACTIVE_PROGRAM_DMA0 (1 << 0) -#define NV34TCL_FP_ACTIVE_PROGRAM_DMA1 (1 << 1) -#define NV34TCL_FP_ACTIVE_PROGRAM_OFFSET_SHIFT 2 -#define NV34TCL_FP_ACTIVE_PROGRAM_OFFSET_MASK 0xfffffffc -#define NV34TCL_RC_COLOR0 0x000008ec -#define NV34TCL_RC_COLOR0_B_SHIFT 0 -#define NV34TCL_RC_COLOR0_B_MASK 0x000000ff -#define NV34TCL_RC_COLOR0_G_SHIFT 8 -#define NV34TCL_RC_COLOR0_G_MASK 0x0000ff00 -#define NV34TCL_RC_COLOR0_R_SHIFT 16 -#define NV34TCL_RC_COLOR0_R_MASK 0x00ff0000 -#define NV34TCL_RC_COLOR0_A_SHIFT 24 -#define NV34TCL_RC_COLOR0_A_MASK 0xff000000 -#define NV34TCL_RC_COLOR1 0x000008f0 -#define NV34TCL_RC_COLOR1_B_SHIFT 0 -#define NV34TCL_RC_COLOR1_B_MASK 0x000000ff -#define NV34TCL_RC_COLOR1_G_SHIFT 8 -#define NV34TCL_RC_COLOR1_G_MASK 0x0000ff00 -#define NV34TCL_RC_COLOR1_R_SHIFT 16 -#define NV34TCL_RC_COLOR1_R_MASK 0x00ff0000 -#define NV34TCL_RC_COLOR1_A_SHIFT 24 -#define NV34TCL_RC_COLOR1_A_MASK 0xff000000 -#define NV34TCL_RC_FINAL0 0x000008f4 -#define NV34TCL_RC_FINAL0_D_INPUT_SHIFT 0 -#define NV34TCL_RC_FINAL0_D_INPUT_MASK 0x0000000f -#define NV34TCL_RC_FINAL0_D_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV34TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV34TCL_RC_FINAL0_D_INPUT_FOG 0x00000003 -#define NV34TCL_RC_FINAL0_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV34TCL_RC_FINAL0_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV34TCL_RC_FINAL0_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV34TCL_RC_FINAL0_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV34TCL_RC_FINAL0_D_INPUT_SPARE0_NV 0x0000000c -#define NV34TCL_RC_FINAL0_D_INPUT_SPARE1_NV 0x0000000d -#define NV34TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV34TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV34TCL_RC_FINAL0_D_COMPONENT_USAGE (1 << 4) -#define NV34TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV34TCL_RC_FINAL0_D_MAPPING_SHIFT 5 -#define NV34TCL_RC_FINAL0_D_MAPPING_MASK 0x000000e0 -#define NV34TCL_RC_FINAL0_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_FINAL0_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV34TCL_RC_FINAL0_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV34TCL_RC_FINAL0_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV34TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV34TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV34TCL_RC_FINAL0_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV34TCL_RC_FINAL0_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV34TCL_RC_FINAL0_C_INPUT_SHIFT 8 -#define NV34TCL_RC_FINAL0_C_INPUT_MASK 0x00000f00 -#define NV34TCL_RC_FINAL0_C_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV34TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV34TCL_RC_FINAL0_C_INPUT_FOG 0x00000300 -#define NV34TCL_RC_FINAL0_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV34TCL_RC_FINAL0_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV34TCL_RC_FINAL0_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV34TCL_RC_FINAL0_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV34TCL_RC_FINAL0_C_INPUT_SPARE0_NV 0x00000c00 -#define NV34TCL_RC_FINAL0_C_INPUT_SPARE1_NV 0x00000d00 -#define NV34TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV34TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV34TCL_RC_FINAL0_C_COMPONENT_USAGE (1 << 12) -#define NV34TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV34TCL_RC_FINAL0_C_MAPPING_SHIFT 13 -#define NV34TCL_RC_FINAL0_C_MAPPING_MASK 0x0000e000 -#define NV34TCL_RC_FINAL0_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_FINAL0_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV34TCL_RC_FINAL0_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV34TCL_RC_FINAL0_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV34TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV34TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV34TCL_RC_FINAL0_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV34TCL_RC_FINAL0_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV34TCL_RC_FINAL0_B_INPUT_SHIFT 16 -#define NV34TCL_RC_FINAL0_B_INPUT_MASK 0x000f0000 -#define NV34TCL_RC_FINAL0_B_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV34TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV34TCL_RC_FINAL0_B_INPUT_FOG 0x00030000 -#define NV34TCL_RC_FINAL0_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV34TCL_RC_FINAL0_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV34TCL_RC_FINAL0_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV34TCL_RC_FINAL0_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV34TCL_RC_FINAL0_B_INPUT_SPARE0_NV 0x000c0000 -#define NV34TCL_RC_FINAL0_B_INPUT_SPARE1_NV 0x000d0000 -#define NV34TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV34TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV34TCL_RC_FINAL0_B_COMPONENT_USAGE (1 << 20) -#define NV34TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV34TCL_RC_FINAL0_B_MAPPING_SHIFT 21 -#define NV34TCL_RC_FINAL0_B_MAPPING_MASK 0x00e00000 -#define NV34TCL_RC_FINAL0_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_FINAL0_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV34TCL_RC_FINAL0_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV34TCL_RC_FINAL0_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV34TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV34TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV34TCL_RC_FINAL0_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV34TCL_RC_FINAL0_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV34TCL_RC_FINAL0_A_INPUT_SHIFT 24 -#define NV34TCL_RC_FINAL0_A_INPUT_MASK 0x0f000000 -#define NV34TCL_RC_FINAL0_A_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV34TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV34TCL_RC_FINAL0_A_INPUT_FOG 0x03000000 -#define NV34TCL_RC_FINAL0_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV34TCL_RC_FINAL0_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV34TCL_RC_FINAL0_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV34TCL_RC_FINAL0_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV34TCL_RC_FINAL0_A_INPUT_SPARE0_NV 0x0c000000 -#define NV34TCL_RC_FINAL0_A_INPUT_SPARE1_NV 0x0d000000 -#define NV34TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV34TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV34TCL_RC_FINAL0_A_COMPONENT_USAGE (1 << 28) -#define NV34TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_SHIFT 29 -#define NV34TCL_RC_FINAL0_A_MAPPING_MASK 0xe0000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV34TCL_RC_FINAL0_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV34TCL_RC_FINAL1 0x000008f8 -#define NV34TCL_RC_FINAL1_COLOR_SUM_CLAMP (1 << 7) -#define NV34TCL_RC_FINAL1_G_INPUT_SHIFT 8 -#define NV34TCL_RC_FINAL1_G_INPUT_MASK 0x00000f00 -#define NV34TCL_RC_FINAL1_G_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV34TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV34TCL_RC_FINAL1_G_INPUT_FOG 0x00000300 -#define NV34TCL_RC_FINAL1_G_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV34TCL_RC_FINAL1_G_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV34TCL_RC_FINAL1_G_INPUT_TEXTURE0_ARB 0x00000800 -#define NV34TCL_RC_FINAL1_G_INPUT_TEXTURE1_ARB 0x00000900 -#define NV34TCL_RC_FINAL1_G_INPUT_SPARE0_NV 0x00000c00 -#define NV34TCL_RC_FINAL1_G_INPUT_SPARE1_NV 0x00000d00 -#define NV34TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV34TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV34TCL_RC_FINAL1_G_COMPONENT_USAGE (1 << 12) -#define NV34TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV34TCL_RC_FINAL1_G_MAPPING_SHIFT 13 -#define NV34TCL_RC_FINAL1_G_MAPPING_MASK 0x0000e000 -#define NV34TCL_RC_FINAL1_G_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_FINAL1_G_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV34TCL_RC_FINAL1_G_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV34TCL_RC_FINAL1_G_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV34TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV34TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV34TCL_RC_FINAL1_G_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV34TCL_RC_FINAL1_G_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV34TCL_RC_FINAL1_F_INPUT_SHIFT 16 -#define NV34TCL_RC_FINAL1_F_INPUT_MASK 0x000f0000 -#define NV34TCL_RC_FINAL1_F_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV34TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV34TCL_RC_FINAL1_F_INPUT_FOG 0x00030000 -#define NV34TCL_RC_FINAL1_F_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV34TCL_RC_FINAL1_F_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV34TCL_RC_FINAL1_F_INPUT_TEXTURE0_ARB 0x00080000 -#define NV34TCL_RC_FINAL1_F_INPUT_TEXTURE1_ARB 0x00090000 -#define NV34TCL_RC_FINAL1_F_INPUT_SPARE0_NV 0x000c0000 -#define NV34TCL_RC_FINAL1_F_INPUT_SPARE1_NV 0x000d0000 -#define NV34TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV34TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV34TCL_RC_FINAL1_F_COMPONENT_USAGE (1 << 20) -#define NV34TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV34TCL_RC_FINAL1_F_MAPPING_SHIFT 21 -#define NV34TCL_RC_FINAL1_F_MAPPING_MASK 0x00e00000 -#define NV34TCL_RC_FINAL1_F_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_FINAL1_F_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV34TCL_RC_FINAL1_F_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV34TCL_RC_FINAL1_F_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV34TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV34TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV34TCL_RC_FINAL1_F_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV34TCL_RC_FINAL1_F_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV34TCL_RC_FINAL1_E_INPUT_SHIFT 24 -#define NV34TCL_RC_FINAL1_E_INPUT_MASK 0x0f000000 -#define NV34TCL_RC_FINAL1_E_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV34TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV34TCL_RC_FINAL1_E_INPUT_FOG 0x03000000 -#define NV34TCL_RC_FINAL1_E_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV34TCL_RC_FINAL1_E_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV34TCL_RC_FINAL1_E_INPUT_TEXTURE0_ARB 0x08000000 -#define NV34TCL_RC_FINAL1_E_INPUT_TEXTURE1_ARB 0x09000000 -#define NV34TCL_RC_FINAL1_E_INPUT_SPARE0_NV 0x0c000000 -#define NV34TCL_RC_FINAL1_E_INPUT_SPARE1_NV 0x0d000000 -#define NV34TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV34TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV34TCL_RC_FINAL1_E_COMPONENT_USAGE (1 << 28) -#define NV34TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_SHIFT 29 -#define NV34TCL_RC_FINAL1_E_MAPPING_MASK 0xe0000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV34TCL_RC_FINAL1_E_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV34TCL_RC_ENABLE 0x000008fc -#define NV34TCL_RC_ENABLE_NUM_COMBINERS_SHIFT 0 -#define NV34TCL_RC_ENABLE_NUM_COMBINERS_MASK 0x0000000f -#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR0_SHIFT 12 -#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR0_MASK 0x0000f000 -#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR1_SHIFT 16 -#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR1_MASK 0x000f0000 -#define NV34TCL_RC_IN_ALPHA(x) (0x00000900+((x)*32)) -#define NV34TCL_RC_IN_ALPHA__SIZE 0x00000008 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_SHIFT 0 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_MASK 0x0000000f -#define NV34TCL_RC_IN_ALPHA_D_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_FOG 0x00000003 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE0_NV 0x0000000c -#define NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV 0x0000000d -#define NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV34TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE (1 << 4) -#define NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE 0x00000000 -#define NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_SHIFT 5 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_MASK 0x000000e0 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV34TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_SHIFT 8 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_MASK 0x00000f00 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_FOG 0x00000300 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE0_NV 0x00000c00 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV 0x00000d00 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV34TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE (1 << 12) -#define NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE 0x00000000 -#define NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_SHIFT 13 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_MASK 0x0000e000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV34TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_SHIFT 16 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_MASK 0x000f0000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_FOG 0x00030000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE0_NV 0x000c0000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV 0x000d0000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV34TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE (1 << 20) -#define NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE 0x00000000 -#define NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_SHIFT 21 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_MASK 0x00e00000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV34TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_SHIFT 24 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_MASK 0x0f000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_FOG 0x03000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE0_NV 0x0c000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV 0x0d000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV34TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE (1 << 28) -#define NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE 0x00000000 -#define NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_SHIFT 29 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_MASK 0xe0000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV34TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV34TCL_RC_IN_RGB(x) (0x00000904+((x)*32)) -#define NV34TCL_RC_IN_RGB__SIZE 0x00000008 -#define NV34TCL_RC_IN_RGB_D_INPUT_SHIFT 0 -#define NV34TCL_RC_IN_RGB_D_INPUT_MASK 0x0000000f -#define NV34TCL_RC_IN_RGB_D_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV34TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV34TCL_RC_IN_RGB_D_INPUT_FOG 0x00000003 -#define NV34TCL_RC_IN_RGB_D_INPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV34TCL_RC_IN_RGB_D_INPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV34TCL_RC_IN_RGB_D_INPUT_TEXTURE0_ARB 0x00000008 -#define NV34TCL_RC_IN_RGB_D_INPUT_TEXTURE1_ARB 0x00000009 -#define NV34TCL_RC_IN_RGB_D_INPUT_SPARE0_NV 0x0000000c -#define NV34TCL_RC_IN_RGB_D_INPUT_SPARE1_NV 0x0000000d -#define NV34TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV34TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV 0x0000000f -#define NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE (1 << 4) -#define NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA 0x00000010 -#define NV34TCL_RC_IN_RGB_D_MAPPING_SHIFT 5 -#define NV34TCL_RC_IN_RGB_D_MAPPING_MASK 0x000000e0 -#define NV34TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020 -#define NV34TCL_RC_IN_RGB_D_MAPPING_EXPAND_NORMAL_NV 0x00000040 -#define NV34TCL_RC_IN_RGB_D_MAPPING_EXPAND_NEGATE_NV 0x00000060 -#define NV34TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080 -#define NV34TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0 -#define NV34TCL_RC_IN_RGB_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0 -#define NV34TCL_RC_IN_RGB_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0 -#define NV34TCL_RC_IN_RGB_C_INPUT_SHIFT 8 -#define NV34TCL_RC_IN_RGB_C_INPUT_MASK 0x00000f00 -#define NV34TCL_RC_IN_RGB_C_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV34TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV34TCL_RC_IN_RGB_C_INPUT_FOG 0x00000300 -#define NV34TCL_RC_IN_RGB_C_INPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV34TCL_RC_IN_RGB_C_INPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV34TCL_RC_IN_RGB_C_INPUT_TEXTURE0_ARB 0x00000800 -#define NV34TCL_RC_IN_RGB_C_INPUT_TEXTURE1_ARB 0x00000900 -#define NV34TCL_RC_IN_RGB_C_INPUT_SPARE0_NV 0x00000c00 -#define NV34TCL_RC_IN_RGB_C_INPUT_SPARE1_NV 0x00000d00 -#define NV34TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV34TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV 0x00000f00 -#define NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE (1 << 12) -#define NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA 0x00001000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_SHIFT 13 -#define NV34TCL_RC_IN_RGB_C_MAPPING_MASK 0x0000e000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_EXPAND_NORMAL_NV 0x00004000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_EXPAND_NEGATE_NV 0x00006000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000 -#define NV34TCL_RC_IN_RGB_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000 -#define NV34TCL_RC_IN_RGB_B_INPUT_SHIFT 16 -#define NV34TCL_RC_IN_RGB_B_INPUT_MASK 0x000f0000 -#define NV34TCL_RC_IN_RGB_B_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR0_NV 0x00010000 -#define NV34TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR1_NV 0x00020000 -#define NV34TCL_RC_IN_RGB_B_INPUT_FOG 0x00030000 -#define NV34TCL_RC_IN_RGB_B_INPUT_PRIMARY_COLOR_NV 0x00040000 -#define NV34TCL_RC_IN_RGB_B_INPUT_SECONDARY_COLOR_NV 0x00050000 -#define NV34TCL_RC_IN_RGB_B_INPUT_TEXTURE0_ARB 0x00080000 -#define NV34TCL_RC_IN_RGB_B_INPUT_TEXTURE1_ARB 0x00090000 -#define NV34TCL_RC_IN_RGB_B_INPUT_SPARE0_NV 0x000c0000 -#define NV34TCL_RC_IN_RGB_B_INPUT_SPARE1_NV 0x000d0000 -#define NV34TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000 -#define NV34TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV 0x000f0000 -#define NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE (1 << 20) -#define NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA 0x00100000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_SHIFT 21 -#define NV34TCL_RC_IN_RGB_B_MAPPING_MASK 0x00e00000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_EXPAND_NORMAL_NV 0x00400000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_EXPAND_NEGATE_NV 0x00600000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000 -#define NV34TCL_RC_IN_RGB_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000 -#define NV34TCL_RC_IN_RGB_A_INPUT_SHIFT 24 -#define NV34TCL_RC_IN_RGB_A_INPUT_MASK 0x0f000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_ZERO 0x00000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR0_NV 0x01000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR1_NV 0x02000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_FOG 0x03000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_PRIMARY_COLOR_NV 0x04000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_SECONDARY_COLOR_NV 0x05000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_TEXTURE0_ARB 0x08000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_TEXTURE1_ARB 0x09000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_SPARE0_NV 0x0c000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_SPARE1_NV 0x0d000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000 -#define NV34TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV 0x0f000000 -#define NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE (1 << 28) -#define NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB 0x00000000 -#define NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA 0x10000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_SHIFT 29 -#define NV34TCL_RC_IN_RGB_A_MAPPING_MASK 0xe0000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_EXPAND_NORMAL_NV 0x40000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_EXPAND_NEGATE_NV 0x60000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000 -#define NV34TCL_RC_IN_RGB_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000 -#define NV34TCL_RC_CONSTANT_COLOR0(x) (0x00000908+((x)*32)) -#define NV34TCL_RC_CONSTANT_COLOR0__SIZE 0x00000008 -#define NV34TCL_RC_CONSTANT_COLOR0_B_SHIFT 0 -#define NV34TCL_RC_CONSTANT_COLOR0_B_MASK 0x000000ff -#define NV34TCL_RC_CONSTANT_COLOR0_G_SHIFT 8 -#define NV34TCL_RC_CONSTANT_COLOR0_G_MASK 0x0000ff00 -#define NV34TCL_RC_CONSTANT_COLOR0_R_SHIFT 16 -#define NV34TCL_RC_CONSTANT_COLOR0_R_MASK 0x00ff0000 -#define NV34TCL_RC_CONSTANT_COLOR0_A_SHIFT 24 -#define NV34TCL_RC_CONSTANT_COLOR0_A_MASK 0xff000000 -#define NV34TCL_RC_CONSTANT_COLOR1(x) (0x0000090c+((x)*32)) -#define NV34TCL_RC_CONSTANT_COLOR1__SIZE 0x00000008 -#define NV34TCL_RC_CONSTANT_COLOR1_B_SHIFT 0 -#define NV34TCL_RC_CONSTANT_COLOR1_B_MASK 0x000000ff -#define NV34TCL_RC_CONSTANT_COLOR1_G_SHIFT 8 -#define NV34TCL_RC_CONSTANT_COLOR1_G_MASK 0x0000ff00 -#define NV34TCL_RC_CONSTANT_COLOR1_R_SHIFT 16 -#define NV34TCL_RC_CONSTANT_COLOR1_R_MASK 0x00ff0000 -#define NV34TCL_RC_CONSTANT_COLOR1_A_SHIFT 24 -#define NV34TCL_RC_CONSTANT_COLOR1_A_MASK 0xff000000 -#define NV34TCL_RC_OUT_ALPHA(x) (0x00000910+((x)*32)) -#define NV34TCL_RC_OUT_ALPHA__SIZE 0x00000008 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SHIFT 0 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_MASK 0x0000000f -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_ZERO 0x00000000 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_FOG 0x00000003 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE0_ARB 0x00000008 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE1_ARB 0x00000009 -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_NV 0x0000000c -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV 0x0000000d -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV 0x0000000f -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT 4 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK 0x000000f0 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO 0x00000000 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_FOG 0x00000030 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE0_ARB 0x00000080 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE1_ARB 0x00000090 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_NV 0x000000c0 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV 0x000000d0 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0 -#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV 0x000000f0 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT 8 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK 0x00000f00 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO 0x00000000 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_FOG 0x00000300 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE0_ARB 0x00000800 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE1_ARB 0x00000900 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_NV 0x00000c00 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV 0x00000d00 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00 -#define NV34TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT (1 << 12) -#define NV34TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT (1 << 13) -#define NV34TCL_RC_OUT_ALPHA_MUX_SUM (1 << 14) -#define NV34TCL_RC_OUT_ALPHA_BIAS (1 << 15) -#define NV34TCL_RC_OUT_ALPHA_BIAS_NONE 0x00000000 -#define NV34TCL_RC_OUT_ALPHA_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000 -#define NV34TCL_RC_OUT_ALPHA_SCALE_SHIFT 17 -#define NV34TCL_RC_OUT_ALPHA_SCALE_MASK 0x00000000 -#define NV34TCL_RC_OUT_ALPHA_SCALE_NONE 0x00000000 -#define NV34TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_TWO_NV 0x00020000 -#define NV34TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_FOUR_NV 0x00040000 -#define NV34TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000 -#define NV34TCL_RC_OUT_RGB(x) (0x00000914+((x)*32)) -#define NV34TCL_RC_OUT_RGB__SIZE 0x00000008 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SHIFT 0 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_MASK 0x0000000f -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_ZERO 0x00000000 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_FOG 0x00000003 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE0_ARB 0x00000008 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE1_ARB 0x00000009 -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_NV 0x0000000c -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV 0x0000000d -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e -#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV 0x0000000f -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT 4 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_MASK 0x000000f0 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_ZERO 0x00000000 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_FOG 0x00000030 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE0_ARB 0x00000080 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE1_ARB 0x00000090 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_NV 0x000000c0 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV 0x000000d0 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0 -#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV 0x000000f0 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT 8 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_MASK 0x00000f00 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO 0x00000000 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_FOG 0x00000300 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE0_ARB 0x00000800 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE1_ARB 0x00000900 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_NV 0x00000c00 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV 0x00000d00 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00 -#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00 -#define NV34TCL_RC_OUT_RGB_CD_DOT_PRODUCT (1 << 12) -#define NV34TCL_RC_OUT_RGB_AB_DOT_PRODUCT (1 << 13) -#define NV34TCL_RC_OUT_RGB_MUX_SUM (1 << 14) -#define NV34TCL_RC_OUT_RGB_BIAS (1 << 15) -#define NV34TCL_RC_OUT_RGB_BIAS_NONE 0x00000000 -#define NV34TCL_RC_OUT_RGB_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000 -#define NV34TCL_RC_OUT_RGB_SCALE_SHIFT 17 -#define NV34TCL_RC_OUT_RGB_SCALE_MASK 0x00000000 -#define NV34TCL_RC_OUT_RGB_SCALE_NONE 0x00000000 -#define NV34TCL_RC_OUT_RGB_SCALE_SCALE_BY_TWO_NV 0x00020000 -#define NV34TCL_RC_OUT_RGB_SCALE_SCALE_BY_FOUR_NV 0x00040000 -#define NV34TCL_RC_OUT_RGB_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000 -#define NV34TCL_VIEWPORT_HORIZ 0x00000a00 -#define NV34TCL_VIEWPORT_HORIZ_X_SHIFT 0 -#define NV34TCL_VIEWPORT_HORIZ_X_MASK 0x0000ffff -#define NV34TCL_VIEWPORT_HORIZ_W_SHIFT 16 -#define NV34TCL_VIEWPORT_HORIZ_W_MASK 0xffff0000 -#define NV34TCL_VIEWPORT_VERT 0x00000a04 -#define NV34TCL_VIEWPORT_VERT_Y_SHIFT 0 -#define NV34TCL_VIEWPORT_VERT_Y_MASK 0x0000ffff -#define NV34TCL_VIEWPORT_VERT_H_SHIFT 16 -#define NV34TCL_VIEWPORT_VERT_H_MASK 0xffff0000 -#define NV34TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x00000a10 -#define NV34TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x00000a14 -#define NV34TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x00000a18 -#define NV34TCL_VIEWPORT_TRANSLATE_X 0x00000a20 -#define NV34TCL_VIEWPORT_TRANSLATE_Y 0x00000a24 -#define NV34TCL_VIEWPORT_TRANSLATE_Z 0x00000a28 -#define NV34TCL_VIEWPORT_TRANSLATE_W 0x00000a2c -#define NV34TCL_VIEWPORT_SCALE_X 0x00000a30 -#define NV34TCL_VIEWPORT_SCALE_Y 0x00000a34 -#define NV34TCL_VIEWPORT_SCALE_Z 0x00000a38 -#define NV34TCL_VIEWPORT_SCALE_W 0x00000a3c -#define NV34TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000a60 -#define NV34TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000a64 -#define NV34TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000a68 -#define NV34TCL_DEPTH_FUNC 0x00000a6c -#define NV34TCL_DEPTH_FUNC_NEVER 0x00000200 -#define NV34TCL_DEPTH_FUNC_LESS 0x00000201 -#define NV34TCL_DEPTH_FUNC_EQUAL 0x00000202 -#define NV34TCL_DEPTH_FUNC_LEQUAL 0x00000203 -#define NV34TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV34TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV34TCL_DEPTH_FUNC_NOTEQUAL 0x00000205 -#define NV34TCL_DEPTH_FUNC_GEQUAL 0x00000206 -#define NV34TCL_DEPTH_FUNC_ALWAYS 0x00000207 -#define NV34TCL_DEPTH_WRITE_ENABLE 0x00000a70 -#define NV34TCL_DEPTH_TEST_ENABLE 0x00000a74 -#define NV34TCL_POLYGON_OFFSET_FACTOR 0x00000a78 -#define NV34TCL_POLYGON_OFFSET_UNITS 0x00000a7c -#define NV34TCL_VTX_ATTR_3I_XY(x) (0x00000a80+((x)*8)) -#define NV34TCL_VTX_ATTR_3I_XY__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_3I_XY_X_SHIFT 0 -#define NV34TCL_VTX_ATTR_3I_XY_X_MASK 0x0000ffff -#define NV34TCL_VTX_ATTR_3I_XY_Y_SHIFT 16 -#define NV34TCL_VTX_ATTR_3I_XY_Y_MASK 0xffff0000 -#define NV34TCL_VTX_ATTR_3I_Z(x) (0x00000a84+((x)*8)) -#define NV34TCL_VTX_ATTR_3I_Z__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_3I_Z_Z_SHIFT 0 -#define NV34TCL_VTX_ATTR_3I_Z_Z_MASK 0x0000ffff -#define NV34TCL_VP_UPLOAD_INST(x) (0x00000b80+((x)*4)) -#define NV34TCL_VP_UPLOAD_INST__SIZE 0x00000004 -#define NV34TCL_TX0_CLIP_PLANE_A(x) (0x00000e00+((x)*16)) -#define NV34TCL_TX0_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX0_CLIP_PLANE_B(x) (0x00000e04+((x)*16)) -#define NV34TCL_TX0_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX0_CLIP_PLANE_C(x) (0x00000e08+((x)*16)) -#define NV34TCL_TX0_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX0_CLIP_PLANE_D(x) (0x00000e0c+((x)*16)) -#define NV34TCL_TX0_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_TX1_CLIP_PLANE_A(x) (0x00000e40+((x)*16)) -#define NV34TCL_TX1_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX1_CLIP_PLANE_B(x) (0x00000e44+((x)*16)) -#define NV34TCL_TX1_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX1_CLIP_PLANE_C(x) (0x00000e48+((x)*16)) -#define NV34TCL_TX1_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX1_CLIP_PLANE_D(x) (0x00000e4c+((x)*16)) -#define NV34TCL_TX1_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_TX2_CLIP_PLANE_A(x) (0x00000e80+((x)*16)) -#define NV34TCL_TX2_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX2_CLIP_PLANE_B(x) (0x00000e84+((x)*16)) -#define NV34TCL_TX2_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX2_CLIP_PLANE_C(x) (0x00000e88+((x)*16)) -#define NV34TCL_TX2_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX2_CLIP_PLANE_D(x) (0x00000e8c+((x)*16)) -#define NV34TCL_TX2_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_TX3_CLIP_PLANE_A(x) (0x00000ec0+((x)*16)) -#define NV34TCL_TX3_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX3_CLIP_PLANE_B(x) (0x00000ec4+((x)*16)) -#define NV34TCL_TX3_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX3_CLIP_PLANE_C(x) (0x00000ec8+((x)*16)) -#define NV34TCL_TX3_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX3_CLIP_PLANE_D(x) (0x00000ecc+((x)*16)) -#define NV34TCL_TX3_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_TX4_CLIP_PLANE_A(x) (0x00000f00+((x)*16)) -#define NV34TCL_TX4_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX4_CLIP_PLANE_B(x) (0x00000f04+((x)*16)) -#define NV34TCL_TX4_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX4_CLIP_PLANE_C(x) (0x00000f08+((x)*16)) -#define NV34TCL_TX4_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX4_CLIP_PLANE_D(x) (0x00000f0c+((x)*16)) -#define NV34TCL_TX4_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_TX5_CLIP_PLANE_A(x) (0x00000f40+((x)*16)) -#define NV34TCL_TX5_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX5_CLIP_PLANE_B(x) (0x00000f44+((x)*16)) -#define NV34TCL_TX5_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX5_CLIP_PLANE_C(x) (0x00000f48+((x)*16)) -#define NV34TCL_TX5_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX5_CLIP_PLANE_D(x) (0x00000f4c+((x)*16)) -#define NV34TCL_TX5_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_TX6_CLIP_PLANE_A(x) (0x00000f80+((x)*16)) -#define NV34TCL_TX6_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX6_CLIP_PLANE_B(x) (0x00000f84+((x)*16)) -#define NV34TCL_TX6_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX6_CLIP_PLANE_C(x) (0x00000f88+((x)*16)) -#define NV34TCL_TX6_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX6_CLIP_PLANE_D(x) (0x00000f8c+((x)*16)) -#define NV34TCL_TX6_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_TX7_CLIP_PLANE_A(x) (0x00000fc0+((x)*16)) -#define NV34TCL_TX7_CLIP_PLANE_A__SIZE 0x00000004 -#define NV34TCL_TX7_CLIP_PLANE_B(x) (0x00000fc4+((x)*16)) -#define NV34TCL_TX7_CLIP_PLANE_B__SIZE 0x00000004 -#define NV34TCL_TX7_CLIP_PLANE_C(x) (0x00000fc8+((x)*16)) -#define NV34TCL_TX7_CLIP_PLANE_C__SIZE 0x00000004 -#define NV34TCL_TX7_CLIP_PLANE_D(x) (0x00000fcc+((x)*16)) -#define NV34TCL_TX7_CLIP_PLANE_D__SIZE 0x00000004 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(x) (0x00001000+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(x) (0x00001004+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(x) (0x00001008+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(x) (0x0000100c+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(x) (0x00001010+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(x) (0x00001014+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(x) (0x00001018+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(x) (0x0000101c+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G__SIZE 0x00000008 -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(x) (0x00001020+((x)*64)) -#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B__SIZE 0x00000008 -#define NV34TCL_LIGHT_HALF_VECTOR_X(x) (0x00001028+((x)*64)) -#define NV34TCL_LIGHT_HALF_VECTOR_X__SIZE 0x00000008 -#define NV34TCL_LIGHT_HALF_VECTOR_Y(x) (0x0000102c+((x)*64)) -#define NV34TCL_LIGHT_HALF_VECTOR_Y__SIZE 0x00000008 -#define NV34TCL_LIGHT_HALF_VECTOR_Z(x) (0x00001030+((x)*64)) -#define NV34TCL_LIGHT_HALF_VECTOR_Z__SIZE 0x00000008 -#define NV34TCL_LIGHT_DIRECTION_X(x) (0x00001034+((x)*64)) -#define NV34TCL_LIGHT_DIRECTION_X__SIZE 0x00000008 -#define NV34TCL_LIGHT_DIRECTION_Y(x) (0x00001038+((x)*64)) -#define NV34TCL_LIGHT_DIRECTION_Y__SIZE 0x00000008 -#define NV34TCL_LIGHT_DIRECTION_Z(x) (0x0000103c+((x)*64)) -#define NV34TCL_LIGHT_DIRECTION_Z__SIZE 0x00000008 -#define NV34TCL_LIGHT_SPOT_CUTOFF_A(x) (0x00001200+((x)*64)) -#define NV34TCL_LIGHT_SPOT_CUTOFF_A__SIZE 0x00000008 -#define NV34TCL_LIGHT_SPOT_CUTOFF_B(x) (0x00001204+((x)*64)) -#define NV34TCL_LIGHT_SPOT_CUTOFF_B__SIZE 0x00000008 -#define NV34TCL_LIGHT_SPOT_CUTOFF_C(x) (0x00001208+((x)*64)) -#define NV34TCL_LIGHT_SPOT_CUTOFF_C__SIZE 0x00000008 -#define NV34TCL_LIGHT_SPOT_DIR_X(x) (0x0000120c+((x)*64)) -#define NV34TCL_LIGHT_SPOT_DIR_X__SIZE 0x00000008 -#define NV34TCL_LIGHT_SPOT_DIR_Y(x) (0x00001210+((x)*64)) -#define NV34TCL_LIGHT_SPOT_DIR_Y__SIZE 0x00000008 -#define NV34TCL_LIGHT_SPOT_DIR_Z(x) (0x00001214+((x)*64)) -#define NV34TCL_LIGHT_SPOT_DIR_Z__SIZE 0x00000008 -#define NV34TCL_LIGHT_SPOT_CUTOFF_D(x) (0x00001218+((x)*64)) -#define NV34TCL_LIGHT_SPOT_CUTOFF_D__SIZE 0x00000008 -#define NV34TCL_LIGHT_POSITION_X(x) (0x0000121c+((x)*64)) -#define NV34TCL_LIGHT_POSITION_X__SIZE 0x00000008 -#define NV34TCL_LIGHT_POSITION_Y(x) (0x00001220+((x)*64)) -#define NV34TCL_LIGHT_POSITION_Y__SIZE 0x00000008 -#define NV34TCL_LIGHT_POSITION_Z(x) (0x00001224+((x)*64)) -#define NV34TCL_LIGHT_POSITION_Z__SIZE 0x00000008 -#define NV34TCL_LIGHT_ATTENUATION_CONSTANT(x) (0x00001228+((x)*64)) -#define NV34TCL_LIGHT_ATTENUATION_CONSTANT__SIZE 0x00000008 -#define NV34TCL_LIGHT_ATTENUATION_LINEAR(x) (0x0000122c+((x)*64)) -#define NV34TCL_LIGHT_ATTENUATION_LINEAR__SIZE 0x00000008 -#define NV34TCL_LIGHT_ATTENUATION_QUADRATIC(x) (0x00001230+((x)*64)) -#define NV34TCL_LIGHT_ATTENUATION_QUADRATIC__SIZE 0x00000008 -#define NV34TCL_FRONT_MATERIAL_SHININESS(x) (0x00001400+((x)*4)) -#define NV34TCL_FRONT_MATERIAL_SHININESS__SIZE 0x00000006 -#define NV34TCL_ENABLED_LIGHTS 0x00001420 -#define NV34TCL_FP_REG_CONTROL 0x00001450 -#define NV34TCL_FP_REG_CONTROL_UNK1_SHIFT 16 -#define NV34TCL_FP_REG_CONTROL_UNK1_MASK 0xffff0000 -#define NV34TCL_FP_REG_CONTROL_UNK0_SHIFT 0 -#define NV34TCL_FP_REG_CONTROL_UNK0_MASK 0x0000ffff -#define NV34TCL_VP_CLIP_PLANES_ENABLE 0x00001478 -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE0 (1 << 1) -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE1 (1 << 5) -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE2 (1 << 9) -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE3 (1 << 13) -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE4 (1 << 17) -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE5 (1 << 21) -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE6 (1 << 25) -#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE7 (1 << 29) -#define NV34TCL_POLYGON_STIPPLE_ENABLE 0x0000147c -#define NV34TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001480+((x)*4)) -#define NV34TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020 -#define NV34TCL_VTX_ATTR_3F_X(x) (0x00001500+((x)*16)) -#define NV34TCL_VTX_ATTR_3F_X__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_3F_Y(x) (0x00001504+((x)*16)) -#define NV34TCL_VTX_ATTR_3F_Y__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_3F_Z(x) (0x00001508+((x)*16)) -#define NV34TCL_VTX_ATTR_3F_Z__SIZE 0x00000010 -#define NV34TCL_VP_CLIP_PLANE_A(x) (0x00001600+((x)*16)) -#define NV34TCL_VP_CLIP_PLANE_A__SIZE 0x00000006 -#define NV34TCL_VP_CLIP_PLANE_B(x) (0x00001604+((x)*16)) -#define NV34TCL_VP_CLIP_PLANE_B__SIZE 0x00000006 -#define NV34TCL_VP_CLIP_PLANE_C(x) (0x00001608+((x)*16)) -#define NV34TCL_VP_CLIP_PLANE_C__SIZE 0x00000006 -#define NV34TCL_VP_CLIP_PLANE_D(x) (0x0000160c+((x)*16)) -#define NV34TCL_VP_CLIP_PLANE_D__SIZE 0x00000006 -#define NV34TCL_VTXBUF_ADDRESS(x) (0x00001680+((x)*4)) -#define NV34TCL_VTXBUF_ADDRESS__SIZE 0x00000010 -#define NV34TCL_VTXBUF_ADDRESS_DMA1 (1 << 31) -#define NV34TCL_VTXBUF_ADDRESS_OFFSET_SHIFT 0 -#define NV34TCL_VTXBUF_ADDRESS_OFFSET_MASK 0x0fffffff -#define NV34TCL_VTXFMT(x) (0x00001740+((x)*4)) -#define NV34TCL_VTXFMT__SIZE 0x00000010 -#define NV34TCL_VTXFMT_TYPE_SHIFT 0 -#define NV34TCL_VTXFMT_TYPE_MASK 0x0000000f -#define NV34TCL_VTXFMT_TYPE_FLOAT 0x00000002 -#define NV34TCL_VTXFMT_TYPE_UBYTE 0x00000004 -#define NV34TCL_VTXFMT_TYPE_USHORT 0x00000005 -#define NV34TCL_VTXFMT_SIZE_SHIFT 4 -#define NV34TCL_VTXFMT_SIZE_MASK 0x000000f0 -#define NV34TCL_VTXFMT_STRIDE_SHIFT 8 -#define NV34TCL_VTXFMT_STRIDE_MASK 0x0000ff00 -#define NV34TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000017a0 -#define NV34TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000017a4 -#define NV34TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000017a8 -#define NV34TCL_COLOR_MATERIAL_BACK_R 0x000017b0 -#define NV34TCL_COLOR_MATERIAL_BACK_G 0x000017b4 -#define NV34TCL_COLOR_MATERIAL_BACK_B 0x000017b8 -#define NV34TCL_COLOR_MATERIAL_BACK_A 0x000017c0 -#define NV34TCL_QUERY_RESET 0x000017c8 -#define NV34TCL_QUERY_UNK17CC 0x000017cc -#define NV34TCL_QUERY_GET 0x00001800 -#define NV34TCL_QUERY_GET_UNK24_SHIFT 24 -#define NV34TCL_QUERY_GET_UNK24_MASK 0xff000000 -#define NV34TCL_QUERY_GET_OFFSET_SHIFT 0 -#define NV34TCL_QUERY_GET_OFFSET_MASK 0x00ffffff -#define NV34TCL_VERTEX_BEGIN_END 0x00001808 -#define NV34TCL_VERTEX_BEGIN_END_STOP 0x00000000 -#define NV34TCL_VERTEX_BEGIN_END_POINTS 0x00000001 -#define NV34TCL_VERTEX_BEGIN_END_LINES 0x00000002 -#define NV34TCL_VERTEX_BEGIN_END_LINE_LOOP 0x00000003 -#define NV34TCL_VERTEX_BEGIN_END_LINE_STRIP 0x00000004 -#define NV34TCL_VERTEX_BEGIN_END_TRIANGLES 0x00000005 -#define NV34TCL_VERTEX_BEGIN_END_TRIANGLE_STRIP 0x00000006 -#define NV34TCL_VERTEX_BEGIN_END_TRIANGLE_FAN 0x00000007 -#define NV34TCL_VERTEX_BEGIN_END_QUADS 0x00000008 -#define NV34TCL_VERTEX_BEGIN_END_QUAD_STRIP 0x00000009 -#define NV34TCL_VERTEX_BEGIN_END_POLYGON 0x0000000a -#define NV34TCL_VB_ELEMENT_U16 0x0000180c -#define NV34TCL_VB_ELEMENT_U16_I0_SHIFT 0 -#define NV34TCL_VB_ELEMENT_U16_I0_MASK 0x0000ffff -#define NV34TCL_VB_ELEMENT_U16_I1_SHIFT 16 -#define NV34TCL_VB_ELEMENT_U16_I1_MASK 0xffff0000 -#define NV34TCL_VB_ELEMENT_U32 0x00001810 -#define NV34TCL_VB_VERTEX_BATCH 0x00001814 -#define NV34TCL_VB_VERTEX_BATCH_OFFSET_SHIFT 0 -#define NV34TCL_VB_VERTEX_BATCH_OFFSET_MASK 0x00ffffff -#define NV34TCL_VB_VERTEX_BATCH_COUNT_SHIFT 24 -#define NV34TCL_VB_VERTEX_BATCH_COUNT_MASK 0xff000000 -#define NV34TCL_VERTEX_DATA 0x00001818 -#define NV34TCL_IDXBUF_ADDRESS 0x0000181c -#define NV34TCL_IDXBUF_FORMAT 0x00001820 -#define NV34TCL_IDXBUF_FORMAT_TYPE_SHIFT 4 -#define NV34TCL_IDXBUF_FORMAT_TYPE_MASK 0x000000f0 -#define NV34TCL_IDXBUF_FORMAT_TYPE_U32 0x00000000 -#define NV34TCL_IDXBUF_FORMAT_TYPE_U16 0x00000010 -#define NV34TCL_IDXBUF_FORMAT_DMA1 (1 << 0) -#define NV34TCL_VB_INDEX_BATCH 0x00001824 -#define NV34TCL_VB_INDEX_BATCH_COUNT_SHIFT 24 -#define NV34TCL_VB_INDEX_BATCH_COUNT_MASK 0xff000000 -#define NV34TCL_VB_INDEX_BATCH_START_SHIFT 0 -#define NV34TCL_VB_INDEX_BATCH_START_MASK 0x00ffffff -#define NV34TCL_POLYGON_MODE_FRONT 0x00001828 -#define NV34TCL_POLYGON_MODE_FRONT_POINT 0x00001b00 -#define NV34TCL_POLYGON_MODE_FRONT_LINE 0x00001b01 -#define NV34TCL_POLYGON_MODE_FRONT_FILL 0x00001b02 -#define NV34TCL_POLYGON_MODE_BACK 0x0000182c -#define NV34TCL_POLYGON_MODE_BACK_POINT 0x00001b00 -#define NV34TCL_POLYGON_MODE_BACK_LINE 0x00001b01 -#define NV34TCL_POLYGON_MODE_BACK_FILL 0x00001b02 -#define NV34TCL_CULL_FACE 0x00001830 -#define NV34TCL_CULL_FACE_FRONT 0x00000404 -#define NV34TCL_CULL_FACE_BACK 0x00000405 -#define NV34TCL_CULL_FACE_FRONT_AND_BACK 0x00000408 -#define NV34TCL_FRONT_FACE 0x00001834 -#define NV34TCL_FRONT_FACE_CW 0x00000900 -#define NV34TCL_FRONT_FACE_CCW 0x00000901 -#define NV34TCL_POLYGON_SMOOTH_ENABLE 0x00001838 -#define NV34TCL_CULL_FACE_ENABLE 0x0000183c -#define NV34TCL_TX_PALETTE_OFFSET(x) (0x00001840+((x)*4)) -#define NV34TCL_TX_PALETTE_OFFSET__SIZE 0x00000004 -#define NV34TCL_VTX_ATTR_2F_X(x) (0x00001880+((x)*8)) -#define NV34TCL_VTX_ATTR_2F_X__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_2F_Y(x) (0x00001884+((x)*8)) -#define NV34TCL_VTX_ATTR_2F_Y__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_2I(x) (0x00001900+((x)*4)) -#define NV34TCL_VTX_ATTR_2I__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_2I_X_SHIFT 0 -#define NV34TCL_VTX_ATTR_2I_X_MASK 0x0000ffff -#define NV34TCL_VTX_ATTR_2I_Y_SHIFT 16 -#define NV34TCL_VTX_ATTR_2I_Y_MASK 0xffff0000 -#define NV34TCL_VTX_ATTR_4UB(x) (0x00001940+((x)*4)) -#define NV34TCL_VTX_ATTR_4UB__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_4UB_X_SHIFT 0 -#define NV34TCL_VTX_ATTR_4UB_X_MASK 0x000000ff -#define NV34TCL_VTX_ATTR_4UB_Y_SHIFT 8 -#define NV34TCL_VTX_ATTR_4UB_Y_MASK 0x0000ff00 -#define NV34TCL_VTX_ATTR_4UB_Z_SHIFT 16 -#define NV34TCL_VTX_ATTR_4UB_Z_MASK 0x00ff0000 -#define NV34TCL_VTX_ATTR_4UB_W_SHIFT 24 -#define NV34TCL_VTX_ATTR_4UB_W_MASK 0xff000000 -#define NV34TCL_VTX_ATTR_4I_XY(x) (0x00001980+((x)*8)) -#define NV34TCL_VTX_ATTR_4I_XY__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_4I_XY_X_SHIFT 0 -#define NV34TCL_VTX_ATTR_4I_XY_X_MASK 0x0000ffff -#define NV34TCL_VTX_ATTR_4I_XY_Y_SHIFT 16 -#define NV34TCL_VTX_ATTR_4I_XY_Y_MASK 0xffff0000 -#define NV34TCL_VTX_ATTR_4I_ZW(x) (0x00001984+((x)*8)) -#define NV34TCL_VTX_ATTR_4I_ZW__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_4I_ZW_Z_SHIFT 0 -#define NV34TCL_VTX_ATTR_4I_ZW_Z_MASK 0x0000ffff -#define NV34TCL_VTX_ATTR_4I_ZW_W_SHIFT 16 -#define NV34TCL_VTX_ATTR_4I_ZW_W_MASK 0xffff0000 -#define NV34TCL_TX_OFFSET(x) (0x00001a00+((x)*32)) -#define NV34TCL_TX_OFFSET__SIZE 0x00000004 -#define NV34TCL_TX_FORMAT(x) (0x00001a04+((x)*32)) -#define NV34TCL_TX_FORMAT__SIZE 0x00000004 -#define NV34TCL_TX_FORMAT_DMA0 (1 << 0) -#define NV34TCL_TX_FORMAT_DMA1 (1 << 1) -#define NV34TCL_TX_FORMAT_CUBIC (1 << 2) -#define NV34TCL_TX_FORMAT_NO_BORDER (1 << 3) -#define NV34TCL_TX_FORMAT_DIMS_SHIFT 4 -#define NV34TCL_TX_FORMAT_DIMS_MASK 0x000000f0 -#define NV34TCL_TX_FORMAT_DIMS_1D 0x00000010 -#define NV34TCL_TX_FORMAT_DIMS_2D 0x00000020 -#define NV34TCL_TX_FORMAT_DIMS_3D 0x00000030 -#define NV34TCL_TX_FORMAT_FORMAT_SHIFT 8 -#define NV34TCL_TX_FORMAT_FORMAT_MASK 0x0000ff00 -#define NV34TCL_TX_FORMAT_FORMAT_L8 0x00000000 -#define NV34TCL_TX_FORMAT_FORMAT_A8 0x00000100 -#define NV34TCL_TX_FORMAT_FORMAT_A1R5G5B5 0x00000200 -#define NV34TCL_TX_FORMAT_FORMAT_A8_RECT 0x00000300 -#define NV34TCL_TX_FORMAT_FORMAT_A4R4G4B4 0x00000400 -#define NV34TCL_TX_FORMAT_FORMAT_R5G6B5 0x00000500 -#define NV34TCL_TX_FORMAT_FORMAT_A8R8G8B8 0x00000600 -#define NV34TCL_TX_FORMAT_FORMAT_X8R8G8B8 0x00000700 -#define NV34TCL_TX_FORMAT_FORMAT_INDEX8 0x00000b00 -#define NV34TCL_TX_FORMAT_FORMAT_DXT1 0x00000c00 -#define NV34TCL_TX_FORMAT_FORMAT_DXT3 0x00000e00 -#define NV34TCL_TX_FORMAT_FORMAT_DXT5 0x00000f00 -#define NV34TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT 0x00001000 -#define NV34TCL_TX_FORMAT_FORMAT_R5G6B5_RECT 0x00001100 -#define NV34TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT 0x00001200 -#define NV34TCL_TX_FORMAT_FORMAT_L8_RECT 0x00001300 -#define NV34TCL_TX_FORMAT_FORMAT_A8L8 0x00001a00 -#define NV34TCL_TX_FORMAT_FORMAT_A8_RECT2 0x00001b00 -#define NV34TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT 0x00001d00 -#define NV34TCL_TX_FORMAT_FORMAT_R8G8B8_RECT 0x00001e00 -#define NV34TCL_TX_FORMAT_FORMAT_L8A8_RECT 0x00002000 -#define NV34TCL_TX_FORMAT_FORMAT_DSDT 0x00002800 -#define NV34TCL_TX_FORMAT_FORMAT_A16 0x00003200 -#define NV34TCL_TX_FORMAT_FORMAT_HILO16 0x00003300 -#define NV34TCL_TX_FORMAT_FORMAT_A16_RECT 0x00003500 -#define NV34TCL_TX_FORMAT_FORMAT_HILO16_RECT 0x00003600 -#define NV34TCL_TX_FORMAT_FORMAT_HILO8 0x00004400 -#define NV34TCL_TX_FORMAT_FORMAT_SIGNED_HILO8 0x00004500 -#define NV34TCL_TX_FORMAT_FORMAT_HILO8_RECT 0x00004600 -#define NV34TCL_TX_FORMAT_FORMAT_SIGNED_HILO8_RECT 0x00004700 -#define NV34TCL_TX_FORMAT_FORMAT_FLOAT_RGBA16_NV 0x00004a00 -#define NV34TCL_TX_FORMAT_FORMAT_FLOAT_RGBA32_NV 0x00004b00 -#define NV34TCL_TX_FORMAT_FORMAT_FLOAT_R32_NV 0x00004c00 -#define NV34TCL_TX_FORMAT_MIPMAP (1 << 19) -#define NV34TCL_TX_FORMAT_BASE_SIZE_U_SHIFT 20 -#define NV34TCL_TX_FORMAT_BASE_SIZE_U_MASK 0x00f00000 -#define NV34TCL_TX_FORMAT_BASE_SIZE_V_SHIFT 24 -#define NV34TCL_TX_FORMAT_BASE_SIZE_V_MASK 0x0f000000 -#define NV34TCL_TX_FORMAT_BASE_SIZE_W_SHIFT 28 -#define NV34TCL_TX_FORMAT_BASE_SIZE_W_MASK 0xf0000000 -#define NV34TCL_TX_WRAP(x) (0x00001a08+((x)*32)) -#define NV34TCL_TX_WRAP__SIZE 0x00000004 -#define NV34TCL_TX_WRAP_S_SHIFT 0 -#define NV34TCL_TX_WRAP_S_MASK 0x000000ff -#define NV34TCL_TX_WRAP_S_REPEAT 0x00000001 -#define NV34TCL_TX_WRAP_S_MIRRORED_REPEAT 0x00000002 -#define NV34TCL_TX_WRAP_S_CLAMP_TO_EDGE 0x00000003 -#define NV34TCL_TX_WRAP_S_CLAMP_TO_BORDER 0x00000004 -#define NV34TCL_TX_WRAP_S_CLAMP 0x00000005 -#define NV34TCL_TX_WRAP_T_SHIFT 8 -#define NV34TCL_TX_WRAP_T_MASK 0x00000f00 -#define NV34TCL_TX_WRAP_T_REPEAT 0x00000100 -#define NV34TCL_TX_WRAP_T_MIRRORED_REPEAT 0x00000200 -#define NV34TCL_TX_WRAP_T_CLAMP_TO_EDGE 0x00000300 -#define NV34TCL_TX_WRAP_T_CLAMP_TO_BORDER 0x00000400 -#define NV34TCL_TX_WRAP_T_CLAMP 0x00000500 -#define NV34TCL_TX_WRAP_EXPAND_NORMAL_SHIFT 12 -#define NV34TCL_TX_WRAP_EXPAND_NORMAL_MASK 0x0000f000 -#define NV34TCL_TX_WRAP_R_SHIFT 16 -#define NV34TCL_TX_WRAP_R_MASK 0x000f0000 -#define NV34TCL_TX_WRAP_R_REPEAT 0x00010000 -#define NV34TCL_TX_WRAP_R_MIRRORED_REPEAT 0x00020000 -#define NV34TCL_TX_WRAP_R_CLAMP_TO_EDGE 0x00030000 -#define NV34TCL_TX_WRAP_R_CLAMP_TO_BORDER 0x00040000 -#define NV34TCL_TX_WRAP_R_CLAMP 0x00050000 -#define NV34TCL_TX_WRAP_RCOMP_SHIFT 28 -#define NV34TCL_TX_WRAP_RCOMP_MASK 0xf0000000 -#define NV34TCL_TX_WRAP_RCOMP_NEVER 0x00000000 -#define NV34TCL_TX_WRAP_RCOMP_GREATER 0x10000000 -#define NV34TCL_TX_WRAP_RCOMP_EQUAL 0x20000000 -#define NV34TCL_TX_WRAP_RCOMP_GEQUAL 0x30000000 -#define NV34TCL_TX_WRAP_RCOMP_LESS 0x40000000 -#define NV34TCL_TX_WRAP_RCOMP_NOTEQUAL 0x50000000 -#define NV34TCL_TX_WRAP_RCOMP_LEQUAL 0x60000000 -#define NV34TCL_TX_WRAP_RCOMP_ALWAYS 0x70000000 -#define NV34TCL_TX_ENABLE(x) (0x00001a0c+((x)*32)) -#define NV34TCL_TX_ENABLE__SIZE 0x00000004 -#define NV34TCL_TX_ENABLE_ANISO_SHIFT 4 -#define NV34TCL_TX_ENABLE_ANISO_MASK 0x00000030 -#define NV34TCL_TX_ENABLE_ANISO_NONE 0x00000000 -#define NV34TCL_TX_ENABLE_ANISO_2X 0x00000010 -#define NV34TCL_TX_ENABLE_ANISO_4X 0x00000020 -#define NV34TCL_TX_ENABLE_ANISO_8X 0x00000030 -#define NV34TCL_TX_ENABLE_MIPMAP_MAX_LOD_SHIFT 14 -#define NV34TCL_TX_ENABLE_MIPMAP_MAX_LOD_MASK 0x0003c000 -#define NV34TCL_TX_ENABLE_MIPMAP_MIN_LOD_SHIFT 26 -#define NV34TCL_TX_ENABLE_MIPMAP_MIN_LOD_MASK 0x3c000000 -#define NV34TCL_TX_ENABLE_ENABLE (1 << 30) -#define NV34TCL_TX_SWIZZLE(x) (0x00001a10+((x)*32)) -#define NV34TCL_TX_SWIZZLE__SIZE 0x00000004 -#define NV34TCL_TX_SWIZZLE_S0_X_SHIFT 14 -#define NV34TCL_TX_SWIZZLE_S0_X_MASK 0x0000c000 -#define NV34TCL_TX_SWIZZLE_S0_X_ZERO 0x00000000 -#define NV34TCL_TX_SWIZZLE_S0_X_ONE 0x00004000 -#define NV34TCL_TX_SWIZZLE_S0_X_S1 0x00008000 -#define NV34TCL_TX_SWIZZLE_S0_Y_SHIFT 12 -#define NV34TCL_TX_SWIZZLE_S0_Y_MASK 0x00003000 -#define NV34TCL_TX_SWIZZLE_S0_Y_ZERO 0x00000000 -#define NV34TCL_TX_SWIZZLE_S0_Y_ONE 0x00001000 -#define NV34TCL_TX_SWIZZLE_S0_Y_S1 0x00002000 -#define NV34TCL_TX_SWIZZLE_S0_Z_SHIFT 10 -#define NV34TCL_TX_SWIZZLE_S0_Z_MASK 0x00000c00 -#define NV34TCL_TX_SWIZZLE_S0_Z_ZERO 0x00000000 -#define NV34TCL_TX_SWIZZLE_S0_Z_ONE 0x00000400 -#define NV34TCL_TX_SWIZZLE_S0_Z_S1 0x00000800 -#define NV34TCL_TX_SWIZZLE_S0_W_SHIFT 8 -#define NV34TCL_TX_SWIZZLE_S0_W_MASK 0x00000300 -#define NV34TCL_TX_SWIZZLE_S0_W_ZERO 0x00000000 -#define NV34TCL_TX_SWIZZLE_S0_W_ONE 0x00000100 -#define NV34TCL_TX_SWIZZLE_S0_W_S1 0x00000200 -#define NV34TCL_TX_SWIZZLE_S1_X_SHIFT 6 -#define NV34TCL_TX_SWIZZLE_S1_X_MASK 0x000000c0 -#define NV34TCL_TX_SWIZZLE_S1_X_W 0x00000000 -#define NV34TCL_TX_SWIZZLE_S1_X_Z 0x00000040 -#define NV34TCL_TX_SWIZZLE_S1_X_Y 0x00000080 -#define NV34TCL_TX_SWIZZLE_S1_X_X 0x000000c0 -#define NV34TCL_TX_SWIZZLE_S1_Y_SHIFT 4 -#define NV34TCL_TX_SWIZZLE_S1_Y_MASK 0x00000030 -#define NV34TCL_TX_SWIZZLE_S1_Y_W 0x00000000 -#define NV34TCL_TX_SWIZZLE_S1_Y_Z 0x00000010 -#define NV34TCL_TX_SWIZZLE_S1_Y_Y 0x00000020 -#define NV34TCL_TX_SWIZZLE_S1_Y_X 0x00000030 -#define NV34TCL_TX_SWIZZLE_S1_Z_SHIFT 2 -#define NV34TCL_TX_SWIZZLE_S1_Z_MASK 0x0000000c -#define NV34TCL_TX_SWIZZLE_S1_Z_W 0x00000000 -#define NV34TCL_TX_SWIZZLE_S1_Z_Z 0x00000004 -#define NV34TCL_TX_SWIZZLE_S1_Z_Y 0x00000008 -#define NV34TCL_TX_SWIZZLE_S1_Z_X 0x0000000c -#define NV34TCL_TX_SWIZZLE_S1_W_SHIFT 0 -#define NV34TCL_TX_SWIZZLE_S1_W_MASK 0x00000003 -#define NV34TCL_TX_SWIZZLE_S1_W_W 0x00000000 -#define NV34TCL_TX_SWIZZLE_S1_W_Z 0x00000001 -#define NV34TCL_TX_SWIZZLE_S1_W_Y 0x00000002 -#define NV34TCL_TX_SWIZZLE_S1_W_X 0x00000003 -#define NV34TCL_TX_SWIZZLE_RECT_PITCH_SHIFT 16 -#define NV34TCL_TX_SWIZZLE_RECT_PITCH_MASK 0xffff0000 -#define NV34TCL_TX_FILTER(x) (0x00001a14+((x)*32)) -#define NV34TCL_TX_FILTER__SIZE 0x00000004 -#define NV34TCL_TX_FILTER_LOD_BIAS_SHIFT 8 -#define NV34TCL_TX_FILTER_LOD_BIAS_MASK 0x00000f00 -#define NV34TCL_TX_FILTER_MINIFY_SHIFT 16 -#define NV34TCL_TX_FILTER_MINIFY_MASK 0x000f0000 -#define NV34TCL_TX_FILTER_MINIFY_NEAREST 0x00010000 -#define NV34TCL_TX_FILTER_MINIFY_LINEAR 0x00020000 -#define NV34TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x00030000 -#define NV34TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x00040000 -#define NV34TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x00050000 -#define NV34TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x00060000 -#define NV34TCL_TX_FILTER_MAGNIFY_SHIFT 24 -#define NV34TCL_TX_FILTER_MAGNIFY_MASK 0x0f000000 -#define NV34TCL_TX_FILTER_MAGNIFY_NEAREST 0x01000000 -#define NV34TCL_TX_FILTER_MAGNIFY_LINEAR 0x02000000 -#define NV34TCL_TX_FILTER_SIGNED_BLUE (1 << 28) -#define NV34TCL_TX_FILTER_SIGNED_GREEN (1 << 29) -#define NV34TCL_TX_FILTER_SIGNED_RED (1 << 30) -#define NV34TCL_TX_FILTER_SIGNED_ALPHA (1 << 31) -#define NV34TCL_TX_NPOT_SIZE(x) (0x00001a18+((x)*32)) -#define NV34TCL_TX_NPOT_SIZE__SIZE 0x00000004 -#define NV34TCL_TX_NPOT_SIZE_H_SHIFT 0 -#define NV34TCL_TX_NPOT_SIZE_H_MASK 0x0000ffff -#define NV34TCL_TX_NPOT_SIZE_W_SHIFT 16 -#define NV34TCL_TX_NPOT_SIZE_W_MASK 0xffff0000 -#define NV34TCL_TX_BORDER_COLOR(x) (0x00001a1c+((x)*32)) -#define NV34TCL_TX_BORDER_COLOR__SIZE 0x00000004 -#define NV34TCL_TX_BORDER_COLOR_B_SHIFT 0 -#define NV34TCL_TX_BORDER_COLOR_B_MASK 0x000000ff -#define NV34TCL_TX_BORDER_COLOR_G_SHIFT 8 -#define NV34TCL_TX_BORDER_COLOR_G_MASK 0x0000ff00 -#define NV34TCL_TX_BORDER_COLOR_R_SHIFT 16 -#define NV34TCL_TX_BORDER_COLOR_R_MASK 0x00ff0000 -#define NV34TCL_TX_BORDER_COLOR_A_SHIFT 24 -#define NV34TCL_TX_BORDER_COLOR_A_MASK 0xff000000 -#define NV34TCL_VTX_ATTR_4F_X(x) (0x00001c00+((x)*16)) -#define NV34TCL_VTX_ATTR_4F_X__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_4F_Y(x) (0x00001c04+((x)*16)) -#define NV34TCL_VTX_ATTR_4F_Y__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_4F_Z(x) (0x00001c08+((x)*16)) -#define NV34TCL_VTX_ATTR_4F_Z__SIZE 0x00000010 -#define NV34TCL_VTX_ATTR_4F_W(x) (0x00001c0c+((x)*16)) -#define NV34TCL_VTX_ATTR_4F_W__SIZE 0x00000010 -#define NV34TCL_FP_CONTROL 0x00001d60 -#define NV34TCL_FP_CONTROL_USES_KIL (1 << 7) -#define NV34TCL_FP_CONTROL_USED_REGS_MINUS1_DIV2_SHIFT 0 -#define NV34TCL_FP_CONTROL_USED_REGS_MINUS1_DIV2_MASK 0x0000000f -#define NV34TCL_DEPTH_UNK17D8 0x00001d78 -#define NV34TCL_DEPTH_UNK17D8_CLAMP_SHIFT 4 -#define NV34TCL_DEPTH_UNK17D8_CLAMP_MASK 0x000000f0 -#define NV34TCL_MULTISAMPLE_CONTROL 0x00001d7c -#define NV34TCL_MULTISAMPLE_CONTROL_ENABLE (1 << 0) -#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_ALPHA_TO_COVERAGE (1 << 4) -#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_ALPHA_TO_ONE (1 << 8) -#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_COVERAGE_SHIFT 16 -#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_COVERAGE_MASK 0xffff0000 -#define NV34TCL_CLEAR_DEPTH_VALUE 0x00001d8c -#define NV34TCL_CLEAR_COLOR_VALUE 0x00001d90 -#define NV34TCL_CLEAR_COLOR_VALUE_B_SHIFT 0 -#define NV34TCL_CLEAR_COLOR_VALUE_B_MASK 0x000000ff -#define NV34TCL_CLEAR_COLOR_VALUE_G_SHIFT 8 -#define NV34TCL_CLEAR_COLOR_VALUE_G_MASK 0x0000ff00 -#define NV34TCL_CLEAR_COLOR_VALUE_R_SHIFT 16 -#define NV34TCL_CLEAR_COLOR_VALUE_R_MASK 0x00ff0000 -#define NV34TCL_CLEAR_COLOR_VALUE_A_SHIFT 24 -#define NV34TCL_CLEAR_COLOR_VALUE_A_MASK 0xff000000 -#define NV34TCL_CLEAR_BUFFERS 0x00001d94 -#define NV34TCL_CLEAR_BUFFERS_COLOR_A (1 << 7) -#define NV34TCL_CLEAR_BUFFERS_COLOR_B (1 << 6) -#define NV34TCL_CLEAR_BUFFERS_COLOR_G (1 << 5) -#define NV34TCL_CLEAR_BUFFERS_COLOR_R (1 << 4) -#define NV34TCL_CLEAR_BUFFERS_STENCIL (1 << 1) -#define NV34TCL_CLEAR_BUFFERS_DEPTH (1 << 0) -#define NV34TCL_DO_VERTICES 0x00001dac -#define NV34TCL_LINE_STIPPLE_ENABLE 0x00001db4 -#define NV34TCL_LINE_STIPPLE_PATTERN 0x00001db8 -#define NV34TCL_LINE_STIPPLE_PATTERN_FACTOR_SHIFT 0 -#define NV34TCL_LINE_STIPPLE_PATTERN_FACTOR_MASK 0x0000ffff -#define NV34TCL_LINE_STIPPLE_PATTERN_PATTERN_SHIFT 16 -#define NV34TCL_LINE_STIPPLE_PATTERN_PATTERN_MASK 0xffff0000 -#define NV34TCL_BACK_MATERIAL_SHININESS(x) (0x00001e20+((x)*4)) -#define NV34TCL_BACK_MATERIAL_SHININESS__SIZE 0x00000006 -#define NV34TCL_VTX_ATTR_1F(x) (0x00001e40+((x)*4)) -#define NV34TCL_VTX_ATTR_1F__SIZE 0x00000010 -#define NV34TCL_ENGINE 0x00001e94 -#define NV34TCL_ENGINE_FP (1 << 0) -#define NV34TCL_ENGINE_VP (1 << 1) -#define NV34TCL_ENGINE_FIXED (1 << 2) -#define NV34TCL_VP_UPLOAD_FROM_ID 0x00001e9c -#define NV34TCL_VP_START_FROM_ID 0x00001ea0 -#define NV34TCL_POINT_PARAMETERS(x) (0x00001ec0+((x)*4)) -#define NV34TCL_POINT_PARAMETERS__SIZE 0x00000008 -#define NV34TCL_POINT_SIZE 0x00001ee0 -#define NV34TCL_POINT_PARAMETERS_ENABLE 0x00001ee4 -#define NV34TCL_POINT_SPRITE 0x00001ee8 -#define NV34TCL_POINT_SPRITE_ENABLE (1 << 0) -#define NV34TCL_POINT_SPRITE_R_MODE_SHIFT 1 -#define NV34TCL_POINT_SPRITE_R_MODE_MASK 0x00000006 -#define NV34TCL_POINT_SPRITE_R_MODE_ZERO 0x00000000 -#define NV34TCL_POINT_SPRITE_R_MODE_R 0x00000002 -#define NV34TCL_POINT_SPRITE_R_MODE_S 0x00000004 -#define NV34TCL_POINT_SPRITE_COORD_REPLACE (1 << 11) -#define NV34TCL_VP_UPLOAD_CONST_ID 0x00001efc -#define NV34TCL_VP_UPLOAD_CONST_X(x) (0x00001f00+((x)*16)) -#define NV34TCL_VP_UPLOAD_CONST_X__SIZE 0x00000004 -#define NV34TCL_VP_UPLOAD_CONST_Y(x) (0x00001f04+((x)*16)) -#define NV34TCL_VP_UPLOAD_CONST_Y__SIZE 0x00000004 -#define NV34TCL_VP_UPLOAD_CONST_Z(x) (0x00001f08+((x)*16)) -#define NV34TCL_VP_UPLOAD_CONST_Z__SIZE 0x00000004 -#define NV34TCL_VP_UPLOAD_CONST_W(x) (0x00001f0c+((x)*16)) -#define NV34TCL_VP_UPLOAD_CONST_W__SIZE 0x00000004 -#define NV34TCL_UNK1f80(x) (0x00001f80+((x)*4)) -#define NV34TCL_UNK1f80__SIZE 0x00000010 - - -#define NV40_CONTEXT_SURFACES_2D 0x00003062 - - - -#define NV40_STRETCHED_IMAGE_FROM_CPU 0x00003066 - - - -#define NV40_TEXTURE_FROM_CPU 0x0000307b - - - -#define NV40_SCALED_IMAGE_FROM_MEMORY 0x00003089 - - - -#define NV40_IMAGE_FROM_CPU 0x0000308a - - - -#define NV40_SWIZZLED_SURFACE 0x0000309e - - - -#define NV40TCL 0x00004097 - -#define NV40TCL_REF_CNT 0x00000050 -#define NV40TCL_NOP 0x00000100 -#define NV40TCL_NOTIFY 0x00000104 -#define NV40TCL_DMA_NOTIFY 0x00000180 -#define NV40TCL_DMA_TEXTURE0 0x00000184 -#define NV40TCL_DMA_TEXTURE1 0x00000188 -#define NV40TCL_DMA_COLOR1 0x0000018c -#define NV40TCL_DMA_COLOR0 0x00000194 -#define NV40TCL_DMA_ZETA 0x00000198 -#define NV40TCL_DMA_VTXBUF0 0x0000019c -#define NV40TCL_DMA_VTXBUF1 0x000001a0 -#define NV40TCL_DMA_FENCE 0x000001a4 -#define NV40TCL_DMA_QUERY 0x000001a8 -#define NV40TCL_DMA_UNK01AC 0x000001ac -#define NV40TCL_DMA_UNK01B0 0x000001b0 -#define NV40TCL_DMA_COLOR2 0x000001b4 -#define NV40TCL_DMA_COLOR3 0x000001b8 -#define NV40TCL_RT_HORIZ 0x00000200 -#define NV40TCL_RT_HORIZ_W_SHIFT 16 -#define NV40TCL_RT_HORIZ_W_MASK 0xffff0000 -#define NV40TCL_RT_HORIZ_X_SHIFT 0 -#define NV40TCL_RT_HORIZ_X_MASK 0x0000ffff -#define NV40TCL_RT_VERT 0x00000204 -#define NV40TCL_RT_VERT_H_SHIFT 16 -#define NV40TCL_RT_VERT_H_MASK 0xffff0000 -#define NV40TCL_RT_VERT_Y_SHIFT 0 -#define NV40TCL_RT_VERT_Y_MASK 0x0000ffff -#define NV40TCL_RT_FORMAT 0x00000208 -#define NV40TCL_RT_FORMAT_LOG2_HEIGHT_SHIFT 24 -#define NV40TCL_RT_FORMAT_LOG2_HEIGHT_MASK 0xff000000 -#define NV40TCL_RT_FORMAT_LOG2_WIDTH_SHIFT 16 -#define NV40TCL_RT_FORMAT_LOG2_WIDTH_MASK 0x00ff0000 -#define NV40TCL_RT_FORMAT_TYPE_SHIFT 8 -#define NV40TCL_RT_FORMAT_TYPE_MASK 0x00000f00 -#define NV40TCL_RT_FORMAT_TYPE_LINEAR 0x00000100 -#define NV40TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200 -#define NV40TCL_RT_FORMAT_ZETA_SHIFT 5 -#define NV40TCL_RT_FORMAT_ZETA_MASK 0x000000e0 -#define NV40TCL_RT_FORMAT_ZETA_Z16 0x00000020 -#define NV40TCL_RT_FORMAT_ZETA_Z24S8 0x00000040 -#define NV40TCL_RT_FORMAT_COLOR_SHIFT 0 -#define NV40TCL_RT_FORMAT_COLOR_MASK 0x0000001f -#define NV40TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003 -#define NV40TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005 -#define NV40TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008 -#define NV40TCL_RT_FORMAT_COLOR_B8 0x00000009 -#define NV40TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d -#define NV40TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f -#define NV40TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010 -#define NV40TCL_COLOR0_PITCH 0x0000020c -#define NV40TCL_COLOR0_OFFSET 0x00000210 -#define NV40TCL_ZETA_OFFSET 0x00000214 -#define NV40TCL_COLOR1_OFFSET 0x00000218 -#define NV40TCL_COLOR1_PITCH 0x0000021c -#define NV40TCL_RT_ENABLE 0x00000220 -#define NV40TCL_RT_ENABLE_MRT (1 << 4) -#define NV40TCL_RT_ENABLE_COLOR3 (1 << 3) -#define NV40TCL_RT_ENABLE_COLOR2 (1 << 2) -#define NV40TCL_RT_ENABLE_COLOR1 (1 << 1) -#define NV40TCL_RT_ENABLE_COLOR0 (1 << 0) -#define NV40TCL_ZETA_PITCH 0x0000022c -#define NV40TCL_COLOR2_PITCH 0x00000280 -#define NV40TCL_COLOR3_PITCH 0x00000284 -#define NV40TCL_COLOR2_OFFSET 0x00000288 -#define NV40TCL_COLOR3_OFFSET 0x0000028c -#define NV40TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*8)) -#define NV40TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008 -#define NV40TCL_VIEWPORT_CLIP_VERT(x) (0x000002c4+((x)*8)) -#define NV40TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008 -#define NV40TCL_DITHER_ENABLE 0x00000300 -#define NV40TCL_ALPHA_TEST_ENABLE 0x00000304 -#define NV40TCL_ALPHA_TEST_FUNC 0x00000308 -#define NV40TCL_ALPHA_TEST_FUNC_NEVER 0x00000200 -#define NV40TCL_ALPHA_TEST_FUNC_LESS 0x00000201 -#define NV40TCL_ALPHA_TEST_FUNC_EQUAL 0x00000202 -#define NV40TCL_ALPHA_TEST_FUNC_LEQUAL 0x00000203 -#define NV40TCL_ALPHA_TEST_FUNC_GREATER 0x00000204 -#define NV40TCL_ALPHA_TEST_FUNC_GREATER 0x00000204 -#define NV40TCL_ALPHA_TEST_FUNC_NOTEQUAL 0x00000205 -#define NV40TCL_ALPHA_TEST_FUNC_GEQUAL 0x00000206 -#define NV40TCL_ALPHA_TEST_FUNC_ALWAYS 0x00000207 -#define NV40TCL_ALPHA_TEST_REF 0x0000030c -#define NV40TCL_BLEND_ENABLE 0x00000310 -#define NV40TCL_BLEND_FUNC_SRC 0x00000314 -#define NV40TCL_BLEND_FUNC_SRC_RGB_SHIFT 0 -#define NV40TCL_BLEND_FUNC_SRC_RGB_MASK 0x0000ffff -#define NV40TCL_BLEND_FUNC_SRC_RGB_ZERO 0x00000000 -#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE 0x00000001 -#define NV40TCL_BLEND_FUNC_SRC_RGB_SRC_COLOR 0x00000300 -#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV40TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA 0x00000302 -#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV40TCL_BLEND_FUNC_SRC_RGB_DST_ALPHA 0x00000304 -#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV40TCL_BLEND_FUNC_SRC_RGB_DST_COLOR 0x00000306 -#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_COLOR 0x00000307 -#define NV40TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA_SATURATE 0x00000308 -#define NV40TCL_BLEND_FUNC_SRC_RGB_CONSTANT_COLOR 0x00008001 -#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV40TCL_BLEND_FUNC_SRC_RGB_CONSTANT_ALPHA 0x00008003 -#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SHIFT 16 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_MASK 0xffff0000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ZERO 0x00000000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE 0x00010000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SRC_COLOR 0x03000000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA 0x03020000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_DST_ALPHA 0x03040000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_DST_COLOR 0x03060000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_COLOR 0x03070000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA_SATURATE 0x03080000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_COLOR 0x80010000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_ALPHA 0x80030000 -#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000 -#define NV40TCL_BLEND_FUNC_DST 0x00000318 -#define NV40TCL_BLEND_FUNC_DST_RGB_SHIFT 0 -#define NV40TCL_BLEND_FUNC_DST_RGB_MASK 0x0000ffff -#define NV40TCL_BLEND_FUNC_DST_RGB_ZERO 0x00000000 -#define NV40TCL_BLEND_FUNC_DST_RGB_ONE 0x00000001 -#define NV40TCL_BLEND_FUNC_DST_RGB_SRC_COLOR 0x00000300 -#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV40TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA 0x00000302 -#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV40TCL_BLEND_FUNC_DST_RGB_DST_ALPHA 0x00000304 -#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV40TCL_BLEND_FUNC_DST_RGB_DST_COLOR 0x00000306 -#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_COLOR 0x00000307 -#define NV40TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA_SATURATE 0x00000308 -#define NV40TCL_BLEND_FUNC_DST_RGB_CONSTANT_COLOR 0x00008001 -#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV40TCL_BLEND_FUNC_DST_RGB_CONSTANT_ALPHA 0x00008003 -#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_SHIFT 16 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_MASK 0xffff0000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ZERO 0x00000000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE 0x00010000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_SRC_COLOR 0x03000000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA 0x03020000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_DST_ALPHA 0x03040000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_DST_COLOR 0x03060000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_COLOR 0x03070000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA_SATURATE 0x03080000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_COLOR 0x80010000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_ALPHA 0x80030000 -#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000 -#define NV40TCL_BLEND_COLOR 0x0000031c -#define NV40TCL_BLEND_EQUATION 0x00000320 -#define NV40TCL_BLEND_EQUATION_RGB_SHIFT 0 -#define NV40TCL_BLEND_EQUATION_RGB_MASK 0x0000ffff -#define NV40TCL_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006 -#define NV40TCL_BLEND_EQUATION_RGB_MIN 0x00008007 -#define NV40TCL_BLEND_EQUATION_RGB_MAX 0x00008008 -#define NV40TCL_BLEND_EQUATION_RGB_FUNC_SUBTRACT 0x0000800a -#define NV40TCL_BLEND_EQUATION_RGB_FUNC_REVERSE_SUBTRACT 0x0000800b -#define NV40TCL_BLEND_EQUATION_ALPHA_SHIFT 16 -#define NV40TCL_BLEND_EQUATION_ALPHA_MASK 0xffff0000 -#define NV40TCL_BLEND_EQUATION_ALPHA_FUNC_ADD 0x80060000 -#define NV40TCL_BLEND_EQUATION_ALPHA_MIN 0x80070000 -#define NV40TCL_BLEND_EQUATION_ALPHA_MAX 0x80080000 -#define NV40TCL_BLEND_EQUATION_ALPHA_FUNC_SUBTRACT 0x800a0000 -#define NV40TCL_BLEND_EQUATION_ALPHA_FUNC_REVERSE_SUBTRACT 0x800b0000 -#define NV40TCL_COLOR_MASK 0x00000324 -#define NV40TCL_COLOR_MASK_BUFFER0_B_SHIFT 0 -#define NV40TCL_COLOR_MASK_BUFFER0_B_MASK 0x000000ff -#define NV40TCL_COLOR_MASK_BUFFER0_G_SHIFT 8 -#define NV40TCL_COLOR_MASK_BUFFER0_G_MASK 0x0000ff00 -#define NV40TCL_COLOR_MASK_BUFFER0_R_SHIFT 16 -#define NV40TCL_COLOR_MASK_BUFFER0_R_MASK 0x00ff0000 -#define NV40TCL_COLOR_MASK_BUFFER0_A_SHIFT 24 -#define NV40TCL_COLOR_MASK_BUFFER0_A_MASK 0xff000000 -#define NV40TCL_STENCIL_FRONT_ENABLE 0x00000328 -#define NV40TCL_STENCIL_FRONT_MASK 0x0000032c -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC 0x00000330 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_NEVER 0x00000200 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_LESS 0x00000201 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_EQUAL 0x00000202 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_LEQUAL 0x00000203 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_GEQUAL 0x00000206 -#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_ALWAYS 0x00000207 -#define NV40TCL_STENCIL_FRONT_FUNC_REF 0x00000334 -#define NV40TCL_STENCIL_FRONT_FUNC_MASK 0x00000338 -#define NV40TCL_STENCIL_FRONT_OP_FAIL 0x0000033c -#define NV40TCL_STENCIL_FRONT_OP_FAIL_ZERO 0x00000000 -#define NV40TCL_STENCIL_FRONT_OP_FAIL_INVERT 0x0000150a -#define NV40TCL_STENCIL_FRONT_OP_FAIL_KEEP 0x00001e00 -#define NV40TCL_STENCIL_FRONT_OP_FAIL_REPLACE 0x00001e01 -#define NV40TCL_STENCIL_FRONT_OP_FAIL_INCR 0x00001e02 -#define NV40TCL_STENCIL_FRONT_OP_FAIL_DECR 0x00001e03 -#define NV40TCL_STENCIL_FRONT_OP_FAIL_INCR_WRAP 0x00008507 -#define NV40TCL_STENCIL_FRONT_OP_FAIL_DECR_WRAP 0x00008508 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL 0x00000340 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_ZERO 0x00000000 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_INVERT 0x0000150a -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_KEEP 0x00001e00 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_REPLACE 0x00001e01 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_INCR 0x00001e02 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_DECR 0x00001e03 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS 0x00000344 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_ZERO 0x00000000 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_INVERT 0x0000150a -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_KEEP 0x00001e00 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_REPLACE 0x00001e01 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_INCR 0x00001e02 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_DECR 0x00001e03 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV40TCL_STENCIL_FRONT_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV40TCL_STENCIL_BACK_ENABLE 0x00000348 -#define NV40TCL_STENCIL_BACK_MASK 0x0000034c -#define NV40TCL_STENCIL_BACK_FUNC_FUNC 0x00000350 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_NEVER 0x00000200 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_LESS 0x00000201 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_EQUAL 0x00000202 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_LEQUAL 0x00000203 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_GEQUAL 0x00000206 -#define NV40TCL_STENCIL_BACK_FUNC_FUNC_ALWAYS 0x00000207 -#define NV40TCL_STENCIL_BACK_FUNC_REF 0x00000354 -#define NV40TCL_STENCIL_BACK_FUNC_MASK 0x00000358 -#define NV40TCL_STENCIL_BACK_OP_FAIL 0x0000035c -#define NV40TCL_STENCIL_BACK_OP_FAIL_ZERO 0x00000000 -#define NV40TCL_STENCIL_BACK_OP_FAIL_INVERT 0x0000150a -#define NV40TCL_STENCIL_BACK_OP_FAIL_KEEP 0x00001e00 -#define NV40TCL_STENCIL_BACK_OP_FAIL_REPLACE 0x00001e01 -#define NV40TCL_STENCIL_BACK_OP_FAIL_INCR 0x00001e02 -#define NV40TCL_STENCIL_BACK_OP_FAIL_DECR 0x00001e03 -#define NV40TCL_STENCIL_BACK_OP_FAIL_INCR_WRAP 0x00008507 -#define NV40TCL_STENCIL_BACK_OP_FAIL_DECR_WRAP 0x00008508 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL 0x00000360 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_ZERO 0x00000000 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_INVERT 0x0000150a -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_KEEP 0x00001e00 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_REPLACE 0x00001e01 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_INCR 0x00001e02 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_DECR 0x00001e03 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV40TCL_STENCIL_BACK_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV40TCL_STENCIL_BACK_OP_ZPASS 0x00000364 -#define NV40TCL_STENCIL_BACK_OP_ZPASS_ZERO 0x00000000 -#define NV40TCL_STENCIL_BACK_OP_ZPASS_INVERT 0x0000150a -#define NV40TCL_STENCIL_BACK_OP_ZPASS_KEEP 0x00001e00 -#define NV40TCL_STENCIL_BACK_OP_ZPASS_REPLACE 0x00001e01 -#define NV40TCL_STENCIL_BACK_OP_ZPASS_INCR 0x00001e02 -#define NV40TCL_STENCIL_BACK_OP_ZPASS_DECR 0x00001e03 -#define NV40TCL_STENCIL_BACK_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV40TCL_STENCIL_BACK_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV40TCL_SHADE_MODEL 0x00000368 -#define NV40TCL_SHADE_MODEL_FLAT 0x00001d00 -#define NV40TCL_SHADE_MODEL_SMOOTH 0x00001d01 -#define NV40TCL_MRT_COLOR_MASK 0x00000370 -#define NV40TCL_MRT_COLOR_MASK_BUFFER1_A (1 << 4) -#define NV40TCL_MRT_COLOR_MASK_BUFFER1_R (1 << 5) -#define NV40TCL_MRT_COLOR_MASK_BUFFER1_G (1 << 6) -#define NV40TCL_MRT_COLOR_MASK_BUFFER1_B (1 << 7) -#define NV40TCL_MRT_COLOR_MASK_BUFFER2_A (1 << 8) -#define NV40TCL_MRT_COLOR_MASK_BUFFER2_R (1 << 9) -#define NV40TCL_MRT_COLOR_MASK_BUFFER2_G (1 << 10) -#define NV40TCL_MRT_COLOR_MASK_BUFFER2_B (1 << 11) -#define NV40TCL_MRT_COLOR_MASK_BUFFER3_A (1 << 12) -#define NV40TCL_MRT_COLOR_MASK_BUFFER3_R (1 << 13) -#define NV40TCL_MRT_COLOR_MASK_BUFFER3_G (1 << 14) -#define NV40TCL_MRT_COLOR_MASK_BUFFER3_B (1 << 15) -#define NV40TCL_COLOR_LOGIC_OP_ENABLE 0x00000374 -#define NV40TCL_COLOR_LOGIC_OP 0x00000378 -#define NV40TCL_COLOR_LOGIC_OP_CLEAR 0x00001500 -#define NV40TCL_COLOR_LOGIC_OP_AND 0x00001501 -#define NV40TCL_COLOR_LOGIC_OP_AND_REVERSE 0x00001502 -#define NV40TCL_COLOR_LOGIC_OP_COPY 0x00001503 -#define NV40TCL_COLOR_LOGIC_OP_AND_INVERTED 0x00001504 -#define NV40TCL_COLOR_LOGIC_OP_NOOP 0x00001505 -#define NV40TCL_COLOR_LOGIC_OP_XOR 0x00001506 -#define NV40TCL_COLOR_LOGIC_OP_OR 0x00001507 -#define NV40TCL_COLOR_LOGIC_OP_NOR 0x00001508 -#define NV40TCL_COLOR_LOGIC_OP_EQUIV 0x00001509 -#define NV40TCL_COLOR_LOGIC_OP_INVERT 0x0000150a -#define NV40TCL_COLOR_LOGIC_OP_OR_REVERSE 0x0000150b -#define NV40TCL_COLOR_LOGIC_OP_COPY_INVERTED 0x0000150c -#define NV40TCL_COLOR_LOGIC_OP_OR_INVERTED 0x0000150d -#define NV40TCL_COLOR_LOGIC_OP_NAND 0x0000150e -#define NV40TCL_COLOR_LOGIC_OP_SET 0x0000150f -#define NV40TCL_DEPTH_RANGE_NEAR 0x00000394 -#define NV40TCL_DEPTH_RANGE_FAR 0x00000398 -#define NV40TCL_LINE_WIDTH 0x000003b8 -#define NV40TCL_LINE_SMOOTH_ENABLE 0x000003bc -#define NV40TCL_UNK03C0(x) (0x000003c0+((x)*4)) -#define NV40TCL_UNK03C0__SIZE 0x00000010 -#define NV40TCL_UNK0400(x) (0x00000400+((x)*4)) -#define NV40TCL_UNK0400__SIZE 0x00000010 -#define NV40TCL_UNK0440(x) (0x00000440+((x)*4)) -#define NV40TCL_UNK0440__SIZE 0x00000020 -#define NV40TCL_SCISSOR_HORIZ 0x000008c0 -#define NV40TCL_SCISSOR_HORIZ_X_SHIFT 0 -#define NV40TCL_SCISSOR_HORIZ_X_MASK 0x0000ffff -#define NV40TCL_SCISSOR_HORIZ_W_SHIFT 16 -#define NV40TCL_SCISSOR_HORIZ_W_MASK 0xffff0000 -#define NV40TCL_SCISSOR_VERT 0x000008c4 -#define NV40TCL_SCISSOR_VERT_Y_SHIFT 0 -#define NV40TCL_SCISSOR_VERT_Y_MASK 0x0000ffff -#define NV40TCL_SCISSOR_VERT_H_SHIFT 16 -#define NV40TCL_SCISSOR_VERT_H_MASK 0xffff0000 -#define NV40TCL_FOG_MODE 0x000008cc -#define NV40TCL_FOG_EQUATION_CONSTANT 0x000008d0 -#define NV40TCL_FOG_EQUATION_LINEAR 0x000008d4 -#define NV40TCL_FOG_EQUATION_QUADRATIC 0x000008d8 -#define NV40TCL_FP_ADDRESS 0x000008e4 -#define NV40TCL_FP_ADDRESS_OFFSET_SHIFT 8 -#define NV40TCL_FP_ADDRESS_OFFSET_MASK 0xffffff00 -#define NV40TCL_FP_ADDRESS_DMA1 (1 << 1) -#define NV40TCL_FP_ADDRESS_DMA0 (1 << 0) -#define NV40TCL_VIEWPORT_HORIZ 0x00000a00 -#define NV40TCL_VIEWPORT_HORIZ_W_SHIFT 16 -#define NV40TCL_VIEWPORT_HORIZ_W_MASK 0xffff0000 -#define NV40TCL_VIEWPORT_HORIZ_X_SHIFT 0 -#define NV40TCL_VIEWPORT_HORIZ_X_MASK 0x0000ffff -#define NV40TCL_VIEWPORT_VERT 0x00000a04 -#define NV40TCL_VIEWPORT_VERT_H_SHIFT 16 -#define NV40TCL_VIEWPORT_VERT_H_MASK 0xffff0000 -#define NV40TCL_VIEWPORT_VERT_Y_SHIFT 0 -#define NV40TCL_VIEWPORT_VERT_Y_MASK 0x0000ffff -#define NV40TCL_VIEWPORT_TRANSLATE_X 0x00000a20 -#define NV40TCL_VIEWPORT_TRANSLATE_Y 0x00000a24 -#define NV40TCL_VIEWPORT_TRANSLATE_Z 0x00000a28 -#define NV40TCL_VIEWPORT_TRANSLATE_W 0x00000a2c -#define NV40TCL_VIEWPORT_SCALE_X 0x00000a30 -#define NV40TCL_VIEWPORT_SCALE_Y 0x00000a34 -#define NV40TCL_VIEWPORT_SCALE_Z 0x00000a38 -#define NV40TCL_VIEWPORT_SCALE_W 0x00000a3c -#define NV40TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000a60 -#define NV40TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000a64 -#define NV40TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000a68 -#define NV40TCL_DEPTH_FUNC 0x00000a6c -#define NV40TCL_DEPTH_FUNC_NEVER 0x00000200 -#define NV40TCL_DEPTH_FUNC_LESS 0x00000201 -#define NV40TCL_DEPTH_FUNC_EQUAL 0x00000202 -#define NV40TCL_DEPTH_FUNC_LEQUAL 0x00000203 -#define NV40TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV40TCL_DEPTH_FUNC_GREATER 0x00000204 -#define NV40TCL_DEPTH_FUNC_NOTEQUAL 0x00000205 -#define NV40TCL_DEPTH_FUNC_GEQUAL 0x00000206 -#define NV40TCL_DEPTH_FUNC_ALWAYS 0x00000207 -#define NV40TCL_DEPTH_WRITE_ENABLE 0x00000a70 -#define NV40TCL_DEPTH_TEST_ENABLE 0x00000a74 -#define NV40TCL_POLYGON_OFFSET_FACTOR 0x00000a78 -#define NV40TCL_POLYGON_OFFSET_UNITS 0x00000a7c -#define NV40TCL_VTX_ATTR_3I_XY(x) (0x00000a80+((x)*8)) -#define NV40TCL_VTX_ATTR_3I_XY__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_3I_XY_X_SHIFT 0 -#define NV40TCL_VTX_ATTR_3I_XY_X_MASK 0x0000ffff -#define NV40TCL_VTX_ATTR_3I_XY_Y_SHIFT 16 -#define NV40TCL_VTX_ATTR_3I_XY_Y_MASK 0xffff0000 -#define NV40TCL_VTX_ATTR_3I_Z(x) (0x00000a84+((x)*8)) -#define NV40TCL_VTX_ATTR_3I_Z__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_3I_Z_Z_SHIFT 0 -#define NV40TCL_VTX_ATTR_3I_Z_Z_MASK 0x0000ffff -#define NV40TCL_UNK0B40(x) (0x00000b40+((x)*4)) -#define NV40TCL_UNK0B40__SIZE 0x00000008 -#define NV40TCL_VP_UPLOAD_INST(x) (0x00000b80+((x)*4)) -#define NV40TCL_VP_UPLOAD_INST__SIZE 0x00000004 -#define NV40TCL_CLIP_PLANE_ENABLE 0x00001478 -#define NV40TCL_CLIP_PLANE_ENABLE_PLANE0 (1 << 1) -#define NV40TCL_CLIP_PLANE_ENABLE_PLANE1 (1 << 5) -#define NV40TCL_CLIP_PLANE_ENABLE_PLANE2 (1 << 9) -#define NV40TCL_CLIP_PLANE_ENABLE_PLANE3 (1 << 13) -#define NV40TCL_CLIP_PLANE_ENABLE_PLANE4 (1 << 17) -#define NV40TCL_CLIP_PLANE_ENABLE_PLANE5 (1 << 21) -#define NV40TCL_POLYGON_STIPPLE_ENABLE 0x0000147c -#define NV40TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001480+((x)*4)) -#define NV40TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020 -#define NV40TCL_VTX_ATTR_3F_X(x) (0x00001500+((x)*16)) -#define NV40TCL_VTX_ATTR_3F_X__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_3F_Y(x) (0x00001504+((x)*16)) -#define NV40TCL_VTX_ATTR_3F_Y__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_3F_Z(x) (0x00001508+((x)*16)) -#define NV40TCL_VTX_ATTR_3F_Z__SIZE 0x00000010 -#define NV40TCL_VTXBUF_ADDRESS(x) (0x00001680+((x)*4)) -#define NV40TCL_VTXBUF_ADDRESS__SIZE 0x00000010 -#define NV40TCL_VTXBUF_ADDRESS_DMA1 (1 << 31) -#define NV40TCL_VTXBUF_ADDRESS_OFFSET_SHIFT 0 -#define NV40TCL_VTXBUF_ADDRESS_OFFSET_MASK 0x0fffffff -#define NV40TCL_VTX_CACHE_INVALIDATE 0x00001714 -#define NV40TCL_VTXFMT(x) (0x00001740+((x)*4)) -#define NV40TCL_VTXFMT__SIZE 0x00000010 -#define NV40TCL_VTXFMT_TYPE_SHIFT 0 -#define NV40TCL_VTXFMT_TYPE_MASK 0x0000000f -#define NV40TCL_VTXFMT_TYPE_FLOAT 0x00000002 -#define NV40TCL_VTXFMT_TYPE_UBYTE 0x00000004 -#define NV40TCL_VTXFMT_TYPE_USHORT 0x00000005 -#define NV40TCL_VTXFMT_SIZE_SHIFT 4 -#define NV40TCL_VTXFMT_SIZE_MASK 0x000000f0 -#define NV40TCL_VTXFMT_STRIDE_SHIFT 8 -#define NV40TCL_VTXFMT_STRIDE_MASK 0x0000ff00 -#define NV40TCL_QUERY_RESET 0x000017c8 -#define NV40TCL_QUERY_UNK17CC 0x000017cc -#define NV40TCL_QUERY_GET 0x00001800 -#define NV40TCL_QUERY_GET_UNK24_SHIFT 24 -#define NV40TCL_QUERY_GET_UNK24_MASK 0xff000000 -#define NV40TCL_QUERY_GET_OFFSET_SHIFT 0 -#define NV40TCL_QUERY_GET_OFFSET_MASK 0x00ffffff -#define NV40TCL_BEGIN_END 0x00001808 -#define NV40TCL_BEGIN_END_STOP 0x00000000 -#define NV40TCL_BEGIN_END_POINTS 0x00000001 -#define NV40TCL_BEGIN_END_LINES 0x00000002 -#define NV40TCL_BEGIN_END_LINE_LOOP 0x00000003 -#define NV40TCL_BEGIN_END_LINE_STRIP 0x00000004 -#define NV40TCL_BEGIN_END_TRIANGLES 0x00000005 -#define NV40TCL_BEGIN_END_TRIANGLE_STRIP 0x00000006 -#define NV40TCL_BEGIN_END_TRIANGLE_FAN 0x00000007 -#define NV40TCL_BEGIN_END_QUADS 0x00000008 -#define NV40TCL_BEGIN_END_QUAD_STRIP 0x00000009 -#define NV40TCL_BEGIN_END_POLYGON 0x0000000a -#define NV40TCL_VB_ELEMENT_U16 0x0000180c -#define NV40TCL_VB_ELEMENT_U16_1_SHIFT 16 -#define NV40TCL_VB_ELEMENT_U16_1_MASK 0xffff0000 -#define NV40TCL_VB_ELEMENT_U16_0_SHIFT 0 -#define NV40TCL_VB_ELEMENT_U16_0_MASK 0x0000ffff -#define NV40TCL_VB_ELEMENT_U32 0x00001810 -#define NV40TCL_VB_VERTEX_BATCH 0x00001814 -#define NV40TCL_VB_VERTEX_BATCH_COUNT_SHIFT 24 -#define NV40TCL_VB_VERTEX_BATCH_COUNT_MASK 0xff000000 -#define NV40TCL_VB_VERTEX_BATCH_START_SHIFT 0 -#define NV40TCL_VB_VERTEX_BATCH_START_MASK 0x00ffffff -#define NV40TCL_VERTEX_DATA 0x00001818 -#define NV40TCL_IDXBUF_ADDRESS 0x0000181c -#define NV40TCL_IDXBUF_FORMAT 0x00001820 -#define NV40TCL_IDXBUF_FORMAT_TYPE_SHIFT 4 -#define NV40TCL_IDXBUF_FORMAT_TYPE_MASK 0x000000f0 -#define NV40TCL_IDXBUF_FORMAT_TYPE_U32 0x00000000 -#define NV40TCL_IDXBUF_FORMAT_TYPE_U16 0x00000010 -#define NV40TCL_IDXBUF_FORMAT_DMA1 (1 << 0) -#define NV40TCL_VB_INDEX_BATCH 0x00001824 -#define NV40TCL_VB_INDEX_BATCH_COUNT_SHIFT 24 -#define NV40TCL_VB_INDEX_BATCH_COUNT_MASK 0xff000000 -#define NV40TCL_VB_INDEX_BATCH_START_SHIFT 0 -#define NV40TCL_VB_INDEX_BATCH_START_MASK 0x00ffffff -#define NV40TCL_POLYGON_MODE_FRONT 0x00001828 -#define NV40TCL_POLYGON_MODE_FRONT_POINT 0x00001b00 -#define NV40TCL_POLYGON_MODE_FRONT_LINE 0x00001b01 -#define NV40TCL_POLYGON_MODE_FRONT_FILL 0x00001b02 -#define NV40TCL_POLYGON_MODE_BACK 0x0000182c -#define NV40TCL_POLYGON_MODE_BACK_POINT 0x00001b00 -#define NV40TCL_POLYGON_MODE_BACK_LINE 0x00001b01 -#define NV40TCL_POLYGON_MODE_BACK_FILL 0x00001b02 -#define NV40TCL_CULL_FACE 0x00001830 -#define NV40TCL_CULL_FACE_FRONT 0x00000404 -#define NV40TCL_CULL_FACE_BACK 0x00000405 -#define NV40TCL_CULL_FACE_FRONT_AND_BACK 0x00000408 -#define NV40TCL_FRONT_FACE 0x00001834 -#define NV40TCL_FRONT_FACE_CW 0x00000900 -#define NV40TCL_FRONT_FACE_CCW 0x00000901 -#define NV40TCL_POLYGON_SMOOTH_ENABLE 0x00001838 -#define NV40TCL_CULL_FACE_ENABLE 0x0000183c -#define NV40TCL_TEX_SIZE1(x) (0x00001840+((x)*4)) -#define NV40TCL_TEX_SIZE1__SIZE 0x00000008 -#define NV40TCL_TEX_SIZE1_DEPTH_SHIFT 20 -#define NV40TCL_TEX_SIZE1_DEPTH_MASK 0xfff00000 -#define NV40TCL_TEX_SIZE1_PITCH_SHIFT 0 -#define NV40TCL_TEX_SIZE1_PITCH_MASK 0x0000ffff -#define NV40TCL_VTX_ATTR_2F_X(x) (0x00001880+((x)*8)) -#define NV40TCL_VTX_ATTR_2F_X__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_2F_Y(x) (0x00001884+((x)*8)) -#define NV40TCL_VTX_ATTR_2F_Y__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_2I(x) (0x00001900+((x)*4)) -#define NV40TCL_VTX_ATTR_2I__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_2I_X_SHIFT 0 -#define NV40TCL_VTX_ATTR_2I_X_MASK 0x0000ffff -#define NV40TCL_VTX_ATTR_2I_Y_SHIFT 16 -#define NV40TCL_VTX_ATTR_2I_Y_MASK 0xffff0000 -#define NV40TCL_VTX_ATTR_4UB(x) (0x00001940+((x)*4)) -#define NV40TCL_VTX_ATTR_4UB__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_4UB_X_SHIFT 0 -#define NV40TCL_VTX_ATTR_4UB_X_MASK 0x000000ff -#define NV40TCL_VTX_ATTR_4UB_Y_SHIFT 8 -#define NV40TCL_VTX_ATTR_4UB_Y_MASK 0x0000ff00 -#define NV40TCL_VTX_ATTR_4UB_Z_SHIFT 16 -#define NV40TCL_VTX_ATTR_4UB_Z_MASK 0x00ff0000 -#define NV40TCL_VTX_ATTR_4UB_W_SHIFT 24 -#define NV40TCL_VTX_ATTR_4UB_W_MASK 0xff000000 -#define NV40TCL_VTX_ATTR_4I_XY(x) (0x00001980+((x)*8)) -#define NV40TCL_VTX_ATTR_4I_XY__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_4I_XY_X_SHIFT 0 -#define NV40TCL_VTX_ATTR_4I_XY_X_MASK 0x0000ffff -#define NV40TCL_VTX_ATTR_4I_XY_Y_SHIFT 16 -#define NV40TCL_VTX_ATTR_4I_XY_Y_MASK 0xffff0000 -#define NV40TCL_VTX_ATTR_4I_ZW(x) (0x00001984+((x)*8)) -#define NV40TCL_VTX_ATTR_4I_ZW__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_4I_ZW_Z_SHIFT 0 -#define NV40TCL_VTX_ATTR_4I_ZW_Z_MASK 0x0000ffff -#define NV40TCL_VTX_ATTR_4I_ZW_W_SHIFT 16 -#define NV40TCL_VTX_ATTR_4I_ZW_W_MASK 0xffff0000 -#define NV40TCL_TEX_OFFSET(x) (0x00001a00+((x)*32)) -#define NV40TCL_TEX_OFFSET__SIZE 0x00000010 -#define NV40TCL_TEX_FORMAT(x) (0x00001a04+((x)*32)) -#define NV40TCL_TEX_FORMAT__SIZE 0x00000010 -#define NV40TCL_TEX_FORMAT_MIPMAP_COUNT_SHIFT 16 -#define NV40TCL_TEX_FORMAT_MIPMAP_COUNT_MASK 0x000f0000 -#define NV40TCL_TEX_FORMAT_RECT (1 << 14) -#define NV40TCL_TEX_FORMAT_LINEAR (1 << 13) -#define NV40TCL_TEX_FORMAT_FORMAT_SHIFT 8 -#define NV40TCL_TEX_FORMAT_FORMAT_MASK 0x00001f00 -#define NV40TCL_TEX_FORMAT_FORMAT_L8 0x00000100 -#define NV40TCL_TEX_FORMAT_FORMAT_A1R5G5B5 0x00000200 -#define NV40TCL_TEX_FORMAT_FORMAT_A4R4G4B4 0x00000300 -#define NV40TCL_TEX_FORMAT_FORMAT_R5G6B5 0x00000400 -#define NV40TCL_TEX_FORMAT_FORMAT_A8R8G8B8 0x00000500 -#define NV40TCL_TEX_FORMAT_FORMAT_DXT1 0x00000600 -#define NV40TCL_TEX_FORMAT_FORMAT_DXT3 0x00000700 -#define NV40TCL_TEX_FORMAT_FORMAT_DXT5 0x00000800 -#define NV40TCL_TEX_FORMAT_FORMAT_A8L8 0x00000b00 -#define NV40TCL_TEX_FORMAT_FORMAT_Z24 0x00001000 -#define NV40TCL_TEX_FORMAT_FORMAT_Z16 0x00001200 -#define NV40TCL_TEX_FORMAT_FORMAT_A16 0x00001400 -#define NV40TCL_TEX_FORMAT_FORMAT_A16L16 0x00001500 -#define NV40TCL_TEX_FORMAT_FORMAT_HILO8 0x00001800 -#define NV40TCL_TEX_FORMAT_FORMAT_RGBA16F 0x00001a00 -#define NV40TCL_TEX_FORMAT_FORMAT_RGBA32F 0x00001b00 -#define NV40TCL_TEX_FORMAT_DIMS_SHIFT 4 -#define NV40TCL_TEX_FORMAT_DIMS_MASK 0x000000f0 -#define NV40TCL_TEX_FORMAT_DIMS_1D 0x00000010 -#define NV40TCL_TEX_FORMAT_DIMS_2D 0x00000020 -#define NV40TCL_TEX_FORMAT_DIMS_3D 0x00000030 -#define NV40TCL_TEX_FORMAT_NO_BORDER (1 << 3) -#define NV40TCL_TEX_FORMAT_CUBIC (1 << 2) -#define NV40TCL_TEX_FORMAT_DMA1 (1 << 1) -#define NV40TCL_TEX_FORMAT_DMA0 (1 << 0) -#define NV40TCL_TEX_WRAP(x) (0x00001a08+((x)*32)) -#define NV40TCL_TEX_WRAP__SIZE 0x00000010 -#define NV40TCL_TEX_WRAP_S_SHIFT 0 -#define NV40TCL_TEX_WRAP_S_MASK 0x000000ff -#define NV40TCL_TEX_WRAP_S_REPEAT 0x00000001 -#define NV40TCL_TEX_WRAP_S_MIRRORED_REPEAT 0x00000002 -#define NV40TCL_TEX_WRAP_S_CLAMP_TO_EDGE 0x00000003 -#define NV40TCL_TEX_WRAP_S_CLAMP_TO_BORDER 0x00000004 -#define NV40TCL_TEX_WRAP_S_CLAMP 0x00000005 -#define NV40TCL_TEX_WRAP_S_MIRROR_CLAMP_TO_EDGE 0x00000006 -#define NV40TCL_TEX_WRAP_S_MIRROR_CLAMP_TO_BORDER 0x00000007 -#define NV40TCL_TEX_WRAP_S_MIRROR_CLAMP 0x00000008 -#define NV40TCL_TEX_WRAP_T_SHIFT 8 -#define NV40TCL_TEX_WRAP_T_MASK 0x00000f00 -#define NV40TCL_TEX_WRAP_T_REPEAT 0x00000100 -#define NV40TCL_TEX_WRAP_T_MIRRORED_REPEAT 0x00000200 -#define NV40TCL_TEX_WRAP_T_CLAMP_TO_EDGE 0x00000300 -#define NV40TCL_TEX_WRAP_T_CLAMP_TO_BORDER 0x00000400 -#define NV40TCL_TEX_WRAP_T_CLAMP 0x00000500 -#define NV40TCL_TEX_WRAP_T_MIRROR_CLAMP_TO_EDGE 0x00000600 -#define NV40TCL_TEX_WRAP_T_MIRROR_CLAMP_TO_BORDER 0x00000700 -#define NV40TCL_TEX_WRAP_T_MIRROR_CLAMP 0x00000800 -#define NV40TCL_TEX_WRAP_EXPAND_NORMAL_SHIFT 12 -#define NV40TCL_TEX_WRAP_EXPAND_NORMAL_MASK 0x0000f000 -#define NV40TCL_TEX_WRAP_R_SHIFT 16 -#define NV40TCL_TEX_WRAP_R_MASK 0x00ff0000 -#define NV40TCL_TEX_WRAP_R_REPEAT 0x00010000 -#define NV40TCL_TEX_WRAP_R_MIRRORED_REPEAT 0x00020000 -#define NV40TCL_TEX_WRAP_R_CLAMP_TO_EDGE 0x00030000 -#define NV40TCL_TEX_WRAP_R_CLAMP_TO_BORDER 0x00040000 -#define NV40TCL_TEX_WRAP_R_CLAMP 0x00050000 -#define NV40TCL_TEX_WRAP_R_MIRROR_CLAMP_TO_EDGE 0x00060000 -#define NV40TCL_TEX_WRAP_R_MIRROR_CLAMP_TO_BORDER 0x00070000 -#define NV40TCL_TEX_WRAP_R_MIRROR_CLAMP 0x00080000 -#define NV40TCL_TEX_WRAP_RCOMP_SHIFT 28 -#define NV40TCL_TEX_WRAP_RCOMP_MASK 0xf0000000 -#define NV40TCL_TEX_WRAP_RCOMP_NEVER 0x00000000 -#define NV40TCL_TEX_WRAP_RCOMP_GREATER 0x10000000 -#define NV40TCL_TEX_WRAP_RCOMP_EQUAL 0x20000000 -#define NV40TCL_TEX_WRAP_RCOMP_GEQUAL 0x30000000 -#define NV40TCL_TEX_WRAP_RCOMP_LESS 0x40000000 -#define NV40TCL_TEX_WRAP_RCOMP_NOTEQUAL 0x50000000 -#define NV40TCL_TEX_WRAP_RCOMP_LEQUAL 0x60000000 -#define NV40TCL_TEX_WRAP_RCOMP_ALWAYS 0x70000000 -#define NV40TCL_TEX_ENABLE(x) (0x00001a0c+((x)*32)) -#define NV40TCL_TEX_ENABLE__SIZE 0x00000010 -#define NV40TCL_TEX_ENABLE_ENABLE (1 << 31) -#define NV40TCL_TEX_ENABLE_MIPMAP_MIN_LOD_SHIFT 27 -#define NV40TCL_TEX_ENABLE_MIPMAP_MIN_LOD_MASK 0x38000000 -#define NV40TCL_TEX_ENABLE_MIPMAP_MAX_LOD_SHIFT 15 -#define NV40TCL_TEX_ENABLE_MIPMAP_MAX_LOD_MASK 0x00038000 -#define NV40TCL_TEX_ENABLE_ANISO_SHIFT 4 -#define NV40TCL_TEX_ENABLE_ANISO_MASK 0x000000f0 -#define NV40TCL_TEX_ENABLE_ANISO_NONE 0x00000000 -#define NV40TCL_TEX_ENABLE_ANISO_2X 0x00000010 -#define NV40TCL_TEX_ENABLE_ANISO_4X 0x00000020 -#define NV40TCL_TEX_ENABLE_ANISO_6X 0x00000030 -#define NV40TCL_TEX_ENABLE_ANISO_8X 0x00000040 -#define NV40TCL_TEX_ENABLE_ANISO_10X 0x00000050 -#define NV40TCL_TEX_ENABLE_ANISO_12X 0x00000060 -#define NV40TCL_TEX_ENABLE_ANISO_16X 0x00000070 -#define NV40TCL_TEX_SWIZZLE(x) (0x00001a10+((x)*32)) -#define NV40TCL_TEX_SWIZZLE__SIZE 0x00000010 -#define NV40TCL_TEX_SWIZZLE_S0_X_SHIFT 14 -#define NV40TCL_TEX_SWIZZLE_S0_X_MASK 0x0000c000 -#define NV40TCL_TEX_SWIZZLE_S0_X_ZERO 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S0_X_ONE 0x00004000 -#define NV40TCL_TEX_SWIZZLE_S0_X_S1 0x00008000 -#define NV40TCL_TEX_SWIZZLE_S0_Y_SHIFT 12 -#define NV40TCL_TEX_SWIZZLE_S0_Y_MASK 0x00003000 -#define NV40TCL_TEX_SWIZZLE_S0_Y_ZERO 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S0_Y_ONE 0x00001000 -#define NV40TCL_TEX_SWIZZLE_S0_Y_S1 0x00002000 -#define NV40TCL_TEX_SWIZZLE_S0_Z_SHIFT 10 -#define NV40TCL_TEX_SWIZZLE_S0_Z_MASK 0x00000c00 -#define NV40TCL_TEX_SWIZZLE_S0_Z_ZERO 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S0_Z_ONE 0x00000400 -#define NV40TCL_TEX_SWIZZLE_S0_Z_S1 0x00000800 -#define NV40TCL_TEX_SWIZZLE_S0_W_SHIFT 8 -#define NV40TCL_TEX_SWIZZLE_S0_W_MASK 0x00000300 -#define NV40TCL_TEX_SWIZZLE_S0_W_ZERO 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S0_W_ONE 0x00000100 -#define NV40TCL_TEX_SWIZZLE_S0_W_S1 0x00000200 -#define NV40TCL_TEX_SWIZZLE_S1_X_SHIFT 6 -#define NV40TCL_TEX_SWIZZLE_S1_X_MASK 0x000000c0 -#define NV40TCL_TEX_SWIZZLE_S1_X_W 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S1_X_Z 0x00000040 -#define NV40TCL_TEX_SWIZZLE_S1_X_Y 0x00000080 -#define NV40TCL_TEX_SWIZZLE_S1_X_X 0x000000c0 -#define NV40TCL_TEX_SWIZZLE_S1_Y_SHIFT 4 -#define NV40TCL_TEX_SWIZZLE_S1_Y_MASK 0x00000030 -#define NV40TCL_TEX_SWIZZLE_S1_Y_W 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S1_Y_Z 0x00000010 -#define NV40TCL_TEX_SWIZZLE_S1_Y_Y 0x00000020 -#define NV40TCL_TEX_SWIZZLE_S1_Y_X 0x00000030 -#define NV40TCL_TEX_SWIZZLE_S1_Z_SHIFT 2 -#define NV40TCL_TEX_SWIZZLE_S1_Z_MASK 0x0000000c -#define NV40TCL_TEX_SWIZZLE_S1_Z_W 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S1_Z_Z 0x00000004 -#define NV40TCL_TEX_SWIZZLE_S1_Z_Y 0x00000008 -#define NV40TCL_TEX_SWIZZLE_S1_Z_X 0x0000000c -#define NV40TCL_TEX_SWIZZLE_S1_W_SHIFT 0 -#define NV40TCL_TEX_SWIZZLE_S1_W_MASK 0x00000003 -#define NV40TCL_TEX_SWIZZLE_S1_W_W 0x00000000 -#define NV40TCL_TEX_SWIZZLE_S1_W_Z 0x00000001 -#define NV40TCL_TEX_SWIZZLE_S1_W_Y 0x00000002 -#define NV40TCL_TEX_SWIZZLE_S1_W_X 0x00000003 -#define NV40TCL_TEX_FILTER(x) (0x00001a14+((x)*32)) -#define NV40TCL_TEX_FILTER__SIZE 0x00000010 -#define NV40TCL_TEX_FILTER_SIGNED_ALPHA (1 << 31) -#define NV40TCL_TEX_FILTER_SIGNED_RED (1 << 30) -#define NV40TCL_TEX_FILTER_SIGNED_GREEN (1 << 29) -#define NV40TCL_TEX_FILTER_SIGNED_BLUE (1 << 28) -#define NV40TCL_TEX_FILTER_MIN_SHIFT 16 -#define NV40TCL_TEX_FILTER_MIN_MASK 0x000f0000 -#define NV40TCL_TEX_FILTER_MIN_NEAREST 0x00010000 -#define NV40TCL_TEX_FILTER_MIN_LINEAR 0x00020000 -#define NV40TCL_TEX_FILTER_MIN_NEAREST_MIPMAP_NEAREST 0x00030000 -#define NV40TCL_TEX_FILTER_MIN_LINEAR_MIPMAP_NEAREST 0x00040000 -#define NV40TCL_TEX_FILTER_MIN_NEAREST_MIPMAP_LINEAR 0x00050000 -#define NV40TCL_TEX_FILTER_MIN_LINEAR_MIPMAP_LINEAR 0x00060000 -#define NV40TCL_TEX_FILTER_MAG_SHIFT 24 -#define NV40TCL_TEX_FILTER_MAG_MASK 0x0f000000 -#define NV40TCL_TEX_FILTER_MAG_NEAREST 0x01000000 -#define NV40TCL_TEX_FILTER_MAG_LINEAR 0x02000000 -#define NV40TCL_TEX_SIZE0(x) (0x00001a18+((x)*32)) -#define NV40TCL_TEX_SIZE0__SIZE 0x00000010 -#define NV40TCL_TEX_SIZE0_H_SHIFT 0 -#define NV40TCL_TEX_SIZE0_H_MASK 0x0000ffff -#define NV40TCL_TEX_SIZE0_W_SHIFT 16 -#define NV40TCL_TEX_SIZE0_W_MASK 0xffff0000 -#define NV40TCL_TEX_BORDER_COLOR(x) (0x00001a1c+((x)*32)) -#define NV40TCL_TEX_BORDER_COLOR__SIZE 0x00000010 -#define NV40TCL_TEX_BORDER_COLOR_B_SHIFT 0 -#define NV40TCL_TEX_BORDER_COLOR_B_MASK 0x000000ff -#define NV40TCL_TEX_BORDER_COLOR_G_SHIFT 8 -#define NV40TCL_TEX_BORDER_COLOR_G_MASK 0x0000ff00 -#define NV40TCL_TEX_BORDER_COLOR_R_SHIFT 16 -#define NV40TCL_TEX_BORDER_COLOR_R_MASK 0x00ff0000 -#define NV40TCL_TEX_BORDER_COLOR_A_SHIFT 24 -#define NV40TCL_TEX_BORDER_COLOR_A_MASK 0xff000000 -#define NV40TCL_VTX_ATTR_4F_X(x) (0x00001c00+((x)*16)) -#define NV40TCL_VTX_ATTR_4F_X__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_4F_Y(x) (0x00001c04+((x)*16)) -#define NV40TCL_VTX_ATTR_4F_Y__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_4F_Z(x) (0x00001c08+((x)*16)) -#define NV40TCL_VTX_ATTR_4F_Z__SIZE 0x00000010 -#define NV40TCL_VTX_ATTR_4F_W(x) (0x00001c0c+((x)*16)) -#define NV40TCL_VTX_ATTR_4F_W__SIZE 0x00000010 -#define NV40TCL_FP_CONTROL 0x00001d60 -#define NV40TCL_FP_CONTROL_TEMP_COUNT_SHIFT 24 -#define NV40TCL_FP_CONTROL_TEMP_COUNT_MASK 0xff000000 -#define NV40TCL_FP_CONTROL_KIL (1 << 7) -#define NV40TCL_MULTISAMPLE_CONTROL 0x00001d7c -#define NV40TCL_CLEAR_VALUE_DEPTH 0x00001d8c -#define NV40TCL_CLEAR_VALUE_COLOR 0x00001d90 -#define NV40TCL_CLEAR_BUFFERS 0x00001d94 -#define NV40TCL_CLEAR_BUFFERS_COLOR_A (1 << 7) -#define NV40TCL_CLEAR_BUFFERS_COLOR_B (1 << 6) -#define NV40TCL_CLEAR_BUFFERS_COLOR_G (1 << 5) -#define NV40TCL_CLEAR_BUFFERS_COLOR_R (1 << 4) -#define NV40TCL_CLEAR_BUFFERS_STENCIL (1 << 1) -#define NV40TCL_CLEAR_BUFFERS_DEPTH (1 << 0) -#define NV40TCL_LINE_STIPPLE_ENABLE 0x00001db4 -#define NV40TCL_LINE_STIPPLE_PATTERN 0x00001db8 -#define NV40TCL_LINE_STIPPLE_PATTERN_FACTOR_SHIFT 0 -#define NV40TCL_LINE_STIPPLE_PATTERN_FACTOR_MASK 0x0000ffff -#define NV40TCL_LINE_STIPPLE_PATTERN_PATTERN_SHIFT 16 -#define NV40TCL_LINE_STIPPLE_PATTERN_PATTERN_MASK 0xffff0000 -#define NV40TCL_VTX_ATTR_1F(x) (0x00001e40+((x)*4)) -#define NV40TCL_VTX_ATTR_1F__SIZE 0x00000010 -#define NV40TCL_VP_UPLOAD_FROM_ID 0x00001e9c -#define NV40TCL_VP_START_FROM_ID 0x00001ea0 -#define NV40TCL_POINT_SIZE 0x00001ee0 -#define NV40TCL_POINT_SPRITE 0x00001ee8 -#define NV40TCL_VP_UPLOAD_CONST_ID 0x00001efc -#define NV40TCL_VP_UPLOAD_CONST_X(x) (0x00001f00+((x)*16)) -#define NV40TCL_VP_UPLOAD_CONST_X__SIZE 0x00000004 -#define NV40TCL_VP_UPLOAD_CONST_Y(x) (0x00001f04+((x)*16)) -#define NV40TCL_VP_UPLOAD_CONST_Y__SIZE 0x00000004 -#define NV40TCL_VP_UPLOAD_CONST_Z(x) (0x00001f08+((x)*16)) -#define NV40TCL_VP_UPLOAD_CONST_Z__SIZE 0x00000004 -#define NV40TCL_VP_UPLOAD_CONST_W(x) (0x00001f0c+((x)*16)) -#define NV40TCL_VP_UPLOAD_CONST_W__SIZE 0x00000004 -#define NV40TCL_TEX_CACHE_CTL 0x00001fd8 -#define NV40TCL_VP_ATTRIB_EN 0x00001ff0 -#define NV40TCL_VP_RESULT_EN 0x00001ff4 - - -#define NV44TCL 0x00004497 - - - -#define NV50_2D 0x0000502d - -#define NV50_2D_NOP 0x00000100 -#define NV50_2D_NOTIFY 0x00000104 -#define NV50_2D_DMA_NOTIFY 0x00000180 -#define NV50_2D_DMA_IN_MEMORY0 0x00000184 -#define NV50_2D_DMA_IN_MEMORY1 0x00000188 -#define NV50_2D_DMA_IN_MEMORY2 0x0000018c -#define NV50_2D_DST_FORMAT 0x00000200 -#define NV50_2D_DST_FORMAT_32BPP 0x000000cf -#define NV50_2D_DST_FORMAT_24BPP 0x000000e6 -#define NV50_2D_DST_FORMAT_16BPP 0x000000e8 -#define NV50_2D_DST_FORMAT_8BPP 0x000000f3 -#define NV50_2D_DST_FORMAT_15BPP 0x000000f8 -#define NV50_2D_DST_PITCH 0x00000214 -#define NV50_2D_DST_WIDTH 0x00000218 -#define NV50_2D_DST_HEIGHT 0x0000021c -#define NV50_2D_DST_ADDRESS_HIGH 0x00000220 -#define NV50_2D_DST_ADDRESS_LOW 0x00000224 -#define NV50_2D_SRC_FORMAT 0x00000230 -#define NV50_2D_SRC_FORMAT_32BPP 0x000000cf -#define NV50_2D_SRC_FORMAT_24BPP 0x000000e6 -#define NV50_2D_SRC_FORMAT_16BPP 0x000000e8 -#define NV50_2D_SRC_FORMAT_8BPP 0x000000f3 -#define NV50_2D_SRC_FORMAT_15BPP 0x000000f8 -#define NV50_2D_SRC_PITCH 0x00000244 -#define NV50_2D_SRC_WIDTH 0x00000248 -#define NV50_2D_SRC_HEIGHT 0x0000024c -#define NV50_2D_SRC_ADDRESS_HIGH 0x00000250 -#define NV50_2D_SRC_ADDRESS_LOW 0x00000254 -#define NV50_2D_CLIP_X 0x00000280 -#define NV50_2D_CLIP_Y 0x00000284 -#define NV50_2D_CLIP_Z 0x00000288 -#define NV50_2D_CLIP_W 0x0000028c -#define NV50_2D_ROP 0x000002a0 -#define NV50_2D_OPERATION 0x000002ac -#define NV50_2D_OPERATION_SRCCOPY_AND 0x00000000 -#define NV50_2D_OPERATION_ROP_AND 0x00000001 -#define NV50_2D_OPERATION_BLEND_AND 0x00000002 -#define NV50_2D_OPERATION_SRCCOPY 0x00000003 -#define NV50_2D_OPERATION_SRCCOPY_PREMULT 0x00000004 -#define NV50_2D_OPERATION_BLEND_PREMULT 0x00000005 -#define NV50_2D_PATTERN_FORMAT 0x000002e8 -#define NV50_2D_PATTERN_FORMAT_16BPP 0x00000000 -#define NV50_2D_PATTERN_FORMAT_15BPP 0x00000001 -#define NV50_2D_PATTERN_FORMAT_32BPP 0x00000002 -#define NV50_2D_PATTERN_FORMAT_8BPP 0x00000003 -#define NV50_2D_PATTERN_COLOR(x) (0x000002f0+((x)*4)) -#define NV50_2D_PATTERN_COLOR__SIZE 0x00000002 -#define NV50_2D_PATTERN_BITMAP(x) (0x000002f8+((x)*4)) -#define NV50_2D_PATTERN_BITMAP__SIZE 0x00000002 -#define NV50_2D_RECT_FORMAT 0x00000584 -#define NV50_2D_RECT_FORMAT_32BPP 0x000000cf -#define NV50_2D_RECT_FORMAT_24BPP 0x000000e6 -#define NV50_2D_RECT_FORMAT_16BPP 0x000000e8 -#define NV50_2D_RECT_FORMAT_8BPP 0x000000f3 -#define NV50_2D_RECT_FORMAT_15BPP 0x000000f8 -#define NV50_2D_RECT_COLOR 0x00000588 -#define NV50_2D_RECT_X1 0x00000600 -#define NV50_2D_RECT_Y1 0x00000604 -#define NV50_2D_RECT_X2 0x00000608 -#define NV50_2D_RECT_Y2 0x0000060c -#define NV50_2D_SIFC_UNK0800 0x00000800 -#define NV50_2D_SIFC_FORMAT 0x00000804 -#define NV50_2D_SIFC_FORMAT_32BPP 0x000000cf -#define NV50_2D_SIFC_FORMAT_24BPP 0x000000e6 -#define NV50_2D_SIFC_FORMAT_16BPP 0x000000e8 -#define NV50_2D_SIFC_FORMAT_8BPP 0x000000f3 -#define NV50_2D_SIFC_FORMAT_15BPP 0x000000f8 -#define NV50_2D_SIFC_WIDTH 0x00000838 -#define NV50_2D_SIFC_HEIGHT 0x0000083c -#define NV50_2D_SIFC_SCALE_UNK0840 0x00000840 -#define NV50_2D_SIFC_SCALE_UNK0844 0x00000844 -#define NV50_2D_SIFC_SCALE_UNK0848 0x00000848 -#define NV50_2D_SIFC_SCALE_UNK084C 0x0000084c -#define NV50_2D_SIFC_UNK0850 0x00000850 -#define NV50_2D_SIFC_DST_X 0x00000854 -#define NV50_2D_SIFC_UNK0858 0x00000858 -#define NV50_2D_SIFC_DST_Y 0x0000085c -#define NV50_2D_SIFC_DATA 0x00000860 -#define NV50_2D_BLIT_DST_X 0x000008b0 -#define NV50_2D_BLIT_DST_Y 0x000008b4 -#define NV50_2D_BLIT_DST_W 0x000008b8 -#define NV50_2D_BLIT_DST_H 0x000008bc -#define NV50_2D_BLIT_SRC_X 0x000008d4 -#define NV50_2D_BLIT_SRC_Y 0x000008dc - - -#define NV50_MEMORY_TO_MEMORY_FORMAT 0x00005039 - -#define NV50_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN_HIGH 0x00000238 -#define NV50_MEMORY_TO_MEMORY_FORMAT_OFFSET_OUT_HIGH 0x0000023c - - -#define NV50TCL 0x00005097 - -#define NV50TCL_NOP 0x00000100 -#define NV50TCL_NOTIFY 0x00000104 -#define NV50TCL_DMA_NOTIFY 0x00000180 -#define NV50TCL_DMA_UNK0(x) (0x00000184+((x)*4)) -#define NV50TCL_DMA_UNK0__SIZE 0x0000000b -#define NV50TCL_DMA_UNK1(x) (0x000001c0+((x)*4)) -#define NV50TCL_DMA_UNK1__SIZE 0x00000008 -#define NV50TCL_RT_ADDRESS_HIGH(x) (0x00000200+((x)*32)) -#define NV50TCL_RT_ADDRESS_HIGH__SIZE 0x00000008 -#define NV50TCL_RT_ADDRESS_LOW(x) (0x00000204+((x)*32)) -#define NV50TCL_RT_ADDRESS_LOW__SIZE 0x00000008 -#define NV50TCL_RT_FORMAT(x) (0x00000208+((x)*32)) -#define NV50TCL_RT_FORMAT__SIZE 0x00000008 -#define NV50TCL_RT_FORMAT_32BPP 0x000000cf -#define NV50TCL_RT_FORMAT_24BPP 0x000000e6 -#define NV50TCL_RT_FORMAT_16BPP 0x000000e8 -#define NV50TCL_RT_FORMAT_8BPP 0x000000f3 -#define NV50TCL_RT_FORMAT_15BPP 0x000000f8 -#define NV50TCL_RT_TILE_UNK(x) (0x0000020c+((x)*32)) -#define NV50TCL_RT_TILE_UNK__SIZE 0x00000008 -#define NV50TCL_RT_UNK4(x) (0x00000210+((x)*32)) -#define NV50TCL_RT_UNK4__SIZE 0x00000008 -#define NV50TCL_VTX_ATTR_1F(x) (0x00000300+((x)*4)) -#define NV50TCL_VTX_ATTR_1F__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_2F_X(x) (0x00000380+((x)*8)) -#define NV50TCL_VTX_ATTR_2F_X__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_2F_Y(x) (0x00000384+((x)*8)) -#define NV50TCL_VTX_ATTR_2F_Y__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_3F_X(x) (0x00000400+((x)*16)) -#define NV50TCL_VTX_ATTR_3F_X__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_3F_Y(x) (0x00000404+((x)*16)) -#define NV50TCL_VTX_ATTR_3F_Y__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_3F_Z(x) (0x00000408+((x)*16)) -#define NV50TCL_VTX_ATTR_3F_Z__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_3F_W(x) (0x0000040c+((x)*16)) -#define NV50TCL_VTX_ATTR_3F_W__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4F_X(x) (0x00000500+((x)*16)) -#define NV50TCL_VTX_ATTR_4F_X__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4F_Y(x) (0x00000504+((x)*16)) -#define NV50TCL_VTX_ATTR_4F_Y__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4F_Z(x) (0x00000508+((x)*16)) -#define NV50TCL_VTX_ATTR_4F_Z__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4F_W(x) (0x0000050c+((x)*16)) -#define NV50TCL_VTX_ATTR_4F_W__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_2I(x) (0x00000680+((x)*4)) -#define NV50TCL_VTX_ATTR_2I__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_2I_X_SHIFT 0 -#define NV50TCL_VTX_ATTR_2I_X_MASK 0x0000ffff -#define NV50TCL_VTX_ATTR_2I_Y_SHIFT 16 -#define NV50TCL_VTX_ATTR_2I_Y_MASK 0xffff0000 -#define NV50TCL_VTX_ATTR_4I_0(x) (0x00000700+((x)*8)) -#define NV50TCL_VTX_ATTR_4I_0__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4I_0_X_SHIFT 0 -#define NV50TCL_VTX_ATTR_4I_0_X_MASK 0x0000ffff -#define NV50TCL_VTX_ATTR_4I_0_Y_SHIFT 16 -#define NV50TCL_VTX_ATTR_4I_0_Y_MASK 0xffff0000 -#define NV50TCL_VTX_ATTR_4I_1(x) (0x00000704+((x)*8)) -#define NV50TCL_VTX_ATTR_4I_1__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4I_1_Z_SHIFT 0 -#define NV50TCL_VTX_ATTR_4I_1_Z_MASK 0x0000ffff -#define NV50TCL_VTX_ATTR_4I_1_W_SHIFT 16 -#define NV50TCL_VTX_ATTR_4I_1_W_MASK 0xffff0000 -#define NV50TCL_VTX_ATTR_4NI_0(x) (0x00000780+((x)*8)) -#define NV50TCL_VTX_ATTR_4NI_0__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4NI_0_X_SHIFT 0 -#define NV50TCL_VTX_ATTR_4NI_0_X_MASK 0x0000ffff -#define NV50TCL_VTX_ATTR_4NI_0_Y_SHIFT 16 -#define NV50TCL_VTX_ATTR_4NI_0_Y_MASK 0xffff0000 -#define NV50TCL_VTX_ATTR_4NI_1(x) (0x00000784+((x)*8)) -#define NV50TCL_VTX_ATTR_4NI_1__SIZE 0x00000010 -#define NV50TCL_VTX_ATTR_4NI_1_Z_SHIFT 0 -#define NV50TCL_VTX_ATTR_4NI_1_Z_MASK 0x0000ffff -#define NV50TCL_VTX_ATTR_4NI_1_W_SHIFT 16 -#define NV50TCL_VTX_ATTR_4NI_1_W_MASK 0xffff0000 -#define NV50TCL_VERTEX_ARRAY_FORMAT(x) (0x00000900+((x)*16)) -#define NV50TCL_VERTEX_ARRAY_FORMAT__SIZE 0x00000010 -#define NV50TCL_VIEWPORT_UNK0(x) (0x00000a00+((x)*4)) -#define NV50TCL_VIEWPORT_UNK0__SIZE 0x00000003 -#define NV50TCL_VIEWPORT_UNK1(x) (0x00000a0c+((x)*4)) -#define NV50TCL_VIEWPORT_UNK1__SIZE 0x00000003 -#define NV50TCL_VIEWPORT_HORIZ 0x00000c00 -#define NV50TCL_VIEWPORT_HORIZ_X_SHIFT 0 -#define NV50TCL_VIEWPORT_HORIZ_X_MASK 0x0000ffff -#define NV50TCL_VIEWPORT_HORIZ_W_SHIFT 16 -#define NV50TCL_VIEWPORT_HORIZ_W_MASK 0xffff0000 -#define NV50TCL_VIEWPORT_VERT 0x00000c04 -#define NV50TCL_VIEWPORT_VERT_Y_SHIFT 0 -#define NV50TCL_VIEWPORT_VERT_Y_MASK 0x0000ffff -#define NV50TCL_VIEWPORT_VERT_H_SHIFT 16 -#define NV50TCL_VIEWPORT_VERT_H_MASK 0xffff0000 -#define NV50TCL_DEPTH_RANGE_NEAR 0x00000c08 -#define NV50TCL_DEPTH_RANGE_FAR 0x00000c0c -#define NV50TCL_VIEWPORT_CLIP_HORIZ(x) (0x00000d00+((x)*8)) -#define NV50TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008 -#define NV50TCL_VIEWPORT_CLIP_VERT(x) (0x00000d04+((x)*8)) -#define NV50TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008 -#define NV50TCL_VERTEX_BUFFER_FIRST 0x00000d74 -#define NV50TCL_VERTEX_BUFFER_COUNT 0x00000d78 -#define NV50TCL_CLEAR_COLOR(x) (0x00000d80+((x)*4)) -#define NV50TCL_CLEAR_COLOR__SIZE 0x00000004 -#define NV50TCL_CLEAR_DEPTH 0x00000d90 -#define NV50TCL_CLEAR_STENCIL 0x00000da0 -#define NV50TCL_POLYGON_MODE_FRONT 0x00000dac -#define NV50TCL_POLYGON_MODE_FRONT_POINT 0x00001b00 -#define NV50TCL_POLYGON_MODE_FRONT_LINE 0x00001b01 -#define NV50TCL_POLYGON_MODE_FRONT_FILL 0x00001b02 -#define NV50TCL_POLYGON_MODE_BACK 0x00000db0 -#define NV50TCL_POLYGON_MODE_BACK_POINT 0x00001b00 -#define NV50TCL_POLYGON_MODE_BACK_LINE 0x00001b01 -#define NV50TCL_POLYGON_MODE_BACK_FILL 0x00001b02 -#define NV50TCL_POLYGON_SMOOTH_ENABLE 0x00000db4 -#define NV50TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000dc0 -#define NV50TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000dc4 -#define NV50TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000dc8 -#define NV50TCL_SCISSOR_HORIZ 0x00000e04 -#define NV50TCL_SCISSOR_HORIZ_L_SHIFT 0 -#define NV50TCL_SCISSOR_HORIZ_L_MASK 0x0000ffff -#define NV50TCL_SCISSOR_HORIZ_R_SHIFT 16 -#define NV50TCL_SCISSOR_HORIZ_R_MASK 0xffff0000 -#define NV50TCL_SCISSOR_VERT 0x00000e08 -#define NV50TCL_SCISSOR_VERT_T_SHIFT 0 -#define NV50TCL_SCISSOR_VERT_T_MASK 0x0000ffff -#define NV50TCL_SCISSOR_VERT_B_SHIFT 16 -#define NV50TCL_SCISSOR_VERT_B_MASK 0xffff0000 -#define NV50TCL_CB_ADDR 0x00000f00 -#define NV50TCL_CB_ADDR_ID_SHIFT 8 -#define NV50TCL_CB_ADDR_ID_MASK 0xffffff00 -#define NV50TCL_CB_ADDR_BUFFER_SHIFT 0 -#define NV50TCL_CB_ADDR_BUFFER_MASK 0x000000ff -#define NV50TCL_CB_DATA(x) (0x00000f04+((x)*4)) -#define NV50TCL_CB_DATA__SIZE 0x00000010 -#define NV50TCL_STENCIL_FRONT_FUNC_REF 0x00000f54 -#define NV50TCL_STENCIL_FRONT_MASK 0x00000f58 -#define NV50TCL_STENCIL_FRONT_FUNC_MASK 0x00000f5c -#define NV50TCL_GP_ADDRESS_HIGH 0x00000f70 -#define NV50TCL_GP_ADDRESS_LOW 0x00000f74 -#define NV50TCL_VP_ADDRESS_HIGH 0x00000f7c -#define NV50TCL_VP_ADDRESS_LOW 0x00000f80 -#define NV50TCL_FP_ADDRESS_HIGH 0x00000fa4 -#define NV50TCL_FP_ADDRESS_LOW 0x00000fa8 -#define NV50TCL_ZETA_ADDRESS_HIGH 0x00000fe0 -#define NV50TCL_ZETA_ADDRESS_LOW 0x00000fe4 -#define NV50TCL_UNKFF4 0x00000ff4 -#define NV50TCL_UNKFF4_W_SHIFT 16 -#define NV50TCL_UNKFF4_W_MASK 0xffff0000 -#define NV50TCL_UNKFF8 0x00000ff8 -#define NV50TCL_UNKFF8_H_SHIFT 16 -#define NV50TCL_UNKFF8_H_MASK 0xffff0000 -#define NV50TCL_RT_HORIZ(x) (0x00001240+((x)*8)) -#define NV50TCL_RT_HORIZ__SIZE 0x00000008 -#define NV50TCL_RT_VERT(x) (0x00001244+((x)*8)) -#define NV50TCL_RT_VERT__SIZE 0x00000008 -#define NV50TCL_CB_DEF_ADDRESS_HIGH 0x00001280 -#define NV50TCL_CB_DEF_ADDRESS_LOW 0x00001284 -#define NV50TCL_CB_DEF_SET 0x00001288 -#define NV50TCL_CB_DEF_SET_SIZE_SHIFT 0 -#define NV50TCL_CB_DEF_SET_SIZE_MASK 0x0000ffff -#define NV50TCL_CB_DEF_SET_BUFFER_SHIFT 16 -#define NV50TCL_CB_DEF_SET_BUFFER_MASK 0xffff0000 -#define NV50TCL_DEPTH_TEST_ENABLE 0x000012cc -#define NV50TCL_SHADE_MODEL 0x000012d4 -#define NV50TCL_SHADE_MODEL_FLAT 0x00001d00 -#define NV50TCL_SHADE_MODEL_SMOOTH 0x00001d01 -#define NV50TCL_DEPTH_WRITE_ENABLE 0x000012e8 -#define NV50TCL_ALPHA_TEST_ENABLE 0x000012ec -#define NV50TCL_DEPTH_TEST_FUNC 0x0000130c -#define NV50TCL_DEPTH_TEST_FUNC_NEVER 0x00000200 -#define NV50TCL_DEPTH_TEST_FUNC_LESS 0x00000201 -#define NV50TCL_DEPTH_TEST_FUNC_EQUAL 0x00000202 -#define NV50TCL_DEPTH_TEST_FUNC_LEQUAL 0x00000203 -#define NV50TCL_DEPTH_TEST_FUNC_GREATER 0x00000204 -#define NV50TCL_DEPTH_TEST_FUNC_GREATER 0x00000204 -#define NV50TCL_DEPTH_TEST_FUNC_NOTEQUAL 0x00000205 -#define NV50TCL_DEPTH_TEST_FUNC_GEQUAL 0x00000206 -#define NV50TCL_DEPTH_TEST_FUNC_ALWAYS 0x00000207 -#define NV50TCL_ALPHA_TEST_REF 0x00001310 -#define NV50TCL_ALPHA_TEST_FUNC 0x00001314 -#define NV50TCL_ALPHA_TEST_FUNC_NEVER 0x00000200 -#define NV50TCL_ALPHA_TEST_FUNC_LESS 0x00000201 -#define NV50TCL_ALPHA_TEST_FUNC_EQUAL 0x00000202 -#define NV50TCL_ALPHA_TEST_FUNC_LEQUAL 0x00000203 -#define NV50TCL_ALPHA_TEST_FUNC_GREATER 0x00000204 -#define NV50TCL_ALPHA_TEST_FUNC_GREATER 0x00000204 -#define NV50TCL_ALPHA_TEST_FUNC_NOTEQUAL 0x00000205 -#define NV50TCL_ALPHA_TEST_FUNC_GEQUAL 0x00000206 -#define NV50TCL_ALPHA_TEST_FUNC_ALWAYS 0x00000207 -#define NV50TCL_BLEND_COLOR(x) (0x0000131c+((x)*4)) -#define NV50TCL_BLEND_COLOR__SIZE 0x00000004 -#define NV50TCL_BLEND_EQUATION_RGB 0x00001340 -#define NV50TCL_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006 -#define NV50TCL_BLEND_EQUATION_RGB_MIN 0x00008007 -#define NV50TCL_BLEND_EQUATION_RGB_MAX 0x00008008 -#define NV50TCL_BLEND_EQUATION_RGB_FUNC_SUBTRACT 0x0000800a -#define NV50TCL_BLEND_EQUATION_RGB_FUNC_REVERSE_SUBTRACT 0x0000800b -#define NV50TCL_BLEND_FUNC_SRC_RGB 0x00001344 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ZERO 0x00000000 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE 0x00000001 -#define NV50TCL_BLEND_FUNC_SRC_RGB_SRC_COLOR 0x00000300 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV50TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA 0x00000302 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV50TCL_BLEND_FUNC_SRC_RGB_DST_ALPHA 0x00000304 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV50TCL_BLEND_FUNC_SRC_RGB_DST_COLOR 0x00000306 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_COLOR 0x00000307 -#define NV50TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA_SATURATE 0x00000308 -#define NV50TCL_BLEND_FUNC_SRC_RGB_CONSTANT_COLOR 0x00008001 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV50TCL_BLEND_FUNC_SRC_RGB_CONSTANT_ALPHA 0x00008003 -#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV50TCL_BLEND_FUNC_DST_RGB 0x00001348 -#define NV50TCL_BLEND_FUNC_DST_RGB_ZERO 0x00000000 -#define NV50TCL_BLEND_FUNC_DST_RGB_ONE 0x00000001 -#define NV50TCL_BLEND_FUNC_DST_RGB_SRC_COLOR 0x00000300 -#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV50TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA 0x00000302 -#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV50TCL_BLEND_FUNC_DST_RGB_DST_ALPHA 0x00000304 -#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV50TCL_BLEND_FUNC_DST_RGB_DST_COLOR 0x00000306 -#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_COLOR 0x00000307 -#define NV50TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA_SATURATE 0x00000308 -#define NV50TCL_BLEND_FUNC_DST_RGB_CONSTANT_COLOR 0x00008001 -#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV50TCL_BLEND_FUNC_DST_RGB_CONSTANT_ALPHA 0x00008003 -#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV50TCL_BLEND_EQUATION_ALPHA 0x0000134c -#define NV50TCL_BLEND_EQUATION_ALPHA_FUNC_ADD 0x00008006 -#define NV50TCL_BLEND_EQUATION_ALPHA_MIN 0x00008007 -#define NV50TCL_BLEND_EQUATION_ALPHA_MAX 0x00008008 -#define NV50TCL_BLEND_EQUATION_ALPHA_FUNC_SUBTRACT 0x0000800a -#define NV50TCL_BLEND_EQUATION_ALPHA_FUNC_REVERSE_SUBTRACT 0x0000800b -#define NV50TCL_BLEND_FUNC_SRC_ALPHA 0x00001350 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ZERO 0x00000000 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE 0x00000001 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_SRC_COLOR 0x00000300 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA 0x00000302 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_DST_ALPHA 0x00000304 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_DST_COLOR 0x00000306 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_COLOR 0x00000307 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA_SATURATE 0x00000308 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_COLOR 0x00008001 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_ALPHA 0x00008003 -#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV50TCL_BLEND_FUNC_DST_ALPHA 0x00001358 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ZERO 0x00000000 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE 0x00000001 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_SRC_COLOR 0x00000300 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_COLOR 0x00000301 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA 0x00000302 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_ALPHA 0x00000303 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_DST_ALPHA 0x00000304 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_ALPHA 0x00000305 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_DST_COLOR 0x00000306 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_COLOR 0x00000307 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA_SATURATE 0x00000308 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_COLOR 0x00008001 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x00008002 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_ALPHA 0x00008003 -#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x00008004 -#define NV50TCL_BLEND_ENABLE(x) (0x00001360+((x)*4)) -#define NV50TCL_BLEND_ENABLE__SIZE 0x00000008 -#define NV50TCL_STENCIL_BACK_ENABLE 0x00001380 -#define NV50TCL_STENCIL_BACK_OP_FAIL 0x00001384 -#define NV50TCL_STENCIL_BACK_OP_FAIL_ZERO 0x00000000 -#define NV50TCL_STENCIL_BACK_OP_FAIL_INVERT 0x0000150a -#define NV50TCL_STENCIL_BACK_OP_FAIL_KEEP 0x00001e00 -#define NV50TCL_STENCIL_BACK_OP_FAIL_REPLACE 0x00001e01 -#define NV50TCL_STENCIL_BACK_OP_FAIL_INCR 0x00001e02 -#define NV50TCL_STENCIL_BACK_OP_FAIL_DECR 0x00001e03 -#define NV50TCL_STENCIL_BACK_OP_FAIL_INCR_WRAP 0x00008507 -#define NV50TCL_STENCIL_BACK_OP_FAIL_DECR_WRAP 0x00008508 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL 0x00001388 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_ZERO 0x00000000 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_INVERT 0x0000150a -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_KEEP 0x00001e00 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_REPLACE 0x00001e01 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_INCR 0x00001e02 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_DECR 0x00001e03 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV50TCL_STENCIL_BACK_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV50TCL_STENCIL_BACK_OP_ZPASS 0x0000138c -#define NV50TCL_STENCIL_BACK_OP_ZPASS_ZERO 0x00000000 -#define NV50TCL_STENCIL_BACK_OP_ZPASS_INVERT 0x0000150a -#define NV50TCL_STENCIL_BACK_OP_ZPASS_KEEP 0x00001e00 -#define NV50TCL_STENCIL_BACK_OP_ZPASS_REPLACE 0x00001e01 -#define NV50TCL_STENCIL_BACK_OP_ZPASS_INCR 0x00001e02 -#define NV50TCL_STENCIL_BACK_OP_ZPASS_DECR 0x00001e03 -#define NV50TCL_STENCIL_BACK_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV50TCL_STENCIL_BACK_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC 0x00001390 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_NEVER 0x00000200 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_LESS 0x00000201 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_EQUAL 0x00000202 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_LEQUAL 0x00000203 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_GEQUAL 0x00000206 -#define NV50TCL_STENCIL_BACK_FUNC_FUNC_ALWAYS 0x00000207 -#define NV50TCL_STENCIL_BACK_FUNC_REF 0x00001394 -#define NV50TCL_STENCIL_BACK_MASK 0x00001398 -#define NV50TCL_STENCIL_BACK_FUNC_MASK 0x0000139c -#define NV50TCL_LINE_WIDTH 0x000013b0 -#define NV50TCL_VP_START_ID 0x0000140c -#define NV50TCL_GP_START_ID 0x00001410 -#define NV50TCL_FP_START_ID 0x00001414 -#define NV50TCL_POINT_SIZE 0x00001518 -#define NV50TCL_TSC_ADDRESS_HIGH 0x0000155c -#define NV50TCL_TSC_ADDRESS_LOW 0x00001560 -#define NV50TCL_POLYGON_OFFSET_FACTOR 0x0000156c -#define NV50TCL_LINE_SMOOTH_ENABLE 0x00001570 -#define NV50TCL_TIC_ADDRESS_HIGH 0x00001574 -#define NV50TCL_TIC_ADDRESS_LOW 0x00001578 -#define NV50TCL_STENCIL_FRONT_ENABLE 0x00001594 -#define NV50TCL_STENCIL_FRONT_OP_FAIL 0x00001598 -#define NV50TCL_STENCIL_FRONT_OP_FAIL_ZERO 0x00000000 -#define NV50TCL_STENCIL_FRONT_OP_FAIL_INVERT 0x0000150a -#define NV50TCL_STENCIL_FRONT_OP_FAIL_KEEP 0x00001e00 -#define NV50TCL_STENCIL_FRONT_OP_FAIL_REPLACE 0x00001e01 -#define NV50TCL_STENCIL_FRONT_OP_FAIL_INCR 0x00001e02 -#define NV50TCL_STENCIL_FRONT_OP_FAIL_DECR 0x00001e03 -#define NV50TCL_STENCIL_FRONT_OP_FAIL_INCR_WRAP 0x00008507 -#define NV50TCL_STENCIL_FRONT_OP_FAIL_DECR_WRAP 0x00008508 -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL 0x0000159c -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_ZERO 0x00000000 -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_INVERT 0x0000150a -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_KEEP 0x00001e00 -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_REPLACE 0x00001e01 -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_INCR 0x00001e02 -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_DECR 0x00001e03 -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_INCR_WRAP 0x00008507 -#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_DECR_WRAP 0x00008508 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS 0x000015a0 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_ZERO 0x00000000 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_INVERT 0x0000150a -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_KEEP 0x00001e00 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_REPLACE 0x00001e01 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_INCR 0x00001e02 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_DECR 0x00001e03 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_INCR_WRAP 0x00008507 -#define NV50TCL_STENCIL_FRONT_OP_ZPASS_DECR_WRAP 0x00008508 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC 0x000015a4 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_NEVER 0x00000200 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_LESS 0x00000201 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_EQUAL 0x00000202 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_LEQUAL 0x00000203 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_NOTEQUAL 0x00000205 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_GEQUAL 0x00000206 -#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_ALWAYS 0x00000207 -#define NV50TCL_POLYGON_OFFSET_UNITS 0x000015bc -#define NV50TCL_VERTEX_BEGIN 0x000015dc -#define NV50TCL_VERTEX_BEGIN_POINTS 0x00000000 -#define NV50TCL_VERTEX_BEGIN_LINES 0x00000001 -#define NV50TCL_VERTEX_BEGIN_LINE_LOOP 0x00000002 -#define NV50TCL_VERTEX_BEGIN_LINE_STRIP 0x00000003 -#define NV50TCL_VERTEX_BEGIN_TRIANGLES 0x00000004 -#define NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP 0x00000005 -#define NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN 0x00000006 -#define NV50TCL_VERTEX_BEGIN_QUADS 0x00000007 -#define NV50TCL_VERTEX_BEGIN_QUAD_STRIP 0x00000008 -#define NV50TCL_VERTEX_BEGIN_POLYGON 0x00000009 -#define NV50TCL_VERTEX_END 0x000015e0 -#define NV50TCL_VERTEX_DATA 0x00001640 -#define NV50TCL_VP_ATTR_EN_0 0x00001650 -#define NV50TCL_VP_ATTR_EN_0_7_SHIFT 28 -#define NV50TCL_VP_ATTR_EN_0_7_MASK 0xf0000000 -#define NV50TCL_VP_ATTR_EN_0_7_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_7_XNNN 0x10000000 -#define NV50TCL_VP_ATTR_EN_0_7_NYNN 0x20000000 -#define NV50TCL_VP_ATTR_EN_0_7_XYNN 0x30000000 -#define NV50TCL_VP_ATTR_EN_0_7_NNZN 0x40000000 -#define NV50TCL_VP_ATTR_EN_0_7_XNZN 0x50000000 -#define NV50TCL_VP_ATTR_EN_0_7_NYZN 0x60000000 -#define NV50TCL_VP_ATTR_EN_0_7_XYZN 0x70000000 -#define NV50TCL_VP_ATTR_EN_0_7_NNNW 0x80000000 -#define NV50TCL_VP_ATTR_EN_0_7_XNNW 0x90000000 -#define NV50TCL_VP_ATTR_EN_0_7_NYNW 0xa0000000 -#define NV50TCL_VP_ATTR_EN_0_7_XYNW 0xb0000000 -#define NV50TCL_VP_ATTR_EN_0_7_NNZW 0xc0000000 -#define NV50TCL_VP_ATTR_EN_0_7_XNZW 0xd0000000 -#define NV50TCL_VP_ATTR_EN_0_7_NYZW 0xe0000000 -#define NV50TCL_VP_ATTR_EN_0_7_XYZW 0xf0000000 -#define NV50TCL_VP_ATTR_EN_0_6_SHIFT 24 -#define NV50TCL_VP_ATTR_EN_0_6_MASK 0x0f000000 -#define NV50TCL_VP_ATTR_EN_0_6_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_6_XNNN 0x01000000 -#define NV50TCL_VP_ATTR_EN_0_6_NYNN 0x02000000 -#define NV50TCL_VP_ATTR_EN_0_6_XYNN 0x03000000 -#define NV50TCL_VP_ATTR_EN_0_6_NNZN 0x04000000 -#define NV50TCL_VP_ATTR_EN_0_6_XNZN 0x05000000 -#define NV50TCL_VP_ATTR_EN_0_6_NYZN 0x06000000 -#define NV50TCL_VP_ATTR_EN_0_6_XYZN 0x07000000 -#define NV50TCL_VP_ATTR_EN_0_6_NNNW 0x08000000 -#define NV50TCL_VP_ATTR_EN_0_6_XNNW 0x09000000 -#define NV50TCL_VP_ATTR_EN_0_6_NYNW 0x0a000000 -#define NV50TCL_VP_ATTR_EN_0_6_XYNW 0x0b000000 -#define NV50TCL_VP_ATTR_EN_0_6_NNZW 0x0c000000 -#define NV50TCL_VP_ATTR_EN_0_6_XNZW 0x0d000000 -#define NV50TCL_VP_ATTR_EN_0_6_NYZW 0x0e000000 -#define NV50TCL_VP_ATTR_EN_0_6_XYZW 0x0f000000 -#define NV50TCL_VP_ATTR_EN_0_5_SHIFT 20 -#define NV50TCL_VP_ATTR_EN_0_5_MASK 0x00f00000 -#define NV50TCL_VP_ATTR_EN_0_5_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_5_XNNN 0x00100000 -#define NV50TCL_VP_ATTR_EN_0_5_NYNN 0x00200000 -#define NV50TCL_VP_ATTR_EN_0_5_XYNN 0x00300000 -#define NV50TCL_VP_ATTR_EN_0_5_NNZN 0x00400000 -#define NV50TCL_VP_ATTR_EN_0_5_XNZN 0x00500000 -#define NV50TCL_VP_ATTR_EN_0_5_NYZN 0x00600000 -#define NV50TCL_VP_ATTR_EN_0_5_XYZN 0x00700000 -#define NV50TCL_VP_ATTR_EN_0_5_NNNW 0x00800000 -#define NV50TCL_VP_ATTR_EN_0_5_XNNW 0x00900000 -#define NV50TCL_VP_ATTR_EN_0_5_NYNW 0x00a00000 -#define NV50TCL_VP_ATTR_EN_0_5_XYNW 0x00b00000 -#define NV50TCL_VP_ATTR_EN_0_5_NNZW 0x00c00000 -#define NV50TCL_VP_ATTR_EN_0_5_XNZW 0x00d00000 -#define NV50TCL_VP_ATTR_EN_0_5_NYZW 0x00e00000 -#define NV50TCL_VP_ATTR_EN_0_5_XYZW 0x00f00000 -#define NV50TCL_VP_ATTR_EN_0_4_SHIFT 16 -#define NV50TCL_VP_ATTR_EN_0_4_MASK 0x000f0000 -#define NV50TCL_VP_ATTR_EN_0_4_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_4_XNNN 0x00010000 -#define NV50TCL_VP_ATTR_EN_0_4_NYNN 0x00020000 -#define NV50TCL_VP_ATTR_EN_0_4_XYNN 0x00030000 -#define NV50TCL_VP_ATTR_EN_0_4_NNZN 0x00040000 -#define NV50TCL_VP_ATTR_EN_0_4_XNZN 0x00050000 -#define NV50TCL_VP_ATTR_EN_0_4_NYZN 0x00060000 -#define NV50TCL_VP_ATTR_EN_0_4_XYZN 0x00070000 -#define NV50TCL_VP_ATTR_EN_0_4_NNNW 0x00080000 -#define NV50TCL_VP_ATTR_EN_0_4_XNNW 0x00090000 -#define NV50TCL_VP_ATTR_EN_0_4_NYNW 0x000a0000 -#define NV50TCL_VP_ATTR_EN_0_4_XYNW 0x000b0000 -#define NV50TCL_VP_ATTR_EN_0_4_NNZW 0x000c0000 -#define NV50TCL_VP_ATTR_EN_0_4_XNZW 0x000d0000 -#define NV50TCL_VP_ATTR_EN_0_4_NYZW 0x000e0000 -#define NV50TCL_VP_ATTR_EN_0_4_XYZW 0x000f0000 -#define NV50TCL_VP_ATTR_EN_0_3_SHIFT 12 -#define NV50TCL_VP_ATTR_EN_0_3_MASK 0x0000f000 -#define NV50TCL_VP_ATTR_EN_0_3_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_3_XNNN 0x00001000 -#define NV50TCL_VP_ATTR_EN_0_3_NYNN 0x00002000 -#define NV50TCL_VP_ATTR_EN_0_3_XYNN 0x00003000 -#define NV50TCL_VP_ATTR_EN_0_3_NNZN 0x00004000 -#define NV50TCL_VP_ATTR_EN_0_3_XNZN 0x00005000 -#define NV50TCL_VP_ATTR_EN_0_3_NYZN 0x00006000 -#define NV50TCL_VP_ATTR_EN_0_3_XYZN 0x00007000 -#define NV50TCL_VP_ATTR_EN_0_3_NNNW 0x00008000 -#define NV50TCL_VP_ATTR_EN_0_3_XNNW 0x00009000 -#define NV50TCL_VP_ATTR_EN_0_3_NYNW 0x0000a000 -#define NV50TCL_VP_ATTR_EN_0_3_XYNW 0x0000b000 -#define NV50TCL_VP_ATTR_EN_0_3_NNZW 0x0000c000 -#define NV50TCL_VP_ATTR_EN_0_3_XNZW 0x0000d000 -#define NV50TCL_VP_ATTR_EN_0_3_NYZW 0x0000e000 -#define NV50TCL_VP_ATTR_EN_0_3_XYZW 0x0000f000 -#define NV50TCL_VP_ATTR_EN_0_2_SHIFT 8 -#define NV50TCL_VP_ATTR_EN_0_2_MASK 0x00000f00 -#define NV50TCL_VP_ATTR_EN_0_2_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_2_XNNN 0x00000100 -#define NV50TCL_VP_ATTR_EN_0_2_NYNN 0x00000200 -#define NV50TCL_VP_ATTR_EN_0_2_XYNN 0x00000300 -#define NV50TCL_VP_ATTR_EN_0_2_NNZN 0x00000400 -#define NV50TCL_VP_ATTR_EN_0_2_XNZN 0x00000500 -#define NV50TCL_VP_ATTR_EN_0_2_NYZN 0x00000600 -#define NV50TCL_VP_ATTR_EN_0_2_XYZN 0x00000700 -#define NV50TCL_VP_ATTR_EN_0_2_NNNW 0x00000800 -#define NV50TCL_VP_ATTR_EN_0_2_XNNW 0x00000900 -#define NV50TCL_VP_ATTR_EN_0_2_NYNW 0x00000a00 -#define NV50TCL_VP_ATTR_EN_0_2_XYNW 0x00000b00 -#define NV50TCL_VP_ATTR_EN_0_2_NNZW 0x00000c00 -#define NV50TCL_VP_ATTR_EN_0_2_XNZW 0x00000d00 -#define NV50TCL_VP_ATTR_EN_0_2_NYZW 0x00000e00 -#define NV50TCL_VP_ATTR_EN_0_2_XYZW 0x00000f00 -#define NV50TCL_VP_ATTR_EN_0_1_SHIFT 4 -#define NV50TCL_VP_ATTR_EN_0_1_MASK 0x000000f0 -#define NV50TCL_VP_ATTR_EN_0_1_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_1_XNNN 0x00000010 -#define NV50TCL_VP_ATTR_EN_0_1_NYNN 0x00000020 -#define NV50TCL_VP_ATTR_EN_0_1_XYNN 0x00000030 -#define NV50TCL_VP_ATTR_EN_0_1_NNZN 0x00000040 -#define NV50TCL_VP_ATTR_EN_0_1_XNZN 0x00000050 -#define NV50TCL_VP_ATTR_EN_0_1_NYZN 0x00000060 -#define NV50TCL_VP_ATTR_EN_0_1_XYZN 0x00000070 -#define NV50TCL_VP_ATTR_EN_0_1_NNNW 0x00000080 -#define NV50TCL_VP_ATTR_EN_0_1_XNNW 0x00000090 -#define NV50TCL_VP_ATTR_EN_0_1_NYNW 0x000000a0 -#define NV50TCL_VP_ATTR_EN_0_1_XYNW 0x000000b0 -#define NV50TCL_VP_ATTR_EN_0_1_NNZW 0x000000c0 -#define NV50TCL_VP_ATTR_EN_0_1_XNZW 0x000000d0 -#define NV50TCL_VP_ATTR_EN_0_1_NYZW 0x000000e0 -#define NV50TCL_VP_ATTR_EN_0_1_XYZW 0x000000f0 -#define NV50TCL_VP_ATTR_EN_0_0_SHIFT 0 -#define NV50TCL_VP_ATTR_EN_0_0_MASK 0x0000000f -#define NV50TCL_VP_ATTR_EN_0_0_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_0_0_XNNN 0x00000001 -#define NV50TCL_VP_ATTR_EN_0_0_NYNN 0x00000002 -#define NV50TCL_VP_ATTR_EN_0_0_XYNN 0x00000003 -#define NV50TCL_VP_ATTR_EN_0_0_NNZN 0x00000004 -#define NV50TCL_VP_ATTR_EN_0_0_XNZN 0x00000005 -#define NV50TCL_VP_ATTR_EN_0_0_NYZN 0x00000006 -#define NV50TCL_VP_ATTR_EN_0_0_XYZN 0x00000007 -#define NV50TCL_VP_ATTR_EN_0_0_NNNW 0x00000008 -#define NV50TCL_VP_ATTR_EN_0_0_XNNW 0x00000009 -#define NV50TCL_VP_ATTR_EN_0_0_NYNW 0x0000000a -#define NV50TCL_VP_ATTR_EN_0_0_XYNW 0x0000000b -#define NV50TCL_VP_ATTR_EN_0_0_NNZW 0x0000000c -#define NV50TCL_VP_ATTR_EN_0_0_XNZW 0x0000000d -#define NV50TCL_VP_ATTR_EN_0_0_NYZW 0x0000000e -#define NV50TCL_VP_ATTR_EN_0_0_XYZW 0x0000000f -#define NV50TCL_VP_ATTR_EN_1 0x00001654 -#define NV50TCL_VP_ATTR_EN_1_15_SHIFT 28 -#define NV50TCL_VP_ATTR_EN_1_15_MASK 0xf0000000 -#define NV50TCL_VP_ATTR_EN_1_15_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_15_XNNN 0x10000000 -#define NV50TCL_VP_ATTR_EN_1_15_NYNN 0x20000000 -#define NV50TCL_VP_ATTR_EN_1_15_XYNN 0x30000000 -#define NV50TCL_VP_ATTR_EN_1_15_NNZN 0x40000000 -#define NV50TCL_VP_ATTR_EN_1_15_XNZN 0x50000000 -#define NV50TCL_VP_ATTR_EN_1_15_NYZN 0x60000000 -#define NV50TCL_VP_ATTR_EN_1_15_XYZN 0x70000000 -#define NV50TCL_VP_ATTR_EN_1_15_NNNW 0x80000000 -#define NV50TCL_VP_ATTR_EN_1_15_XNNW 0x90000000 -#define NV50TCL_VP_ATTR_EN_1_15_NYNW 0xa0000000 -#define NV50TCL_VP_ATTR_EN_1_15_XYNW 0xb0000000 -#define NV50TCL_VP_ATTR_EN_1_15_NNZW 0xc0000000 -#define NV50TCL_VP_ATTR_EN_1_15_XNZW 0xd0000000 -#define NV50TCL_VP_ATTR_EN_1_15_NYZW 0xe0000000 -#define NV50TCL_VP_ATTR_EN_1_15_XYZW 0xf0000000 -#define NV50TCL_VP_ATTR_EN_1_14_SHIFT 24 -#define NV50TCL_VP_ATTR_EN_1_14_MASK 0x0f000000 -#define NV50TCL_VP_ATTR_EN_1_14_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_14_XNNN 0x01000000 -#define NV50TCL_VP_ATTR_EN_1_14_NYNN 0x02000000 -#define NV50TCL_VP_ATTR_EN_1_14_XYNN 0x03000000 -#define NV50TCL_VP_ATTR_EN_1_14_NNZN 0x04000000 -#define NV50TCL_VP_ATTR_EN_1_14_XNZN 0x05000000 -#define NV50TCL_VP_ATTR_EN_1_14_NYZN 0x06000000 -#define NV50TCL_VP_ATTR_EN_1_14_XYZN 0x07000000 -#define NV50TCL_VP_ATTR_EN_1_14_NNNW 0x08000000 -#define NV50TCL_VP_ATTR_EN_1_14_XNNW 0x09000000 -#define NV50TCL_VP_ATTR_EN_1_14_NYNW 0x0a000000 -#define NV50TCL_VP_ATTR_EN_1_14_XYNW 0x0b000000 -#define NV50TCL_VP_ATTR_EN_1_14_NNZW 0x0c000000 -#define NV50TCL_VP_ATTR_EN_1_14_XNZW 0x0d000000 -#define NV50TCL_VP_ATTR_EN_1_14_NYZW 0x0e000000 -#define NV50TCL_VP_ATTR_EN_1_14_XYZW 0x0f000000 -#define NV50TCL_VP_ATTR_EN_1_13_SHIFT 20 -#define NV50TCL_VP_ATTR_EN_1_13_MASK 0x00f00000 -#define NV50TCL_VP_ATTR_EN_1_13_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_13_XNNN 0x00100000 -#define NV50TCL_VP_ATTR_EN_1_13_NYNN 0x00200000 -#define NV50TCL_VP_ATTR_EN_1_13_XYNN 0x00300000 -#define NV50TCL_VP_ATTR_EN_1_13_NNZN 0x00400000 -#define NV50TCL_VP_ATTR_EN_1_13_XNZN 0x00500000 -#define NV50TCL_VP_ATTR_EN_1_13_NYZN 0x00600000 -#define NV50TCL_VP_ATTR_EN_1_13_XYZN 0x00700000 -#define NV50TCL_VP_ATTR_EN_1_13_NNNW 0x00800000 -#define NV50TCL_VP_ATTR_EN_1_13_XNNW 0x00900000 -#define NV50TCL_VP_ATTR_EN_1_13_NYNW 0x00a00000 -#define NV50TCL_VP_ATTR_EN_1_13_XYNW 0x00b00000 -#define NV50TCL_VP_ATTR_EN_1_13_NNZW 0x00c00000 -#define NV50TCL_VP_ATTR_EN_1_13_XNZW 0x00d00000 -#define NV50TCL_VP_ATTR_EN_1_13_NYZW 0x00e00000 -#define NV50TCL_VP_ATTR_EN_1_13_XYZW 0x00f00000 -#define NV50TCL_VP_ATTR_EN_1_12_SHIFT 16 -#define NV50TCL_VP_ATTR_EN_1_12_MASK 0x000f0000 -#define NV50TCL_VP_ATTR_EN_1_12_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_12_XNNN 0x00010000 -#define NV50TCL_VP_ATTR_EN_1_12_NYNN 0x00020000 -#define NV50TCL_VP_ATTR_EN_1_12_XYNN 0x00030000 -#define NV50TCL_VP_ATTR_EN_1_12_NNZN 0x00040000 -#define NV50TCL_VP_ATTR_EN_1_12_XNZN 0x00050000 -#define NV50TCL_VP_ATTR_EN_1_12_NYZN 0x00060000 -#define NV50TCL_VP_ATTR_EN_1_12_XYZN 0x00070000 -#define NV50TCL_VP_ATTR_EN_1_12_NNNW 0x00080000 -#define NV50TCL_VP_ATTR_EN_1_12_XNNW 0x00090000 -#define NV50TCL_VP_ATTR_EN_1_12_NYNW 0x000a0000 -#define NV50TCL_VP_ATTR_EN_1_12_XYNW 0x000b0000 -#define NV50TCL_VP_ATTR_EN_1_12_NNZW 0x000c0000 -#define NV50TCL_VP_ATTR_EN_1_12_XNZW 0x000d0000 -#define NV50TCL_VP_ATTR_EN_1_12_NYZW 0x000e0000 -#define NV50TCL_VP_ATTR_EN_1_12_XYZW 0x000f0000 -#define NV50TCL_VP_ATTR_EN_1_11_SHIFT 12 -#define NV50TCL_VP_ATTR_EN_1_11_MASK 0x0000f000 -#define NV50TCL_VP_ATTR_EN_1_11_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_11_XNNN 0x00001000 -#define NV50TCL_VP_ATTR_EN_1_11_NYNN 0x00002000 -#define NV50TCL_VP_ATTR_EN_1_11_XYNN 0x00003000 -#define NV50TCL_VP_ATTR_EN_1_11_NNZN 0x00004000 -#define NV50TCL_VP_ATTR_EN_1_11_XNZN 0x00005000 -#define NV50TCL_VP_ATTR_EN_1_11_NYZN 0x00006000 -#define NV50TCL_VP_ATTR_EN_1_11_XYZN 0x00007000 -#define NV50TCL_VP_ATTR_EN_1_11_NNNW 0x00008000 -#define NV50TCL_VP_ATTR_EN_1_11_XNNW 0x00009000 -#define NV50TCL_VP_ATTR_EN_1_11_NYNW 0x0000a000 -#define NV50TCL_VP_ATTR_EN_1_11_XYNW 0x0000b000 -#define NV50TCL_VP_ATTR_EN_1_11_NNZW 0x0000c000 -#define NV50TCL_VP_ATTR_EN_1_11_XNZW 0x0000d000 -#define NV50TCL_VP_ATTR_EN_1_11_NYZW 0x0000e000 -#define NV50TCL_VP_ATTR_EN_1_11_XYZW 0x0000f000 -#define NV50TCL_VP_ATTR_EN_1_10_SHIFT 8 -#define NV50TCL_VP_ATTR_EN_1_10_MASK 0x00000f00 -#define NV50TCL_VP_ATTR_EN_1_10_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_10_XNNN 0x00000100 -#define NV50TCL_VP_ATTR_EN_1_10_NYNN 0x00000200 -#define NV50TCL_VP_ATTR_EN_1_10_XYNN 0x00000300 -#define NV50TCL_VP_ATTR_EN_1_10_NNZN 0x00000400 -#define NV50TCL_VP_ATTR_EN_1_10_XNZN 0x00000500 -#define NV50TCL_VP_ATTR_EN_1_10_NYZN 0x00000600 -#define NV50TCL_VP_ATTR_EN_1_10_XYZN 0x00000700 -#define NV50TCL_VP_ATTR_EN_1_10_NNNW 0x00000800 -#define NV50TCL_VP_ATTR_EN_1_10_XNNW 0x00000900 -#define NV50TCL_VP_ATTR_EN_1_10_NYNW 0x00000a00 -#define NV50TCL_VP_ATTR_EN_1_10_XYNW 0x00000b00 -#define NV50TCL_VP_ATTR_EN_1_10_NNZW 0x00000c00 -#define NV50TCL_VP_ATTR_EN_1_10_XNZW 0x00000d00 -#define NV50TCL_VP_ATTR_EN_1_10_NYZW 0x00000e00 -#define NV50TCL_VP_ATTR_EN_1_10_XYZW 0x00000f00 -#define NV50TCL_VP_ATTR_EN_1_9_SHIFT 4 -#define NV50TCL_VP_ATTR_EN_1_9_MASK 0x000000f0 -#define NV50TCL_VP_ATTR_EN_1_9_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_9_XNNN 0x00000010 -#define NV50TCL_VP_ATTR_EN_1_9_NYNN 0x00000020 -#define NV50TCL_VP_ATTR_EN_1_9_XYNN 0x00000030 -#define NV50TCL_VP_ATTR_EN_1_9_NNZN 0x00000040 -#define NV50TCL_VP_ATTR_EN_1_9_XNZN 0x00000050 -#define NV50TCL_VP_ATTR_EN_1_9_NYZN 0x00000060 -#define NV50TCL_VP_ATTR_EN_1_9_XYZN 0x00000070 -#define NV50TCL_VP_ATTR_EN_1_9_NNNW 0x00000080 -#define NV50TCL_VP_ATTR_EN_1_9_XNNW 0x00000090 -#define NV50TCL_VP_ATTR_EN_1_9_NYNW 0x000000a0 -#define NV50TCL_VP_ATTR_EN_1_9_XYNW 0x000000b0 -#define NV50TCL_VP_ATTR_EN_1_9_NNZW 0x000000c0 -#define NV50TCL_VP_ATTR_EN_1_9_XNZW 0x000000d0 -#define NV50TCL_VP_ATTR_EN_1_9_NYZW 0x000000e0 -#define NV50TCL_VP_ATTR_EN_1_9_XYZW 0x000000f0 -#define NV50TCL_VP_ATTR_EN_1_8_SHIFT 0 -#define NV50TCL_VP_ATTR_EN_1_8_MASK 0x0000000f -#define NV50TCL_VP_ATTR_EN_1_8_NONE 0x00000000 -#define NV50TCL_VP_ATTR_EN_1_8_XNNN 0x00000001 -#define NV50TCL_VP_ATTR_EN_1_8_NYNN 0x00000002 -#define NV50TCL_VP_ATTR_EN_1_8_XYNN 0x00000003 -#define NV50TCL_VP_ATTR_EN_1_8_NNZN 0x00000004 -#define NV50TCL_VP_ATTR_EN_1_8_XNZN 0x00000005 -#define NV50TCL_VP_ATTR_EN_1_8_NYZN 0x00000006 -#define NV50TCL_VP_ATTR_EN_1_8_XYZN 0x00000007 -#define NV50TCL_VP_ATTR_EN_1_8_NNNW 0x00000008 -#define NV50TCL_VP_ATTR_EN_1_8_XNNW 0x00000009 -#define NV50TCL_VP_ATTR_EN_1_8_NYNW 0x0000000a -#define NV50TCL_VP_ATTR_EN_1_8_XYNW 0x0000000b -#define NV50TCL_VP_ATTR_EN_1_8_NNZW 0x0000000c -#define NV50TCL_VP_ATTR_EN_1_8_XNZW 0x0000000d -#define NV50TCL_VP_ATTR_EN_1_8_NYZW 0x0000000e -#define NV50TCL_VP_ATTR_EN_1_8_XYZW 0x0000000f -#define NV50TCL_LINE_STIPPLE_ENABLE 0x0000166c -#define NV50TCL_LINE_STIPPLE_PATTERN 0x00001680 -#define NV50TCL_POLYGON_STIPPLE_ENABLE 0x0000168c -#define NV50TCL_VP_REG_HPOS 0x000016bc -#define NV50TCL_VP_REG_HPOS_X_SHIFT 0 -#define NV50TCL_VP_REG_HPOS_X_MASK 0x000000ff -#define NV50TCL_VP_REG_HPOS_Y_SHIFT 8 -#define NV50TCL_VP_REG_HPOS_Y_MASK 0x0000ff00 -#define NV50TCL_VP_REG_HPOS_Z_SHIFT 16 -#define NV50TCL_VP_REG_HPOS_Z_MASK 0x00ff0000 -#define NV50TCL_VP_REG_HPOS_W_SHIFT 24 -#define NV50TCL_VP_REG_HPOS_W_MASK 0xff000000 -#define NV50TCL_VP_REG_COL0 0x000016c0 -#define NV50TCL_VP_REG_COL0_X_SHIFT 0 -#define NV50TCL_VP_REG_COL0_X_MASK 0x000000ff -#define NV50TCL_VP_REG_COL0_Y_SHIFT 8 -#define NV50TCL_VP_REG_COL0_Y_MASK 0x0000ff00 -#define NV50TCL_VP_REG_COL0_Z_SHIFT 16 -#define NV50TCL_VP_REG_COL0_Z_MASK 0x00ff0000 -#define NV50TCL_VP_REG_COL0_W_SHIFT 24 -#define NV50TCL_VP_REG_COL0_W_MASK 0xff000000 -#define NV50TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001700+((x)*4)) -#define NV50TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020 -#define NV50TCL_CULL_FACE_ENABLE 0x00001918 -#define NV50TCL_FRONT_FACE 0x0000191c -#define NV50TCL_FRONT_FACE_CW 0x00000900 -#define NV50TCL_FRONT_FACE_CCW 0x00000901 -#define NV50TCL_CULL_FACE 0x00001920 -#define NV50TCL_CULL_FACE_FRONT 0x00000404 -#define NV50TCL_CULL_FACE_BACK 0x00000405 -#define NV50TCL_CULL_FACE_FRONT_AND_BACK 0x00000408 -#define NV50TCL_LOGIC_OP_ENABLE 0x000019c4 -#define NV50TCL_LOGIC_OP 0x000019c8 -#define NV50TCL_LOGIC_OP_CLEAR 0x00001500 -#define NV50TCL_LOGIC_OP_AND 0x00001501 -#define NV50TCL_LOGIC_OP_AND_REVERSE 0x00001502 -#define NV50TCL_LOGIC_OP_COPY 0x00001503 -#define NV50TCL_LOGIC_OP_AND_INVERTED 0x00001504 -#define NV50TCL_LOGIC_OP_NOOP 0x00001505 -#define NV50TCL_LOGIC_OP_XOR 0x00001506 -#define NV50TCL_LOGIC_OP_OR 0x00001507 -#define NV50TCL_LOGIC_OP_NOR 0x00001508 -#define NV50TCL_LOGIC_OP_EQUIV 0x00001509 -#define NV50TCL_LOGIC_OP_INVERT 0x0000150a -#define NV50TCL_LOGIC_OP_OR_REVERSE 0x0000150b -#define NV50TCL_LOGIC_OP_COPY_INVERTED 0x0000150c -#define NV50TCL_LOGIC_OP_OR_INVERTED 0x0000150d -#define NV50TCL_LOGIC_OP_NAND 0x0000150e -#define NV50TCL_LOGIC_OP_SET 0x0000150f -#define NV50TCL_CLEAR_BUFFERS 0x000019d0 -#define NV50TCL_COLOR_MASK(x) (0x00001a00+((x)*4)) -#define NV50TCL_COLOR_MASK__SIZE 0x00000008 -#define NV50TCL_COLOR_MASK_R_SHIFT 0 -#define NV50TCL_COLOR_MASK_R_MASK 0x0000000f -#define NV50TCL_COLOR_MASK_G_SHIFT 4 -#define NV50TCL_COLOR_MASK_G_MASK 0x000000f0 -#define NV50TCL_COLOR_MASK_B_SHIFT 8 -#define NV50TCL_COLOR_MASK_B_MASK 0x00000f00 -#define NV50TCL_COLOR_MASK_A_SHIFT 12 -#define NV50TCL_COLOR_MASK_A_MASK 0x0000f000 - - -#define NV50_COMPUTE 0x000050c0 - -#define NV50_COMPUTE_DMA_UNK0 0x000001a0 -#define NV50_COMPUTE_DMA_STATUS 0x000001a4 -#define NV50_COMPUTE_DMA_UNK1 0x000001b8 -#define NV50_COMPUTE_DMA_UNK2 0x000001bc -#define NV50_COMPUTE_DMA_UNK3 0x000001c0 -#define NV50_COMPUTE_UNK4_HIGH 0x00000210 -#define NV50_COMPUTE_UNK4_LOW 0x00000214 -#define NV50_COMPUTE_UNK5_HIGH 0x00000218 -#define NV50_COMPUTE_UNK5_LOW 0x0000021c -#define NV50_COMPUTE_UNK6_HIGH 0x00000294 -#define NV50_COMPUTE_UNK6_LOW 0x00000298 -#define NV50_COMPUTE_CONST_BASE_HIGH 0x000002a4 -#define NV50_COMPUTE_CONST_BASE_LO 0x000002a8 -#define NV50_COMPUTE_CONST_SIZE_SEG 0x000002ac -#define NV50_COMPUTE_REG_COUNT 0x000002c0 -#define NV50_COMPUTE_STATUS_HIGH 0x00000310 -#define NV50_COMPUTE_STATUS_LOW 0x00000314 -#define NV50_COMPUTE_EXECUTE 0x0000031c -#define NV50_COMPUTE_USER_PARAM_COUNT 0x00000374 -#define NV50_COMPUTE_GRIDDIM_YX 0x000003a4 -#define NV50_COMPUTE_SHARED_SIZE 0x000003a8 -#define NV50_COMPUTE_BLOCKDIM_YX 0x000003ac -#define NV50_COMPUTE_BLOCKDIM_Z 0x000003b0 -#define NV50_COMPUTE_CALL_ADDRESS 0x000003b4 -#define NV50_COMPUTE_GLOBAL_BASE_HIGH(x) (0x00000400+((x)*32)) -#define NV50_COMPUTE_GLOBAL_BASE_HIGH__SIZE 0x00000010 -#define NV50_COMPUTE_GLOBAL_BASE_LOW(x) (0x00000404+((x)*32)) -#define NV50_COMPUTE_GLOBAL_BASE_LOW__SIZE 0x00000010 -#define NV50_COMPUTE_GLOBAL_LIMIT_HIGH(x) (0x00000408+((x)*32)) -#define NV50_COMPUTE_GLOBAL_LIMIT_HIGH__SIZE 0x00000010 -#define NV50_COMPUTE_GLOBAL_LIMIT_LOW(x) (0x0000040c+((x)*32)) -#define NV50_COMPUTE_GLOBAL_LIMIT_LOW__SIZE 0x00000010 -#define NV50_COMPUTE_GLOBAL_UNK(x) (0x00000410+((x)*32)) -#define NV50_COMPUTE_GLOBAL_UNK__SIZE 0x00000010 -#define NV50_COMPUTE_USER_PARAM(x) (0x00000600+((x)*4)) -#define NV50_COMPUTE_USER_PARAM__SIZE 0x00000040 - - -#define NV54TCL 0x00008297 - - - -#endif /* NOUVEAU_REG_H */ diff --git a/src/gallium/drivers/nouveau/nouveau_device.h b/src/gallium/drivers/nouveau/nouveau_device.h deleted file mode 100644 index e25e89fedd..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_device.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_DEVICE_H__ -#define __NOUVEAU_DEVICE_H__ - -struct nouveau_device { - unsigned chipset; -}; - -#endif diff --git a/src/gallium/drivers/nouveau/nouveau_grobj.h b/src/gallium/drivers/nouveau/nouveau_grobj.h deleted file mode 100644 index 8f5abf9051..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_grobj.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_GROBJ_H__ -#define __NOUVEAU_GROBJ_H__ - -#include "nouveau_channel.h" - -struct nouveau_grobj { - struct nouveau_channel *channel; - int grclass; - uint32_t handle; - int subc; -}; - -#endif diff --git a/src/gallium/drivers/nouveau/nouveau_notifier.h b/src/gallium/drivers/nouveau/nouveau_notifier.h deleted file mode 100644 index 35adde1e32..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_notifier.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_NOTIFIER_H__ -#define __NOUVEAU_NOTIFIER_H__ - -#define NV_NOTIFIER_SIZE 32 -#define NV_NOTIFY_TIME_0 0x00000000 -#define NV_NOTIFY_TIME_1 0x00000004 -#define NV_NOTIFY_RETURN_VALUE 0x00000008 -#define NV_NOTIFY_STATE 0x0000000C -#define NV_NOTIFY_STATE_STATUS_MASK 0xFF000000 -#define NV_NOTIFY_STATE_STATUS_SHIFT 24 -#define NV_NOTIFY_STATE_STATUS_COMPLETED 0x00 -#define NV_NOTIFY_STATE_STATUS_IN_PROCESS 0x01 -#define NV_NOTIFY_STATE_ERROR_CODE_MASK 0x0000FFFF -#define NV_NOTIFY_STATE_ERROR_CODE_SHIFT 0 - -struct nouveau_notifier { - struct nouveau_channel *channel; - uint32_t handle; -}; - -#endif diff --git a/src/gallium/drivers/nouveau/nouveau_pushbuf.h b/src/gallium/drivers/nouveau/nouveau_pushbuf.h deleted file mode 100644 index 1909765098..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_pushbuf.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_PUSHBUF_H__ -#define __NOUVEAU_PUSHBUF_H__ - -struct nouveau_pushbuf { - struct nouveau_channel *channel; - unsigned remaining; - uint32_t *cur; -}; - -#endif diff --git a/src/gallium/drivers/nouveau/nouveau_resource.h b/src/gallium/drivers/nouveau/nouveau_resource.h deleted file mode 100644 index 1af7961d30..0000000000 --- a/src/gallium/drivers/nouveau/nouveau_resource.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_RESOURCE_H__ -#define __NOUVEAU_RESOURCE_H__ - -struct nouveau_resource { - struct nouveau_resource *prev; - struct nouveau_resource *next; - - int in_use; - void *priv; - - unsigned int start; - unsigned int size; -}; - -#endif diff --git a/src/gallium/drivers/nouveau/nouveau_stateobj.h b/src/gallium/drivers/nouveau/nouveau_stateobj.h index 729988b095..4ae4ff4940 100644 --- a/src/gallium/drivers/nouveau/nouveau_stateobj.h +++ b/src/gallium/drivers/nouveau/nouveau_stateobj.h @@ -147,8 +147,9 @@ so_emit_reloc_markers(struct nouveau_winsys *nvws, struct nouveau_stateobj *so) struct nouveau_stateobj_reloc *r = &so->reloc[i]; nvws->push_reloc(nvws, pb->cur++, r->bo, r->packet, - (r->flags & - (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) | + (r->flags & (NOUVEAU_BO_VRAM | + NOUVEAU_BO_GART | + NOUVEAU_BO_RDWR)) | NOUVEAU_BO_DUMMY, 0, 0); nvws->push_reloc(nvws, pb->cur++, r->bo, r->data, r->flags | NOUVEAU_BO_DUMMY, r->vor, r->tor); diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 602d76ac74..948112ffa9 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -47,9 +47,11 @@ nv50_state_validate_fb(struct nv50_context *nv50) so_method(so, tesla, NV50TCL_RT_ADDRESS_HIGH(i), 5); so_reloc (so, nv50_surface_buffer(fb->cbufs[i]), fb->cbufs[i]->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH, 0, 0); + NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH | + NOUVEAU_BO_RDWR, 0, 0); so_reloc (so, nv50_surface_buffer(fb->cbufs[i]), fb->cbufs[i]->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW, 0, 0); + NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | + NOUVEAU_BO_RDWR, 0, 0); switch (fb->cbufs[i]->format) { case PIPE_FORMAT_A8R8G8B8_UNORM: so_data(so, 0xcf); @@ -82,9 +84,11 @@ nv50_state_validate_fb(struct nv50_context *nv50) so_method(so, tesla, NV50TCL_ZETA_ADDRESS_HIGH, 5); so_reloc (so, nv50_surface_buffer(fb->zsbuf), fb->zsbuf->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH, 0, 0); + NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH | + NOUVEAU_BO_RDWR, 0, 0); so_reloc (so, nv50_surface_buffer(fb->zsbuf), fb->zsbuf->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW, 0, 0); + NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | + NOUVEAU_BO_RDWR, 0, 0); switch (fb->zsbuf->format) { case PIPE_FORMAT_Z24S8_UNORM: so_data(so, 0x16); diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index 239407c92b..675f9b20cb 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -117,13 +117,15 @@ nv50_tex_construct(struct nouveau_stateobj *so, struct nv50_miptree *mt) return 1; } - so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW, 0, 0); + so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | + NOUVEAU_BO_RD, 0, 0); so_data (so, 0xd0005000); so_data (so, 0x00300000); so_data (so, mt->base.width[0]); so_data (so, (mt->base.depth[0] << 16) | mt->base.height[0]); so_data (so, 0x03000000); - so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH, 0, 0); + so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH | + NOUVEAU_BO_RD, 0, 0); return 0; } diff --git a/src/gallium/winsys/drm/nouveau/common/Makefile b/src/gallium/winsys/drm/nouveau/common/Makefile index 06f558959d..9bc5c42585 100644 --- a/src/gallium/winsys/drm/nouveau/common/Makefile +++ b/src/gallium/winsys/drm/nouveau/common/Makefile @@ -4,17 +4,8 @@ include $(TOP)/configs/current LIBNAME = nouveaudrm C_SOURCES = \ - nouveau_bo.c \ - nouveau_channel.c \ - nouveau_context.c \ - nouveau_device.c \ - nouveau_dma.c \ - nouveau_fence.c \ - nouveau_grobj.c \ + nouveau_context.c \ nouveau_lock.c \ - nouveau_notifier.c \ - nouveau_pushbuf.c \ - nouveau_resource.c \ nouveau_screen.c \ nouveau_winsys.c \ nouveau_winsys_pipe.c \ @@ -27,6 +18,8 @@ include ./Makefile.template DRIVER_DEFINES = $(shell pkg-config libdrm --cflags \ && pkg-config libdrm --atleast-version=2.3.1 \ + && pkg-config libdrm_nouveau --exact-version=0.5 \ + && pkg-config libdrm_nouveau --cflags \ && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP") symlinks: diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_bo.c b/src/gallium/winsys/drm/nouveau/common/nouveau_bo.c deleted file mode 100644 index 76b98bed67..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_bo.c +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include -#include - -#include "nouveau_drmif.h" -#include "nouveau_dma.h" -#include "nouveau_local.h" - -static void -nouveau_mem_free(struct nouveau_device *dev, struct drm_nouveau_mem_alloc *ma, - void **map) -{ - struct nouveau_device_priv *nvdev = nouveau_device(dev); - struct drm_nouveau_mem_free mf; - - if (map && *map) { - drmUnmap(*map, ma->size); - *map = NULL; - } - - if (ma->size) { - mf.offset = ma->offset; - mf.flags = ma->flags; - drmCommandWrite(nvdev->fd, DRM_NOUVEAU_MEM_FREE, - &mf, sizeof(mf)); - ma->size = 0; - } -} - -static int -nouveau_mem_alloc(struct nouveau_device *dev, unsigned size, unsigned align, - uint32_t flags, struct drm_nouveau_mem_alloc *ma, void **map) -{ - struct nouveau_device_priv *nvdev = nouveau_device(dev); - int ret; - - ma->alignment = align; - ma->size = size; - ma->flags = flags; - if (map) - ma->flags |= NOUVEAU_MEM_MAPPED; - ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_MEM_ALLOC, ma, - sizeof(struct drm_nouveau_mem_alloc)); - if (ret) - return ret; - - if (map) { - ret = drmMap(nvdev->fd, ma->map_handle, ma->size, map); - if (ret) { - *map = NULL; - nouveau_mem_free(dev, ma, map); - return ret; - } - } - - return 0; -} - -static void -nouveau_bo_tmp_del(void *priv) -{ - struct nouveau_resource *r = priv; - - nouveau_fence_ref(NULL, (struct nouveau_fence **)&r->priv); - nouveau_resource_free(&r); -} - -static unsigned -nouveau_bo_tmp_max(struct nouveau_device_priv *nvdev) -{ - struct nouveau_resource *r = nvdev->sa_heap; - unsigned max = 0; - - while (r) { - if (r->in_use && !nouveau_fence(r->priv)->emitted) { - r = r->next; - continue; - } - - if (max < r->size) - max = r->size; - r = r->next; - } - - return max; -} - -static struct nouveau_resource * -nouveau_bo_tmp(struct nouveau_channel *chan, unsigned size, - struct nouveau_fence *fence) -{ - struct nouveau_device_priv *nvdev = nouveau_device(chan->device); - struct nouveau_resource *r = NULL; - struct nouveau_fence *ref = NULL; - - if (fence) - nouveau_fence_ref(fence, &ref); - else - nouveau_fence_new(chan, &ref); - assert(ref); - - while (nouveau_resource_alloc(nvdev->sa_heap, size, ref, &r)) { - if (nouveau_bo_tmp_max(nvdev) < size) { - nouveau_fence_ref(NULL, &ref); - return NULL; - } - - nouveau_fence_flush(chan); - } - nouveau_fence_signal_cb(ref, nouveau_bo_tmp_del, r); - - return r; -} - -int -nouveau_bo_init(struct nouveau_device *dev) -{ - struct nouveau_device_priv *nvdev = nouveau_device(dev); - int ret; - - ret = nouveau_mem_alloc(dev, 128*1024, 0, NOUVEAU_MEM_AGP | - NOUVEAU_MEM_PCI, &nvdev->sa, &nvdev->sa_map); - if (ret) - return ret; - - ret = nouveau_resource_init(&nvdev->sa_heap, 0, nvdev->sa.size); - if (ret) { - nouveau_mem_free(dev, &nvdev->sa, &nvdev->sa_map); - return ret; - } - - return 0; -} - -void -nouveau_bo_takedown(struct nouveau_device *dev) -{ - struct nouveau_device_priv *nvdev = nouveau_device(dev); - - nouveau_mem_free(dev, &nvdev->sa, &nvdev->sa_map); -} - -int -nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, int align, - int size, struct nouveau_bo **bo) -{ - struct nouveau_bo_priv *nvbo; - int ret; - - if (!dev || !bo || *bo) - return -EINVAL; - - nvbo = calloc(1, sizeof(struct nouveau_bo_priv)); - if (!nvbo) - return -ENOMEM; - nvbo->base.device = dev; - nvbo->base.size = size; - nvbo->base.handle = bo_to_ptr(nvbo); - nvbo->drm.alignment = align; - nvbo->refcount = 1; - - if (flags & NOUVEAU_BO_TILED) { - nvbo->tiled = 1; - if (flags & NOUVEAU_BO_ZTILE) - nvbo->tiled |= 2; - flags &= ~NOUVEAU_BO_TILED; - } - - ret = nouveau_bo_set_status(&nvbo->base, flags); - if (ret) { - free(nvbo); - return ret; - } - - *bo = &nvbo->base; - return 0; -} - -int -nouveau_bo_user(struct nouveau_device *dev, void *ptr, int size, - struct nouveau_bo **bo) -{ - struct nouveau_bo_priv *nvbo; - - if (!dev || !bo || *bo) - return -EINVAL; - - nvbo = calloc(1, sizeof(*nvbo)); - if (!nvbo) - return -ENOMEM; - nvbo->base.device = dev; - - nvbo->sysmem = ptr; - nvbo->user = 1; - - nvbo->base.size = size; - nvbo->base.offset = nvbo->drm.offset; - nvbo->base.handle = bo_to_ptr(nvbo); - nvbo->refcount = 1; - *bo = &nvbo->base; - return 0; -} - -int -nouveau_bo_ref(struct nouveau_device *dev, uint64_t handle, - struct nouveau_bo **bo) -{ - struct nouveau_bo_priv *nvbo = ptr_to_bo(handle); - - if (!dev || !bo || *bo) - return -EINVAL; - - nvbo->refcount++; - *bo = &nvbo->base; - return 0; -} - -static void -nouveau_bo_del_cb(void *priv) -{ - struct nouveau_bo_priv *nvbo = priv; - - nouveau_fence_ref(NULL, &nvbo->fence); - nouveau_mem_free(nvbo->base.device, &nvbo->drm, &nvbo->map); - if (nvbo->sysmem && !nvbo->user) - free(nvbo->sysmem); - free(nvbo); -} - -void -nouveau_bo_del(struct nouveau_bo **bo) -{ - struct nouveau_bo_priv *nvbo; - - if (!bo || !*bo) - return; - nvbo = nouveau_bo(*bo); - *bo = NULL; - - if (--nvbo->refcount) - return; - - if (nvbo->pending) - nouveau_pushbuf_flush(nvbo->pending->channel, 0); - - if (nvbo->fence) - nouveau_fence_signal_cb(nvbo->fence, nouveau_bo_del_cb, nvbo); - else - nouveau_bo_del_cb(nvbo); -} - -int -nouveau_bo_busy(struct nouveau_bo *bo, uint32_t flags) -{ - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - struct nouveau_fence *fence; - - if (!nvbo) - return -EINVAL; - - /* If the buffer is pending it must be busy, unless - * both are RD, in which case we can allow access */ - if (nvbo->pending) { - if ((nvbo->pending->flags & NOUVEAU_BO_RDWR) == NOUVEAU_BO_RD && - (flags & NOUVEAU_BO_RDWR) == NOUVEAU_BO_RD) - return 0; - else - return 1; - } - - if (flags & NOUVEAU_BO_WR) - fence = nvbo->fence; - else - fence = nvbo->wr_fence; - - /* If the buffer is not pending and doesn't have a fence - * that conflicts with our flags then it can't be busy - */ - if (!fence) - return 0; - else - /* If the fence is signalled the buffer is not busy, else is busy */ - return !nouveau_fence(fence)->signalled; -} - -int -nouveau_bo_map(struct nouveau_bo *bo, uint32_t flags) -{ - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - - if (!nvbo) - return -EINVAL; - - if (nvbo->pending && - (nvbo->pending->flags & NOUVEAU_BO_WR || flags & NOUVEAU_BO_WR)) { - nouveau_pushbuf_flush(nvbo->pending->channel, 0); - } - - if (flags & NOUVEAU_BO_WR) - nouveau_fence_wait(&nvbo->fence); - else - nouveau_fence_wait(&nvbo->wr_fence); - - if (nvbo->sysmem) - bo->map = nvbo->sysmem; - else - bo->map = nvbo->map; - return 0; -} - -void -nouveau_bo_unmap(struct nouveau_bo *bo) -{ - bo->map = NULL; -} - -static int -nouveau_bo_upload(struct nouveau_bo_priv *nvbo) -{ - if (nvbo->fence) - nouveau_fence_wait(&nvbo->fence); - memcpy(nvbo->map, nvbo->sysmem, nvbo->drm.size); - return 0; -} - -int -nouveau_bo_set_status(struct nouveau_bo *bo, uint32_t flags) -{ - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - struct drm_nouveau_mem_alloc new; - void *new_map = NULL, *new_sysmem = NULL; - unsigned new_flags = 0, ret; - - assert(!bo->map); - - /* Check current memtype vs requested, if they match do nothing */ - if ((nvbo->drm.flags & NOUVEAU_MEM_FB) && (flags & NOUVEAU_BO_VRAM)) - return 0; - if ((nvbo->drm.flags & (NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI)) && - (flags & NOUVEAU_BO_GART)) - return 0; - if (nvbo->drm.size == 0 && nvbo->sysmem && (flags & NOUVEAU_BO_LOCAL)) - return 0; - - memset(&new, 0x00, sizeof(new)); - - /* Allocate new memory */ - if (flags & NOUVEAU_BO_VRAM) - new_flags |= NOUVEAU_MEM_FB; - else - if (flags & NOUVEAU_BO_GART) - new_flags |= (NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI); - - if (nvbo->tiled && flags) { - new_flags |= NOUVEAU_MEM_TILE; - if (nvbo->tiled & 2) - new_flags |= NOUVEAU_MEM_TILE_ZETA; - } - - if (new_flags) { - ret = nouveau_mem_alloc(bo->device, bo->size, - nvbo->drm.alignment, new_flags, - &new, &new_map); - if (ret) - return ret; - } else - if (!nvbo->user) { - new_sysmem = malloc(bo->size); - } - - /* Copy old -> new */ - /*XXX: use M2MF */ - if (nvbo->sysmem || nvbo->map) { - struct nouveau_pushbuf_bo *pbo = nvbo->pending; - nvbo->pending = NULL; - nouveau_bo_map(bo, NOUVEAU_BO_RD); - memcpy(new_map, bo->map, bo->size); - nouveau_bo_unmap(bo); - nvbo->pending = pbo; - } - - /* Free old memory */ - if (nvbo->fence) - nouveau_fence_wait(&nvbo->fence); - nouveau_mem_free(bo->device, &nvbo->drm, &nvbo->map); - if (nvbo->sysmem && !nvbo->user) - free(nvbo->sysmem); - - nvbo->drm = new; - nvbo->map = new_map; - if (!nvbo->user) - nvbo->sysmem = new_sysmem; - bo->flags = flags; - bo->offset = nvbo->drm.offset; - return 0; -} - -static int -nouveau_bo_validate_user(struct nouveau_channel *chan, struct nouveau_bo *bo, - struct nouveau_fence *fence, uint32_t flags) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_device_priv *nvdev = nouveau_device(chan->device); - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - struct nouveau_resource *r; - - if (nvchan->user_charge + bo->size > nvdev->sa.size) - return 1; - - if (!(flags & NOUVEAU_BO_GART)) - return 1; - - r = nouveau_bo_tmp(chan, bo->size, fence); - if (!r) - return 1; - nvchan->user_charge += bo->size; - - memcpy(nvdev->sa_map + r->start, nvbo->sysmem, bo->size); - - nvbo->offset = nvdev->sa.offset + r->start; - nvbo->flags = NOUVEAU_BO_GART; - return 0; -} - -static int -nouveau_bo_validate_bo(struct nouveau_channel *chan, struct nouveau_bo *bo, - struct nouveau_fence *fence, uint32_t flags) -{ - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - int ret; - - ret = nouveau_bo_set_status(bo, flags); - if (ret) { - nouveau_fence_flush(chan); - - ret = nouveau_bo_set_status(bo, flags); - if (ret) - return ret; - } - - if (nvbo->user) - nouveau_bo_upload(nvbo); - - nvbo->offset = nvbo->drm.offset; - if (nvbo->drm.flags & (NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI)) - nvbo->flags = NOUVEAU_BO_GART; - else - nvbo->flags = NOUVEAU_BO_VRAM; - - return 0; -} - -int -nouveau_bo_validate(struct nouveau_channel *chan, struct nouveau_bo *bo, - uint32_t flags) -{ - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - struct nouveau_fence *fence = nouveau_pushbuf(chan->pushbuf)->fence; - int ret; - - assert(bo->map == NULL); - - if (nvbo->user) { - ret = nouveau_bo_validate_user(chan, bo, fence, flags); - if (ret) { - ret = nouveau_bo_validate_bo(chan, bo, fence, flags); - if (ret) - return ret; - } - } else { - ret = nouveau_bo_validate_bo(chan, bo, fence, flags); - if (ret) - return ret; - } - - if (flags & NOUVEAU_BO_WR) - nouveau_fence_ref(fence, &nvbo->wr_fence); - nouveau_fence_ref(fence, &nvbo->fence); - return 0; -} - diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_channel.c b/src/gallium/winsys/drm/nouveau/common/nouveau_channel.c deleted file mode 100644 index b7298131c1..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_channel.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include -#include -#include "nouveau_drmif.h" -#include "nouveau_dma.h" - -int -nouveau_channel_alloc(struct nouveau_device *dev, uint32_t fb_ctxdma, - uint32_t tt_ctxdma, struct nouveau_channel **chan) -{ - struct nouveau_device_priv *nvdev = nouveau_device(dev); - struct nouveau_channel_priv *nvchan; - int ret; - - if (!nvdev || !chan || *chan) - return -EINVAL; - - nvchan = CALLOC_STRUCT(nouveau_channel_priv); - if (!nvchan) - return -ENOMEM; - nvchan->base.device = dev; - - nvchan->drm.fb_ctxdma_handle = fb_ctxdma; - nvchan->drm.tt_ctxdma_handle = tt_ctxdma; - ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_CHANNEL_ALLOC, - &nvchan->drm, sizeof(nvchan->drm)); - if (ret) { - FREE(nvchan); - return ret; - } - - nvchan->base.id = nvchan->drm.channel; - if (nouveau_grobj_ref(&nvchan->base, nvchan->drm.fb_ctxdma_handle, - &nvchan->base.vram) || - nouveau_grobj_ref(&nvchan->base, nvchan->drm.tt_ctxdma_handle, - &nvchan->base.gart)) { - nouveau_channel_free((void *)&nvchan); - return -EINVAL; - } - - ret = drmMap(nvdev->fd, nvchan->drm.ctrl, nvchan->drm.ctrl_size, - (void*)&nvchan->user); - if (ret) { - nouveau_channel_free((void *)&nvchan); - return ret; - } - nvchan->put = &nvchan->user[0x40/4]; - nvchan->get = &nvchan->user[0x44/4]; - nvchan->ref_cnt = &nvchan->user[0x48/4]; - - ret = drmMap(nvdev->fd, nvchan->drm.notifier, nvchan->drm.notifier_size, - (drmAddressPtr)&nvchan->notifier_block); - if (ret) { - nouveau_channel_free((void *)&nvchan); - return ret; - } - - ret = drmMap(nvdev->fd, nvchan->drm.cmdbuf, nvchan->drm.cmdbuf_size, - (void*)&nvchan->pushbuf); - if (ret) { - nouveau_channel_free((void *)&nvchan); - return ret; - } - - ret = nouveau_grobj_alloc(&nvchan->base, 0x00000000, 0x0030, - &nvchan->base.nullobj); - if (ret) { - nouveau_channel_free((void *)&nvchan); - return ret; - } - - nouveau_dma_channel_init(&nvchan->base); - nouveau_pushbuf_init(&nvchan->base); - - *chan = &nvchan->base; - return 0; -} - -void -nouveau_channel_free(struct nouveau_channel **chan) -{ - struct nouveau_channel_priv *nvchan; - struct nouveau_device_priv *nvdev; - struct drm_nouveau_channel_free cf; - - if (!chan || !*chan) - return; - nvchan = nouveau_channel(*chan); - *chan = NULL; - nvdev = nouveau_device(nvchan->base.device); - - FIRE_RING_CH(&nvchan->base); - - nouveau_grobj_free(&nvchan->base.vram); - nouveau_grobj_free(&nvchan->base.gart); - nouveau_grobj_free(&nvchan->base.nullobj); - - FREE(nvchan->pb.buffers); - FREE(nvchan->pb.relocs); - cf.channel = nvchan->drm.channel; - drmCommandWrite(nvdev->fd, DRM_NOUVEAU_CHANNEL_FREE, &cf, sizeof(cf)); - FREE(nvchan); -} diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c index e093877381..de4a90e25f 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c @@ -43,7 +43,7 @@ nouveau_channel_context_create(struct nouveau_device *dev) return NULL; } - nvc->next_handle = 0x80000000; + nvc->next_handle = 0x88000000; if ((ret = nouveau_notifier_alloc(nvc->channel, nvc->next_handle++, 1, &nvc->sync_notifier))) { @@ -120,22 +120,12 @@ nouveau_context_init(struct nouveau_screen *nv_screen, { struct pipe_surface *fb_surf; struct nouveau_pipe_buffer *fb_buf; - struct nouveau_bo_priv *fb_bo; - - fb_bo = calloc(1, sizeof(struct nouveau_bo_priv)); - fb_bo->drm.offset = nv_screen->front_offset; - fb_bo->drm.flags = NOUVEAU_MEM_FB; - fb_bo->drm.size = nv_screen->front_pitch * - nv_screen->front_height; - fb_bo->refcount = 1; - fb_bo->base.flags = NOUVEAU_BO_PIN | NOUVEAU_BO_VRAM; - fb_bo->base.offset = fb_bo->drm.offset; - fb_bo->base.handle = (unsigned long)fb_bo; - fb_bo->base.size = fb_bo->drm.size; - fb_bo->base.device = nv_screen->device; fb_buf = calloc(1, sizeof(struct nouveau_pipe_buffer)); - fb_buf->bo = &fb_bo->base; + + nouveau_bo_fake(dev, nv_screen->front_offset, NOUVEAU_BO_VRAM, + nv_screen->front_pitch*nv_screen->front_height, + NULL, &fb_buf->bo); fb_surf = calloc(1, sizeof(struct pipe_surface)); if (nv_screen->front_cpp == 2) diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h index b1bdb01bdf..d7199db3de 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h @@ -3,7 +3,14 @@ #include "nouveau/nouveau_winsys.h" #include "nouveau_drmif.h" -#include "nouveau_dma.h" +#include "nouveau_device.h" +#include "nouveau_channel.h" +#include "nouveau_pushbuf.h" +#include "nouveau_bo.h" +#include "nouveau_grobj.h" +#include "nouveau_notifier.h" +#include "nouveau_class.h" +#include "nouveau_local.h" struct nouveau_channel_context { struct pipe_screen *pscreen; @@ -29,7 +36,6 @@ struct nouveau_channel_context { struct nouveau_grobj *Nv2D; uint32_t next_handle; - uint32_t next_subchannel; uint32_t next_sequence; }; diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_device.c b/src/gallium/winsys/drm/nouveau/common/nouveau_device.c deleted file mode 100644 index 92b57b834b..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_device.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include -#include -#include "nouveau_drmif.h" - -int -nouveau_device_open_existing(struct nouveau_device **dev, int close, - int fd, drm_context_t ctx) -{ - struct nouveau_device_priv *nvdev; - int ret; - - if (!dev || *dev) - return -EINVAL; - - nvdev = CALLOC_STRUCT(nouveau_device_priv); - if (!nvdev) - return -ENOMEM; - nvdev->fd = fd; - nvdev->ctx = ctx; - nvdev->needs_close = close; - - drmCommandNone(nvdev->fd, DRM_NOUVEAU_CARD_INIT); - - if ((ret = nouveau_bo_init(&nvdev->base))) { - nouveau_device_close((void *)&nvdev); - return ret; - } - - { - uint64_t value; - - ret = nouveau_device_get_param(&nvdev->base, - NOUVEAU_GETPARAM_CHIPSET_ID, - &value); - if (ret) { - nouveau_device_close((void *)&nvdev); - return ret; - } - nvdev->base.chipset = value; - } - - *dev = &nvdev->base; - return 0; -} - -int -nouveau_device_open(struct nouveau_device **dev, const char *busid) -{ - drm_context_t ctx; - int fd, ret; - - if (!dev || *dev) - return -EINVAL; - - fd = drmOpen("nouveau", busid); - if (fd < 0) - return -EINVAL; - - ret = drmCreateContext(fd, &ctx); - if (ret) { - drmClose(fd); - return ret; - } - - ret = nouveau_device_open_existing(dev, 1, fd, ctx); - if (ret) { - drmDestroyContext(fd, ctx); - drmClose(fd); - return ret; - } - - return 0; -} - -void -nouveau_device_close(struct nouveau_device **dev) -{ - struct nouveau_device_priv *nvdev; - - if (dev || !*dev) - return; - nvdev = nouveau_device(*dev); - *dev = NULL; - - nouveau_bo_takedown(&nvdev->base); - - if (nvdev->needs_close) { - drmDestroyContext(nvdev->fd, nvdev->ctx); - drmClose(nvdev->fd); - } - FREE(nvdev); -} - -int -nouveau_device_get_param(struct nouveau_device *dev, - uint64_t param, uint64_t *value) -{ - struct nouveau_device_priv *nvdev = nouveau_device(dev); - struct drm_nouveau_getparam g; - int ret; - - if (!nvdev || !value) - return -EINVAL; - - g.param = param; - ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GETPARAM, - &g, sizeof(g)); - if (ret) - return ret; - - *value = g.value; - return 0; -} - -int -nouveau_device_set_param(struct nouveau_device *dev, - uint64_t param, uint64_t value) -{ - struct nouveau_device_priv *nvdev = nouveau_device(dev); - struct drm_nouveau_setparam s; - int ret; - - if (!nvdev) - return -EINVAL; - - s.param = param; - s.value = value; - ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_SETPARAM, - &s, sizeof(s)); - if (ret) - return ret; - - return 0; -} - diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.c b/src/gallium/winsys/drm/nouveau/common/nouveau_dma.c deleted file mode 100644 index f8a8ba04f6..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include - -#include "nouveau_drmif.h" -#include "nouveau_dma.h" -#include "nouveau_local.h" - -static inline uint32_t -READ_GET(struct nouveau_channel_priv *nvchan) -{ - return *nvchan->get; -} - -static inline void -WRITE_PUT(struct nouveau_channel_priv *nvchan, uint32_t val) -{ - uint32_t put = ((val << 2) + nvchan->dma->base); - volatile int dum; - - NOUVEAU_DMA_BARRIER; - dum = READ_GET(nvchan); - - *nvchan->put = put; - nvchan->dma->put = val; -#ifdef NOUVEAU_DMA_TRACE - NOUVEAU_MSG("WRITE_PUT %d/0x%08x\n", nvchan->drm.channel, put); -#endif - - NOUVEAU_DMA_BARRIER; -} - -static inline int -LOCAL_GET(struct nouveau_dma_priv *dma, uint32_t *val) -{ - uint32_t get = *val; - - if (get >= dma->base && get <= (dma->base + (dma->max << 2))) { - *val = (get - dma->base) >> 2; - return 1; - } - - return 0; -} - -void -nouveau_dma_channel_init(struct nouveau_channel *chan) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - int i; - - nvchan->dma = &nvchan->dma_master; - nvchan->dma->base = nvchan->drm.put_base; - nvchan->dma->cur = nvchan->dma->put = 0; - nvchan->dma->max = (nvchan->drm.cmdbuf_size >> 2) - 2; - nvchan->dma->free = nvchan->dma->max - nvchan->dma->cur; - - RING_SPACE_CH(chan, RING_SKIPS); - for (i = 0; i < RING_SKIPS; i++) - OUT_RING_CH(chan, 0); -} - -#define CHECK_TIMEOUT() do { \ - if ((NOUVEAU_TIME_MSEC() - t_start) > NOUVEAU_DMA_TIMEOUT) \ - return - EBUSY; \ -} while(0) - -int -nouveau_dma_wait(struct nouveau_channel *chan, int size) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_dma_priv *dma = nvchan->dma; - uint32_t get, t_start; - - FIRE_RING_CH(chan); - - t_start = NOUVEAU_TIME_MSEC(); - while (dma->free < size) { - CHECK_TIMEOUT(); - - get = READ_GET(nvchan); - if (!LOCAL_GET(dma, &get)) - continue; - - if (dma->put >= get) { - dma->free = dma->max - dma->cur; - - if (dma->free < size) { -#ifdef NOUVEAU_DMA_DEBUG - dma->push_free = 1; -#endif - OUT_RING_CH(chan, 0x20000000 | dma->base); - if (get <= RING_SKIPS) { - /*corner case - will be idle*/ - if (dma->put <= RING_SKIPS) - WRITE_PUT(nvchan, - RING_SKIPS + 1); - - do { - CHECK_TIMEOUT(); - get = READ_GET(nvchan); - if (!LOCAL_GET(dma, &get)) - get = 0; - } while (get <= RING_SKIPS); - } - - WRITE_PUT(nvchan, RING_SKIPS); - dma->cur = dma->put = RING_SKIPS; - dma->free = get - (RING_SKIPS + 1); - } - } else { - dma->free = get - dma->cur - 1; - } - } - - return 0; -} - -#ifdef NOUVEAU_DMA_DUMP_POSTRELOC_PUSHBUF -static void -nouveau_dma_parse_pushbuf(struct nouveau_channel *chan, int get, int put) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - unsigned mthd_count = 0; - - while (get != put) { - uint32_t gpuget = (get << 2) + nvchan->drm.put_base; - uint32_t data; - - if (get < 0 || get >= nvchan->drm.cmdbuf_size) { - NOUVEAU_ERR("DMA_PT 0x%08x\n", gpuget); - assert(0); - } - data = nvchan->pushbuf[get++]; - - if (mthd_count) { - NOUVEAU_MSG("0x%08x 0x%08x\n", gpuget, data); - mthd_count--; - continue; - } - - switch (data & 0x60000000) { - case 0x00000000: - mthd_count = (data >> 18) & 0x7ff; - NOUVEAU_MSG("0x%08x 0x%08x MTHD " - "Sc %d Mthd 0x%04x Size %d\n", - gpuget, data, (data>>13) & 7, data & 0x1ffc, - mthd_count); - break; - case 0x20000000: - get = (data & 0x1ffffffc) >> 2; - NOUVEAU_MSG("0x%08x 0x%08x JUMP 0x%08x\n", - gpuget, data, data & 0x1ffffffc); - continue; - case 0x40000000: - mthd_count = (data >> 18) & 0x7ff; - NOUVEAU_MSG("0x%08x 0x%08x NINC " - "Sc %d Mthd 0x%04x Size %d\n", - gpuget, data, (data>>13) & 7, data & 0x1ffc, - mthd_count); - break; - case 0x60000000: - /* DMA_OPCODE_CALL apparently, doesn't seem to work on - * my NV40 at least.. - */ - /* fall-through */ - default: - NOUVEAU_MSG("DMA_PUSHER 0x%08x 0x%08x\n", - gpuget, data); - assert(0); - } - } -} -#endif - -void -nouveau_dma_kickoff(struct nouveau_channel *chan) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_dma_priv *dma = nvchan->dma; - - if (dma->cur == dma->put) - return; - -#ifdef NOUVEAU_DMA_DEBUG - if (dma->push_free) { - NOUVEAU_ERR("Packet incomplete: %d left\n", dma->push_free); - return; - } -#endif - -#ifdef NOUVEAU_DMA_DUMP_POSTRELOC_PUSHBUF - nouveau_dma_parse_pushbuf(chan, dma->put, dma->cur); -#endif - - WRITE_PUT(nvchan, dma->cur); -} diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.h b/src/gallium/winsys/drm/nouveau/common/nouveau_dma.h deleted file mode 100644 index cfa6d26e82..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_DMA_H__ -#define __NOUVEAU_DMA_H__ - -#include -#include "nouveau_drmif.h" -#include "nouveau_local.h" - -#define RING_SKIPS 8 - -extern int nouveau_dma_wait(struct nouveau_channel *chan, int size); -extern void nouveau_dma_subc_bind(struct nouveau_grobj *); -extern void nouveau_dma_channel_init(struct nouveau_channel *); -extern void nouveau_dma_kickoff(struct nouveau_channel *); - -#ifdef NOUVEAU_DMA_DEBUG -static char faulty[1024]; -#endif - -static inline void -nouveau_dma_out(struct nouveau_channel *chan, uint32_t data) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_dma_priv *dma = nvchan->dma; - -#ifdef NOUVEAU_DMA_DEBUG - if (dma->push_free == 0) { - NOUVEAU_ERR("No space left in packet at %s\n", faulty); - return; - } - dma->push_free--; -#endif -#ifdef NOUVEAU_DMA_TRACE - { - uint32_t offset = (dma->cur << 2) + dma->base; - NOUVEAU_MSG("\tOUT_RING %d/0x%08x -> 0x%08x\n", - nvchan->drm.channel, offset, data); - } -#endif - nvchan->pushbuf[dma->cur + (dma->base - nvchan->drm.put_base)/4] = data; - dma->cur++; -} - -static inline void -nouveau_dma_outp(struct nouveau_channel *chan, uint32_t *ptr, int size) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_dma_priv *dma = nvchan->dma; - (void)dma; - -#ifdef NOUVEAU_DMA_DEBUG - if (dma->push_free < size) { - NOUVEAU_ERR("Packet too small. Free=%d, Need=%d\n", - dma->push_free, size); - return; - } -#endif -#ifdef NOUVEAU_DMA_TRACE - while (size--) { - nouveau_dma_out(chan, *ptr); - ptr++; - } -#else - memcpy(&nvchan->pushbuf[dma->cur], ptr, size << 2); -#ifdef NOUVEAU_DMA_DEBUG - dma->push_free -= size; -#endif - dma->cur += size; -#endif -} - -static inline void -nouveau_dma_space(struct nouveau_channel *chan, int size) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_dma_priv *dma = nvchan->dma; - - if (dma->free < size) { - if (nouveau_dma_wait(chan, size) && chan->hang_notify) - chan->hang_notify(chan); - } - dma->free -= size; -#ifdef NOUVEAU_DMA_DEBUG - dma->push_free = size; -#endif -} - -static inline void -nouveau_dma_begin(struct nouveau_channel *chan, struct nouveau_grobj *grobj, - int method, int size, const char* file, int line) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_dma_priv *dma = nvchan->dma; - (void)dma; - -#ifdef NOUVEAU_DMA_TRACE - NOUVEAU_MSG("BEGIN_RING %d/%08x/%d/0x%04x/%d\n", nvchan->drm.channel, - grobj->handle, grobj->subc, method, size); -#endif - -#ifdef NOUVEAU_DMA_DEBUG - if (dma->push_free) { - NOUVEAU_ERR("Previous packet incomplete: %d left at %s\n", - dma->push_free, faulty); - return; - } - sprintf(faulty,"%s:%d",file,line); -#endif - - nouveau_dma_space(chan, (size + 1)); - nouveau_dma_out(chan, (size << 18) | (grobj->subc << 13) | method); -} - -#define RING_SPACE_CH(ch,sz) nouveau_dma_space((ch), (sz)) -#define BEGIN_RING_CH(ch,gr,m,sz) nouveau_dma_begin((ch), (gr), (m), (sz), __FUNCTION__, __LINE__ ) -#define OUT_RING_CH(ch, data) nouveau_dma_out((ch), (data)) -#define OUT_RINGp_CH(ch,ptr,dwords) nouveau_dma_outp((ch), (void*)(ptr), \ - (dwords)) -#define FIRE_RING_CH(ch) nouveau_dma_kickoff((ch)) -#define WAIT_RING_CH(ch,sz) nouveau_dma_wait((ch), (sz)) - -#endif diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h b/src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h deleted file mode 100644 index 5f72800676..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 __NOUVEAU_DRMIF_H__ -#define __NOUVEAU_DRMIF_H__ - -#include -#include -#include - -#include "nouveau/nouveau_device.h" -#include "nouveau/nouveau_channel.h" -#include "nouveau/nouveau_grobj.h" -#include "nouveau/nouveau_notifier.h" -#include "nouveau/nouveau_bo.h" -#include "nouveau/nouveau_resource.h" -#include "nouveau/nouveau_pushbuf.h" - -struct nouveau_device_priv { - struct nouveau_device base; - - int fd; - drm_context_t ctx; - drmLock *lock; - int needs_close; - - struct drm_nouveau_mem_alloc sa; - void *sa_map; - struct nouveau_resource *sa_heap; -}; -#define nouveau_device(n) ((struct nouveau_device_priv *)(n)) - -extern int -nouveau_device_open_existing(struct nouveau_device **, int close, - int fd, drm_context_t ctx); - -extern int -nouveau_device_open(struct nouveau_device **, const char *busid); - -extern void -nouveau_device_close(struct nouveau_device **); - -extern int -nouveau_device_get_param(struct nouveau_device *, uint64_t param, uint64_t *v); - -extern int -nouveau_device_set_param(struct nouveau_device *, uint64_t param, uint64_t val); - -struct nouveau_fence { - struct nouveau_channel *channel; -}; - -struct nouveau_fence_cb { - struct nouveau_fence_cb *next; - void (*func)(void *); - void *priv; -}; - -struct nouveau_fence_priv { - struct nouveau_fence base; - int refcount; - - struct nouveau_fence *next; - struct nouveau_fence_cb *signal_cb; - - uint32_t sequence; - int emitted; - int signalled; -}; -#define nouveau_fence(n) ((struct nouveau_fence_priv *)(n)) - -extern int -nouveau_fence_new(struct nouveau_channel *, struct nouveau_fence **); - -extern int -nouveau_fence_ref(struct nouveau_fence *, struct nouveau_fence **); - -extern int -nouveau_fence_signal_cb(struct nouveau_fence *, void (*)(void *), void *); - -extern void -nouveau_fence_emit(struct nouveau_fence *); - -extern int -nouveau_fence_wait(struct nouveau_fence **); - -extern void -nouveau_fence_flush(struct nouveau_channel *); - -struct nouveau_pushbuf_reloc { - struct nouveau_pushbuf_bo *pbbo; - uint32_t *ptr; - uint32_t flags; - uint32_t data; - uint32_t vor; - uint32_t tor; -}; - -struct nouveau_pushbuf_bo { - struct nouveau_channel *channel; - struct nouveau_bo *bo; - unsigned flags; - unsigned handled; -}; - -#define NOUVEAU_PUSHBUF_MAX_BUFFERS 1024 -#define NOUVEAU_PUSHBUF_MAX_RELOCS 1024 -struct nouveau_pushbuf_priv { - struct nouveau_pushbuf base; - - struct nouveau_fence *fence; - - unsigned nop_jump; - unsigned start; - unsigned size; - - struct nouveau_pushbuf_bo *buffers; - unsigned nr_buffers; - struct nouveau_pushbuf_reloc *relocs; - unsigned nr_relocs; -}; -#define nouveau_pushbuf(n) ((struct nouveau_pushbuf_priv *)(n)) - -#define pbbo_to_ptr(o) ((uint64_t)(unsigned long)(o)) -#define ptr_to_pbbo(h) ((struct nouveau_pushbuf_bo *)(unsigned long)(h)) -#define pbrel_to_ptr(o) ((uint64_t)(unsigned long)(o)) -#define ptr_to_pbrel(h) ((struct nouveau_pushbuf_reloc *)(unsigned long)(h)) -#define bo_to_ptr(o) ((uint64_t)(unsigned long)(o)) -#define ptr_to_bo(h) ((struct nouveau_bo_priv *)(unsigned long)(h)) - -extern int -nouveau_pushbuf_init(struct nouveau_channel *); - -extern int -nouveau_pushbuf_flush(struct nouveau_channel *, unsigned min); - -extern int -nouveau_pushbuf_emit_reloc(struct nouveau_channel *, void *ptr, - struct nouveau_bo *, uint32_t data, uint32_t flags, - uint32_t vor, uint32_t tor); - -struct nouveau_dma_priv { - uint32_t base; - uint32_t max; - uint32_t cur; - uint32_t put; - uint32_t free; - - int push_free; -} dma; - -struct nouveau_channel_priv { - struct nouveau_channel base; - - struct drm_nouveau_channel_alloc drm; - - uint32_t *pushbuf; - void *notifier_block; - - volatile uint32_t *user; - volatile uint32_t *put; - volatile uint32_t *get; - volatile uint32_t *ref_cnt; - - struct nouveau_dma_priv dma_master; - struct nouveau_dma_priv dma_bufmgr; - struct nouveau_dma_priv *dma; - - struct nouveau_fence *fence_head; - struct nouveau_fence *fence_tail; - uint32_t fence_sequence; - - struct nouveau_pushbuf_priv pb; - - unsigned user_charge; -}; -#define nouveau_channel(n) ((struct nouveau_channel_priv *)(n)) - -extern int -nouveau_channel_alloc(struct nouveau_device *, uint32_t fb, uint32_t tt, - struct nouveau_channel **); - -extern void -nouveau_channel_free(struct nouveau_channel **); - -struct nouveau_grobj_priv { - struct nouveau_grobj base; -}; -#define nouveau_grobj(n) ((struct nouveau_grobj_priv *)(n)) - -extern int nouveau_grobj_alloc(struct nouveau_channel *, uint32_t handle, - int class, struct nouveau_grobj **); -extern int nouveau_grobj_ref(struct nouveau_channel *, uint32_t handle, - struct nouveau_grobj **); -extern void nouveau_grobj_free(struct nouveau_grobj **); - - -struct nouveau_notifier_priv { - struct nouveau_notifier base; - - struct drm_nouveau_notifierobj_alloc drm; - volatile void *map; -}; -#define nouveau_notifier(n) ((struct nouveau_notifier_priv *)(n)) - -extern int -nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, int count, - struct nouveau_notifier **); - -extern void -nouveau_notifier_free(struct nouveau_notifier **); - -extern void -nouveau_notifier_reset(struct nouveau_notifier *, int id); - -extern uint32_t -nouveau_notifier_status(struct nouveau_notifier *, int id); - -extern uint32_t -nouveau_notifier_return_val(struct nouveau_notifier *, int id); - -extern int -nouveau_notifier_wait_status(struct nouveau_notifier *, int id, int status, - int timeout); - -struct nouveau_bo_priv { - struct nouveau_bo base; - - struct nouveau_pushbuf_bo *pending; - struct nouveau_fence *fence; - struct nouveau_fence *wr_fence; - - struct drm_nouveau_mem_alloc drm; - void *map; - - void *sysmem; - int user; - - int refcount; - - uint64_t offset; - uint64_t flags; - int tiled; -}; -#define nouveau_bo(n) ((struct nouveau_bo_priv *)(n)) - -extern int -nouveau_bo_init(struct nouveau_device *); - -extern void -nouveau_bo_takedown(struct nouveau_device *); - -extern int -nouveau_bo_new(struct nouveau_device *, uint32_t flags, int align, int size, - struct nouveau_bo **); - -extern int -nouveau_bo_user(struct nouveau_device *, void *ptr, int size, - struct nouveau_bo **); - -extern int -nouveau_bo_ref(struct nouveau_device *, uint64_t handle, struct nouveau_bo **); - -extern int -nouveau_bo_set_status(struct nouveau_bo *, uint32_t flags); - -extern void -nouveau_bo_del(struct nouveau_bo **); - -extern int -nouveau_bo_busy(struct nouveau_bo *bo, uint32_t flags); - -extern int -nouveau_bo_map(struct nouveau_bo *, uint32_t flags); - -extern void -nouveau_bo_unmap(struct nouveau_bo *); - -extern int -nouveau_bo_validate(struct nouveau_channel *, struct nouveau_bo *, - uint32_t flags); - -extern int -nouveau_resource_init(struct nouveau_resource **heap, unsigned start, - unsigned size); - -extern int -nouveau_resource_alloc(struct nouveau_resource *heap, int size, void *priv, - struct nouveau_resource **); - -extern void -nouveau_resource_free(struct nouveau_resource **); - -#endif diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_fence.c b/src/gallium/winsys/drm/nouveau/common/nouveau_fence.c deleted file mode 100644 index 451011e112..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_fence.c +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include - -#include "nouveau_drmif.h" -#include "nouveau_dma.h" -#include "nouveau_local.h" - -static void -nouveau_fence_del_unsignalled(struct nouveau_fence *fence) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(fence->channel); - struct nouveau_fence *le; - - if (nvchan->fence_head == fence) { - nvchan->fence_head = nouveau_fence(fence)->next; - if (nvchan->fence_head == NULL) - nvchan->fence_tail = NULL; - return; - } - - le = nvchan->fence_head; - while (le && nouveau_fence(le)->next != fence) - le = nouveau_fence(le)->next; - assert(le && nouveau_fence(le)->next == fence); - nouveau_fence(le)->next = nouveau_fence(fence)->next; - if (nvchan->fence_tail == fence) - nvchan->fence_tail = le; -} - -static void -nouveau_fence_del(struct nouveau_fence **fence) -{ - struct nouveau_fence_priv *nvfence; - - if (!fence || !*fence) - return; - nvfence = nouveau_fence(*fence); - *fence = NULL; - - if (--nvfence->refcount) - return; - - if (nvfence->emitted && !nvfence->signalled) { - if (nvfence->signal_cb) { - nvfence->refcount++; - nouveau_fence_wait((void *)&nvfence); - return; - } - - nouveau_fence_del_unsignalled(&nvfence->base); - } - free(nvfence); -} - -int -nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **fence) -{ - struct nouveau_fence_priv *nvfence; - - if (!chan || !fence || *fence) - return -EINVAL; - - nvfence = calloc(1, sizeof(struct nouveau_fence_priv)); - if (!nvfence) - return -ENOMEM; - nvfence->base.channel = chan; - nvfence->refcount = 1; - - *fence = &nvfence->base; - return 0; -} - -int -nouveau_fence_ref(struct nouveau_fence *ref, struct nouveau_fence **fence) -{ - struct nouveau_fence_priv *nvfence; - - if (!fence) - return -EINVAL; - - if (*fence) { - nouveau_fence_del(fence); - *fence = NULL; - } - - if (ref) { - nvfence = nouveau_fence(ref); - nvfence->refcount++; - *fence = &nvfence->base; - } - - return 0; -} - -int -nouveau_fence_signal_cb(struct nouveau_fence *fence, void (*func)(void *), - void *priv) -{ - struct nouveau_fence_priv *nvfence = nouveau_fence(fence); - struct nouveau_fence_cb *cb; - - if (!nvfence || !func) - return -EINVAL; - - cb = malloc(sizeof(struct nouveau_fence_cb)); - if (!cb) - return -ENOMEM; - - cb->func = func; - cb->priv = priv; - cb->next = nvfence->signal_cb; - nvfence->signal_cb = cb; - return 0; -} - -void -nouveau_fence_emit(struct nouveau_fence *fence) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(fence->channel); - struct nouveau_fence_priv *nvfence = nouveau_fence(fence); - - nvfence->emitted = 1; - nvfence->sequence = ++nvchan->fence_sequence; - if (nvfence->sequence == 0xffffffff) - NOUVEAU_ERR("AII wrap unhandled\n"); - - /*XXX: assumes subc 0 is populated */ - /* Not the way to fence on nv4 */ - if (nvchan->base.device->chipset >= 0x10) { - RING_SPACE_CH(fence->channel, 2); - OUT_RING_CH (fence->channel, 0x00040050); - OUT_RING_CH (fence->channel, nvfence->sequence); - } - - if (nvchan->fence_tail) { - nouveau_fence(nvchan->fence_tail)->next = fence; - } else { - nvchan->fence_head = fence; - } - nvchan->fence_tail = fence; -} - -void -nouveau_fence_flush(struct nouveau_channel *chan) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - uint32_t sequence = *nvchan->ref_cnt; - - while (nvchan->fence_head) { - struct nouveau_fence_priv *nvfence; - - nvfence = nouveau_fence(nvchan->fence_head); - if (nvfence->sequence > sequence) - break; - nouveau_fence_del_unsignalled(&nvfence->base); - nvfence->signalled = 1; - - if (nvfence->signal_cb) { - struct nouveau_fence *fence = NULL; - - nouveau_fence_ref(&nvfence->base, &fence); - - while (nvfence->signal_cb) { - struct nouveau_fence_cb *cb; - - cb = nvfence->signal_cb; - nvfence->signal_cb = cb->next; - cb->func(cb->priv); - free(cb); - } - - nouveau_fence_ref(NULL, &fence); - } - } -} - -int -nouveau_fence_wait(struct nouveau_fence **fence) -{ - struct nouveau_fence_priv *nvfence; - - if (!fence || !*fence) - return -EINVAL; - nvfence = nouveau_fence(*fence); - - if (nvfence->emitted) { - while (!nvfence->signalled) - nouveau_fence_flush(nvfence->base.channel); - } - nouveau_fence_ref(NULL, fence); - - return 0; -} - diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c b/src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c deleted file mode 100644 index fb430a25b8..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include -#include "nouveau_drmif.h" - -int -nouveau_grobj_alloc(struct nouveau_channel *chan, uint32_t handle, - int class, struct nouveau_grobj **grobj) -{ - struct nouveau_device_priv *nvdev = nouveau_device(chan->device); - struct nouveau_grobj_priv *nvgrobj; - struct drm_nouveau_grobj_alloc g; - int ret; - - if (!nvdev || !grobj || *grobj) - return -EINVAL; - - nvgrobj = CALLOC_STRUCT(nouveau_grobj_priv); - if (!nvgrobj) - return -ENOMEM; - nvgrobj->base.channel = chan; - nvgrobj->base.handle = handle; - nvgrobj->base.grclass = class; - - g.channel = chan->id; - g.handle = handle; - g.class = class; - ret = drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GROBJ_ALLOC, - &g, sizeof(g)); - if (ret) { - nouveau_grobj_free((void *)&nvgrobj); - return ret; - } - - *grobj = &nvgrobj->base; - return 0; -} - -int -nouveau_grobj_ref(struct nouveau_channel *chan, uint32_t handle, - struct nouveau_grobj **grobj) -{ - struct nouveau_grobj_priv *nvgrobj; - - if (!chan || !grobj || *grobj) - return -EINVAL; - - nvgrobj = CALLOC_STRUCT(nouveau_grobj_priv); - if (!nvgrobj) - return -ENOMEM; - nvgrobj->base.channel = chan; - nvgrobj->base.handle = handle; - nvgrobj->base.grclass = 0; - - *grobj = &nvgrobj->base; - return 0; -} - -void -nouveau_grobj_free(struct nouveau_grobj **grobj) -{ - struct nouveau_device_priv *nvdev; - struct nouveau_channel_priv *chan; - struct nouveau_grobj_priv *nvgrobj; - - if (!grobj || !*grobj) - return; - nvgrobj = nouveau_grobj(*grobj); - *grobj = NULL; - - - chan = nouveau_channel(nvgrobj->base.channel); - nvdev = nouveau_device(chan->base.device); - - if (nvgrobj->base.grclass) { - struct drm_nouveau_gpuobj_free f; - - f.channel = chan->drm.channel; - f.handle = nvgrobj->base.handle; - drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, - &f, sizeof(f)); - } - FREE(nvgrobj); -} - diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_local.h b/src/gallium/winsys/drm/nouveau/common/nouveau_local.h index 877c7a8c47..11175bce7a 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_local.h +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_local.h @@ -16,100 +16,4 @@ fflush(stderr); \ } while(0) -#define NOUVEAU_TIME_MSEC() 0 - -/* User FIFO control */ -//#define NOUVEAU_DMA_TRACE -//#define NOUVEAU_DMA_DEBUG -//#define NOUVEAU_DMA_DUMP_POSTRELOC_PUSHBUF -#define NOUVEAU_DMA_BARRIER -#define NOUVEAU_DMA_TIMEOUT 2000 - -/* Push buffer access macros */ -static INLINE void -OUT_RING(struct nouveau_channel *chan, unsigned data) -{ - *(chan->pushbuf->cur++) = (data); -} - -static INLINE void -OUT_RINGp(struct nouveau_channel *chan, uint32_t *data, unsigned size) -{ - memcpy(chan->pushbuf->cur, data, size * 4); - chan->pushbuf->cur += size; -} - -static INLINE void -OUT_RINGf(struct nouveau_channel *chan, float f) -{ - union { uint32_t i; float f; } c; - c.f = f; - OUT_RING(chan, c.i); -} - -static INLINE void -BEGIN_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, - unsigned mthd, unsigned size) -{ - if (chan->pushbuf->remaining < (size + 1)) - nouveau_pushbuf_flush(chan, (size + 1)); - OUT_RING(chan, (gr->subc << 13) | (size << 18) | mthd); - chan->pushbuf->remaining -= (size + 1); -} - -static INLINE void -FIRE_RING(struct nouveau_channel *chan) -{ - nouveau_pushbuf_flush(chan, 0); -} - -static INLINE void -BIND_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, unsigned subc) -{ - gr->subc = subc; - BEGIN_RING(chan, gr, 0x0000, 1); - OUT_RING (chan, gr->handle); -} - -static INLINE void -OUT_RELOC(struct nouveau_channel *chan, struct nouveau_bo *bo, - unsigned data, unsigned flags, unsigned vor, unsigned tor) -{ - nouveau_pushbuf_emit_reloc(chan, chan->pushbuf->cur++, bo, - data, flags, vor, tor); -} - -/* Raw data + flags depending on FB/TT buffer */ -static INLINE void -OUT_RELOCd(struct nouveau_channel *chan, struct nouveau_bo *bo, - unsigned data, unsigned flags, unsigned vor, unsigned tor) -{ - OUT_RELOC(chan, bo, data, flags | NOUVEAU_BO_OR, vor, tor); -} - -/* FB/TT object handle */ -static INLINE void -OUT_RELOCo(struct nouveau_channel *chan, struct nouveau_bo *bo, - unsigned flags) -{ - OUT_RELOC(chan, bo, 0, flags | NOUVEAU_BO_OR, - chan->vram->handle, chan->gart->handle); -} - -/* Low 32-bits of offset */ -static INLINE void -OUT_RELOCl(struct nouveau_channel *chan, struct nouveau_bo *bo, - unsigned delta, unsigned flags) -{ - OUT_RELOC(chan, bo, delta, flags | NOUVEAU_BO_LOW, 0, 0); -} - -/* High 32-bits of offset */ -static INLINE void -OUT_RELOCh(struct nouveau_channel *chan, struct nouveau_bo *bo, - unsigned delta, unsigned flags) -{ - OUT_RELOC(chan, bo, delta, flags | NOUVEAU_BO_HIGH, 0, 0); -} - #endif diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c b/src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c deleted file mode 100644 index 01e8f38440..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include - -#include "nouveau_drmif.h" -#include "nouveau_local.h" - -#define NOTIFIER(__v) \ - struct nouveau_notifier_priv *nvnotify = nouveau_notifier(notifier); \ - volatile uint32_t *__v = (void*)nvnotify->map + (id * 32) - -int -nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, - int count, struct nouveau_notifier **notifier) -{ - struct nouveau_notifier_priv *nvnotify; - int ret; - - if (!chan || !notifier || *notifier) - return -EINVAL; - - nvnotify = calloc(1, sizeof(struct nouveau_notifier_priv)); - if (!nvnotify) - return -ENOMEM; - nvnotify->base.channel = chan; - nvnotify->base.handle = handle; - - nvnotify->drm.channel = chan->id; - nvnotify->drm.handle = handle; - nvnotify->drm.count = count; - if ((ret = drmCommandWriteRead(nouveau_device(chan->device)->fd, - DRM_NOUVEAU_NOTIFIEROBJ_ALLOC, - &nvnotify->drm, - sizeof(nvnotify->drm)))) { - nouveau_notifier_free((void *)&nvnotify); - return ret; - } - - nvnotify->map = (void *)nouveau_channel(chan)->notifier_block + - nvnotify->drm.offset; - *notifier = &nvnotify->base; - return 0; -} - -void -nouveau_notifier_free(struct nouveau_notifier **notifier) -{ - - struct nouveau_notifier_priv *nvnotify; - struct nouveau_channel_priv *nvchan; - struct nouveau_device_priv *nvdev; - struct drm_nouveau_gpuobj_free f; - - if (!notifier || !*notifier) - return; - nvnotify = nouveau_notifier(*notifier); - *notifier = NULL; - - nvchan = nouveau_channel(nvnotify->base.channel); - nvdev = nouveau_device(nvchan->base.device); - - f.channel = nvchan->drm.channel; - f.handle = nvnotify->base.handle; - drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, &f, sizeof(f)); - free(nvnotify); -} - -void -nouveau_notifier_reset(struct nouveau_notifier *notifier, int id) -{ - NOTIFIER(n); - - n[NV_NOTIFY_TIME_0 /4] = 0x00000000; - n[NV_NOTIFY_TIME_1 /4] = 0x00000000; - n[NV_NOTIFY_RETURN_VALUE/4] = 0x00000000; - n[NV_NOTIFY_STATE /4] = (NV_NOTIFY_STATE_STATUS_IN_PROCESS << - NV_NOTIFY_STATE_STATUS_SHIFT); -} - -uint32_t -nouveau_notifier_status(struct nouveau_notifier *notifier, int id) -{ - NOTIFIER(n); - - return n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT; -} - -uint32_t -nouveau_notifier_return_val(struct nouveau_notifier *notifier, int id) -{ - NOTIFIER(n); - - return n[NV_NOTIFY_RETURN_VALUE/4]; -} - -int -nouveau_notifier_wait_status(struct nouveau_notifier *notifier, int id, - int status, int timeout) -{ - NOTIFIER(n); - uint32_t time = 0, t_start = NOUVEAU_TIME_MSEC(); - - while (time <= timeout) { - uint32_t v; - - v = n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT; - if (v == status) - return 0; - - if (timeout) - time = NOUVEAU_TIME_MSEC() - t_start; - } - - return -EBUSY; -} - diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c b/src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c deleted file mode 100644 index 7c094eb795..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include -#include -#include "nouveau_drmif.h" -#include "nouveau_dma.h" - -#define PB_BUFMGR_DWORDS (4096 / 2) -#define PB_MIN_USER_DWORDS 2048 - -static int -nouveau_pushbuf_space(struct nouveau_channel *chan, unsigned min) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; - - assert((min + 1) <= nvchan->dma->max); - - /* Wait for enough space in push buffer */ - min = min < PB_MIN_USER_DWORDS ? PB_MIN_USER_DWORDS : min; - min += 1; /* a bit extra for the NOP */ - if (nvchan->dma->free < min) - WAIT_RING_CH(chan, min); - - /* Insert NOP, may turn into a jump later */ - RING_SPACE_CH(chan, 1); - nvpb->nop_jump = nvchan->dma->cur; - OUT_RING_CH(chan, 0); - - /* Any remaining space is available to the user */ - nvpb->start = nvchan->dma->cur; - nvpb->size = nvchan->dma->free; - nvpb->base.channel = chan; - nvpb->base.remaining = nvpb->size; - nvpb->base.cur = &nvchan->pushbuf[nvpb->start]; - - /* Create a new fence object for this "frame" */ - nouveau_fence_ref(NULL, &nvpb->fence); - nouveau_fence_new(chan, &nvpb->fence); - - return 0; -} - -int -nouveau_pushbuf_init(struct nouveau_channel *chan) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_dma_priv *m = &nvchan->dma_master; - struct nouveau_dma_priv *b = &nvchan->dma_bufmgr; - int i; - - if (!nvchan) - return -EINVAL; - - /* Reassign last bit of push buffer for a "separate" bufmgr - * ring buffer - */ - m->max -= PB_BUFMGR_DWORDS; - m->free -= PB_BUFMGR_DWORDS; - - b->base = m->base + ((m->max + 2) << 2); - b->max = PB_BUFMGR_DWORDS - 2; - b->cur = b->put = 0; - b->free = b->max - b->cur; - - /* Some NOPs just to be safe - *XXX: RING_SKIPS - */ - nvchan->dma = b; - RING_SPACE_CH(chan, 8); - for (i = 0; i < 8; i++) - OUT_RING_CH(chan, 0); - nvchan->dma = m; - - nouveau_pushbuf_space(chan, 0); - chan->pushbuf = &nvchan->pb.base; - - nvchan->pb.buffers = CALLOC(NOUVEAU_PUSHBUF_MAX_BUFFERS, - sizeof(struct nouveau_pushbuf_bo)); - nvchan->pb.relocs = CALLOC(NOUVEAU_PUSHBUF_MAX_RELOCS, - sizeof(struct nouveau_pushbuf_reloc)); - return 0; -} - -static uint32_t -nouveau_pushbuf_calc_reloc(struct nouveau_bo *bo, - struct nouveau_pushbuf_reloc *r) -{ - uint32_t push; - - if (r->flags & NOUVEAU_BO_LOW) { - push = bo->offset + r->data; - } else - if (r->flags & NOUVEAU_BO_HIGH) { - push = (bo->offset + r->data) >> 32; - } else { - push = r->data; - } - - if (r->flags & NOUVEAU_BO_OR) { - if (bo->flags & NOUVEAU_BO_VRAM) - push |= r->vor; - else - push |= r->tor; - } - - return push; -} - -/* This would be our TTM "superioctl" */ -int -nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min) -{ - struct nouveau_channel_priv *nvchan = nouveau_channel(chan); - struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; - int ret, i; - - if (nvpb->base.remaining == nvpb->size) - return 0; - - nouveau_fence_flush(chan); - - nvpb->size -= nvpb->base.remaining; - nvchan->dma->cur += nvpb->size; - nvchan->dma->free -= nvpb->size; - assert(nvchan->dma->cur <= nvchan->dma->max); - - nvchan->dma = &nvchan->dma_bufmgr; - nvchan->pushbuf[nvpb->nop_jump] = 0x20000000 | - (nvchan->dma->base + (nvchan->dma->cur << 2)); - - /* Validate buffers + apply relocations */ - nvchan->user_charge = 0; - for (i = 0; i < nvpb->nr_relocs; i++) { - struct nouveau_pushbuf_reloc *r = &nvpb->relocs[i]; - struct nouveau_pushbuf_bo *pbbo = r->pbbo; - struct nouveau_bo *bo = pbbo->bo; - - /* Validated, mem matches presumed, no relocation necessary */ - if (pbbo->handled & 2) { - if (!(pbbo->handled & 1)) - assert(0); - continue; - } - - /* Not yet validated, do it now */ - if (!(pbbo->handled & 1)) { - ret = nouveau_bo_validate(chan, bo, pbbo->flags); - if (ret) { - assert(0); - return ret; - } - pbbo->handled |= 1; - - if (bo->offset == nouveau_bo(bo)->offset && - bo->flags == nouveau_bo(bo)->flags) { - pbbo->handled |= 2; - continue; - } - bo->offset = nouveau_bo(bo)->offset; - bo->flags = nouveau_bo(bo)->flags; - } - - /* Apply the relocation */ - *r->ptr = nouveau_pushbuf_calc_reloc(bo, r); - } - nvpb->nr_relocs = 0; - - /* Dereference all buffers on validate list */ - for (i = 0; i < nvpb->nr_buffers; i++) { - struct nouveau_pushbuf_bo *pbbo = &nvpb->buffers[i]; - - nouveau_bo(pbbo->bo)->pending = NULL; - nouveau_bo_del(&pbbo->bo); - } - nvpb->nr_buffers = 0; - - /* Switch back to user's ring */ - RING_SPACE_CH(chan, 1); - OUT_RING_CH(chan, 0x20000000 | ((nvpb->start << 2) + - nvchan->dma_master.base)); - nvchan->dma = &nvchan->dma_master; - - /* Fence + kickoff */ - nouveau_fence_emit(nvpb->fence); - FIRE_RING_CH(chan); - - /* Allocate space for next push buffer */ - ret = nouveau_pushbuf_space(chan, min); - assert(!ret); - - return 0; -} - -static struct nouveau_pushbuf_bo * -nouveau_pushbuf_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo) -{ - struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(chan->pushbuf); - struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - struct nouveau_pushbuf_bo *pbbo; - - if (nvbo->pending) - return nvbo->pending; - - if (nvpb->nr_buffers >= NOUVEAU_PUSHBUF_MAX_BUFFERS) - return NULL; - pbbo = nvpb->buffers + nvpb->nr_buffers++; - nvbo->pending = pbbo; - - nouveau_bo_ref(bo->device, bo->handle, &pbbo->bo); - pbbo->channel = chan; - pbbo->flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART; - pbbo->handled = 0; - return pbbo; -} - -int -nouveau_pushbuf_emit_reloc(struct nouveau_channel *chan, void *ptr, - struct nouveau_bo *bo, uint32_t data, uint32_t flags, - uint32_t vor, uint32_t tor) -{ - struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(chan->pushbuf); - struct nouveau_pushbuf_bo *pbbo; - struct nouveau_pushbuf_reloc *r; - - if (nvpb->nr_relocs >= NOUVEAU_PUSHBUF_MAX_RELOCS) - return -ENOMEM; - - pbbo = nouveau_pushbuf_emit_buffer(chan, bo); - if (!pbbo) - return -ENOMEM; - pbbo->flags |= (flags & NOUVEAU_BO_RDWR); - pbbo->flags &= (flags | NOUVEAU_BO_RDWR); - - r = nvpb->relocs + nvpb->nr_relocs++; - r->pbbo = pbbo; - r->ptr = ptr; - r->flags = flags; - r->data = data; - r->vor = vor; - r->tor = tor; - - if (flags & NOUVEAU_BO_DUMMY) - *(uint32_t *)ptr = 0; - else - *(uint32_t *)ptr = nouveau_pushbuf_calc_reloc(bo, r); - return 0; -} diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_resource.c b/src/gallium/winsys/drm/nouveau/common/nouveau_resource.c deleted file mode 100644 index 766fd279fe..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_resource.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2007 Nouveau Project - * - * 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 - * THE AUTHORS 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 -#include -#include -#include "nouveau_drmif.h" -#include "nouveau_local.h" - -int -nouveau_resource_init(struct nouveau_resource **heap, - unsigned start, unsigned size) -{ - struct nouveau_resource *r; - - r = CALLOC_STRUCT(nouveau_resource); - if (!r) - return 1; - - r->start = start; - r->size = size; - *heap = r; - return 0; -} - -int -nouveau_resource_alloc(struct nouveau_resource *heap, int size, void *priv, - struct nouveau_resource **res) -{ - struct nouveau_resource *r; - - if (!heap || !size || !res || *res) - return 1; - - while (heap) { - if (!heap->in_use && heap->size >= size) { - r = CALLOC_STRUCT(nouveau_resource); - if (!r) - return 1; - - r->start = (heap->start + heap->size) - size; - r->size = size; - r->in_use = 1; - r->priv = priv; - - heap->size -= size; - - r->next = heap->next; - if (heap->next) - heap->next->prev = r; - r->prev = heap; - heap->next = r; - - *res = r; - return 0; - } - - heap = heap->next; - } - - return 1; -} - -void -nouveau_resource_free(struct nouveau_resource **res) -{ - struct nouveau_resource *r; - - if (!res || !*res) - return; - r = *res; - *res = NULL; - - r->in_use = 0; - - if (r->next && !r->next->in_use) { - struct nouveau_resource *new = r->next; - - new->prev = r->prev; - if (r->prev) - r->prev->next = new; - new->size += r->size; - new->start = r->start; - - free(r); - r = new; - } - - if (r->prev && !r->prev->in_use) { - r->prev->next = r->next; - if (r->next) - r->next->prev = r->prev; - r->prev->size += r->size; - FREE(r); - } - -} diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c index 722694e4a4..3b2b86cd40 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c @@ -29,8 +29,9 @@ nouveau_pipe_grobj_alloc(struct nouveau_winsys *nvws, int grclass, if (ret) return ret; - assert(nv->nvc->next_subchannel < 7); - BIND_RING(chan, *grobj, nv->nvc->next_subchannel++); + BEGIN_RING(chan, *grobj, 0x0000, 1); + OUT_RING (chan, (*grobj)->handle); + (*grobj)->bound = NOUVEAU_GROBJ_BOUND_EXPLICIT; return 0; } @@ -73,14 +74,8 @@ static int nouveau_pipe_push_flush(struct nouveau_winsys *nvws, unsigned size, struct pipe_fence_handle **fence) { - if (fence) { - struct nouveau_pushbuf *pb = nvws->channel->pushbuf; - struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(pb); - struct nouveau_fence *ref = NULL; - - nouveau_fence_ref(nvpb->fence, &ref); - *fence = (struct pipe_fence_handle *)ref; - } + if (fence) + *fence = NULL; return nouveau_pushbuf_flush(nvws->channel, size); } diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c index 8e889b9f36..6f79e0800a 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c @@ -105,7 +105,7 @@ nouveau_pipe_bo_del(struct pipe_winsys *ws, struct pipe_buffer *buf) { struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf); - nouveau_bo_del(&nvbuf->bo); + nouveau_bo_ref(NULL, &nvbuf->bo); FREE(nvbuf); } @@ -121,6 +121,7 @@ nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf, if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) map_flags |= NOUVEAU_BO_WR; +#if 0 if (flags & PIPE_BUFFER_USAGE_DISCARD && !(flags & PIPE_BUFFER_USAGE_CPU_READ) && nouveau_bo_busy(nvbuf->bo, map_flags)) { @@ -131,10 +132,11 @@ nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf, uint32_t flags = nouveau_flags_from_usage(nv, buf->usage); if (!nouveau_bo_new(dev, flags, buf->alignment, buf->size, &rename)) { - nouveau_bo_del(&nvbuf->bo); + nouveau_bo_ref(NULL, &nvbuf->bo); nvbuf->bo = rename; } } +#endif if (nouveau_bo_map(nvbuf->bo, map_flags)) return NULL; @@ -149,42 +151,26 @@ nouveau_pipe_bo_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf) nouveau_bo_unmap(nvbuf->bo); } -static INLINE struct nouveau_fence * -nouveau_pipe_fence(struct pipe_fence_handle *pfence) -{ - return (struct nouveau_fence *)pfence; -} - static void nouveau_pipe_fence_reference(struct pipe_winsys *ws, struct pipe_fence_handle **ptr, struct pipe_fence_handle *pfence) { - nouveau_fence_ref((void *)pfence, (void *)ptr); + *ptr = pfence; } static int nouveau_pipe_fence_signalled(struct pipe_winsys *ws, struct pipe_fence_handle *pfence, unsigned flag) { - struct nouveau_pipe_winsys *nvpws = (struct nouveau_pipe_winsys *)ws; - struct nouveau_fence *fence = nouveau_pipe_fence(pfence); - - if (nouveau_fence(fence)->signalled == 0) - nouveau_fence_flush(nvpws->nv->nvc->channel); - - return !nouveau_fence(fence)->signalled; + return 0; } static int nouveau_pipe_fence_finish(struct pipe_winsys *ws, struct pipe_fence_handle *pfence, unsigned flag) { - struct nouveau_fence *fence = nouveau_pipe_fence(pfence); - struct nouveau_fence *ref = NULL; - - nouveau_fence_ref(fence, &ref); - return nouveau_fence_wait(&ref); + return 0; } static void diff --git a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c b/src/gallium/winsys/drm/nouveau/common/nv04_surface.c index e9a8a2ac1c..b83f3475df 100644 --- a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c +++ b/src/gallium/winsys/drm/nouveau/common/nv04_surface.c @@ -354,7 +354,6 @@ nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc) NOUVEAU_ERR("Error creating m2mf object: %d\n", ret); return 1; } - BIND_RING (chan, nvc->NvM2MF, nvc->next_subchannel++); BEGIN_RING(chan, nvc->NvM2MF, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 1); OUT_RING (chan, nvc->sync_notifier->handle); @@ -366,7 +365,6 @@ nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc) NOUVEAU_ERR("Error creating 2D surface object: %d\n", ret); return 1; } - BIND_RING (chan, nvc->NvCtxSurf2D, nvc->next_subchannel++); BEGIN_RING(chan, nvc->NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); OUT_RING (chan, nvc->channel->vram->handle); @@ -378,7 +376,6 @@ nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc) NOUVEAU_ERR("Error creating blit object: %d\n", ret); return 1; } - BIND_RING (chan, nvc->NvImageBlit, nvc->next_subchannel++); BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_DMA_NOTIFY, 1); OUT_RING (chan, nvc->sync_notifier->handle); BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_SURFACE, 1); @@ -392,7 +389,6 @@ nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc) NOUVEAU_ERR("Error creating rect object: %d\n", ret); return 1; } - BIND_RING (chan, nvc->NvGdiRect, nvc->next_subchannel++); BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY, 1); OUT_RING (chan, nvc->sync_notifier->handle); BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_SURFACE, 1); @@ -431,8 +427,6 @@ nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc) return 1; } - BIND_RING (chan, nvc->NvSwzSurf, nvc->next_subchannel++); - if (chipset < 0x10) { class = NV04_SCALED_IMAGE_FROM_MEMORY; } else @@ -449,8 +443,6 @@ nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc) return 1; } - BIND_RING (chan, nvc->NvSIFM, nvc->next_subchannel++); - return 0; } diff --git a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c b/src/gallium/winsys/drm/nouveau/common/nv50_surface.c index c8ab7f690f..d16f3a97d5 100644 --- a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c +++ b/src/gallium/winsys/drm/nouveau/common/nv50_surface.c @@ -34,7 +34,7 @@ nv50_surface_set(struct nouveau_context *nv, struct pipe_surface *surf, int dst) if (surf_format < 0) return 1; - if (!nouveau_bo(bo)->tiled) { + if (!bo->tiled) { BEGIN_RING(chan, eng2d, mthd, 2); OUT_RING (chan, surf_format); OUT_RING (chan, 1); @@ -166,7 +166,6 @@ nouveau_surface_channel_create_nv50(struct nouveau_channel_context *nvc) return ret; nvc->Nv2D = eng2d; - BIND_RING (chan, eng2d, nvc->next_subchannel++); BEGIN_RING(chan, eng2d, NV50_2D_DMA_NOTIFY, 4); OUT_RING (chan, nvc->sync_notifier->handle); OUT_RING (chan, chan->vram->handle); diff --git a/src/gallium/winsys/drm/nouveau/dri/Makefile b/src/gallium/winsys/drm/nouveau/dri/Makefile index e129e42e97..3f3553b61d 100644 --- a/src/gallium/winsys/drm/nouveau/dri/Makefile +++ b/src/gallium/winsys/drm/nouveau/dri/Makefile @@ -26,6 +26,9 @@ C_SOURCES = \ ASM_SOURCES = +DRIVER_DEFINES = $(shell pkg-config libdrm_nouveau --cflags) +DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs) + include ../../Makefile.template symlinks: diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h b/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h index 8257790d47..64cf326411 100644 --- a/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h +++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h @@ -5,8 +5,6 @@ #include #include #include "../common/nouveau_context.h" -#include "../common/nouveau_drmif.h" -#include "../common/nouveau_dma.h" struct nouveau_framebuffer { struct st_framebuffer *stfb; diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c b/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c index 1d7c92376f..964a9028aa 100644 --- a/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c +++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c @@ -12,7 +12,7 @@ #include "nouveau_screen_dri.h" #include "nouveau_swapbuffers.h" -#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 11 +#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 12 #error nouveau_drm.h version does not match expected version #endif -- cgit v1.2.3 From 79bf0bdc7ffe97ec128e5dd143c4ed54648aae42 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 4 Feb 2009 20:59:49 +1000 Subject: nouveau: get things building/running again after pipe_surface.buffer removal Don't look at nouveau_winsys_pipe.h... I promise it's temporary! --- src/gallium/drivers/nv04/nv04_miptree.c | 25 +++++++++ src/gallium/drivers/nv10/nv10_miptree.c | 25 +++++++++ src/gallium/drivers/nv20/nv20_miptree.c | 25 +++++++++ src/gallium/drivers/nv30/nv30_miptree.c | 25 +++++++++ src/gallium/drivers/nv40/nv40_miptree.c | 25 +++++++++ src/gallium/drivers/nv50/nv50_miptree.c | 26 ++++++++++ .../winsys/drm/nouveau/common/nouveau_context.c | 60 +++++++++++----------- .../winsys/drm/nouveau/common/nouveau_context.h | 1 + .../winsys/drm/nouveau/common/nouveau_winsys.c | 5 +- .../drm/nouveau/common/nouveau_winsys_pipe.c | 38 ++++++++++++-- .../drm/nouveau/common/nouveau_winsys_pipe.h | 14 ++++- .../winsys/drm/nouveau/common/nv04_surface.c | 32 ++++++------ .../winsys/drm/nouveau/common/nv50_surface.c | 2 +- 13 files changed, 249 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_miptree.c b/src/gallium/drivers/nv04/nv04_miptree.c index 0575dc0afc..fd908491e9 100644 --- a/src/gallium/drivers/nv04/nv04_miptree.c +++ b/src/gallium/drivers/nv04/nv04_miptree.c @@ -69,6 +69,30 @@ nv04_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) return &mt->base; } +static struct pipe_texture * +nv04_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, + const unsigned *stride, struct pipe_buffer *pb) +{ + struct nv04_miptree *mt; + + /* Only supports 2D, non-mipmapped textures for the moment */ + if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 || + pt->depth[0] != 1) + return NULL; + + mt = CALLOC_STRUCT(nv04_miptree); + if (!mt) + return NULL; + + mt->base = *pt; + mt->base.refcount = 1; + mt->base.screen = pscreen; + mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); + + pipe_buffer_reference(pscreen, &mt->buffer, pb); + return &mt->base; +} + static void nv04_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt) { @@ -144,6 +168,7 @@ void nv04_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv04_miptree_create; + pscreen->texture_blanket = nv04_miptree_blanket; pscreen->texture_release = nv04_miptree_release; pscreen->get_tex_surface = nv04_miptree_surface_new; pscreen->tex_surface_release = nv04_miptree_surface_del; diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c index 909278213e..bbd4b1e15c 100644 --- a/src/gallium/drivers/nv10/nv10_miptree.c +++ b/src/gallium/drivers/nv10/nv10_miptree.c @@ -50,6 +50,30 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt) nv10mt->total_size = offset; } +static struct pipe_texture * +nv10_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, + const unsigned *stride, struct pipe_buffer *pb) +{ + struct nv10_miptree *mt; + + /* Only supports 2D, non-mipmapped textures for the moment */ + if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 || + pt->depth[0] != 1) + return NULL; + + mt = CALLOC_STRUCT(nv10_miptree); + if (!mt) + return NULL; + + mt->base = *pt; + mt->base.refcount = 1; + mt->base.screen = pscreen; + mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); + + pipe_buffer_reference(pscreen, &mt->buffer, pb); + return &mt->base; +} + static struct pipe_texture * nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt) { @@ -141,6 +165,7 @@ nv10_miptree_surface_release(struct pipe_screen *screen, void nv10_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv10_miptree_create; + pscreen->texture_blanket = nv10_miptree_blanket; pscreen->texture_release = nv10_miptree_release; pscreen->get_tex_surface = nv10_miptree_surface_get; pscreen->tex_surface_release = nv10_miptree_surface_release; diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c index 8e4cc80902..89a4058700 100644 --- a/src/gallium/drivers/nv20/nv20_miptree.c +++ b/src/gallium/drivers/nv20/nv20_miptree.c @@ -50,6 +50,30 @@ nv20_miptree_layout(struct nv20_miptree *nv20mt) nv20mt->total_size = offset; } +static struct pipe_texture * +nv20_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, + const unsigned *stride, struct pipe_buffer *pb) +{ + struct nv20_miptree *mt; + + /* Only supports 2D, non-mipmapped textures for the moment */ + if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 || + pt->depth[0] != 1) + return NULL; + + mt = CALLOC_STRUCT(nv20_miptree); + if (!mt) + return NULL; + + mt->base = *pt; + mt->base.refcount = 1; + mt->base.screen = pscreen; + mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); + + pipe_buffer_reference(pscreen, &mt->buffer, pb); + return &mt->base; +} + static struct pipe_texture * nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt) { @@ -146,6 +170,7 @@ nv20_miptree_surface_release(struct pipe_screen *pscreen, void nv20_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv20_miptree_create; + pscreen->texture_blanket = nv20_miptree_blanket; pscreen->texture_release = nv20_miptree_release; pscreen->get_tex_surface = nv20_miptree_surface_get; pscreen->tex_surface_release = nv20_miptree_surface_release; diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index c55756971b..5458f834aa 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -105,6 +105,30 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) return &mt->base; } +static struct pipe_texture * +nv30_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, + const unsigned *stride, struct pipe_buffer *pb) +{ + struct nv30_miptree *mt; + + /* Only supports 2D, non-mipmapped textures for the moment */ + if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 || + pt->depth[0] != 1) + return NULL; + + mt = CALLOC_STRUCT(nv30_miptree); + if (!mt) + return NULL; + + mt->base = *pt; + mt->base.refcount = 1; + mt->base.screen = pscreen; + mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); + + pipe_buffer_reference(pscreen, &mt->buffer, pb); + return &mt->base; +} + static void nv30_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt) { @@ -187,6 +211,7 @@ void nv30_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv30_miptree_create; + pscreen->texture_blanket = nv30_miptree_blanket; pscreen->texture_release = nv30_miptree_release; pscreen->get_tex_surface = nv30_miptree_surface_new; pscreen->tex_surface_release = nv30_miptree_surface_del; diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index b1fba11d2f..e8cd104ea4 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -106,6 +106,30 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) return &mt->base; } +static struct pipe_texture * +nv40_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, + const unsigned *stride, struct pipe_buffer *pb) +{ + struct nv40_miptree *mt; + + /* Only supports 2D, non-mipmapped textures for the moment */ + if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 || + pt->depth[0] != 1) + return NULL; + + mt = CALLOC_STRUCT(nv40_miptree); + if (!mt) + return NULL; + + mt->base = *pt; + mt->base.refcount = 1; + mt->base.screen = pscreen; + mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); + + pipe_buffer_reference(pscreen, &mt->buffer, pb); + return &mt->base; +} + static void nv40_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt) { @@ -188,6 +212,7 @@ void nv40_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv40_miptree_create; + pscreen->texture_blanket = nv40_miptree_blanket; pscreen->texture_release = nv40_miptree_release; pscreen->get_tex_surface = nv40_miptree_surface_new; pscreen->tex_surface_release = nv40_miptree_surface_del; diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index c6e65c9816..a6ef76ff75 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -104,6 +104,31 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp) return &mt->base; } +static struct pipe_texture * +nv50_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, + const unsigned *stride, struct pipe_buffer *pb) +{ + struct nv50_miptree *mt; + + /* Only supports 2D, non-mipmapped textures for the moment */ + if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 || + pt->depth[0] != 1) + return NULL; + + mt = CALLOC_STRUCT(nv50_miptree); + if (!mt) + return NULL; + + mt->base = *pt; + mt->base.refcount = 1; + mt->base.screen = pscreen; + mt->image_nr = 1; + mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); + + pipe_buffer_reference(pscreen, &mt->buffer, pb); + return &mt->base; +} + static INLINE void mark_dirty(uint32_t *flags, unsigned image) { @@ -287,6 +312,7 @@ void nv50_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv50_miptree_create; + pscreen->texture_blanket = nv50_miptree_blanket; pscreen->texture_release = nv50_miptree_release; pscreen->get_tex_surface = nv50_miptree_surface_new; pscreen->tex_surface_release = nv50_miptree_surface_del; diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c index de4a90e25f..70f005b888 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c @@ -113,35 +113,6 @@ nouveau_context_init(struct nouveau_screen *nv_screen, nvdev->lock = sarea_lock; } - /*XXX: Hack up a fake region and buffer object for front buffer. - * This will go away with TTM, replaced with a simple reference - * of the front buffer handle passed to us by the DDX. - */ - { - struct pipe_surface *fb_surf; - struct nouveau_pipe_buffer *fb_buf; - - fb_buf = calloc(1, sizeof(struct nouveau_pipe_buffer)); - - nouveau_bo_fake(dev, nv_screen->front_offset, NOUVEAU_BO_VRAM, - nv_screen->front_pitch*nv_screen->front_height, - NULL, &fb_buf->bo); - - fb_surf = calloc(1, sizeof(struct pipe_surface)); - if (nv_screen->front_cpp == 2) - fb_surf->format = PIPE_FORMAT_R5G6B5_UNORM; - else - fb_surf->format = PIPE_FORMAT_A8R8G8B8_UNORM; - pf_get_block(fb_surf->format, &fb_surf->block); - fb_surf->width = nv_screen->front_pitch / nv_screen->front_cpp; - fb_surf->height = nv_screen->front_height; - fb_surf->stride = fb_surf->width * fb_surf->block.size; - fb_surf->refcount = 1; - fb_surf->buffer = &fb_buf->base; - - nv->frontbuffer = fb_surf; - } - /* Attempt to share a single channel between multiple contexts from * a single process. */ @@ -229,8 +200,37 @@ nouveau_context_init(struct nouveau_screen *nv_screen, } } - pipe->priv = nv; + { + struct pipe_texture *fb_tex; + struct pipe_surface *fb_surf; + struct nouveau_pipe_buffer *fb_buf; + enum pipe_format format; + + fb_buf = calloc(1, sizeof(struct nouveau_pipe_buffer)); + fb_buf->base.refcount = 1; + fb_buf->base.usage = PIPE_BUFFER_USAGE_PIXEL; + + nouveau_bo_fake(dev, nv_screen->front_offset, NOUVEAU_BO_VRAM, + nv_screen->front_pitch*nv_screen->front_height, + NULL, &fb_buf->bo); + + if (nv_screen->front_cpp == 4) + format = PIPE_FORMAT_A8R8G8B8_UNORM; + else + format = PIPE_FORMAT_R5G6B5_UNORM; + + fb_surf = nouveau_surface_buffer_ref(nv, &fb_buf->base, format, + nv_screen->front_pitch / + nv_screen->front_cpp, + nv_screen->front_height, + nv_screen->front_pitch, + &fb_tex); + nv->frontbuffer = fb_surf; + nv->frontbuffer_texture = fb_tex; + } + + pipe->priv = nv; return 0; } diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h index d7199db3de..6f6bdafe6b 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h @@ -43,6 +43,7 @@ struct nouveau_context { int locked; struct nouveau_screen *nv_screen; struct pipe_surface *frontbuffer; + struct pipe_texture *frontbuffer_texture; struct { int hw_vertex_buffer; diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c index 3b2b86cd40..527c09cf6b 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c @@ -65,8 +65,9 @@ nouveau_pipe_push_reloc(struct nouveau_winsys *nvws, void *ptr, struct pipe_buffer *buf, uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor) { - return nouveau_pushbuf_emit_reloc(nvws->channel, ptr, - nouveau_buffer(buf)->bo, + struct nouveau_bo *bo = ((struct nouveau_pipe_buffer *)buf)->bo; + + return nouveau_pushbuf_emit_reloc(nvws->channel, ptr, bo, data, flags, vor, tor); } diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c index 6f79e0800a..c17d8a05e6 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c @@ -103,7 +103,7 @@ nouveau_pipe_bo_user_create(struct pipe_winsys *pws, void *ptr, unsigned bytes) static void nouveau_pipe_bo_del(struct pipe_winsys *ws, struct pipe_buffer *buf) { - struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf); + struct nouveau_pipe_buffer *nvbuf = (void *)buf; nouveau_bo_ref(NULL, &nvbuf->bo); FREE(nvbuf); @@ -113,7 +113,7 @@ static void * nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf, unsigned flags) { - struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf); + struct nouveau_pipe_buffer *nvbuf = (void *)buf; uint32_t map_flags = 0; if (flags & PIPE_BUFFER_USAGE_CPU_READ) @@ -146,7 +146,7 @@ nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf, static void nouveau_pipe_bo_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf) { - struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf); + struct nouveau_pipe_buffer *nvbuf = (void *)buf; nouveau_bo_unmap(nvbuf->bo); } @@ -173,6 +173,38 @@ nouveau_pipe_fence_finish(struct pipe_winsys *ws, return 0; } +struct pipe_surface * +nouveau_surface_buffer_ref(struct nouveau_context *nv, struct pipe_buffer *pb, + enum pipe_format format, int w, int h, + unsigned pitch, struct pipe_texture **ppt) +{ + struct pipe_screen *pscreen = nv->nvc->pscreen; + struct pipe_texture tmpl, *pt; + struct pipe_surface *ps; + + memset(&tmpl, 0, sizeof(tmpl)); + tmpl.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + NOUVEAU_TEXTURE_USAGE_LINEAR; + tmpl.target = PIPE_TEXTURE_2D; + tmpl.width[0] = w; + tmpl.height[0] = h; + tmpl.depth[0] = 1; + tmpl.format = format; + pf_get_block(tmpl.format, &tmpl.block); + tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w); + tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h); + + pt = pscreen->texture_blanket(pscreen, &tmpl, &pitch, pb); + if (!pt) + return NULL; + + ps = pscreen->get_tex_surface(pscreen, pt, 0, 0, 0, + PIPE_BUFFER_USAGE_GPU_WRITE); + + *ppt = pt; + return ps; +} + static void nouveau_destroy(struct pipe_winsys *pws) { diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h index d97ffdf337..b041a77e38 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h @@ -10,10 +10,15 @@ struct nouveau_pipe_buffer { struct nouveau_bo *bo; }; +/* This is so horrible I should be shot - I promise I'll fix it properly + * tomorrow. Just to make the winsys build again however... The TG guys + * don't like to make life easy :) + */ static inline struct nouveau_pipe_buffer * -nouveau_buffer(struct pipe_buffer *buf) +nouveau_buffer(struct pipe_surface *ps) { - return (struct nouveau_pipe_buffer *)buf; + return *(struct nouveau_pipe_buffer **) + ((void *)ps->texture + sizeof(struct pipe_texture)); } struct nouveau_pipe_winsys { @@ -36,4 +41,9 @@ extern void nouveau_flush_frontbuffer(struct pipe_winsys *pws, struct pipe_surface *surf, void *context_private); +struct pipe_surface * +nouveau_surface_buffer_ref(struct nouveau_context *nv, struct pipe_buffer *pb, + enum pipe_format format, int w, int h, + unsigned pitch, struct pipe_texture **ppt); + #endif diff --git a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c b/src/gallium/winsys/drm/nouveau/common/nv04_surface.c index b83f3475df..214c843782 100644 --- a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c +++ b/src/gallium/winsys/drm/nouveau/common/nv04_surface.c @@ -132,7 +132,7 @@ nv04_surface_copy_swizzle(struct nouveau_context *nv, unsigned dx, unsigned dy, assert(!(w & (w - 1)) && !(h & (h - 1))); BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, 1); - OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(dst)->bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); OUT_RING (chan, nv04_surface_format(dst->format) | @@ -140,7 +140,7 @@ nv04_surface_copy_swizzle(struct nouveau_context *nv, unsigned dx, unsigned dy, log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1); - OUT_RELOCo(chan, nouveau_buffer(src->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(src)->bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1); OUT_RING (chan, nv->nvc->NvSwzSurf->handle); @@ -148,7 +148,7 @@ nv04_surface_copy_swizzle(struct nouveau_context *nv, unsigned dx, unsigned dy, for (cy = 0; cy < h; cy += sub_h) { for (cx = 0; cx < w; cx += sub_w) { BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, + OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst->offset + nv04_swizzle_bits(cx, cy) * dst->block.size, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); @@ -168,7 +168,7 @@ nv04_surface_copy_swizzle(struct nouveau_context *nv, unsigned dx, unsigned dy, OUT_RING (chan, src->stride | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); - OUT_RELOCl(chan, nouveau_buffer(src->buffer)->bo, + OUT_RELOCl(chan, nouveau_buffer(src)->bo, src->offset + cy * src->stride + cx * src->block.size, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); OUT_RING (chan, 0); @@ -193,9 +193,9 @@ nv04_surface_copy_m2mf(struct nouveau_context *nv, unsigned dx, unsigned dy, BEGIN_RING(chan, nv->nvc->NvM2MF, NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8); - OUT_RELOCl(chan, nouveau_buffer(src->buffer)->bo, src_offset, + OUT_RELOCl(chan, nouveau_buffer(src)->bo, src_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD); - OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst_offset, + OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR); OUT_RING (chan, src->stride); OUT_RING (chan, dst->stride); @@ -253,9 +253,9 @@ nv04_surface_copy_prep(struct nouveau_context *nv, struct pipe_surface *dst, if ((src->offset & 63) || (dst->offset & 63)) { BEGIN_RING(nv->nvc->channel, nv->nvc->NvM2MF, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2); - OUT_RELOCo(chan, nouveau_buffer(src->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(src)->bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(dst)->bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); nv->surface_copy = nv04_surface_copy_m2mf; @@ -273,18 +273,18 @@ nv04_surface_copy_prep(struct nouveau_context *nv, struct pipe_surface *dst, BEGIN_RING(chan, nv->nvc->NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); - OUT_RELOCo(chan, nouveau_buffer(src->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(src)->bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(dst)->bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); BEGIN_RING(chan, nv->nvc->NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D_FORMAT, 4); OUT_RING (chan, format); OUT_RING (chan, (dst->stride << 16) | src->stride); - OUT_RELOCl(chan, nouveau_buffer(src->buffer)->bo, src->offset, + OUT_RELOCl(chan, nouveau_buffer(src)->bo, src->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst->offset, + OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); return 0; @@ -317,16 +317,16 @@ nv04_surface_fill(struct nouveau_context *nv, struct pipe_surface *dst, } BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); - OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(dst)->bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo, + OUT_RELOCo(chan, nouveau_buffer(dst)->bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_FORMAT, 4); OUT_RING (chan, cs2d_format); OUT_RING (chan, (dst->stride << 16) | dst->stride); - OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst->offset, + OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst->offset, + OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT, 1); diff --git a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c b/src/gallium/winsys/drm/nouveau/common/nv50_surface.c index d16f3a97d5..540240cd23 100644 --- a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c +++ b/src/gallium/winsys/drm/nouveau/common/nv50_surface.c @@ -26,7 +26,7 @@ nv50_surface_set(struct nouveau_context *nv, struct pipe_surface *surf, int dst) { struct nouveau_channel *chan = nv->nvc->channel; struct nouveau_grobj *eng2d = nv->nvc->Nv2D; - struct nouveau_bo *bo = nouveau_buffer(surf->buffer)->bo; + struct nouveau_bo *bo = nouveau_buffer(surf)->bo; int surf_format, mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT; int flags = NOUVEAU_BO_VRAM | (dst ? NOUVEAU_BO_WR : NOUVEAU_BO_RD); -- cgit v1.2.3 From ee97bcc66c270a8a5152988213190d910302a0dd Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 4 Feb 2009 21:08:41 +1000 Subject: nouveau: notifier timeout is a float now --- src/gallium/drivers/nouveau/nouveau_winsys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h index 25e0b05be1..e935ffffc1 100644 --- a/src/gallium/drivers/nouveau/nouveau_winsys.h +++ b/src/gallium/drivers/nouveau/nouveau_winsys.h @@ -50,7 +50,7 @@ struct nouveau_winsys { uint32_t (*notifier_status)(struct nouveau_notifier *, int id); uint32_t (*notifier_retval)(struct nouveau_notifier *, int id); int (*notifier_wait)(struct nouveau_notifier *, int id, - int status, int timeout); + int status, float timeout); int (*surface_copy)(struct nouveau_winsys *, struct pipe_surface *, unsigned, unsigned, struct pipe_surface *, -- cgit v1.2.3 From 5ee71bad7b3c2bbae03a73488ddf477f4dc9b0cf Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 24 Jan 2009 14:58:17 +0100 Subject: r300: Fix EXP2 fog --- src/mesa/drivers/dri/r300/r300_state.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index d02034f039..c192fecca4 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -783,6 +783,7 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) R300_FG_FOG_BLEND_FN_EXP2; fogScale.f = 0.3 * ctx->Fog.Density; fogStart.f = 0.0; + break; default: return; } -- cgit v1.2.3 From c20df0ab4ee63c3257ac5726e4e2829db388ab42 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 4 Feb 2009 13:26:09 +0100 Subject: r300: make the macros safe. add missing parenthesis. --- src/mesa/drivers/dri/r300/r300_reg.h | 84 ++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 7c6485ef60..872a33e258 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -656,7 +656,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_GB_FOG_SELECT_C3A (3 << 0) # define R300_GB_FOG_SELECT_1_1_W (4 << 0) # define R300_GB_FOG_SELECT_Z (5 << 0) -# define R300_GB_DEPTH_SELECT_Z (0 << 3 +# define R300_GB_DEPTH_SELECT_Z (0 << 3) # define R300_GB_DEPTH_SELECT_1_1_W (1 << 3) # define R300_GB_W_SELECT_1_W (0 << 4) # define R300_GB_W_SELECT_1 (1 << 4) @@ -730,8 +730,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define R500_RS_IP_TEX_PTR_Q_SHIFT 18 #define R500_RS_IP_COL_PTR_SHIFT 24 #define R500_RS_IP_COL_FMT_SHIFT 27 -# define R500_RS_COL_PTR(x) (x << 24) -# define R500_RS_COL_FMT(x) (x << 27) +# define R500_RS_COL_PTR(x) ((x) << 24) +# define R500_RS_COL_FMT(x) ((x) << 27) /* gap */ #define R500_RS_IP_OFFSET_DIS (0 << 31) #define R500_RS_IP_OFFSET_EN (1 << 31) @@ -1172,9 +1172,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define R300_RS_IP_3 0x431C # define R300_RS_INTERP_SRC_SHIFT 2 /* TODO: check for removal */ # define R300_RS_INTERP_SRC_MASK (7 << 2) /* TODO: check for removal */ -# define R300_RS_TEX_PTR(x) (x << 0) -# define R300_RS_COL_PTR(x) (x << 6) -# define R300_RS_COL_FMT(x) (x << 9) +# define R300_RS_TEX_PTR(x) ((x) << 0) +# define R300_RS_COL_PTR(x) ((x) << 6) +# define R300_RS_COL_FMT(x) ((x) << 9) # define R300_RS_COL_FMT_RGBA 0 # define R300_RS_COL_FMT_RGB0 1 # define R300_RS_COL_FMT_RGB1 2 @@ -1184,10 +1184,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_RS_COL_FMT_111A 8 # define R300_RS_COL_FMT_1110 9 # define R300_RS_COL_FMT_1111 10 -# define R300_RS_SEL_S(x) (x << 13) -# define R300_RS_SEL_T(x) (x << 16) -# define R300_RS_SEL_R(x) (x << 19) -# define R300_RS_SEL_Q(x) (x << 22) +# define R300_RS_SEL_S(x) ((x) << 13) +# define R300_RS_SEL_T(x) ((x) << 16) +# define R300_RS_SEL_R(x) ((x) << 19) +# define R300_RS_SEL_Q(x) ((x) << 22) # define R300_RS_SEL_C0 0 # define R300_RS_SEL_C1 1 # define R300_RS_SEL_C2 2 @@ -2705,7 +2705,7 @@ enum { # define R500_ALPHA_OP_COS 13 # define R500_ALPHA_OP_MDH 14 # define R500_ALPHA_OP_MDV 15 -# define R500_ALPHA_ADDRD(x) (x << 4) +# define R500_ALPHA_ADDRD(x) ((x) << 4) # define R500_ALPHA_ADDRD_REL (1 << 11) # define R500_ALPHA_SEL_A_SHIFT 12 # define R500_ALPHA_SEL_A_SRC0 (0 << 12) @@ -2749,16 +2749,16 @@ enum { # define R500_ALPHA_OMOD_DIV_4 (5 << 26) # define R500_ALPHA_OMOD_DIV_8 (6 << 26) # define R500_ALPHA_OMOD_DISABLE (7 << 26) -# define R500_ALPHA_TARGET(x) (x << 29) +# define R500_ALPHA_TARGET(x) ((x) << 29) # define R500_ALPHA_W_OMASK (1 << 31) #define R500_US_ALU_ALPHA_ADDR_0 0x9800 -# define R500_ALPHA_ADDR0(x) (x << 0) +# define R500_ALPHA_ADDR0(x) ((x) << 0) # define R500_ALPHA_ADDR0_CONST (1 << 8) # define R500_ALPHA_ADDR0_REL (1 << 9) -# define R500_ALPHA_ADDR1(x) (x << 10) +# define R500_ALPHA_ADDR1(x) ((x) << 10) # define R500_ALPHA_ADDR1_CONST (1 << 18) # define R500_ALPHA_ADDR1_REL (1 << 19) -# define R500_ALPHA_ADDR2(x) (x << 20) +# define R500_ALPHA_ADDR2(x) ((x) << 20) # define R500_ALPHA_ADDR2_CONST (1 << 28) # define R500_ALPHA_ADDR2_REL (1 << 29) # define R500_ALPHA_SRCP_OP_1_MINUS_2A0 (0 << 30) @@ -2779,7 +2779,7 @@ enum { # define R500_ALU_RGBA_OP_SOP (10 << 0) # define R500_ALU_RGBA_OP_MDH (11 << 0) # define R500_ALU_RGBA_OP_MDV (12 << 0) -# define R500_ALU_RGBA_ADDRD(x) (x << 4) +# define R500_ALU_RGBA_ADDRD(x) ((x) << 4) # define R500_ALU_RGBA_ADDRD_REL (1 << 11) # define R500_ALU_RGBA_SEL_C_SHIFT 12 # define R500_ALU_RGBA_SEL_C_SRC0 (0 << 12) @@ -2906,16 +2906,16 @@ enum { # define R500_ALU_RGB_OMOD_DIV_4 (5 << 26) # define R500_ALU_RGB_OMOD_DIV_8 (6 << 26) # define R500_ALU_RGB_OMOD_DISABLE (7 << 26) -# define R500_ALU_RGB_TARGET(x) (x << 29) +# define R500_ALU_RGB_TARGET(x) ((x) << 29) # define R500_ALU_RGB_WMASK (1 << 31) #define R500_US_ALU_RGB_ADDR_0 0x9000 -# define R500_RGB_ADDR0(x) (x << 0) +# define R500_RGB_ADDR0(x) ((x) << 0) # define R500_RGB_ADDR0_CONST (1 << 8) # define R500_RGB_ADDR0_REL (1 << 9) -# define R500_RGB_ADDR1(x) (x << 10) +# define R500_RGB_ADDR1(x) ((x) << 10) # define R500_RGB_ADDR1_CONST (1 << 18) # define R500_RGB_ADDR1_REL (1 << 19) -# define R500_RGB_ADDR2(x) (x << 20) +# define R500_RGB_ADDR2(x) ((x) << 20) # define R500_RGB_ADDR2_CONST (1 << 28) # define R500_RGB_ADDR2_REL (1 << 29) # define R500_RGB_SRCP_OP_1_MINUS_2RGB0 (0 << 30) @@ -2970,19 +2970,19 @@ enum { /* note that these are 8 bit lengths, despite the offsets, at least for R500 */ #define R500_US_CODE_ADDR 0x4630 -# define R500_US_CODE_START_ADDR(x) (x << 0) -# define R500_US_CODE_END_ADDR(x) (x << 16) +# define R500_US_CODE_START_ADDR(x) ((x) << 0) +# define R500_US_CODE_END_ADDR(x) ((x) << 16) #define R500_US_CODE_OFFSET 0x4638 -# define R500_US_CODE_OFFSET_ADDR(x) (x << 0) +# define R500_US_CODE_OFFSET_ADDR(x) ((x) << 0) #define R500_US_CODE_RANGE 0x4634 -# define R500_US_CODE_RANGE_ADDR(x) (x << 0) -# define R500_US_CODE_RANGE_SIZE(x) (x << 16) +# define R500_US_CODE_RANGE_ADDR(x) ((x) << 0) +# define R500_US_CODE_RANGE_SIZE(x) ((x) << 16) #define R500_US_CONFIG 0x4600 # define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) #define R500_US_FC_ADDR_0 0xa000 -# define R500_FC_BOOL_ADDR(x) (x << 0) -# define R500_FC_INT_ADDR(x) (x << 8) -# define R500_FC_JUMP_ADDR(x) (x << 16) +# define R500_FC_BOOL_ADDR(x) ((x) << 0) +# define R500_FC_INT_ADDR(x) ((x) << 8) +# define R500_FC_JUMP_ADDR(x) ((x) << 16) # define R500_FC_JUMP_GLOBAL (1 << 31) #define R500_US_FC_BOOL_CONST 0x4620 # define R500_FC_KBOOL(x) (x) @@ -3003,8 +3003,8 @@ enum { # define R500_FC_A_OP_NONE (0 << 6) # define R500_FC_A_OP_POP (1 << 6) # define R500_FC_A_OP_PUSH (2 << 6) -# define R500_FC_JUMP_FUNC(x) (x << 8) -# define R500_FC_B_POP_CNT(x) (x << 16) +# define R500_FC_JUMP_FUNC(x) ((x) << 8) +# define R500_FC_B_POP_CNT(x) ((x) << 16) # define R500_FC_B_OP0_NONE (0 << 24) # define R500_FC_B_OP0_DECR (1 << 24) # define R500_FC_B_OP0_INCR (2 << 24) @@ -3013,14 +3013,14 @@ enum { # define R500_FC_B_OP1_INCR (2 << 26) # define R500_FC_IGNORE_UNCOVERED (1 << 28) #define R500_US_FC_INT_CONST_0 0x4c00 -# define R500_FC_INT_CONST_KR(x) (x << 0) -# define R500_FC_INT_CONST_KG(x) (x << 8) -# define R500_FC_INT_CONST_KB(x) (x << 16) +# define R500_FC_INT_CONST_KR(x) ((x) << 0) +# define R500_FC_INT_CONST_KG(x) ((x) << 8) +# define R500_FC_INT_CONST_KB(x) ((x) << 16) /* _0 through _15 */ #define R500_US_FORMAT0_0 0x4640 -# define R500_FORMAT_TXWIDTH(x) (x << 0) -# define R500_FORMAT_TXHEIGHT(x) (x << 11) -# define R500_FORMAT_TXDEPTH(x) (x << 22) +# define R500_FORMAT_TXWIDTH(x) ((x) << 0) +# define R500_FORMAT_TXHEIGHT(x) ((x) << 11) +# define R500_FORMAT_TXDEPTH(x) ((x) << 22) /* _0 through _3 */ #define R500_US_OUT_FMT_0 0x46a4 # define R500_OUT_FMT_C4_8 (0 << 0) @@ -3061,12 +3061,12 @@ enum { # define R500_C3_SEL_R (1 << 14) # define R500_C3_SEL_G (2 << 14) # define R500_C3_SEL_B (3 << 14) -# define R500_OUT_SIGN(x) (x << 16) +# define R500_OUT_SIGN(x) ((x) << 16) # define R500_ROUND_ADJ (1 << 20) #define R500_US_PIXSIZE 0x4604 # define R500_PIX_SIZE(x) (x) #define R500_US_TEX_ADDR_0 0x9800 -# define R500_TEX_SRC_ADDR(x) (x << 0) +# define R500_TEX_SRC_ADDR(x) ((x) << 0) # define R500_TEX_SRC_ADDR_REL (1 << 7) # define R500_TEX_SRC_S_SWIZ_R (0 << 8) # define R500_TEX_SRC_S_SWIZ_G (1 << 8) @@ -3084,7 +3084,7 @@ enum { # define R500_TEX_SRC_Q_SWIZ_G (1 << 14) # define R500_TEX_SRC_Q_SWIZ_B (2 << 14) # define R500_TEX_SRC_Q_SWIZ_A (3 << 14) -# define R500_TEX_DST_ADDR(x) (x << 16) +# define R500_TEX_DST_ADDR(x) ((x) << 16) # define R500_TEX_DST_ADDR_REL (1 << 23) # define R500_TEX_DST_R_SWIZ_R (0 << 24) # define R500_TEX_DST_R_SWIZ_G (1 << 24) @@ -3103,7 +3103,7 @@ enum { # define R500_TEX_DST_A_SWIZ_B (2 << 30) # define R500_TEX_DST_A_SWIZ_A (3 << 30) #define R500_US_TEX_ADDR_DXDY_0 0xa000 -# define R500_DX_ADDR(x) (x << 0) +# define R500_DX_ADDR(x) ((x) << 0) # define R500_DX_ADDR_REL (1 << 7) # define R500_DX_S_SWIZ_R (0 << 8) # define R500_DX_S_SWIZ_G (1 << 8) @@ -3121,7 +3121,7 @@ enum { # define R500_DX_Q_SWIZ_G (1 << 14) # define R500_DX_Q_SWIZ_B (2 << 14) # define R500_DX_Q_SWIZ_A (3 << 14) -# define R500_DY_ADDR(x) (x << 16) +# define R500_DY_ADDR(x) ((x) << 16) # define R500_DY_ADDR_REL (1 << 17) # define R500_DY_S_SWIZ_R (0 << 24) # define R500_DY_S_SWIZ_G (1 << 24) @@ -3140,7 +3140,7 @@ enum { # define R500_DY_Q_SWIZ_B (2 << 30) # define R500_DY_Q_SWIZ_A (3 << 30) #define R500_US_TEX_INST_0 0x9000 -# define R500_TEX_ID(x) (x << 16) +# define R500_TEX_ID(x) ((x) << 16) # define R500_TEX_INST_NOP (0 << 22) # define R500_TEX_INST_LD (1 << 22) # define R500_TEX_INST_TEXKILL (2 << 22) -- cgit v1.2.3 From b2e09910f65ae2c8c43c0441955aa262a8946ef3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Feb 2009 10:27:13 -0800 Subject: intel: Fix fbo_firecube regression with FBconfigs change. By selecting a 4444 texture format due to a bad test, we hit the intel_update_wrapper error path, and despite the appearance of error handling in it and its callers, the desired behavior (software fallback) doesn't occur. --- src/mesa/drivers/dri/intel/intel_tex_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index 5e418ac446..2715a540d0 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 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, GLenum format, GLenum type) { struct intel_context *intel = intel_context(ctx); - const GLboolean do32bpt = (intel->ctx.Visual.rgbBits == 32); + const GLboolean do32bpt = (intel->ctx.Visual.rgbBits >= 24); switch (internalFormat) { case 4: -- cgit v1.2.3 From 05d130a35acf10c0c002fcf5f3a32154ca9cb19e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 4 Feb 2009 20:25:08 +0000 Subject: intel: Correct decoding of 3DSTATE_PIXEL_SHADER_CONSTANTS A couple of minor typos that proclaimed an error in the wrong command, and failed to offset the mask. --- src/mesa/drivers/dri/intel/intel_decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_decode.c b/src/mesa/drivers/dri/intel/intel_decode.c index 5f90ca22ec..cbee7dc5d9 100644 --- a/src/mesa/drivers/dri/intel/intel_decode.c +++ b/src/mesa/drivers/dri/intel/intel_decode.c @@ -932,7 +932,7 @@ decode_3d_1d(uint32_t *data, int count, uint32_t hw_offset, int *failures, int i instr_out(data, hw_offset, 0, "3DSTATE_PIXEL_SHADER_CONSTANTS\n"); len = (data[0] & 0x000000ff) + 2; - i = 1; + i = 2; for (c = 0; c <= 31; c++) { if (data[1] & (1 << c)) { if (i + 4 >= count) @@ -952,7 +952,7 @@ decode_3d_1d(uint32_t *data, int count, uint32_t hw_offset, int *failures, int i } } if (len != i) { - fprintf(out, "Bad count in 3DSTATE_MAP_STATE\n"); + fprintf(out, "Bad count in 3DSTATE_PIXEL_SHADER_CONSTANTS\n"); (*failures)++; } return len; -- cgit v1.2.3 From e92d97d75bcd1ac2caafc2a565b304639cedd520 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 4 Feb 2009 20:59:22 +0000 Subject: intel: Decode MI operands using specific length masks The MI opcodes have different variable length masks, so use an operand specific mask to decode the length. --- src/mesa/drivers/dri/intel/intel_decode.c | 43 +++++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_decode.c b/src/mesa/drivers/dri/intel/intel_decode.c index cbee7dc5d9..136221c37f 100644 --- a/src/mesa/drivers/dri/intel/intel_decode.c +++ b/src/mesa/drivers/dri/intel/intel_decode.c @@ -87,27 +87,28 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures) struct { uint32_t opcode; + int len_mask; int min_len; int max_len; char *name; } opcodes_mi[] = { - { 0x08, 1, 1, "MI_ARB_ON_OFF" }, - { 0x0a, 1, 1, "MI_BATCH_BUFFER_END" }, - { 0x31, 2, 2, "MI_BATCH_BUFFER_START" }, - { 0x14, 3, 3, "MI_DISPLAY_BUFFER_INFO" }, - { 0x04, 1, 1, "MI_FLUSH" }, - { 0x22, 3, 3, "MI_LOAD_REGISTER_IMM" }, - { 0x13, 2, 2, "MI_LOAD_SCAN_LINES_EXCL" }, - { 0x12, 2, 2, "MI_LOAD_SCAN_LINES_INCL" }, - { 0x00, 1, 1, "MI_NOOP" }, - { 0x11, 2, 2, "MI_OVERLAY_FLIP" }, - { 0x07, 1, 1, "MI_REPORT_HEAD" }, - { 0x18, 2, 2, "MI_SET_CONTEXT" }, - { 0x20, 3, 4, "MI_STORE_DATA_IMM" }, - { 0x21, 3, 4, "MI_STORE_DATA_INDEX" }, - { 0x24, 3, 3, "MI_STORE_REGISTER_MEM" }, - { 0x02, 1, 1, "MI_USER_INTERRUPT" }, - { 0x03, 1, 1, "MI_WAIT_FOR_EVENT" }, + { 0x08, 0, 1, 1, "MI_ARB_ON_OFF" }, + { 0x0a, 0, 1, 1, "MI_BATCH_BUFFER_END" }, + { 0x31, 0x3f, 2, 2, "MI_BATCH_BUFFER_START" }, + { 0x14, 0x3f, 3, 3, "MI_DISPLAY_BUFFER_INFO" }, + { 0x04, 0, 1, 1, "MI_FLUSH" }, + { 0x22, 0, 3, 3, "MI_LOAD_REGISTER_IMM" }, + { 0x13, 0x3f, 2, 2, "MI_LOAD_SCAN_LINES_EXCL" }, + { 0x12, 0x3f, 2, 2, "MI_LOAD_SCAN_LINES_INCL" }, + { 0x00, 0, 1, 1, "MI_NOOP" }, + { 0x11, 0x3f, 2, 2, "MI_OVERLAY_FLIP" }, + { 0x07, 0, 1, 1, "MI_REPORT_HEAD" }, + { 0x18, 0x3f, 2, 2, "MI_SET_CONTEXT" }, + { 0x20, 0x3f, 3, 4, "MI_STORE_DATA_IMM" }, + { 0x21, 0x3f, 3, 4, "MI_STORE_DATA_INDEX" }, + { 0x24, 0x3f, 3, 3, "MI_STORE_REGISTER_MEM" }, + { 0x02, 0, 1, 1, "MI_USER_INTERRUPT" }, + { 0x03, 0, 1, 1, "MI_WAIT_FOR_EVENT" }, }; @@ -118,12 +119,14 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures) instr_out(data, hw_offset, 0, "%s\n", opcodes_mi[opcode].name); if (opcodes_mi[opcode].max_len > 1) { - len = (data[0] & 0x000000ff) + 2; + len = (data[0] & opcodes_mi[opcode].len_mask) + 2; if (len < opcodes_mi[opcode].min_len || len > opcodes_mi[opcode].max_len) { - fprintf(out, "Bad length in %s\n", - opcodes_mi[opcode].name); + fprintf(out, "Bad length (%d) in %s, [%d, %d]\n", + len, opcodes_mi[opcode].name, + opcodes_mi[opcode].min_len, + opcodes_mi[opcode].max_len); } } -- cgit v1.2.3 From 803504e69fbd85713fc6d93af21f5245852cecab Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Feb 2009 16:33:12 -0700 Subject: mesa: minor error msg improvement --- src/mesa/main/teximage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index d119d22b54..9519d89e4a 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2168,7 +2168,8 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexSubImage%dD(missing readbuffer)", dimensions); + "glCopyTexSubImage%dD(missing readbuffer, format=0x%x)", + dimensions, teximage->_BaseFormat); return GL_TRUE; } -- cgit v1.2.3 From c35a5aeb706d33b9c09b5a12bbbeae0f109885c9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Feb 2009 08:42:30 -0700 Subject: mesa: make Xlib glXIsDirect() always return True --- src/mesa/drivers/x11/fakeglx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 73fde865e3..3b004a3ee2 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1395,13 +1395,13 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) /** * Init basic fields of a new fake_glx_context. - * If the MESA_GLX_FORCE_DIRECT env var is set, the context will be marked as - * a direct rendering context. Some apps won't run without this. */ static void init_glx_context(struct fake_glx_context *glxCtx, Display *dpy) { - GLboolean direct = _mesa_getenv("MESA_GLX_FORCE_DIRECT") ? GL_TRUE : GL_FALSE; + /* Always return True. See if anyone's confused... */ + GLboolean direct = GL_TRUE; + glxCtx->xmesaContext->direct = direct; glxCtx->glxContext.isDirect = direct; glxCtx->glxContext.currentDpy = dpy; -- cgit v1.2.3 From 8962bac0a1e422afcd034f4ce00d45d8f3df46bf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Feb 2009 10:45:04 -0700 Subject: swrast: add minor comments --- src/mesa/swrast/s_span.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 7f9cc64bb2..ab7b82b19d 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1311,6 +1311,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) /* Do the alpha test */ if (ctx->Color.AlphaEnabled) { if (!_swrast_alpha_test(ctx, span)) { + /* all fragments failed test */ goto end; } } @@ -1323,6 +1324,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0) { /* Combined Z/stencil tests */ if (!_swrast_stencil_and_ztest_span(ctx, span)) { + /* all fragments failed test */ goto end; } } @@ -1331,6 +1333,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) ASSERT(ctx->Depth.Test); ASSERT(span->arrayMask & SPAN_Z); if (!_swrast_depth_test_span(ctx, span)) { + /* all fragments failed test */ goto end; } } @@ -1350,6 +1353,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) * the occlusion test. */ if (colorMask == 0x0) { + /* no colors to write */ goto end; } -- cgit v1.2.3 From 1ca05a066b8d8cb8a99da88743a48f7d97f695fe Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Feb 2009 14:22:12 -0700 Subject: mesa: more info in error messages --- src/mesa/main/buffers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index dc415c4f20..7877ee0045 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -247,13 +247,14 @@ _mesa_DrawBuffer(GLenum buffer) destMask = draw_buffer_enum_to_bitmask(buffer); if (destMask == BAD_MASK) { /* totally bogus buffer */ - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer=0x%x)", buffer); return; } destMask &= supportedMask; if (destMask == 0x0) { /* none of the named color buffers exist! */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(buffer)"); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glDrawBuffer(buffer=0x%x)", buffer); return; } } -- cgit v1.2.3 From fb8b794c69330924ad15083237b1a8a35eb62e31 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 4 Feb 2009 16:07:39 -0800 Subject: r300: Add shader state stubs. --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_context.h | 30 ++++++++++++++++++++---- src/gallium/drivers/r300/r300_state.c | 35 ++++++++++++++++++++++------ src/gallium/drivers/r300/r300_state_shader.c | 33 ++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_state_shader.h | 35 ++++++++++++++++++++++++++++ 5 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_state_shader.c create mode 100644 src/gallium/drivers/r300/r300_state_shader.h (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 8906d1227a..e83d943cd8 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -11,6 +11,7 @@ C_SOURCES = \ r300_flush.c \ r300_screen.c \ r300_state.c \ + r300_state_shader.c \ r300_surface.c \ r300_swtcl_emit.c \ r300_texture.c diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index e0aad66018..fb91c172f4 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -25,6 +25,7 @@ #include "draw/draw_context.h" #include "pipe/p_context.h" +#include "tgsi/tgsi_scan.h" #include "util/u_memory.h" #include "r300_clear.h" @@ -56,9 +57,6 @@ struct r300_dsa_state { uint32_t stencil_ref_bf; /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */ }; -struct r300_fs_state { -}; - struct r300_rs_state { uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */ uint32_t point_size; /* R300_GA_POINT_SIZE: 0x421c */ @@ -99,6 +97,28 @@ struct r300_texture_state { #define R300_NEW_VERTEX_SHADER 0x800000 #define R300_NEW_KITCHEN_SINK 0xffffff +/* The next several objects are not pure Radeon state; they inherit from + * various Gallium classes. */ + +struct r3xx_fragment_shader { + /* Parent class */ + struct pipe_shader_state state; + struct tgsi_shader_info info; + + /* Has this shader been translated yet? */ + boolean translated; +}; + +struct r300_fragment_shader { + /* Parent class */ + struct r3xx_fragment_shader shader; +}; + +struct r500_fragment_shader { + /* Parent class */ + struct r3xx_fragment_shader shader; +}; + struct r300_texture { /* Parent class */ struct pipe_texture tex; @@ -129,8 +149,8 @@ struct r300_context { struct r300_blend_color_state* blend_color_state; /* Depth, stencil, and alpha state. */ struct r300_dsa_state* dsa_state; - /* Fragment shader state. */ - struct r300_fs_state* fs_state; + /* Fragment shader. */ + struct r3xx_fragment_shader* fs; /* Framebuffer state. We currently don't need our own version of this. */ struct pipe_framebuffer_state framebuffer_state; /* Rasterizer state. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index b4b50ce1a9..9392d72342 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -399,27 +399,48 @@ static void /* Create fragment shader state. */ static void* r300_create_fs_state(struct pipe_context* pipe, - const struct pipe_shader_state* state) + const struct pipe_shader_state* shader) { - struct r300_fs_state* fs = CALLOC_STRUCT(r300_fs_state); + struct r300_context* r300 = r300_context(pipe); + struct r3xx_fragment_shader* fs = NULL; + + if (r300_screen(r300->context.screen)->caps->is_r500) { + fs = + (struct r3xx_fragment_shader*)CALLOC_STRUCT(r500_fragment_shader); + } else { + fs = + (struct r3xx_fragment_shader*)CALLOC_STRUCT(r300_fragment_shader); + } + + /* Copy state directly into shader. */ + fs->state = *shader; return (void*)fs; } /* Bind fragment shader state. */ -static void r300_bind_fs_state(struct pipe_context* pipe, void* state) +static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) { struct r300_context* r300 = r300_context(pipe); + struct r3xx_fragment_shader* fs = (struct r3xx_fragment_shader*)shader; - r300->fs_state = (struct r300_fs_state*)state; + if (!fs->translated) { + if (r300_screen(r300->context.screen)->caps->is_r500) { + r500_translate_shader(r300, fs); + } else { + r300_translate_shader(r300, fs); + } + } + + r300->fs = fs; r300->dirty_state |= R300_NEW_FRAGMENT_SHADER; } -/* Delect fragment shader state. */ -static void r300_delete_fs_state(struct pipe_context* pipe, void* state) +/* Delete fragment shader state. */ +static void r300_delete_fs_state(struct pipe_context* pipe, void* shader) { - FREE(state); + FREE(shader); } static void r300_set_polygon_stipple(struct pipe_context* pipe, diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c new file mode 100644 index 0000000000..e87172128f --- /dev/null +++ b/src/gallium/drivers/r300/r300_state_shader.c @@ -0,0 +1,33 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_state_shader.h" + +void r300_translate_shader(struct r300_context* r300, + struct r300_fragment_shader* fs) +{ +} + +void r500_translate_shader(struct r300_context* r300, + struct r500_fragment_shader* fs) +{ +} diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h new file mode 100644 index 0000000000..a20bd4276c --- /dev/null +++ b/src/gallium/drivers/r300/r300_state_shader.h @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_STATE_SHADER_H +#define R300_STATE_SHADER_H + +#include "r300_context.h" +#include "r300_screen.h" + +void r300_translate_shader(struct r300_context* r300, + struct r300_fragment_shader* fs); + +void r500_translate_shader(struct r300_context* r300, + struct r500_fragment_shader* fs); + +#endif /* R300_STATE_SHADER_H */ -- cgit v1.2.3 From 0744805d5879abd1d1d968ec6ed99c974c95add6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Feb 2009 17:32:07 -0700 Subject: glsl: replace assertion with conditional in _slang_pop_var_table() We were hitting the assertion when we ran out of registers, which can happen. Also, add some additional assertions and freshen up some comments. --- src/mesa/shader/slang/slang_vartable.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index de0c93957b..3649bdf9e7 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -72,9 +72,8 @@ _slang_delete_var_table(slang_var_table *vt) /** - * Create new table, put at head, return ptr to it. - * XXX we should take a maxTemps parameter to indicate how many temporaries - * are available for the current shader/program target. + * Create new table on top of vartable stack. + * Used when we enter a {} block. */ void _slang_push_var_table(slang_var_table *vt) @@ -95,7 +94,8 @@ _slang_push_var_table(slang_var_table *vt) /** - * Destroy given table, return ptr to Parent + * Pop top entry from variable table. + * Used when we leave a {} block. */ void _slang_pop_var_table(slang_var_table *vt) @@ -125,10 +125,12 @@ _slang_pop_var_table(slang_var_table *vt) else comp = 0; - assert(store->Index >= 0); - for (j = 0; j < store->Size; j++) { - assert(t->Temps[store->Index * 4 + j + comp] == VAR); - t->Temps[store->Index * 4 + j + comp] = FREE; + /* store->Index may be -1 if we run out of registers */ + if (store->Index >= 0) { + for (j = 0; j < store->Size; j++) { + assert(t->Temps[store->Index * 4 + j + comp] == VAR); + t->Temps[store->Index * 4 + j + comp] = FREE; + } } store->Index = -1; } @@ -156,7 +158,7 @@ _slang_pop_var_table(slang_var_table *vt) /** - * Add a new variable to the given symbol table. + * Add a new variable to the given var/symbol table. */ void _slang_add_variable(slang_var_table *vt, slang_variable *v) @@ -214,6 +216,7 @@ alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp) for (i = 0; i <= vt->MaxRegisters * 4 - size; i += step) { GLuint found = 0; for (j = 0; j < (GLuint) size; j++) { + assert(i + j < 4 * MAX_PROGRAM_TEMPS); if (i + j < vt->MaxRegisters * 4 && t->Temps[i + j] == FREE) { found++; } @@ -225,13 +228,17 @@ alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp) /* found block of size free regs */ if (size > 1) assert(i % 4 == 0); - for (j = 0; j < (GLuint) size; j++) + for (j = 0; j < (GLuint) size; j++) { + assert(i + j < 4 * MAX_PROGRAM_TEMPS); t->Temps[i + j] = isTemp ? TEMP : VAR; + } assert(i < MAX_PROGRAM_TEMPS * 4); t->ValSize[i] = size; return i; } } + + /* if we get here, we ran out of registers */ return -1; } -- cgit v1.2.3 From d96d8b21bf91c501c6a565d0be37a741fa6ff445 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Feb 2009 17:37:20 -0700 Subject: glsl: remove unused prototype --- src/mesa/shader/slang/slang_emit.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_emit.h b/src/mesa/shader/slang/slang_emit.h index 8ff52bf605..ab4c202d67 100644 --- a/src/mesa/shader/slang/slang_emit.h +++ b/src/mesa/shader/slang/slang_emit.h @@ -32,10 +32,6 @@ #include "main/mtypes.h" -extern void -slang_print_ir(const slang_ir_node *n, int indent); - - extern GLuint _slang_swizzle_swizzle(GLuint swz1, GLuint swz2); -- cgit v1.2.3 From 285b500bb7710b17e39754ef253ac2df718c2db7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Feb 2009 17:40:51 -0700 Subject: glsl: use _slang_var_swizzle() in a few places to simplify the code. --- src/mesa/shader/slang/slang_vartable.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index 3649bdf9e7..a4ebacc093 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -4,6 +4,7 @@ #include "shader/prog_print.h" #include "slang_compile.h" #include "slang_compile_variable.h" +#include "slang_emit.h" #include "slang_mem.h" #include "slang_vartable.h" #include "slang_ir.h" @@ -266,21 +267,7 @@ _slang_alloc_var(slang_var_table *vt, slang_ir_storage *store) return GL_FALSE; store->Index = i / 4; - if (store->Size == 1) { - const GLuint comp = i % 4; - store->Swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp); - } - else if (store->Size == 2) { - store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, - SWIZZLE_NIL, SWIZZLE_NIL); - } - else if (store->Size == 3) { - store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, - SWIZZLE_Z, SWIZZLE_NIL); - } - else { - store->Swizzle = SWIZZLE_NOOP; - } + store->Swizzle = _slang_var_swizzle(store->Size, i % 4); if (dbg) printf("Alloc var storage sz %d at %d.%s (level %d) store %p\n", @@ -308,20 +295,7 @@ _slang_alloc_temp(slang_var_table *vt, slang_ir_storage *store) assert(store->Index < 0); store->Index = i / 4; - if (store->Size == 1) { - const GLuint comp = i % 4; - store->Swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp); - } - else { - /* XXX improve swizzled for size=2/3, use for writemask... */ -#if 1 - if (store->Size == 2) { - store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, - SWIZZLE_NIL, SWIZZLE_NIL); - } -#endif - store->Swizzle = SWIZZLE_NOOP; - } + store->Swizzle = _slang_var_swizzle(store->Size, i % 4); if (dbg) printf("Alloc temp sz %d at %d.%s (level %d) store %p\n", store->Size, store->Index, -- cgit v1.2.3 From ae8a7544d1ab96240f646ea91fb149227067a2db Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 5 Feb 2009 13:17:12 +1000 Subject: nouveau: support getting "native" bo from winsys --- src/gallium/drivers/nouveau/nouveau_winsys.h | 2 ++ src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h index e935ffffc1..99f8e08201 100644 --- a/src/gallium/drivers/nouveau/nouveau_winsys.h +++ b/src/gallium/drivers/nouveau/nouveau_winsys.h @@ -57,6 +57,8 @@ struct nouveau_winsys { unsigned, unsigned, unsigned, unsigned); int (*surface_fill)(struct nouveau_winsys *, struct pipe_surface *, unsigned, unsigned, unsigned, unsigned, unsigned); + + struct nouveau_bo *(*get_bo)(struct pipe_buffer *); }; extern struct pipe_screen * diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c index 527c09cf6b..ef7e8aac54 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c @@ -81,6 +81,12 @@ nouveau_pipe_push_flush(struct nouveau_winsys *nvws, unsigned size, return nouveau_pushbuf_flush(nvws->channel, size); } +static struct nouveau_bo * +nouveau_pipe_get_bo(struct pipe_buffer *pb) +{ + return ((struct nouveau_pipe_buffer *)pb)->bo; +} + struct pipe_context * nouveau_pipe_create(struct nouveau_context *nv) { @@ -151,6 +157,8 @@ nouveau_pipe_create(struct nouveau_context *nv) nvws->surface_copy = nouveau_pipe_surface_copy; nvws->surface_fill = nouveau_pipe_surface_fill; + nvws->get_bo = nouveau_pipe_get_bo; + ws = nouveau_create_pipe_winsys(nv); if (!nvc->pscreen) -- cgit v1.2.3 From 13393736dbab1087589f8dd788bc412d16b431d1 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 5 Feb 2009 14:04:45 +1000 Subject: nv50: move 2d blit/fill code into pipe driver --- src/gallium/drivers/nv50/nv50_screen.c | 24 +++ src/gallium/drivers/nv50/nv50_screen.h | 1 + src/gallium/drivers/nv50/nv50_surface.c | 152 +++++++++++++++- src/gallium/winsys/drm/nouveau/common/Makefile | 3 +- .../winsys/drm/nouveau/common/nouveau_context.c | 5 +- .../winsys/drm/nouveau/common/nouveau_context.h | 3 - .../winsys/drm/nouveau/common/nv50_surface.c | 193 --------------------- .../winsys/drm/nouveau/dri/nouveau_swapbuffers.c | 42 +++-- 8 files changed, 203 insertions(+), 220 deletions(-) delete mode 100644 src/gallium/winsys/drm/nouveau/common/nv50_surface.c (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 6cddddacd5..58d7a621a8 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -173,6 +173,14 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) return NULL; screen->nvws = nvws; + /* 2D object */ + ret = nvws->grobj_alloc(nvws, NV50_2D, &screen->eng2d); + if (ret) { + NOUVEAU_ERR("Error creating 2D object: %d\n", ret); + nv50_screen_destroy(&screen->pipe); + return NULL; + } + /* 3D object */ if ((chipset & 0xf0) != 0x50 && (chipset & 0xf0) != 0x80) { NOUVEAU_ERR("Not a G8x chipset\n"); @@ -218,6 +226,22 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) return NULL; } + /* Static 2D init */ + so = so_new(64, 0); + so_method(so, screen->eng2d, NV50_2D_DMA_NOTIFY, 4); + so_data (so, screen->sync->handle); + so_data (so, screen->nvws->channel->vram->handle); + so_data (so, screen->nvws->channel->vram->handle); + so_data (so, screen->nvws->channel->vram->handle); + so_method(so, screen->eng2d, NV50_2D_OPERATION, 1); + so_data (so, NV50_2D_OPERATION_SRCCOPY); + so_method(so, screen->eng2d, 0x0290, 1); + so_data (so, 0); + so_method(so, screen->eng2d, 0x0888, 1); + so_data (so, 1); + so_emit(nvws, so); + so_ref(NULL, &so); + /* Static tesla init */ so = so_new(256, 20); diff --git a/src/gallium/drivers/nv50/nv50_screen.h b/src/gallium/drivers/nv50/nv50_screen.h index 400ddcef06..c888ca071c 100644 --- a/src/gallium/drivers/nv50/nv50_screen.h +++ b/src/gallium/drivers/nv50/nv50_screen.h @@ -11,6 +11,7 @@ struct nv50_screen { unsigned cur_pctx; struct nouveau_grobj *tesla; + struct nouveau_grobj *eng2d; struct nouveau_notifier *sync; struct pipe_buffer *constbuf; diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 8ebbc84817..b3c04505cf 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -20,6 +20,9 @@ * SOFTWARE. */ +#define __NOUVEAU_PUSH_H__ +#include +#include "nouveau/nouveau_pushbuf.h" #include "nv50_context.h" #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" @@ -27,6 +30,118 @@ #include "util/u_tile.h" +static INLINE int +nv50_format(enum pipe_format format) +{ + switch (format) { + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + return NV50_2D_DST_FORMAT_32BPP; + case PIPE_FORMAT_X8R8G8B8_UNORM: + return NV50_2D_DST_FORMAT_24BPP; + case PIPE_FORMAT_R5G6B5_UNORM: + return NV50_2D_DST_FORMAT_16BPP; + case PIPE_FORMAT_A8_UNORM: + return NV50_2D_DST_FORMAT_8BPP; + default: + return -1; + } +} + +static int +nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) +{ + struct nouveau_channel *chan = screen->nvws->channel; + struct nouveau_grobj *eng2d = screen->eng2d; + struct nouveau_bo *bo; + int format, mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT; + int flags = NOUVEAU_BO_VRAM | (dst ? NOUVEAU_BO_WR : NOUVEAU_BO_RD); + + bo = screen->nvws->get_bo(nv50_miptree(ps->texture)->buffer); + if (!bo) + return 1; + + format = nv50_format(ps->format); + if (format < 0) + return 1; + + if (!bo->tiled) { + BEGIN_RING(chan, eng2d, mthd, 2); + OUT_RING (chan, format); + OUT_RING (chan, 1); + BEGIN_RING(chan, eng2d, mthd + 0x14, 5); + OUT_RING (chan, ps->stride); + OUT_RING (chan, ps->width); + OUT_RING (chan, ps->height); + OUT_RELOCh(chan, bo, ps->offset, flags); + OUT_RELOCl(chan, bo, ps->offset, flags); + } else { + BEGIN_RING(chan, eng2d, mthd, 5); + OUT_RING (chan, format); + OUT_RING (chan, 0); + OUT_RING (chan, 0); + OUT_RING (chan, 1); + OUT_RING (chan, 0); + BEGIN_RING(chan, eng2d, mthd + 0x18, 4); + OUT_RING (chan, ps->width); + OUT_RING (chan, ps->height); + OUT_RELOCh(chan, bo, ps->offset, flags); + OUT_RELOCl(chan, bo, ps->offset, flags); + } + +#if 0 + if (dst) { + BEGIN_RING(chan, eng2d, NV50_2D_CLIP_X, 4); + OUT_RING (chan, 0); + OUT_RING (chan, 0); + OUT_RING (chan, surf->width); + OUT_RING (chan, surf->height); + } +#endif + + return 0; +} + +static int +nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst, + int dx, int dy, struct pipe_surface *src, int sx, int sy, + int w, int h) +{ + struct nouveau_channel *chan = screen->nvws->channel; + struct nouveau_grobj *eng2d = screen->eng2d; + int ret; + + WAIT_RING (chan, 32); + + ret = nv50_surface_set(screen, dst, 1); + if (ret) + return ret; + + ret = nv50_surface_set(screen, src, 0); + if (ret) + return ret; + + BEGIN_RING(chan, eng2d, 0x088c, 1); + OUT_RING (chan, 0); + BEGIN_RING(chan, eng2d, NV50_2D_BLIT_DST_X, 4); + OUT_RING (chan, dx); + OUT_RING (chan, dy); + OUT_RING (chan, w); + OUT_RING (chan, h); + BEGIN_RING(chan, eng2d, 0x08c0, 4); + OUT_RING (chan, 0); + OUT_RING (chan, 1); + OUT_RING (chan, 0); + OUT_RING (chan, 1); + BEGIN_RING(chan, eng2d, 0x08d0, 4); + OUT_RING (chan, 0); + OUT_RING (chan, sx); + OUT_RING (chan, 0); + OUT_RING (chan, sy); + + return 0; +} + static void nv50_surface_copy(struct pipe_context *pipe, boolean flip, struct pipe_surface *dest, unsigned destx, unsigned desty, @@ -34,17 +149,19 @@ nv50_surface_copy(struct pipe_context *pipe, boolean flip, unsigned width, unsigned height) { struct nv50_context *nv50 = (struct nv50_context *)pipe; - struct nouveau_winsys *nvws = nv50->screen->nvws; + struct nv50_screen *screen = nv50->screen; + + assert(src->format == dest->format); if (flip) { desty += height; while (height--) { - nvws->surface_copy(nvws, dest, destx, desty--, src, - srcx, srcy++, width, 1); + nv50_surface_do_copy(screen, dest, destx, desty--, src, + srcx, srcy++, width, 1); } } else { - nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy, - width, height); + nv50_surface_do_copy(screen, dest, destx, desty, src, srcx, + srcy, width, height); } } @@ -54,9 +171,30 @@ nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, unsigned height, unsigned value) { struct nv50_context *nv50 = (struct nv50_context *)pipe; - struct nouveau_winsys *nvws = nv50->screen->nvws; + struct nv50_screen *screen = nv50->screen; + struct nouveau_channel *chan = screen->nvws->channel; + struct nouveau_grobj *eng2d = screen->eng2d; + int format, ret; + + format = nv50_format(dest->format); + if (format < 0) + return; + + WAIT_RING (chan, 32); + + ret = nv50_surface_set(screen, dest, 1); + if (ret) + return; - nvws->surface_fill(nvws, dest, destx, desty, width, height, value); + BEGIN_RING(chan, eng2d, 0x0580, 3); + OUT_RING (chan, 4); + OUT_RING (chan, format); + OUT_RING (chan, value); + BEGIN_RING(chan, eng2d, NV50_2D_RECT_X1, 4); + OUT_RING (chan, destx); + OUT_RING (chan, desty); + OUT_RING (chan, width); + OUT_RING (chan, height); } static void * diff --git a/src/gallium/winsys/drm/nouveau/common/Makefile b/src/gallium/winsys/drm/nouveau/common/Makefile index 9bc5c42585..4cd315e289 100644 --- a/src/gallium/winsys/drm/nouveau/common/Makefile +++ b/src/gallium/winsys/drm/nouveau/common/Makefile @@ -10,8 +10,7 @@ C_SOURCES = \ nouveau_winsys.c \ nouveau_winsys_pipe.c \ nouveau_winsys_softpipe.c \ - nv04_surface.c \ - nv50_surface.c + nv04_surface.c include ./Makefile.template diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c index 70f005b888..7be3e94d49 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c @@ -56,7 +56,7 @@ nouveau_channel_context_create(struct nouveau_device *dev) case 0x50: case 0x80: case 0x90: - ret = nouveau_surface_channel_create_nv50(nvc); + /* pipe driver does this */ break; default: ret = nouveau_surface_channel_create_nv04(nvc); @@ -168,8 +168,7 @@ nouveau_context_init(struct nouveau_screen *nv_screen, case 0x50: case 0x80: case 0x90: - if (nouveau_surface_init_nv50(nv)) - return 1; + /* pipe driver does this */ break; default: if (nouveau_surface_init_nv04(nv)) diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h index 6f6bdafe6b..66883e85fe 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h @@ -78,10 +78,7 @@ extern void UNLOCK_HARDWARE(struct nouveau_context *); extern int nouveau_surface_channel_create_nv04(struct nouveau_channel_context *); -extern int -nouveau_surface_channel_create_nv50(struct nouveau_channel_context *); extern int nouveau_surface_init_nv04(struct nouveau_context *); -extern int nouveau_surface_init_nv50(struct nouveau_context *); extern uint32_t *nouveau_pipe_dma_beginp(struct nouveau_grobj *, int, int); extern void nouveau_pipe_dma_kickoff(struct nouveau_channel *); diff --git a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c b/src/gallium/winsys/drm/nouveau/common/nv50_surface.c deleted file mode 100644 index 540240cd23..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c +++ /dev/null @@ -1,193 +0,0 @@ -#include "pipe/p_context.h" -#include "pipe/p_format.h" - -#include "nouveau_context.h" - -static INLINE int -nv50_format(enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - return NV50_2D_DST_FORMAT_32BPP; - case PIPE_FORMAT_X8R8G8B8_UNORM: - return NV50_2D_DST_FORMAT_24BPP; - case PIPE_FORMAT_R5G6B5_UNORM: - return NV50_2D_DST_FORMAT_16BPP; - case PIPE_FORMAT_A8_UNORM: - return NV50_2D_DST_FORMAT_8BPP; - default: - return -1; - } -} - -static int -nv50_surface_set(struct nouveau_context *nv, struct pipe_surface *surf, int dst) -{ - struct nouveau_channel *chan = nv->nvc->channel; - struct nouveau_grobj *eng2d = nv->nvc->Nv2D; - struct nouveau_bo *bo = nouveau_buffer(surf)->bo; - int surf_format, mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT; - int flags = NOUVEAU_BO_VRAM | (dst ? NOUVEAU_BO_WR : NOUVEAU_BO_RD); - - surf_format = nv50_format(surf->format); - if (surf_format < 0) - return 1; - - if (!bo->tiled) { - BEGIN_RING(chan, eng2d, mthd, 2); - OUT_RING (chan, surf_format); - OUT_RING (chan, 1); - BEGIN_RING(chan, eng2d, mthd + 0x14, 5); - OUT_RING (chan, surf->stride); - OUT_RING (chan, surf->width); - OUT_RING (chan, surf->height); - OUT_RELOCh(chan, bo, surf->offset, flags); - OUT_RELOCl(chan, bo, surf->offset, flags); - } else { - BEGIN_RING(chan, eng2d, mthd, 5); - OUT_RING (chan, surf_format); - OUT_RING (chan, 0); - OUT_RING (chan, 0); - OUT_RING (chan, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, eng2d, mthd + 0x18, 4); - OUT_RING (chan, surf->width); - OUT_RING (chan, surf->height); - OUT_RELOCh(chan, bo, surf->offset, flags); - OUT_RELOCl(chan, bo, surf->offset, flags); - } - -#if 0 - if (dst) { - BEGIN_RING(chan, eng2d, NV50_2D_CLIP_X, 4); - OUT_RING (chan, 0); - OUT_RING (chan, 0); - OUT_RING (chan, surf->width); - OUT_RING (chan, surf->height); - } -#endif - - return 0; -} - -static int -nv50_surface_copy_prep(struct nouveau_context *nv, - struct pipe_surface *dst, struct pipe_surface *src) -{ - int ret; - - assert(src->format == dst->format); - - ret = nv50_surface_set(nv, dst, 1); - if (ret) - return ret; - - ret = nv50_surface_set(nv, src, 0); - if (ret) - return ret; - - return 0; -} - -static void -nv50_surface_copy(struct nouveau_context *nv, unsigned dx, unsigned dy, - unsigned sx, unsigned sy, unsigned w, unsigned h) -{ - struct nouveau_channel *chan = nv->nvc->channel; - struct nouveau_grobj *eng2d = nv->nvc->Nv2D; - - BEGIN_RING(chan, eng2d, 0x088c, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, eng2d, NV50_2D_BLIT_DST_X, 4); - OUT_RING (chan, dx); - OUT_RING (chan, dy); - OUT_RING (chan, w); - OUT_RING (chan, h); - BEGIN_RING(chan, eng2d, 0x08c0, 4); - OUT_RING (chan, 0); - OUT_RING (chan, 1); - OUT_RING (chan, 0); - OUT_RING (chan, 1); - BEGIN_RING(chan, eng2d, 0x08d0, 4); - OUT_RING (chan, 0); - OUT_RING (chan, sx); - OUT_RING (chan, 0); - OUT_RING (chan, sy); -} - -static void -nv50_surface_copy_done(struct nouveau_context *nv) -{ - FIRE_RING(nv->nvc->channel); -} - -static int -nv50_surface_fill(struct nouveau_context *nv, struct pipe_surface *dst, - unsigned dx, unsigned dy, unsigned w, unsigned h, - unsigned value) -{ - struct nouveau_channel *chan = nv->nvc->channel; - struct nouveau_grobj *eng2d = nv->nvc->Nv2D; - int rect_format, ret; - - rect_format = nv50_format(dst->format); - if (rect_format < 0) - return 1; - - ret = nv50_surface_set(nv, dst, 1); - if (ret) - return ret; - - BEGIN_RING(chan, eng2d, 0x0580, 3); - OUT_RING (chan, 4); - OUT_RING (chan, rect_format); - OUT_RING (chan, value); - - BEGIN_RING(chan, eng2d, NV50_2D_RECT_X1, 4); - OUT_RING (chan, dx); - OUT_RING (chan, dy); - OUT_RING (chan, dx + w); - OUT_RING (chan, dy + h); - - FIRE_RING(chan); - return 0; -} - -int -nouveau_surface_channel_create_nv50(struct nouveau_channel_context *nvc) -{ - struct nouveau_channel *chan = nvc->channel; - struct nouveau_grobj *eng2d = NULL; - int ret; - - ret = nouveau_grobj_alloc(chan, nvc->next_handle++, NV50_2D, &eng2d); - if (ret) - return ret; - nvc->Nv2D = eng2d; - - BEGIN_RING(chan, eng2d, NV50_2D_DMA_NOTIFY, 4); - OUT_RING (chan, nvc->sync_notifier->handle); - OUT_RING (chan, chan->vram->handle); - OUT_RING (chan, chan->vram->handle); - OUT_RING (chan, chan->vram->handle); - BEGIN_RING(chan, eng2d, NV50_2D_OPERATION, 1); - OUT_RING (chan, NV50_2D_OPERATION_SRCCOPY); - BEGIN_RING(chan, eng2d, 0x0290, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, eng2d, 0x0888, 1); - OUT_RING (chan, 1); - - return 0; -} - -int -nouveau_surface_init_nv50(struct nouveau_context *nv) -{ - nv->surface_copy_prep = nv50_surface_copy_prep; - nv->surface_copy = nv50_surface_copy; - nv->surface_copy_done = nv50_surface_copy_done; - nv->surface_fill = nv50_surface_fill; - return 0; -} - diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c index e111eec932..450c981ca4 100644 --- a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c +++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c @@ -28,18 +28,36 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf, pbox = dPriv->pClipRects; nbox = dPriv->numClipRects; - nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf); - for (i = 0; i < nbox; i++, pbox++) { - int sx, sy, dx, dy, w, h; - - sx = pbox->x1 - dPriv->x; - sy = pbox->y1 - dPriv->y; - dx = pbox->x1; - dy = pbox->y1; - w = pbox->x2 - pbox->x1; - h = pbox->y2 - pbox->y1; - - nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h); + if (nv->base.surface_copy_prep) { + nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf); + for (i = 0; i < nbox; i++, pbox++) { + int sx, sy, dx, dy, w, h; + + sx = pbox->x1 - dPriv->x; + sy = pbox->y1 - dPriv->y; + dx = pbox->x1; + dy = pbox->y1; + w = pbox->x2 - pbox->x1; + h = pbox->y2 - pbox->y1; + + nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h); + } + } else { + struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id]; + + for (i = 0; i < nbox; i++, pbox++) { + int sx, sy, dx, dy, w, h; + + sx = pbox->x1 - dPriv->x; + sy = pbox->y1 - dPriv->y; + dx = pbox->x1; + dy = pbox->y1; + w = pbox->x2 - pbox->x1; + h = pbox->y2 - pbox->y1; + + pipe->surface_copy(pipe, FALSE, nv->base.frontbuffer, + dx, dy, surf, sx, sy, w, h); + } } FIRE_RING(nv->base.nvc->channel); -- cgit v1.2.3 From ff8dff017e537c6db4c86aad43e92b768cb187e4 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 5 Feb 2009 18:19:32 +1000 Subject: nv04-nv40: move 2d blit/fill code into pipe driver --- src/gallium/drivers/nouveau/nouveau_winsys.h | 2 +- src/gallium/drivers/nv04/Makefile | 1 + src/gallium/drivers/nv04/nv04_screen.c | 13 + src/gallium/drivers/nv04/nv04_screen.h | 2 + src/gallium/drivers/nv04/nv04_surface.c | 17 +- src/gallium/drivers/nv04/nv04_surface_2d.c | 449 ++++++++++++++++++++ src/gallium/drivers/nv04/nv04_surface_2d.h | 29 ++ src/gallium/drivers/nv10/nv10_screen.c | 12 + src/gallium/drivers/nv10/nv10_screen.h | 2 + src/gallium/drivers/nv10/nv10_surface.c | 17 +- src/gallium/drivers/nv20/nv20_screen.c | 12 + src/gallium/drivers/nv20/nv20_screen.h | 2 + src/gallium/drivers/nv20/nv20_surface.c | 17 +- src/gallium/drivers/nv30/nv30_screen.c | 12 + src/gallium/drivers/nv30/nv30_screen.h | 2 + src/gallium/drivers/nv30/nv30_surface.c | 20 +- src/gallium/drivers/nv40/nv40_screen.c | 12 + src/gallium/drivers/nv40/nv40_screen.h | 2 + src/gallium/drivers/nv40/nv40_surface.c | 20 +- src/gallium/winsys/drm/nouveau/common/Makefile | 4 +- .../winsys/drm/nouveau/common/nouveau_context.c | 49 +-- .../winsys/drm/nouveau/common/nouveau_context.h | 33 +- .../winsys/drm/nouveau/common/nouveau_winsys.c | 32 +- .../drm/nouveau/common/nouveau_winsys_pipe.c | 6 +- .../drm/nouveau/common/nouveau_winsys_pipe.h | 11 +- .../winsys/drm/nouveau/common/nv04_surface.c | 458 --------------------- .../winsys/drm/nouveau/dri/nouveau_swapbuffers.c | 43 +- 27 files changed, 625 insertions(+), 654 deletions(-) create mode 100644 src/gallium/drivers/nv04/nv04_surface_2d.c create mode 100644 src/gallium/drivers/nv04/nv04_surface_2d.h delete mode 100644 src/gallium/winsys/drm/nouveau/common/nv04_surface.c (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h index 99f8e08201..b86c4b9338 100644 --- a/src/gallium/drivers/nouveau/nouveau_winsys.h +++ b/src/gallium/drivers/nouveau/nouveau_winsys.h @@ -50,7 +50,7 @@ struct nouveau_winsys { uint32_t (*notifier_status)(struct nouveau_notifier *, int id); uint32_t (*notifier_retval)(struct nouveau_notifier *, int id); int (*notifier_wait)(struct nouveau_notifier *, int id, - int status, float timeout); + int status, double timeout); int (*surface_copy)(struct nouveau_winsys *, struct pipe_surface *, unsigned, unsigned, struct pipe_surface *, diff --git a/src/gallium/drivers/nv04/Makefile b/src/gallium/drivers/nv04/Makefile index 5ea51a2f42..4ed62dae95 100644 --- a/src/gallium/drivers/nv04/Makefile +++ b/src/gallium/drivers/nv04/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configs/current LIBNAME = nv04 DRIVER_SOURCES = \ + nv04_surface_2d.c \ nv04_clear.c \ nv04_context.c \ nv04_fragprog.c \ diff --git a/src/gallium/drivers/nv04/nv04_screen.c b/src/gallium/drivers/nv04/nv04_screen.c index e5e3d4772a..9ef38bc244 100644 --- a/src/gallium/drivers/nv04/nv04_screen.c +++ b/src/gallium/drivers/nv04/nv04_screen.c @@ -149,10 +149,19 @@ nv04_screen_destroy(struct pipe_screen *pscreen) nvws->notifier_free(&screen->sync); nvws->grobj_free(&screen->fahrenheit); + nv04_surface_2d_takedown(&screen->eng2d); FREE(pscreen); } +static struct pipe_buffer * +nv04_surface_buffer(struct pipe_surface *surf) +{ + struct nv04_miptree *mt = (struct nv04_miptree *)surf->texture; + + return mt->buffer; +} + struct pipe_screen * nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) { @@ -181,6 +190,10 @@ nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) return NULL; } + /* 2D engine setup */ + screen->eng2d = nv04_surface_2d_init(nvws); + screen->eng2d->buf = nv04_surface_buffer; + /* 3D object */ ret = nvws->grobj_alloc(nvws, fahrenheit_class, &screen->fahrenheit); if (ret) { diff --git a/src/gallium/drivers/nv04/nv04_screen.h b/src/gallium/drivers/nv04/nv04_screen.h index 99a49cdf7a..540aec907b 100644 --- a/src/gallium/drivers/nv04/nv04_screen.h +++ b/src/gallium/drivers/nv04/nv04_screen.h @@ -2,6 +2,7 @@ #define __NV04_SCREEN_H__ #include "pipe/p_screen.h" +#include "nv04_surface_2d.h" struct nv04_screen { struct pipe_screen pipe; @@ -10,6 +11,7 @@ struct nv04_screen { unsigned chipset; /* HW graphics objects */ + struct nv04_surface_2d *eng2d; struct nouveau_grobj *fahrenheit; struct nouveau_grobj *context_surfaces_3d; struct nouveau_notifier *sync; diff --git a/src/gallium/drivers/nv04/nv04_surface.c b/src/gallium/drivers/nv04/nv04_surface.c index 0d0983f9d4..1d11f53f2a 100644 --- a/src/gallium/drivers/nv04/nv04_surface.c +++ b/src/gallium/drivers/nv04/nv04_surface.c @@ -39,10 +39,17 @@ nv04_surface_copy(struct pipe_context *pipe, boolean do_flip, unsigned width, unsigned height) { struct nv04_context *nv04 = nv04_context(pipe); - struct nouveau_winsys *nvws = nv04->nvws; + struct nv04_surface_2d *eng2d = nv04->screen->eng2d; - nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy, - width, height); + if (do_flip) { + desty += height; + while (height--) { + eng2d->copy(eng2d, dest, destx, desty--, src, + srcx, srcy++, width, 1); + } + } + + eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); } static void @@ -51,9 +58,9 @@ nv04_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, unsigned height, unsigned value) { struct nv04_context *nv04 = nv04_context(pipe); - struct nouveau_winsys *nvws = nv04->nvws; + struct nv04_surface_2d *eng2d = nv04->screen->eng2d; - nvws->surface_fill(nvws, dest, destx, desty, width, height, value); + eng2d->fill(eng2d, dest, destx, desty, width, height, value); } void diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c new file mode 100644 index 0000000000..7529583151 --- /dev/null +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -0,0 +1,449 @@ +#include "pipe/p_context.h" +#include "pipe/p_format.h" +#include "util/u_memory.h" + +#include "nouveau/nouveau_winsys.h" +#include "nouveau/nouveau_util.h" +#include "nv04_surface_2d.h" + +static INLINE int +nv04_surface_format(enum pipe_format format) +{ + switch (format) { + case PIPE_FORMAT_A8_UNORM: + return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8; + case PIPE_FORMAT_R16_SNORM: + case PIPE_FORMAT_R5G6B5_UNORM: + return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5; + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: + return NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8; + case PIPE_FORMAT_Z24S8_UNORM: + return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32; + default: + return -1; + } +} + +static INLINE int +nv04_rect_format(enum pipe_format format) +{ + switch (format) { + case PIPE_FORMAT_A8_UNORM: + return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; + case PIPE_FORMAT_R5G6B5_UNORM: + return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5; + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; + default: + return -1; + } +} + +static INLINE int +nv04_scaled_image_format(enum pipe_format format) +{ + switch (format) { + case PIPE_FORMAT_A1R5G5B5_UNORM: + return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5; + case PIPE_FORMAT_A8R8G8B8_UNORM: + return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8; + case PIPE_FORMAT_X8R8G8B8_UNORM: + return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8; + case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_R16_SNORM: + return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5; + default: + return -1; + } +} + +static INLINE unsigned +nv04_swizzle_bits(unsigned x, unsigned y) +{ + unsigned u = (x & 0x001) << 0 | + (x & 0x002) << 1 | + (x & 0x004) << 2 | + (x & 0x008) << 3 | + (x & 0x010) << 4 | + (x & 0x020) << 5 | + (x & 0x040) << 6 | + (x & 0x080) << 7 | + (x & 0x100) << 8 | + (x & 0x200) << 9 | + (x & 0x400) << 10 | + (x & 0x800) << 11; + + unsigned v = (y & 0x001) << 1 | + (y & 0x002) << 2 | + (y & 0x004) << 3 | + (y & 0x008) << 4 | + (y & 0x010) << 5 | + (y & 0x020) << 6 | + (y & 0x040) << 7 | + (y & 0x080) << 8 | + (y & 0x100) << 9 | + (y & 0x200) << 10 | + (y & 0x400) << 11 | + (y & 0x800) << 12; + return v | u; +} + +static int +nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, + struct pipe_surface *dst, int dx, int dy, + struct pipe_surface *src, int sx, int sy, + int w, int h) +{ + struct nouveau_channel *chan = ctx->nvws->channel; + struct nouveau_grobj *swzsurf = ctx->swzsurf; + struct nouveau_grobj *sifm = ctx->sifm; + struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src)); + struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst)); + const unsigned max_w = 1024; + const unsigned max_h = 1024; + const unsigned sub_w = w > max_w ? max_w : w; + const unsigned sub_h = h > max_h ? max_h : h; + unsigned cx = 0; + unsigned cy = 0; + + /* POT or GTFO */ + assert(!(w & (w - 1)) && !(h & (h - 1))); + + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, 1); + OUT_RELOCo(chan, dst_bo, + NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); + OUT_RING (chan, nv04_surface_format(dst->format) | + log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | + log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); + + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1); + OUT_RELOCo(chan, src_bo, + NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1); + OUT_RING (chan, swzsurf->handle); + + for (cy = 0; cy < h; cy += sub_h) { + for (cx = 0; cx < w; cx += sub_w) { + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); + OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx, cy) * + dst->block.size, NOUVEAU_BO_GART | + NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); + OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE); + OUT_RING (chan, nv04_scaled_image_format(src->format)); + OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY); + OUT_RING (chan, 0); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, 0); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, 1 << 20); + OUT_RING (chan, 1 << 20); + + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, src->stride | + NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | + NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); + OUT_RELOCl(chan, src_bo, src->offset + cy * src->stride + + cx * src->block.size, NOUVEAU_BO_GART | + NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + OUT_RING (chan, 0); + } + } + + return 0; +} + +static int +nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx, + struct pipe_surface *dst, int dx, int dy, + struct pipe_surface *src, int sx, int sy, int w, int h) +{ + struct nouveau_channel *chan = ctx->nvws->channel; + struct nouveau_grobj *m2mf = ctx->m2mf; + struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src)); + struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst)); + unsigned dst_offset, src_offset; + + dst_offset = dst->offset + (dy * dst->stride) + (dx * dst->block.size); + src_offset = src->offset + (sy * src->stride) + (sx * src->block.size); + + WAIT_RING (chan, 3 + ((h / 2047) + 1) * 9); + BEGIN_RING(chan, m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2); + OUT_RELOCo(chan, src_bo, + NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + OUT_RELOCo(chan, dst_bo, + NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + + while (h) { + int count = (h > 2047) ? 2047 : h; + + BEGIN_RING(chan, m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8); + OUT_RELOCl(chan, src_bo, src_offset, + NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD); + OUT_RELOCl(chan, dst_bo, dst_offset, + NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR); + OUT_RING (chan, src->stride); + OUT_RING (chan, dst->stride); + OUT_RING (chan, w * src->block.size); + OUT_RING (chan, count); + OUT_RING (chan, 0x0101); + OUT_RING (chan, 0); + + h -= count; + src_offset += src->stride * count; + dst_offset += dst->stride * count; + } + + return 0; +} + +static int +nv04_surface_copy_blit(struct nv04_surface_2d *ctx, struct pipe_surface *dst, + int dx, int dy, struct pipe_surface *src, int sx, int sy, + int w, int h) +{ + struct nouveau_channel *chan = ctx->nvws->channel; + struct nouveau_grobj *surf2d = ctx->surf2d; + struct nouveau_grobj *blit = ctx->blit; + struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src)); + struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst)); + int format; + + format = nv04_surface_format(dst->format); + if (format < 0) + return 1; + + WAIT_RING (chan, 12); + BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); + OUT_RELOCo(chan, src_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_FORMAT, 4); + OUT_RING (chan, format); + OUT_RING (chan, (dst->stride << 16) | src->stride); + OUT_RELOCl(chan, src_bo, src->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + OUT_RELOCl(chan, dst_bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + + BEGIN_RING(chan, blit, 0x0300, 3); + OUT_RING (chan, (sy << 16) | sx); + OUT_RING (chan, (dy << 16) | dx); + OUT_RING (chan, ( h << 16) | w); + + return 0; +} + +static void +nv04_surface_copy(struct nv04_surface_2d *ctx, struct pipe_surface *dst, + int dx, int dy, struct pipe_surface *src, int sx, int sy, + int w, int h) +{ + int src_linear = src->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR; + int dst_linear = dst->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR; + + assert(src->format == dst->format); + + /* Setup transfer to swizzle the texture to vram if needed */ + /* FIXME/TODO: check proper limits of this operation */ + if (src_linear ^ dst_linear) { + nv04_surface_copy_swizzle(ctx, dst, dx, dy, src, sx, sy, w, h); + return; + } + + /* NV_CONTEXT_SURFACES_2D has buffer alignment restrictions, fallback + * to NV_MEMORY_TO_MEMORY_FORMAT in this case. + */ + if ((src->offset & 63) || (dst->offset & 63)) { + nv04_surface_copy_m2mf(ctx, dst, dx, dy, src, sx, sy, w, h); + return; + } + + nv04_surface_copy_blit(ctx, dst, dx, dy, src, sx, sy, w, h); +} + +static void +nv04_surface_fill(struct nv04_surface_2d *ctx, struct pipe_surface *dst, + int dx, int dy, int w, int h, unsigned value) +{ + struct nouveau_channel *chan = ctx->nvws->channel; + struct nouveau_grobj *surf2d = ctx->surf2d; + struct nouveau_grobj *rect = ctx->rect; + struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst)); + int cs2d_format, gdirect_format; + + cs2d_format = nv04_surface_format(dst->format); + assert(cs2d_format >= 0); + + gdirect_format = nv04_surface_format(dst->format); + assert(gdirect_format >= 0); + + WAIT_RING (chan, 16); + BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); + OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_FORMAT, 4); + OUT_RING (chan, cs2d_format); + OUT_RING (chan, (dst->stride << 16) | dst->stride); + OUT_RELOCl(chan, dst_bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + OUT_RELOCl(chan, dst_bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + + BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT, 1); + OUT_RING (chan, gdirect_format); + BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR1_A, 1); + OUT_RING (chan, value); + BEGIN_RING(chan, rect, + NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT(0), 2); + OUT_RING (chan, (dx << 16) | dy); + OUT_RING (chan, ( w << 16) | h); +} + +void +nv04_surface_2d_takedown(struct nv04_surface_2d **pctx) +{ + struct nv04_surface_2d *ctx; + + if (!pctx || !*pctx) + return; + ctx = *pctx; + *pctx = NULL; + + nouveau_notifier_free(&ctx->ntfy); + nouveau_grobj_free(&ctx->m2mf); + nouveau_grobj_free(&ctx->surf2d); + nouveau_grobj_free(&ctx->swzsurf); + nouveau_grobj_free(&ctx->rect); + nouveau_grobj_free(&ctx->blit); + nouveau_grobj_free(&ctx->sifm); + + FREE(ctx); +} + +struct nv04_surface_2d * +nv04_surface_2d_init(struct nouveau_winsys *nvws) +{ + struct nv04_surface_2d *ctx = CALLOC_STRUCT(nv04_surface_2d); + struct nouveau_channel *chan = nvws->channel; + unsigned handle = 0x88000000, class; + int ret; + + if (!ctx) + return NULL; + + ret = nouveau_notifier_alloc(chan, handle++, 1, &ctx->ntfy); + if (ret) { + nv04_surface_2d_takedown(&ctx); + return NULL; + } + + ret = nouveau_grobj_alloc(chan, handle++, 0x0039, &ctx->m2mf); + if (ret) { + nv04_surface_2d_takedown(&ctx); + return NULL; + } + + BEGIN_RING(chan, ctx->m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 1); + OUT_RING (chan, ctx->ntfy->handle); + + if (chan->device->chipset < 0x10) + class = NV04_CONTEXT_SURFACES_2D; + else + class = NV10_CONTEXT_SURFACES_2D; + + ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->surf2d); + if (ret) { + nv04_surface_2d_takedown(&ctx); + return NULL; + } + + BEGIN_RING(chan, ctx->surf2d, + NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); + OUT_RING (chan, chan->vram->handle); + OUT_RING (chan, chan->vram->handle); + + if (chan->device->chipset < 0x10) + class = NV04_IMAGE_BLIT; + else + class = NV12_IMAGE_BLIT; + + ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->blit); + if (ret) { + nv04_surface_2d_takedown(&ctx); + return NULL; + } + + BEGIN_RING(chan, ctx->blit, NV04_IMAGE_BLIT_DMA_NOTIFY, 1); + OUT_RING (chan, ctx->ntfy->handle); + BEGIN_RING(chan, ctx->blit, NV04_IMAGE_BLIT_SURFACE, 1); + OUT_RING (chan, ctx->surf2d->handle); + BEGIN_RING(chan, ctx->blit, NV04_IMAGE_BLIT_OPERATION, 1); + OUT_RING (chan, NV04_IMAGE_BLIT_OPERATION_SRCCOPY); + + ret = nouveau_grobj_alloc(chan, handle++, NV04_GDI_RECTANGLE_TEXT, + &ctx->rect); + if (ret) { + nv04_surface_2d_takedown(&ctx); + return NULL; + } + + BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY, 1); + OUT_RING (chan, ctx->ntfy->handle); + BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_SURFACE, 1); + OUT_RING (chan, ctx->ntfy->handle); + BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_OPERATION, 1); + OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY); + BEGIN_RING(chan, ctx->rect, + NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT, 1); + OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE); + + switch (chan->device->chipset & 0xf0) { + case 0x00: + case 0x10: + class = NV04_SWIZZLED_SURFACE; + break; + case 0x20: + class = NV20_SWIZZLED_SURFACE; + break; + case 0x30: + class = NV30_SWIZZLED_SURFACE; + break; + case 0x40: + case 0x60: + class = NV40_SWIZZLED_SURFACE; + break; + default: + /* Famous last words: this really can't happen.. */ + assert(0); + break; + } + + ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->swzsurf); + if (ret) { + nv04_surface_2d_takedown(&ctx); + return NULL; + } + + if (chan->device->chipset < 0x10) { + class = NV04_SCALED_IMAGE_FROM_MEMORY; + } else + if (chan->device->chipset < 0x40) { + class = NV10_SCALED_IMAGE_FROM_MEMORY; + } else { + class = NV40_SCALED_IMAGE_FROM_MEMORY; + } + + ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->sifm); + if (ret) { + nv04_surface_2d_takedown(&ctx); + return NULL; + } + + ctx->nvws = nvws; + ctx->copy = nv04_surface_copy; + ctx->fill = nv04_surface_fill; + return ctx; +} + + diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.h b/src/gallium/drivers/nv04/nv04_surface_2d.h new file mode 100644 index 0000000000..21b8f86960 --- /dev/null +++ b/src/gallium/drivers/nv04/nv04_surface_2d.h @@ -0,0 +1,29 @@ +#ifndef __NV04_SURFACE_2D_H__ +#define __NV04_SURFACE_2D_H__ + +struct nv04_surface_2d { + struct nouveau_winsys *nvws; + struct nouveau_notifier *ntfy; + struct nouveau_grobj *surf2d; + struct nouveau_grobj *swzsurf; + struct nouveau_grobj *m2mf; + struct nouveau_grobj *rect; + struct nouveau_grobj *blit; + struct nouveau_grobj *sifm; + + struct pipe_buffer *(*buf)(struct pipe_surface *); + + void (*copy)(struct nv04_surface_2d *, struct pipe_surface *dst, + int dx, int dy, struct pipe_surface *src, int sx, int sy, + int w, int h); + void (*fill)(struct nv04_surface_2d *, struct pipe_surface *dst, + int dx, int dy, int w, int h, unsigned value); +}; + +struct nv04_surface_2d * +nv04_surface_2d_init(struct nouveau_winsys *nvws); + +void +nv04_surface_2d_takedown(struct nv04_surface_2d **); + +#endif diff --git a/src/gallium/drivers/nv10/nv10_screen.c b/src/gallium/drivers/nv10/nv10_screen.c index 2f945a193c..f417b06c94 100644 --- a/src/gallium/drivers/nv10/nv10_screen.c +++ b/src/gallium/drivers/nv10/nv10_screen.c @@ -152,6 +152,14 @@ nv10_screen_destroy(struct pipe_screen *pscreen) FREE(pscreen); } +static struct pipe_buffer * +nv10_surface_buffer(struct pipe_surface *surf) +{ + struct nv10_miptree *mt = (struct nv10_miptree *)surf->texture; + + return mt->buffer; +} + struct pipe_screen * nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) { @@ -164,6 +172,10 @@ nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) return NULL; screen->nvws = nvws; + /* 2D engine setup */ + screen->eng2d = nv04_surface_2d_init(nvws); + screen->eng2d->buf = nv10_surface_buffer; + /* 3D object */ if (chipset>=0x20) celsius_class=NV11TCL; diff --git a/src/gallium/drivers/nv10/nv10_screen.h b/src/gallium/drivers/nv10/nv10_screen.h index 3f8750a13f..60102a369a 100644 --- a/src/gallium/drivers/nv10/nv10_screen.h +++ b/src/gallium/drivers/nv10/nv10_screen.h @@ -2,6 +2,7 @@ #define __NV10_SCREEN_H__ #include "pipe/p_screen.h" +#include "nv04/nv04_surface_2d.h" struct nv10_screen { struct pipe_screen pipe; @@ -9,6 +10,7 @@ struct nv10_screen { struct nouveau_winsys *nvws; /* HW graphics objects */ + struct nv04_surface_2d *eng2d; struct nouveau_grobj *celsius; struct nouveau_notifier *sync; }; diff --git a/src/gallium/drivers/nv10/nv10_surface.c b/src/gallium/drivers/nv10/nv10_surface.c index 78fd7b42da..1093dfd62e 100644 --- a/src/gallium/drivers/nv10/nv10_surface.c +++ b/src/gallium/drivers/nv10/nv10_surface.c @@ -39,10 +39,17 @@ nv10_surface_copy(struct pipe_context *pipe, boolean do_flip, unsigned width, unsigned height) { struct nv10_context *nv10 = nv10_context(pipe); - struct nouveau_winsys *nvws = nv10->nvws; + struct nv04_surface_2d *eng2d = nv10->screen->eng2d; - nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy, - width, height); + if (do_flip) { + desty += height; + while (height--) { + eng2d->copy(eng2d, dest, destx, desty--, src, + srcx, srcy++, width, 1); + } + } + + eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); } static void @@ -51,9 +58,9 @@ nv10_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, unsigned height, unsigned value) { struct nv10_context *nv10 = nv10_context(pipe); - struct nouveau_winsys *nvws = nv10->nvws; + struct nv04_surface_2d *eng2d = nv10->screen->eng2d; - nvws->surface_fill(nvws, dest, destx, desty, width, height, value); + eng2d->fill(eng2d, dest, destx, desty, width, height, value); } void diff --git a/src/gallium/drivers/nv20/nv20_screen.c b/src/gallium/drivers/nv20/nv20_screen.c index c9171fa178..5f2b7b4f71 100644 --- a/src/gallium/drivers/nv20/nv20_screen.c +++ b/src/gallium/drivers/nv20/nv20_screen.c @@ -152,6 +152,14 @@ nv20_screen_destroy(struct pipe_screen *pscreen) FREE(pscreen); } +static struct pipe_buffer * +nv20_surface_buffer(struct pipe_surface *surf) +{ + struct nv20_miptree *mt = (struct nv20_miptree *)surf->texture; + + return mt->buffer; +} + struct pipe_screen * nv20_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) { @@ -164,6 +172,10 @@ nv20_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) return NULL; screen->nvws = nvws; + /* 2D engine setup */ + screen->eng2d = nv04_surface_2d_init(nvws); + screen->eng2d->buf = nv20_surface_buffer; + /* 3D object */ if (chipset >= 0x25) kelvin_class = NV25TCL; diff --git a/src/gallium/drivers/nv20/nv20_screen.h b/src/gallium/drivers/nv20/nv20_screen.h index 8f2f2e341d..bf2f2c0d9f 100644 --- a/src/gallium/drivers/nv20/nv20_screen.h +++ b/src/gallium/drivers/nv20/nv20_screen.h @@ -2,6 +2,7 @@ #define __NV20_SCREEN_H__ #include "pipe/p_screen.h" +#include "nv04/nv04_surface_2d.h" struct nv20_screen { struct pipe_screen pipe; @@ -9,6 +10,7 @@ struct nv20_screen { struct nouveau_winsys *nvws; /* HW graphics objects */ + struct nv04_surface_2d *eng2d; struct nouveau_grobj *kelvin; struct nouveau_notifier *sync; }; diff --git a/src/gallium/drivers/nv20/nv20_surface.c b/src/gallium/drivers/nv20/nv20_surface.c index 9b4c028eae..a79974ce5e 100644 --- a/src/gallium/drivers/nv20/nv20_surface.c +++ b/src/gallium/drivers/nv20/nv20_surface.c @@ -39,10 +39,17 @@ nv20_surface_copy(struct pipe_context *pipe, boolean do_flip, unsigned width, unsigned height) { struct nv20_context *nv20 = nv20_context(pipe); - struct nouveau_winsys *nvws = nv20->nvws; + struct nv04_surface_2d *eng2d = nv20->screen->eng2d; - nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy, - width, height); + if (do_flip) { + desty += height; + while (height--) { + eng2d->copy(eng2d, dest, destx, desty--, src, + srcx, srcy++, width, 1); + } + } + + eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); } static void @@ -51,9 +58,9 @@ nv20_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, unsigned height, unsigned value) { struct nv20_context *nv20 = nv20_context(pipe); - struct nouveau_winsys *nvws = nv20->nvws; + struct nv04_surface_2d *eng2d = nv20->screen->eng2d; - nvws->surface_fill(nvws, dest, destx, desty, width, height, value); + eng2d->fill(eng2d, dest, destx, desty, width, height, value); } void diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index 9738436dc4..2bc83f815b 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -220,6 +220,14 @@ nv30_screen_destroy(struct pipe_screen *pscreen) FREE(pscreen); } +static struct pipe_buffer * +nv30_surface_buffer(struct pipe_surface *surf) +{ + struct nv30_miptree *mt = (struct nv30_miptree *)surf->texture; + + return mt->buffer; +} + struct pipe_screen * nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) { @@ -233,6 +241,10 @@ nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) return NULL; screen->nvws = nvws; + /* 2D engine setup */ + screen->eng2d = nv04_surface_2d_init(nvws); + screen->eng2d->buf = nv30_surface_buffer; + /* 3D object */ switch (chipset & 0xf0) { case 0x30: diff --git a/src/gallium/drivers/nv30/nv30_screen.h b/src/gallium/drivers/nv30/nv30_screen.h index b7ddc2a959..b11e470f94 100644 --- a/src/gallium/drivers/nv30/nv30_screen.h +++ b/src/gallium/drivers/nv30/nv30_screen.h @@ -2,6 +2,7 @@ #define __NV30_SCREEN_H__ #include "pipe/p_screen.h" +#include "nv04/nv04_surface_2d.h" struct nv30_screen { struct pipe_screen pipe; @@ -11,6 +12,7 @@ struct nv30_screen { unsigned cur_pctx; /* HW graphics objects */ + struct nv04_surface_2d *eng2d; struct nouveau_grobj *rankine; struct nouveau_notifier *sync; diff --git a/src/gallium/drivers/nv30/nv30_surface.c b/src/gallium/drivers/nv30/nv30_surface.c index 806131dcc9..b46b6123cf 100644 --- a/src/gallium/drivers/nv30/nv30_surface.c +++ b/src/gallium/drivers/nv30/nv30_surface.c @@ -30,7 +30,6 @@ #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_inlines.h" - #include "util/u_tile.h" static void @@ -40,22 +39,17 @@ nv30_surface_copy(struct pipe_context *pipe, boolean do_flip, unsigned width, unsigned height) { struct nv30_context *nv30 = nv30_context(pipe); - struct nouveau_winsys *nvws = nv30->nvws; + struct nv04_surface_2d *eng2d = nv30->screen->eng2d; if (do_flip) { - /*XXX: This dodgyness will do for now for correctness. But, - * need to investigate whether the 2D engine is able to - * manage a flip (perhaps SIFM?), if not, use the 3D engine - */ desty += height; while (height--) { - nvws->surface_copy(nvws, dest, destx, desty--, src, - srcx, srcy++, width, 1); + eng2d->copy(eng2d, dest, destx, desty--, src, + srcx, srcy++, width, 1); } - } else { - nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy, - width, height); } + + eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); } static void @@ -64,9 +58,9 @@ nv30_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, unsigned height, unsigned value) { struct nv30_context *nv30 = nv30_context(pipe); - struct nouveau_winsys *nvws = nv30->nvws; + struct nv04_surface_2d *eng2d = nv30->screen->eng2d; - nvws->surface_fill(nvws, dest, destx, desty, width, height, value); + eng2d->fill(eng2d, dest, destx, desty, width, height, value); } void diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c index 41d342d27d..a2b124d228 100644 --- a/src/gallium/drivers/nv40/nv40_screen.c +++ b/src/gallium/drivers/nv40/nv40_screen.c @@ -230,6 +230,14 @@ nv40_screen_destroy(struct pipe_screen *pscreen) FREE(pscreen); } +static struct pipe_buffer * +nv40_surface_buffer(struct pipe_surface *surf) +{ + struct nv40_miptree *mt = (struct nv40_miptree *)surf->texture; + + return mt->buffer; +} + struct pipe_screen * nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) { @@ -243,6 +251,10 @@ nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) return NULL; screen->nvws = nvws; + /* 2D engine setup */ + screen->eng2d = nv04_surface_2d_init(nvws); + screen->eng2d->buf = nv40_surface_buffer; + /* 3D object */ switch (chipset & 0xf0) { case 0x40: diff --git a/src/gallium/drivers/nv40/nv40_screen.h b/src/gallium/drivers/nv40/nv40_screen.h index c04a1275a0..4500aa0e5c 100644 --- a/src/gallium/drivers/nv40/nv40_screen.h +++ b/src/gallium/drivers/nv40/nv40_screen.h @@ -2,6 +2,7 @@ #define __NV40_SCREEN_H__ #include "pipe/p_screen.h" +#include "nv04/nv04_surface_2d.h" struct nv40_screen { struct pipe_screen pipe; @@ -11,6 +12,7 @@ struct nv40_screen { unsigned cur_pctx; /* HW graphics objects */ + struct nv04_surface_2d *eng2d; struct nouveau_grobj *curie; struct nouveau_notifier *sync; diff --git a/src/gallium/drivers/nv40/nv40_surface.c b/src/gallium/drivers/nv40/nv40_surface.c index aa51d04051..68bbfce448 100644 --- a/src/gallium/drivers/nv40/nv40_surface.c +++ b/src/gallium/drivers/nv40/nv40_surface.c @@ -30,7 +30,6 @@ #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_inlines.h" - #include "util/u_tile.h" static void @@ -40,22 +39,17 @@ nv40_surface_copy(struct pipe_context *pipe, boolean do_flip, unsigned width, unsigned height) { struct nv40_context *nv40 = nv40_context(pipe); - struct nouveau_winsys *nvws = nv40->nvws; + struct nv04_surface_2d *eng2d = nv40->screen->eng2d; if (do_flip) { - /*XXX: This dodgyness will do for now for correctness. But, - * need to investigate whether the 2D engine is able to - * manage a flip (perhaps SIFM?), if not, use the 3D engine - */ desty += height; while (height--) { - nvws->surface_copy(nvws, dest, destx, desty--, src, - srcx, srcy++, width, 1); + eng2d->copy(eng2d, dest, destx, desty--, src, + srcx, srcy++, width, 1); } - } else { - nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy, - width, height); } + + eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); } static void @@ -64,9 +58,9 @@ nv40_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, unsigned height, unsigned value) { struct nv40_context *nv40 = nv40_context(pipe); - struct nouveau_winsys *nvws = nv40->nvws; + struct nv04_surface_2d *eng2d = nv40->screen->eng2d; - nvws->surface_fill(nvws, dest, destx, desty, width, height, value); + eng2d->fill(eng2d, dest, destx, desty, width, height, value); } void diff --git a/src/gallium/winsys/drm/nouveau/common/Makefile b/src/gallium/winsys/drm/nouveau/common/Makefile index 4cd315e289..c6dd6dd7f9 100644 --- a/src/gallium/winsys/drm/nouveau/common/Makefile +++ b/src/gallium/winsys/drm/nouveau/common/Makefile @@ -9,9 +9,7 @@ C_SOURCES = \ nouveau_screen.c \ nouveau_winsys.c \ nouveau_winsys_pipe.c \ - nouveau_winsys_softpipe.c \ - nv04_surface.c - + nouveau_winsys_softpipe.c include ./Makefile.template diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c index 7be3e94d49..d6ae0827cd 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c @@ -11,16 +11,6 @@ static void nouveau_channel_context_destroy(struct nouveau_channel_context *nvc) { - nouveau_grobj_free(&nvc->NvCtxSurf2D); - nouveau_grobj_free(&nvc->NvImageBlit); - nouveau_grobj_free(&nvc->NvGdiRect); - nouveau_grobj_free(&nvc->NvM2MF); - nouveau_grobj_free(&nvc->Nv2D); - nouveau_grobj_free(&nvc->NvSwzSurf); - nouveau_grobj_free(&nvc->NvSIFM); - - nouveau_notifier_free(&nvc->sync_notifier); - nouveau_channel_free(&nvc->channel); FREE(nvc); @@ -43,32 +33,7 @@ nouveau_channel_context_create(struct nouveau_device *dev) return NULL; } - nvc->next_handle = 0x88000000; - - if ((ret = nouveau_notifier_alloc(nvc->channel, nvc->next_handle++, 1, - &nvc->sync_notifier))) { - NOUVEAU_ERR("Error creating channel sync notifier: %d\n", ret); - nouveau_channel_context_destroy(nvc); - return NULL; - } - - switch (dev->chipset & 0xf0) { - case 0x50: - case 0x80: - case 0x90: - /* pipe driver does this */ - break; - default: - ret = nouveau_surface_channel_create_nv04(nvc); - break; - } - - if (ret) { - NOUVEAU_ERR("Error initialising surface objects: %d\n", ret); - nouveau_channel_context_destroy(nvc); - return NULL; - } - + nvc->next_handle = 0x77000000; return nvc; } @@ -164,18 +129,6 @@ nouveau_context_init(struct nouveau_screen *nv_screen, } /* Create pipe */ - switch (dev->chipset & 0xf0) { - case 0x50: - case 0x80: - case 0x90: - /* pipe driver does this */ - break; - default: - if (nouveau_surface_init_nv04(nv)) - return 1; - break; - } - if (!getenv("NOUVEAU_FORCE_SOFTPIPE")) { struct pipe_screen *pscreen; diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h index 66883e85fe..02d2745680 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h @@ -21,22 +21,7 @@ struct nouveau_channel_context { struct pipe_context **pctx; struct nouveau_channel *channel; - - struct nouveau_notifier *sync_notifier; - - /* Common */ - struct nouveau_grobj *NvM2MF; - /* NV04-NV40 */ - struct nouveau_grobj *NvCtxSurf2D; - struct nouveau_grobj *NvSwzSurf; - struct nouveau_grobj *NvImageBlit; - struct nouveau_grobj *NvGdiRect; - struct nouveau_grobj *NvSIFM; - /* G80 */ - struct nouveau_grobj *Nv2D; - - uint32_t next_handle; - uint32_t next_sequence; + unsigned next_handle; }; struct nouveau_context { @@ -53,18 +38,6 @@ struct nouveau_context { /* Hardware context */ struct nouveau_channel_context *nvc; int pctx_id; - - /* pipe_surface accel */ - struct pipe_surface *surf_src, *surf_dst; - unsigned surf_src_offset, surf_dst_offset; - int (*surface_copy_prep)(struct nouveau_context *, - struct pipe_surface *dst, - struct pipe_surface *src); - void (*surface_copy)(struct nouveau_context *, unsigned dx, unsigned dy, - unsigned sx, unsigned sy, unsigned w, unsigned h); - void (*surface_copy_done)(struct nouveau_context *); - int (*surface_fill)(struct nouveau_context *, struct pipe_surface *, - unsigned, unsigned, unsigned, unsigned, unsigned); }; extern int nouveau_context_init(struct nouveau_screen *nv_screen, @@ -76,10 +49,6 @@ extern void nouveau_context_cleanup(struct nouveau_context *nv); extern void LOCK_HARDWARE(struct nouveau_context *); extern void UNLOCK_HARDWARE(struct nouveau_context *); -extern int -nouveau_surface_channel_create_nv04(struct nouveau_channel_context *); -extern int nouveau_surface_init_nv04(struct nouveau_context *); - extern uint32_t *nouveau_pipe_dma_beginp(struct nouveau_grobj *, int, int); extern void nouveau_pipe_dma_kickoff(struct nouveau_channel *); diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c index ef7e8aac54..b6199f8e6d 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c @@ -35,37 +35,12 @@ nouveau_pipe_grobj_alloc(struct nouveau_winsys *nvws, int grclass, return 0; } -static int -nouveau_pipe_surface_copy(struct nouveau_winsys *nvws, struct pipe_surface *dst, - unsigned dx, unsigned dy, struct pipe_surface *src, - unsigned sx, unsigned sy, unsigned w, unsigned h) -{ - struct nouveau_context *nv = nvws->nv; - - if (nv->surface_copy_prep(nv, dst, src)) - return 1; - nv->surface_copy(nv, dx, dy, sx, sy, w, h); - nv->surface_copy_done(nv); - - return 0; -} - -static int -nouveau_pipe_surface_fill(struct nouveau_winsys *nvws, struct pipe_surface *dst, - unsigned dx, unsigned dy, unsigned w, unsigned h, - unsigned value) -{ - if (nvws->nv->surface_fill(nvws->nv, dst, dx, dy, w, h, value)) - return 1; - return 0; -} - static int nouveau_pipe_push_reloc(struct nouveau_winsys *nvws, void *ptr, struct pipe_buffer *buf, uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor) { - struct nouveau_bo *bo = ((struct nouveau_pipe_buffer *)buf)->bo; + struct nouveau_bo *bo = nouveau_pipe_buffer(buf)->bo; return nouveau_pushbuf_emit_reloc(nvws->channel, ptr, bo, data, flags, vor, tor); @@ -84,7 +59,7 @@ nouveau_pipe_push_flush(struct nouveau_winsys *nvws, unsigned size, static struct nouveau_bo * nouveau_pipe_get_bo(struct pipe_buffer *pb) { - return ((struct nouveau_pipe_buffer *)pb)->bo; + return nouveau_pipe_buffer(pb)->bo; } struct pipe_context * @@ -154,9 +129,6 @@ nouveau_pipe_create(struct nouveau_context *nv) nvws->notifier_retval = nouveau_notifier_return_val; nvws->notifier_wait = nouveau_notifier_wait_status; - nvws->surface_copy = nouveau_pipe_surface_copy; - nvws->surface_fill = nouveau_pipe_surface_fill; - nvws->get_bo = nouveau_pipe_get_bo; ws = nouveau_create_pipe_winsys(nv); diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c index c17d8a05e6..881df98556 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c @@ -103,7 +103,7 @@ nouveau_pipe_bo_user_create(struct pipe_winsys *pws, void *ptr, unsigned bytes) static void nouveau_pipe_bo_del(struct pipe_winsys *ws, struct pipe_buffer *buf) { - struct nouveau_pipe_buffer *nvbuf = (void *)buf; + struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf); nouveau_bo_ref(NULL, &nvbuf->bo); FREE(nvbuf); @@ -113,7 +113,7 @@ static void * nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf, unsigned flags) { - struct nouveau_pipe_buffer *nvbuf = (void *)buf; + struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf); uint32_t map_flags = 0; if (flags & PIPE_BUFFER_USAGE_CPU_READ) @@ -146,7 +146,7 @@ nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf, static void nouveau_pipe_bo_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf) { - struct nouveau_pipe_buffer *nvbuf = (void *)buf; + struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf); nouveau_bo_unmap(nvbuf->bo); } diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h index b041a77e38..1eb8043478 100644 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h +++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h @@ -10,15 +10,10 @@ struct nouveau_pipe_buffer { struct nouveau_bo *bo; }; -/* This is so horrible I should be shot - I promise I'll fix it properly - * tomorrow. Just to make the winsys build again however... The TG guys - * don't like to make life easy :) - */ -static inline struct nouveau_pipe_buffer * -nouveau_buffer(struct pipe_surface *ps) +static INLINE struct nouveau_pipe_buffer * +nouveau_pipe_buffer(struct pipe_buffer *buf) { - return *(struct nouveau_pipe_buffer **) - ((void *)ps->texture + sizeof(struct pipe_texture)); + return (struct nouveau_pipe_buffer *)buf; } struct nouveau_pipe_winsys { diff --git a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c b/src/gallium/winsys/drm/nouveau/common/nv04_surface.c deleted file mode 100644 index 214c843782..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c +++ /dev/null @@ -1,458 +0,0 @@ -#include "pipe/p_context.h" -#include "pipe/p_format.h" - -#include "nouveau_context.h" - -static INLINE int log2i(int i) -{ - int r = 0; - - if (i & 0xffff0000) { - i >>= 16; - r += 16; - } - if (i & 0x0000ff00) { - i >>= 8; - r += 8; - } - if (i & 0x000000f0) { - i >>= 4; - r += 4; - } - if (i & 0x0000000c) { - i >>= 2; - r += 2; - } - if (i & 0x00000002) { - r += 1; - } - return r; -} - -static INLINE int -nv04_surface_format(enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_A8_UNORM: - return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8; - case PIPE_FORMAT_R16_SNORM: - case PIPE_FORMAT_R5G6B5_UNORM: - return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5; - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: - return NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8; - case PIPE_FORMAT_Z24S8_UNORM: - return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32; - default: - return -1; - } -} - -static INLINE int -nv04_rect_format(enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_A8_UNORM: - return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; - case PIPE_FORMAT_R5G6B5_UNORM: - return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5; - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; - default: - return -1; - } -} - -static INLINE int -nv04_scaled_image_format(enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_A1R5G5B5_UNORM: - return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5; - case PIPE_FORMAT_A8R8G8B8_UNORM: - return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8; - case PIPE_FORMAT_X8R8G8B8_UNORM: - return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8; - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_R16_SNORM: - return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5; - default: - return -1; - } -} - -static INLINE unsigned -nv04_swizzle_bits(unsigned x, unsigned y) -{ - unsigned u = (x & 0x001) << 0 | - (x & 0x002) << 1 | - (x & 0x004) << 2 | - (x & 0x008) << 3 | - (x & 0x010) << 4 | - (x & 0x020) << 5 | - (x & 0x040) << 6 | - (x & 0x080) << 7 | - (x & 0x100) << 8 | - (x & 0x200) << 9 | - (x & 0x400) << 10 | - (x & 0x800) << 11; - - unsigned v = (y & 0x001) << 1 | - (y & 0x002) << 2 | - (y & 0x004) << 3 | - (y & 0x008) << 4 | - (y & 0x010) << 5 | - (y & 0x020) << 6 | - (y & 0x040) << 7 | - (y & 0x080) << 8 | - (y & 0x100) << 9 | - (y & 0x200) << 10 | - (y & 0x400) << 11 | - (y & 0x800) << 12; - return v | u; -} - -static void -nv04_surface_copy_swizzle(struct nouveau_context *nv, unsigned dx, unsigned dy, - unsigned sx, unsigned sy, unsigned w, unsigned h) -{ - struct nouveau_channel *chan = nv->nvc->channel; - struct pipe_surface *dst = nv->surf_dst; - struct pipe_surface *src = nv->surf_src; - - const unsigned max_w = 1024; - const unsigned max_h = 1024; - const unsigned sub_w = w > max_w ? max_w : w; - const unsigned sub_h = h > max_h ? max_h : h; - unsigned cx = 0; - unsigned cy = 0; - - /* POT or GTFO */ - assert(!(w & (w - 1)) && !(h & (h - 1))); - - BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, 1); - OUT_RELOCo(chan, nouveau_buffer(dst)->bo, - NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); - OUT_RING (chan, nv04_surface_format(dst->format) | - log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | - log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); - - BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1); - OUT_RELOCo(chan, nouveau_buffer(src)->bo, - NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1); - OUT_RING (chan, nv->nvc->NvSwzSurf->handle); - - for (cy = 0; cy < h; cy += sub_h) { - for (cx = 0; cx < w; cx += sub_w) { - BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, nouveau_buffer(dst)->bo, - dst->offset + nv04_swizzle_bits(cx, cy) * dst->block.size, - NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - - BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); - OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE); - OUT_RING (chan, nv04_scaled_image_format(src->format)); - OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY); - OUT_RING (chan, 0); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, 0); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, 1 << 20); - OUT_RING (chan, 1 << 20); - - BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, src->stride | - NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | - NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); - OUT_RELOCl(chan, nouveau_buffer(src)->bo, - src->offset + cy * src->stride + cx * src->block.size, - NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RING (chan, 0); - } - } -} - -static void -nv04_surface_copy_m2mf(struct nouveau_context *nv, unsigned dx, unsigned dy, - unsigned sx, unsigned sy, unsigned w, unsigned h) -{ - struct nouveau_channel *chan = nv->nvc->channel; - struct pipe_surface *dst = nv->surf_dst; - struct pipe_surface *src = nv->surf_src; - unsigned dst_offset, src_offset; - - dst_offset = dst->offset + (dy * dst->stride) + (dx * dst->block.size); - src_offset = src->offset + (sy * src->stride) + (sx * src->block.size); - - while (h) { - int count = (h > 2047) ? 2047 : h; - - BEGIN_RING(chan, nv->nvc->NvM2MF, - NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8); - OUT_RELOCl(chan, nouveau_buffer(src)->bo, src_offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD); - OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst_offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR); - OUT_RING (chan, src->stride); - OUT_RING (chan, dst->stride); - OUT_RING (chan, w * src->block.size); - OUT_RING (chan, count); - OUT_RING (chan, 0x0101); - OUT_RING (chan, 0); - - h -= count; - src_offset += src->stride * count; - dst_offset += dst->stride * count; - } -} - -static void -nv04_surface_copy_blit(struct nouveau_context *nv, unsigned dx, unsigned dy, - unsigned sx, unsigned sy, unsigned w, unsigned h) -{ - struct nouveau_channel *chan = nv->nvc->channel; - - BEGIN_RING(chan, nv->nvc->NvImageBlit, 0x0300, 3); - OUT_RING (chan, (sy << 16) | sx); - OUT_RING (chan, (dy << 16) | dx); - OUT_RING (chan, ( h << 16) | w); -} - -static int -nv04_surface_copy_prep(struct nouveau_context *nv, struct pipe_surface *dst, - struct pipe_surface *src) -{ - struct nouveau_channel *chan = nv->nvc->channel; - int format; - - if (src->format != dst->format) - return 1; - - /* Setup transfer to swizzle the texture to vram if needed */ - /* FIXME/TODO: check proper limits of this operation */ - if (src->texture && dst->texture) { - unsigned int src_linear = src->texture->tex_usage & - NOUVEAU_TEXTURE_USAGE_LINEAR; - unsigned int dst_linear = dst->texture->tex_usage & - NOUVEAU_TEXTURE_USAGE_LINEAR; - if (src_linear ^ dst_linear) { - nv->surface_copy = nv04_surface_copy_swizzle; - nv->surf_dst = dst; - nv->surf_src = src; - return 0; - } - } - - /* NV_CONTEXT_SURFACES_2D has buffer alignment restrictions, fallback - * to NV_MEMORY_TO_MEMORY_FORMAT in this case. - */ - if ((src->offset & 63) || (dst->offset & 63)) { - BEGIN_RING(nv->nvc->channel, nv->nvc->NvM2MF, - NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2); - OUT_RELOCo(chan, nouveau_buffer(src)->bo, - NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RELOCo(chan, nouveau_buffer(dst)->bo, - NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - - nv->surface_copy = nv04_surface_copy_m2mf; - nv->surf_dst = dst; - nv->surf_src = src; - return 0; - - } - - if ((format = nv04_surface_format(dst->format)) < 0) { - NOUVEAU_ERR("Bad surface format 0x%x\n", dst->format); - return 1; - } - nv->surface_copy = nv04_surface_copy_blit; - - BEGIN_RING(chan, nv->nvc->NvCtxSurf2D, - NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); - OUT_RELOCo(chan, nouveau_buffer(src)->bo, - NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RELOCo(chan, nouveau_buffer(dst)->bo, - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - - BEGIN_RING(chan, nv->nvc->NvCtxSurf2D, - NV04_CONTEXT_SURFACES_2D_FORMAT, 4); - OUT_RING (chan, format); - OUT_RING (chan, (dst->stride << 16) | src->stride); - OUT_RELOCl(chan, nouveau_buffer(src)->bo, src->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - - return 0; -} - -static void -nv04_surface_copy_done(struct nouveau_context *nv) -{ - FIRE_RING(nv->nvc->channel); -} - -static int -nv04_surface_fill(struct nouveau_context *nv, struct pipe_surface *dst, - unsigned dx, unsigned dy, unsigned w, unsigned h, - unsigned value) -{ - struct nouveau_channel *chan = nv->nvc->channel; - struct nouveau_grobj *surf2d = nv->nvc->NvCtxSurf2D; - struct nouveau_grobj *rect = nv->nvc->NvGdiRect; - int cs2d_format, gdirect_format; - - if ((cs2d_format = nv04_surface_format(dst->format)) < 0) { - NOUVEAU_ERR("Bad format = %d\n", dst->format); - return 1; - } - - if ((gdirect_format = nv04_rect_format(dst->format)) < 0) { - NOUVEAU_ERR("Bad format = %d\n", dst->format); - return 1; - } - - BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); - OUT_RELOCo(chan, nouveau_buffer(dst)->bo, - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - OUT_RELOCo(chan, nouveau_buffer(dst)->bo, - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_FORMAT, 4); - OUT_RING (chan, cs2d_format); - OUT_RING (chan, (dst->stride << 16) | dst->stride); - OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - OUT_RELOCl(chan, nouveau_buffer(dst)->bo, dst->offset, - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - - BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT, 1); - OUT_RING (chan, gdirect_format); - BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR1_A, 1); - OUT_RING (chan, value); - BEGIN_RING(chan, rect, - NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT(0), 2); - OUT_RING (chan, (dx << 16) | dy); - OUT_RING (chan, ( w << 16) | h); - - FIRE_RING(chan); - return 0; -} - -int -nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc) -{ - struct nouveau_channel *chan = nvc->channel; - unsigned chipset = nvc->channel->device->chipset, class; - int ret; - - if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, 0x39, - &nvc->NvM2MF))) { - NOUVEAU_ERR("Error creating m2mf object: %d\n", ret); - return 1; - } - BEGIN_RING(chan, nvc->NvM2MF, - NV04_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 1); - OUT_RING (chan, nvc->sync_notifier->handle); - - class = chipset < 0x10 ? NV04_CONTEXT_SURFACES_2D : - NV10_CONTEXT_SURFACES_2D; - if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class, - &nvc->NvCtxSurf2D))) { - NOUVEAU_ERR("Error creating 2D surface object: %d\n", ret); - return 1; - } - BEGIN_RING(chan, nvc->NvCtxSurf2D, - NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); - OUT_RING (chan, nvc->channel->vram->handle); - OUT_RING (chan, nvc->channel->vram->handle); - - class = chipset < 0x10 ? NV04_IMAGE_BLIT : NV12_IMAGE_BLIT; - if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class, - &nvc->NvImageBlit))) { - NOUVEAU_ERR("Error creating blit object: %d\n", ret); - return 1; - } - BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_DMA_NOTIFY, 1); - OUT_RING (chan, nvc->sync_notifier->handle); - BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_SURFACE, 1); - OUT_RING (chan, nvc->NvCtxSurf2D->handle); - BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_OPERATION, 1); - OUT_RING (chan, NV04_IMAGE_BLIT_OPERATION_SRCCOPY); - - class = NV04_GDI_RECTANGLE_TEXT; - if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class, - &nvc->NvGdiRect))) { - NOUVEAU_ERR("Error creating rect object: %d\n", ret); - return 1; - } - BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY, 1); - OUT_RING (chan, nvc->sync_notifier->handle); - BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_SURFACE, 1); - OUT_RING (chan, nvc->NvCtxSurf2D->handle); - BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_OPERATION, 1); - OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY); - BEGIN_RING(chan, nvc->NvGdiRect, - NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT, 1); - OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE); - - switch (chipset & 0xf0) { - case 0x00: - case 0x10: - class = NV04_SWIZZLED_SURFACE; - break; - case 0x20: - class = NV20_SWIZZLED_SURFACE; - break; - case 0x30: - class = NV30_SWIZZLED_SURFACE; - break; - case 0x40: - case 0x60: - class = NV40_SWIZZLED_SURFACE; - break; - default: - /* Famous last words: this really can't happen.. */ - assert(0); - break; - } - - ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class, - &nvc->NvSwzSurf); - if (ret) { - NOUVEAU_ERR("Error creating swizzled surface: %d\n", ret); - return 1; - } - - if (chipset < 0x10) { - class = NV04_SCALED_IMAGE_FROM_MEMORY; - } else - if (chipset < 0x40) { - class = NV10_SCALED_IMAGE_FROM_MEMORY; - } else { - class = NV40_SCALED_IMAGE_FROM_MEMORY; - } - - ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class, - &nvc->NvSIFM); - if (ret) { - NOUVEAU_ERR("Error creating scaled image object: %d\n", ret); - return 1; - } - - return 0; -} - -int -nouveau_surface_init_nv04(struct nouveau_context *nv) -{ - nv->surface_copy_prep = nv04_surface_copy_prep; - nv->surface_copy = nv04_surface_copy_blit; - nv->surface_copy_done = nv04_surface_copy_done; - nv->surface_fill = nv04_surface_fill; - return 0; -} - diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c index 450c981ca4..58cb6f7265 100644 --- a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c +++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c @@ -17,6 +17,7 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf, const drm_clip_rect_t *rect) { struct nouveau_context_dri *nv = dPriv->driContextPriv->driverPrivate; + struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id]; drm_clip_rect_t *pbox; int nbox, i; @@ -28,36 +29,18 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf, pbox = dPriv->pClipRects; nbox = dPriv->numClipRects; - if (nv->base.surface_copy_prep) { - nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf); - for (i = 0; i < nbox; i++, pbox++) { - int sx, sy, dx, dy, w, h; - - sx = pbox->x1 - dPriv->x; - sy = pbox->y1 - dPriv->y; - dx = pbox->x1; - dy = pbox->y1; - w = pbox->x2 - pbox->x1; - h = pbox->y2 - pbox->y1; - - nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h); - } - } else { - struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id]; - - for (i = 0; i < nbox; i++, pbox++) { - int sx, sy, dx, dy, w, h; - - sx = pbox->x1 - dPriv->x; - sy = pbox->y1 - dPriv->y; - dx = pbox->x1; - dy = pbox->y1; - w = pbox->x2 - pbox->x1; - h = pbox->y2 - pbox->y1; - - pipe->surface_copy(pipe, FALSE, nv->base.frontbuffer, - dx, dy, surf, sx, sy, w, h); - } + for (i = 0; i < nbox; i++, pbox++) { + int sx, sy, dx, dy, w, h; + + sx = pbox->x1 - dPriv->x; + sy = pbox->y1 - dPriv->y; + dx = pbox->x1; + dy = pbox->y1; + w = pbox->x2 - pbox->x1; + h = pbox->y2 - pbox->y1; + + pipe->surface_copy(pipe, FALSE, nv->base.frontbuffer, + dx, dy, surf, sx, sy, w, h); } FIRE_RING(nv->base.nvc->channel); -- cgit v1.2.3 From 75f0b38d9ea4a7318b0d661712dda15e24707395 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 5 Feb 2009 18:40:38 +1000 Subject: nv50: stop using nouveau_push.h, it's evil --- src/gallium/drivers/nv50/nv50_clear.c | 28 ++++++------ src/gallium/drivers/nv50/nv50_context.c | 2 +- src/gallium/drivers/nv50/nv50_context.h | 4 -- src/gallium/drivers/nv50/nv50_program.c | 23 ++++++---- src/gallium/drivers/nv50/nv50_query.c | 25 ++++++---- src/gallium/drivers/nv50/nv50_vbo.c | 81 +++++++++++++++++++-------------- 6 files changed, 92 insertions(+), 71 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_clear.c b/src/gallium/drivers/nv50/nv50_clear.c index 6380f397ea..f9bc3b53ca 100644 --- a/src/gallium/drivers/nv50/nv50_clear.c +++ b/src/gallium/drivers/nv50/nv50_clear.c @@ -31,6 +31,8 @@ nv50_clear(struct pipe_context *pipe, struct pipe_surface *ps, unsigned clearValue) { struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; struct pipe_framebuffer_state fb, s_fb = nv50->framebuffer; struct pipe_scissor_state sc, s_sc = nv50->scissor; unsigned dirty = nv50->dirty; @@ -59,21 +61,21 @@ nv50_clear(struct pipe_context *pipe, struct pipe_surface *ps, switch (ps->format) { case PIPE_FORMAT_A8R8G8B8_UNORM: - BEGIN_RING(tesla, 0x0d80, 4); - OUT_RINGf (ubyte_to_float((clearValue >> 16) & 0xff)); - OUT_RINGf (ubyte_to_float((clearValue >> 8) & 0xff)); - OUT_RINGf (ubyte_to_float((clearValue >> 0) & 0xff)); - OUT_RINGf (ubyte_to_float((clearValue >> 24) & 0xff)); - BEGIN_RING(tesla, 0x19d0, 1); - OUT_RING (0x3c); + BEGIN_RING(chan, tesla, 0x0d80, 4); + OUT_RINGf (chan, ubyte_to_float((clearValue >> 16) & 0xff)); + OUT_RINGf (chan, ubyte_to_float((clearValue >> 8) & 0xff)); + OUT_RINGf (chan, ubyte_to_float((clearValue >> 0) & 0xff)); + OUT_RINGf (chan, ubyte_to_float((clearValue >> 24) & 0xff)); + BEGIN_RING(chan, tesla, 0x19d0, 1); + OUT_RING (chan, 0x3c); break; case PIPE_FORMAT_Z24S8_UNORM: - BEGIN_RING(tesla, 0x0d90, 1); - OUT_RINGf ((float)(clearValue >> 8) * (1.0 / 16777215.0)); - BEGIN_RING(tesla, 0x0da0, 1); - OUT_RING (clearValue & 0xff); - BEGIN_RING(tesla, 0x19d0, 1); - OUT_RING (0x03); + BEGIN_RING(chan, tesla, 0x0d90, 1); + OUT_RINGf (chan, (float)(clearValue >> 8) * (1.0 / 16777215.0)); + BEGIN_RING(chan, tesla, 0x0da0, 1); + OUT_RING (chan, clearValue & 0xff); + BEGIN_RING(chan, tesla, 0x19d0, 1); + OUT_RING (chan, 0x03); break; default: pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index 99776239d2..565a5da668 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -33,7 +33,7 @@ nv50_flush(struct pipe_context *pipe, unsigned flags, { struct nv50_context *nv50 = (struct nv50_context *)pipe; - FIRE_RING(fence); + FIRE_RING(nv50->screen->nvws->channel); } static void diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 6c9e18429a..6a11572590 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -15,10 +15,6 @@ #include "nouveau/nouveau_gldefs.h" #include "nouveau/nouveau_stateobj.h" -#define NOUVEAU_PUSH_CONTEXT(ctx) \ - struct nv50_screen *ctx = nv50->screen -#include "nouveau/nouveau_push.h" - #include "nv50_screen.h" #include "nv50_program.h" diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index b902c8cf53..14c5d47e79 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -1545,13 +1545,16 @@ static void nv50_program_upload_data(struct nv50_context *nv50, float *map, unsigned start, unsigned count) { + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; + while (count) { unsigned nr = count > 2047 ? 2047 : count; - BEGIN_RING(tesla, 0x00000f00, 1); - OUT_RING ((NV50_CB_PMISC << 0) | (start << 8)); - BEGIN_RING(tesla, 0x40000f04, nr); - OUT_RINGp (map, nr); + BEGIN_RING(chan, tesla, 0x00000f00, 1); + OUT_RING (chan, (NV50_CB_PMISC << 0) | (start << 8)); + BEGIN_RING(chan, tesla, 0x40000f04, nr); + OUT_RINGp (chan, map, nr); map += nr; start += nr; @@ -1598,6 +1601,8 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p) static void nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p) { + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; struct pipe_winsys *ws = nv50->pipe.winsys; struct nv50_program_exec *e; struct nouveau_stateobj *so; @@ -1664,14 +1669,14 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p) nr = MIN2(count, 2047); nr = MIN2(nvws->channel->pushbuf->remaining, nr); if (nvws->channel->pushbuf->remaining < (nr + 3)) { - FIRE_RING(NULL); + FIRE_RING(chan); continue; } - BEGIN_RING(tesla, 0x0f00, 1); - OUT_RING ((start << 8) | NV50_CB_PUPLOAD); - BEGIN_RING(tesla, 0x40000f04, nr); - OUT_RINGp (up + start, nr); + BEGIN_RING(chan, tesla, 0x0f00, 1); + OUT_RING (chan, (start << 8) | NV50_CB_PUPLOAD); + BEGIN_RING(chan, tesla, 0x40000f04, nr); + OUT_RINGp (chan, up + start, nr); start += nr; count -= nr; diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c index 1b3a41340a..20745ceab8 100644 --- a/src/gallium/drivers/nv50/nv50_query.c +++ b/src/gallium/drivers/nv50/nv50_query.c @@ -71,12 +71,14 @@ static void nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq) { struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; struct nv50_query *q = nv50_query(pq); - BEGIN_RING(tesla, 0x1530, 1); - OUT_RING (1); - BEGIN_RING(tesla, 0x1514, 1); - OUT_RING (1); + BEGIN_RING(chan, tesla, 0x1530, 1); + OUT_RING (chan, 1); + BEGIN_RING(chan, tesla, 0x1514, 1); + OUT_RING (chan, 1); q->ready = FALSE; } @@ -85,14 +87,17 @@ static void nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq) { struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; struct nv50_query *q = nv50_query(pq); - BEGIN_RING(tesla, 0x1b00, 4); - OUT_RELOCh(q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - OUT_RELOCl(q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - OUT_RING (0x00000000); - OUT_RING (0x0100f002); - FIRE_RING (NULL); + WAIT_RING (chan, 5); + BEGIN_RING(chan, tesla, 0x1b00, 4); + OUT_RELOCh(chan, q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + OUT_RELOCl(chan, q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + OUT_RING (chan, 0x00000000); + OUT_RING (chan, 0x0100f002); + FIRE_RING (chan); } static boolean diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index c482a4c241..0c970adb03 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -53,25 +53,27 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, unsigned count) { struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; nv50_state_validate(nv50); - BEGIN_RING(tesla, 0x142c, 1); - OUT_RING (0); - BEGIN_RING(tesla, 0x142c, 1); - OUT_RING (0); - BEGIN_RING(tesla, 0x1440, 1); - OUT_RING (0); - BEGIN_RING(tesla, 0x1334, 1); - OUT_RING (0); - - BEGIN_RING(tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (nv50_prim(mode)); - BEGIN_RING(tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); - OUT_RING (start); - OUT_RING (count); - BEGIN_RING(tesla, NV50TCL_VERTEX_END, 1); - OUT_RING (0); + BEGIN_RING(chan, tesla, 0x142c, 1); + OUT_RING (chan, 0); + BEGIN_RING(chan, tesla, 0x142c, 1); + OUT_RING (chan, 0); + BEGIN_RING(chan, tesla, 0x1440, 1); + OUT_RING (chan, 0); + BEGIN_RING(chan, tesla, 0x1334, 1); + OUT_RING (chan, 0); + + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); + OUT_RING (chan, nv50_prim(mode)); + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); + OUT_RING (chan, start); + OUT_RING (chan, count); + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); + OUT_RING (chan, 0); pipe->flush(pipe, 0, NULL); return TRUE; @@ -81,11 +83,14 @@ static INLINE void nv50_draw_elements_inline_u08(struct nv50_context *nv50, uint8_t *map, unsigned start, unsigned count) { + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; + map += start; if (count & 1) { - BEGIN_RING(tesla, 0x15e8, 1); - OUT_RING (map[0]); + BEGIN_RING(chan, tesla, 0x15e8, 1); + OUT_RING (chan, map[0]); map++; count--; } @@ -94,9 +99,9 @@ nv50_draw_elements_inline_u08(struct nv50_context *nv50, uint8_t *map, unsigned nr = count > 2046 ? 2046 : count; int i; - BEGIN_RING(tesla, 0x400015f0, nr >> 1); + BEGIN_RING(chan, tesla, 0x400015f0, nr >> 1); for (i = 0; i < nr; i += 2) - OUT_RING ((map[1] << 16) | map[0]); + OUT_RING (chan, (map[1] << 16) | map[0]); count -= nr; map += nr; @@ -107,11 +112,14 @@ static INLINE void nv50_draw_elements_inline_u16(struct nv50_context *nv50, uint16_t *map, unsigned start, unsigned count) { + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; + map += start; if (count & 1) { - BEGIN_RING(tesla, 0x15e8, 1); - OUT_RING (map[0]); + BEGIN_RING(chan, tesla, 0x15e8, 1); + OUT_RING (chan, map[0]); map++; count--; } @@ -120,9 +128,9 @@ nv50_draw_elements_inline_u16(struct nv50_context *nv50, uint16_t *map, unsigned nr = count > 2046 ? 2046 : count; int i; - BEGIN_RING(tesla, 0x400015f0, nr >> 1); + BEGIN_RING(chan, tesla, 0x400015f0, nr >> 1); for (i = 0; i < nr; i += 2) - OUT_RING ((map[1] << 16) | map[0]); + OUT_RING (chan, (map[1] << 16) | map[0]); count -= nr; map += nr; @@ -133,13 +141,16 @@ static INLINE void nv50_draw_elements_inline_u32(struct nv50_context *nv50, uint8_t *map, unsigned start, unsigned count) { + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; + map += start; while (count) { unsigned nr = count > 2047 ? 2047 : count; - BEGIN_RING(tesla, 0x400015e8, nr); - OUT_RINGp (map, nr); + BEGIN_RING(chan, tesla, 0x400015e8, nr); + OUT_RINGp (chan, map, nr); count -= nr; map += nr; @@ -152,18 +163,20 @@ nv50_draw_elements(struct pipe_context *pipe, unsigned mode, unsigned start, unsigned count) { struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_channel *chan = nv50->screen->nvws->channel; + struct nouveau_grobj *tesla = nv50->screen->tesla; struct pipe_winsys *ws = pipe->winsys; void *map = ws->buffer_map(ws, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ); nv50_state_validate(nv50); - BEGIN_RING(tesla, 0x142c, 1); - OUT_RING (0); - BEGIN_RING(tesla, 0x142c, 1); - OUT_RING (0); + BEGIN_RING(chan, tesla, 0x142c, 1); + OUT_RING (chan, 0); + BEGIN_RING(chan, tesla, 0x142c, 1); + OUT_RING (chan, 0); - BEGIN_RING(tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (nv50_prim(mode)); + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); + OUT_RING (chan, nv50_prim(mode)); switch (indexSize) { case 1: nv50_draw_elements_inline_u08(nv50, map, start, count); @@ -177,8 +190,8 @@ nv50_draw_elements(struct pipe_context *pipe, default: assert(0); } - BEGIN_RING(tesla, NV50TCL_VERTEX_END, 1); - OUT_RING (0); + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); + OUT_RING (chan, 0); pipe->flush(pipe, 0, NULL); return TRUE; -- cgit v1.2.3 From 0703b2e9ad9ef9d05f7ba53b93dba780ad34b47d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Feb 2009 08:16:56 -0700 Subject: gallium: move 'struct pipe_winsys' Not used in p_state.h but used in p_context.h and p_screen.h --- src/gallium/include/pipe/p_context.h | 1 + src/gallium/include/pipe/p_screen.h | 2 ++ src/gallium/include/pipe/p_state.h | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 166c6b6b7e..9454cc87db 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -40,6 +40,7 @@ struct pipe_screen; struct pipe_fence_handle; struct pipe_state_cache; struct pipe_query; +struct pipe_winsys; /** diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 0bd7d12e22..64ab71ce43 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -50,6 +50,8 @@ extern "C" { /** Opaque type */ struct pipe_fence_handle; +struct pipe_winsys; + /** * Gallium screen/adapter context. Basically everything diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index dd0dfac238..9dc541630c 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -66,7 +66,6 @@ extern "C" { /* fwd decls */ struct pipe_screen; struct pipe_surface; -struct pipe_winsys; -- cgit v1.2.3 From 099e9d20f0e8f5ee108e4fbb4bf7cae97b5f9a4a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Feb 2009 08:23:00 -0700 Subject: gallium: fixup #includes: p_screen.h does not need anything in p_state.h --- src/gallium/include/pipe/p_screen.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 64ab71ce43..17d1548253 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -39,7 +39,8 @@ #include "pipe/p_compiler.h" -#include "pipe/p_state.h" +#include "pipe/p_format.h" +#include "pipe/p_defines.h" @@ -51,6 +52,7 @@ extern "C" { /** Opaque type */ struct pipe_fence_handle; struct pipe_winsys; +struct pipe_buffer; /** -- cgit v1.2.3 From 3120894c6d33a26cda642246344e8945db200ac2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 5 Feb 2009 14:44:17 +0000 Subject: gallium: add new aux lib for index list translations Could this be the ultimate index list translating utility? Maybe, but it doesn't yet include support for splitting primitives. Unlike previous attempts, this captures all possible combinations of API and hardware provoking vertex, supports generated list reuse and various other tricks. Relies on python-generated code. --- configs/default | 2 +- src/gallium/SConscript | 1 + src/gallium/auxiliary/indices/Makefile | 16 + src/gallium/auxiliary/indices/SConscript | 17 + src/gallium/auxiliary/indices/u_indices.c | 253 ++ src/gallium/auxiliary/indices/u_indices.h | 83 + src/gallium/auxiliary/indices/u_indices_gen.c | 5129 ++++++++++++++++++++++++ src/gallium/auxiliary/indices/u_indices_gen.py | 318 ++ src/gallium/auxiliary/indices/u_indices_priv.h | 43 + 9 files changed, 5861 insertions(+), 1 deletion(-) create mode 100644 src/gallium/auxiliary/indices/Makefile create mode 100644 src/gallium/auxiliary/indices/SConscript create mode 100644 src/gallium/auxiliary/indices/u_indices.c create mode 100644 src/gallium/auxiliary/indices/u_indices.h create mode 100644 src/gallium/auxiliary/indices/u_indices_gen.c create mode 100644 src/gallium/auxiliary/indices/u_indices_gen.py create mode 100644 src/gallium/auxiliary/indices/u_indices_priv.h (limited to 'src') diff --git a/configs/default b/configs/default index 40f3a2a02d..13bda58f18 100644 --- a/configs/default +++ b/configs/default @@ -89,7 +89,7 @@ PROGRAM_DIRS = demos redbook samples glsl xdemos EGL_DRIVERS_DIRS = demo # Gallium directories and -GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util +GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util indices GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a) GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv04 nv10 nv20 nv30 nv40 nv50 failover trace GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 85baf51a7f..0c632ac2b8 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -21,6 +21,7 @@ SConscript([ 'auxiliary/translate/SConscript', 'auxiliary/draw/SConscript', 'auxiliary/pipebuffer/SConscript', + 'auxiliary/indices/SConscript', ]) for driver in env['drivers']: diff --git a/src/gallium/auxiliary/indices/Makefile b/src/gallium/auxiliary/indices/Makefile new file mode 100644 index 0000000000..8fa61d265e --- /dev/null +++ b/src/gallium/auxiliary/indices/Makefile @@ -0,0 +1,16 @@ +TOP = ../../../.. +include $(TOP)/configs/current + +LIBNAME = indices + +C_SOURCES = \ + u_indices_gen.c + +include ../../Makefile.template + +u_indices_gen.c: u_indices_gen.py + python $< > $@ + + +symlinks: + diff --git a/src/gallium/auxiliary/indices/SConscript b/src/gallium/auxiliary/indices/SConscript new file mode 100644 index 0000000000..65a43a9f64 --- /dev/null +++ b/src/gallium/auxiliary/indices/SConscript @@ -0,0 +1,17 @@ +Import('*') + +env.CodeGenerate( + target = 'u_indices_gen.c', + script = 'u_indices_gen.py', + source = [], + command = 'python $SCRIPT > $TARGET' +) + +indices = env.ConvenienceLibrary( + target = 'indices', + source = [ +# 'u_indices.c', + 'u_indices_gen.c', + ]) + +auxiliaries.insert(0, indices) diff --git a/src/gallium/auxiliary/indices/u_indices.c b/src/gallium/auxiliary/indices/u_indices.c new file mode 100644 index 0000000000..0cf7d88653 --- /dev/null +++ b/src/gallium/auxiliary/indices/u_indices.c @@ -0,0 +1,253 @@ +/* + * Copyright 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"), + * 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 + * VMWARE 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 "u_indices.h" +#include "u_indices_priv.h" + +static void translate_memcpy_ushort( const void *in, + unsigned nr, + void *out ) +{ + memcpy(out, in, nr*sizeof(short)); +} + +static void translate_memcpy_uint( const void *in, + unsigned nr, + void *out ) +{ + memcpy(out, in, nr*sizeof(int)); +} + + +int u_index_translator( unsigned hw_mask, + unsigned prim, + unsigned in_index_size, + unsigned nr, + unsigned in_pv, + unsigned out_pv, + unsigned *out_prim, + unsigned *out_index_size, + unsigned *out_nr, + u_translate_func *out_translate ) +{ + unsigned in_idx; + unsigned out_idx; + int ret = U_TRANSLATE_NORMAL; + + u_index_init(); + + in_idx = in_size_idx(in_index_size); + *out_index_size = (in_index_size == 4) ? 4 : 2; + out_idx = out_size_idx(*out_index_size); + + if ((hw_mask & (1< 0xfffe) ? 4 : 2; + out_idx = out_size_idx(*out_index_size); + + if ((hw_mask & (1< Date: Thu, 5 Feb 2009 16:04:13 +0000 Subject: indices: quad fixes --- src/gallium/auxiliary/indices/u_indices_gen.c | 256 ++++++++++++------------- src/gallium/auxiliary/indices/u_indices_gen.py | 9 +- 2 files changed, 133 insertions(+), 132 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/indices/u_indices_gen.c b/src/gallium/auxiliary/indices/u_indices_gen.c index 00b99804f2..01953c3244 100644 --- a/src/gallium/auxiliary/indices/u_indices_gen.c +++ b/src/gallium/auxiliary/indices/u_indices_gen.c @@ -176,11 +176,11 @@ static void generate_quadstrip_ushort_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)(i+0); - (out+j+0)[1] = (ushort)(i+1); + (out+j+0)[0] = (ushort)(i+2); + (out+j+0)[1] = (ushort)(i+0); (out+j+0)[2] = (ushort)(i+3); - (out+j+3)[0] = (ushort)(i+1); - (out+j+3)[1] = (ushort)(i+2); + (out+j+3)[0] = (ushort)(i+0); + (out+j+3)[1] = (ushort)(i+1); (out+j+3)[2] = (ushort)(i+3); } } @@ -309,12 +309,12 @@ static void generate_quadstrip_ushort_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)(i+1); + (out+j+0)[0] = (ushort)(i+0); (out+j+0)[1] = (ushort)(i+3); - (out+j+0)[2] = (ushort)(i+0); - (out+j+3)[0] = (ushort)(i+2); + (out+j+0)[2] = (ushort)(i+2); + (out+j+3)[0] = (ushort)(i+1); (out+j+3)[1] = (ushort)(i+3); - (out+j+3)[2] = (ushort)(i+1); + (out+j+3)[2] = (ushort)(i+0); } } static void generate_polygon_ushort_first2last( @@ -443,11 +443,11 @@ static void generate_quadstrip_ushort_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (ushort)(i+3); - (out+j+0)[1] = (ushort)(i+0); - (out+j+0)[2] = (ushort)(i+1); + (out+j+0)[1] = (ushort)(i+2); + (out+j+0)[2] = (ushort)(i+0); (out+j+3)[0] = (ushort)(i+3); - (out+j+3)[1] = (ushort)(i+1); - (out+j+3)[2] = (ushort)(i+2); + (out+j+3)[1] = (ushort)(i+0); + (out+j+3)[2] = (ushort)(i+1); } } static void generate_polygon_ushort_last2first( @@ -575,11 +575,11 @@ static void generate_quadstrip_ushort_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)(i+0); - (out+j+0)[1] = (ushort)(i+1); + (out+j+0)[0] = (ushort)(i+2); + (out+j+0)[1] = (ushort)(i+0); (out+j+0)[2] = (ushort)(i+3); - (out+j+3)[0] = (ushort)(i+1); - (out+j+3)[1] = (ushort)(i+2); + (out+j+3)[0] = (ushort)(i+0); + (out+j+3)[1] = (ushort)(i+1); (out+j+3)[2] = (ushort)(i+3); } } @@ -708,11 +708,11 @@ static void generate_quadstrip_uint_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)(i+0); - (out+j+0)[1] = (uint)(i+1); + (out+j+0)[0] = (uint)(i+2); + (out+j+0)[1] = (uint)(i+0); (out+j+0)[2] = (uint)(i+3); - (out+j+3)[0] = (uint)(i+1); - (out+j+3)[1] = (uint)(i+2); + (out+j+3)[0] = (uint)(i+0); + (out+j+3)[1] = (uint)(i+1); (out+j+3)[2] = (uint)(i+3); } } @@ -841,12 +841,12 @@ static void generate_quadstrip_uint_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)(i+1); + (out+j+0)[0] = (uint)(i+0); (out+j+0)[1] = (uint)(i+3); - (out+j+0)[2] = (uint)(i+0); - (out+j+3)[0] = (uint)(i+2); + (out+j+0)[2] = (uint)(i+2); + (out+j+3)[0] = (uint)(i+1); (out+j+3)[1] = (uint)(i+3); - (out+j+3)[2] = (uint)(i+1); + (out+j+3)[2] = (uint)(i+0); } } static void generate_polygon_uint_first2last( @@ -975,11 +975,11 @@ static void generate_quadstrip_uint_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (uint)(i+3); - (out+j+0)[1] = (uint)(i+0); - (out+j+0)[2] = (uint)(i+1); + (out+j+0)[1] = (uint)(i+2); + (out+j+0)[2] = (uint)(i+0); (out+j+3)[0] = (uint)(i+3); - (out+j+3)[1] = (uint)(i+1); - (out+j+3)[2] = (uint)(i+2); + (out+j+3)[1] = (uint)(i+0); + (out+j+3)[2] = (uint)(i+1); } } static void generate_polygon_uint_last2first( @@ -1107,11 +1107,11 @@ static void generate_quadstrip_uint_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)(i+0); - (out+j+0)[1] = (uint)(i+1); + (out+j+0)[0] = (uint)(i+2); + (out+j+0)[1] = (uint)(i+0); (out+j+0)[2] = (uint)(i+3); - (out+j+3)[0] = (uint)(i+1); - (out+j+3)[1] = (uint)(i+2); + (out+j+3)[0] = (uint)(i+0); + (out+j+3)[1] = (uint)(i+1); (out+j+3)[2] = (uint)(i+3); } } @@ -1258,11 +1258,11 @@ static void translate_quadstrip_ubyte2ushort_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+0]; - (out+j+0)[1] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+2]; + (out+j+0)[1] = (ushort)in[i+0]; (out+j+0)[2] = (ushort)in[i+3]; - (out+j+3)[0] = (ushort)in[i+1]; - (out+j+3)[1] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+0]; + (out+j+3)[1] = (ushort)in[i+1]; (out+j+3)[2] = (ushort)in[i+3]; } } @@ -1411,12 +1411,12 @@ static void translate_quadstrip_ubyte2ushort_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+0]; (out+j+0)[1] = (ushort)in[i+3]; - (out+j+0)[2] = (ushort)in[i+0]; - (out+j+3)[0] = (ushort)in[i+2]; + (out+j+0)[2] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+1]; (out+j+3)[1] = (ushort)in[i+3]; - (out+j+3)[2] = (ushort)in[i+1]; + (out+j+3)[2] = (ushort)in[i+0]; } } static void translate_polygon_ubyte2ushort_first2last( @@ -1565,11 +1565,11 @@ static void translate_quadstrip_ubyte2ushort_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (ushort)in[i+3]; - (out+j+0)[1] = (ushort)in[i+0]; - (out+j+0)[2] = (ushort)in[i+1]; + (out+j+0)[1] = (ushort)in[i+2]; + (out+j+0)[2] = (ushort)in[i+0]; (out+j+3)[0] = (ushort)in[i+3]; - (out+j+3)[1] = (ushort)in[i+1]; - (out+j+3)[2] = (ushort)in[i+2]; + (out+j+3)[1] = (ushort)in[i+0]; + (out+j+3)[2] = (ushort)in[i+1]; } } static void translate_polygon_ubyte2ushort_last2first( @@ -1717,11 +1717,11 @@ static void translate_quadstrip_ubyte2ushort_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+0]; - (out+j+0)[1] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+2]; + (out+j+0)[1] = (ushort)in[i+0]; (out+j+0)[2] = (ushort)in[i+3]; - (out+j+3)[0] = (ushort)in[i+1]; - (out+j+3)[1] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+0]; + (out+j+3)[1] = (ushort)in[i+1]; (out+j+3)[2] = (ushort)in[i+3]; } } @@ -1870,11 +1870,11 @@ static void translate_quadstrip_ubyte2uint_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+0]; - (out+j+0)[1] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+2]; + (out+j+0)[1] = (uint)in[i+0]; (out+j+0)[2] = (uint)in[i+3]; - (out+j+3)[0] = (uint)in[i+1]; - (out+j+3)[1] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+0]; + (out+j+3)[1] = (uint)in[i+1]; (out+j+3)[2] = (uint)in[i+3]; } } @@ -2023,12 +2023,12 @@ static void translate_quadstrip_ubyte2uint_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+0]; (out+j+0)[1] = (uint)in[i+3]; - (out+j+0)[2] = (uint)in[i+0]; - (out+j+3)[0] = (uint)in[i+2]; + (out+j+0)[2] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+1]; (out+j+3)[1] = (uint)in[i+3]; - (out+j+3)[2] = (uint)in[i+1]; + (out+j+3)[2] = (uint)in[i+0]; } } static void translate_polygon_ubyte2uint_first2last( @@ -2177,11 +2177,11 @@ static void translate_quadstrip_ubyte2uint_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (uint)in[i+3]; - (out+j+0)[1] = (uint)in[i+0]; - (out+j+0)[2] = (uint)in[i+1]; + (out+j+0)[1] = (uint)in[i+2]; + (out+j+0)[2] = (uint)in[i+0]; (out+j+3)[0] = (uint)in[i+3]; - (out+j+3)[1] = (uint)in[i+1]; - (out+j+3)[2] = (uint)in[i+2]; + (out+j+3)[1] = (uint)in[i+0]; + (out+j+3)[2] = (uint)in[i+1]; } } static void translate_polygon_ubyte2uint_last2first( @@ -2329,11 +2329,11 @@ static void translate_quadstrip_ubyte2uint_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+0]; - (out+j+0)[1] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+2]; + (out+j+0)[1] = (uint)in[i+0]; (out+j+0)[2] = (uint)in[i+3]; - (out+j+3)[0] = (uint)in[i+1]; - (out+j+3)[1] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+0]; + (out+j+3)[1] = (uint)in[i+1]; (out+j+3)[2] = (uint)in[i+3]; } } @@ -2482,11 +2482,11 @@ static void translate_quadstrip_ushort2ushort_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+0]; - (out+j+0)[1] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+2]; + (out+j+0)[1] = (ushort)in[i+0]; (out+j+0)[2] = (ushort)in[i+3]; - (out+j+3)[0] = (ushort)in[i+1]; - (out+j+3)[1] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+0]; + (out+j+3)[1] = (ushort)in[i+1]; (out+j+3)[2] = (ushort)in[i+3]; } } @@ -2635,12 +2635,12 @@ static void translate_quadstrip_ushort2ushort_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+0]; (out+j+0)[1] = (ushort)in[i+3]; - (out+j+0)[2] = (ushort)in[i+0]; - (out+j+3)[0] = (ushort)in[i+2]; + (out+j+0)[2] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+1]; (out+j+3)[1] = (ushort)in[i+3]; - (out+j+3)[2] = (ushort)in[i+1]; + (out+j+3)[2] = (ushort)in[i+0]; } } static void translate_polygon_ushort2ushort_first2last( @@ -2789,11 +2789,11 @@ static void translate_quadstrip_ushort2ushort_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (ushort)in[i+3]; - (out+j+0)[1] = (ushort)in[i+0]; - (out+j+0)[2] = (ushort)in[i+1]; + (out+j+0)[1] = (ushort)in[i+2]; + (out+j+0)[2] = (ushort)in[i+0]; (out+j+3)[0] = (ushort)in[i+3]; - (out+j+3)[1] = (ushort)in[i+1]; - (out+j+3)[2] = (ushort)in[i+2]; + (out+j+3)[1] = (ushort)in[i+0]; + (out+j+3)[2] = (ushort)in[i+1]; } } static void translate_polygon_ushort2ushort_last2first( @@ -2941,11 +2941,11 @@ static void translate_quadstrip_ushort2ushort_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+0]; - (out+j+0)[1] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+2]; + (out+j+0)[1] = (ushort)in[i+0]; (out+j+0)[2] = (ushort)in[i+3]; - (out+j+3)[0] = (ushort)in[i+1]; - (out+j+3)[1] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+0]; + (out+j+3)[1] = (ushort)in[i+1]; (out+j+3)[2] = (ushort)in[i+3]; } } @@ -3094,11 +3094,11 @@ static void translate_quadstrip_ushort2uint_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+0]; - (out+j+0)[1] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+2]; + (out+j+0)[1] = (uint)in[i+0]; (out+j+0)[2] = (uint)in[i+3]; - (out+j+3)[0] = (uint)in[i+1]; - (out+j+3)[1] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+0]; + (out+j+3)[1] = (uint)in[i+1]; (out+j+3)[2] = (uint)in[i+3]; } } @@ -3247,12 +3247,12 @@ static void translate_quadstrip_ushort2uint_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+0]; (out+j+0)[1] = (uint)in[i+3]; - (out+j+0)[2] = (uint)in[i+0]; - (out+j+3)[0] = (uint)in[i+2]; + (out+j+0)[2] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+1]; (out+j+3)[1] = (uint)in[i+3]; - (out+j+3)[2] = (uint)in[i+1]; + (out+j+3)[2] = (uint)in[i+0]; } } static void translate_polygon_ushort2uint_first2last( @@ -3401,11 +3401,11 @@ static void translate_quadstrip_ushort2uint_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (uint)in[i+3]; - (out+j+0)[1] = (uint)in[i+0]; - (out+j+0)[2] = (uint)in[i+1]; + (out+j+0)[1] = (uint)in[i+2]; + (out+j+0)[2] = (uint)in[i+0]; (out+j+3)[0] = (uint)in[i+3]; - (out+j+3)[1] = (uint)in[i+1]; - (out+j+3)[2] = (uint)in[i+2]; + (out+j+3)[1] = (uint)in[i+0]; + (out+j+3)[2] = (uint)in[i+1]; } } static void translate_polygon_ushort2uint_last2first( @@ -3553,11 +3553,11 @@ static void translate_quadstrip_ushort2uint_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+0]; - (out+j+0)[1] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+2]; + (out+j+0)[1] = (uint)in[i+0]; (out+j+0)[2] = (uint)in[i+3]; - (out+j+3)[0] = (uint)in[i+1]; - (out+j+3)[1] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+0]; + (out+j+3)[1] = (uint)in[i+1]; (out+j+3)[2] = (uint)in[i+3]; } } @@ -3706,11 +3706,11 @@ static void translate_quadstrip_uint2ushort_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+0]; - (out+j+0)[1] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+2]; + (out+j+0)[1] = (ushort)in[i+0]; (out+j+0)[2] = (ushort)in[i+3]; - (out+j+3)[0] = (ushort)in[i+1]; - (out+j+3)[1] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+0]; + (out+j+3)[1] = (ushort)in[i+1]; (out+j+3)[2] = (ushort)in[i+3]; } } @@ -3859,12 +3859,12 @@ static void translate_quadstrip_uint2ushort_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+0]; (out+j+0)[1] = (ushort)in[i+3]; - (out+j+0)[2] = (ushort)in[i+0]; - (out+j+3)[0] = (ushort)in[i+2]; + (out+j+0)[2] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+1]; (out+j+3)[1] = (ushort)in[i+3]; - (out+j+3)[2] = (ushort)in[i+1]; + (out+j+3)[2] = (ushort)in[i+0]; } } static void translate_polygon_uint2ushort_first2last( @@ -4013,11 +4013,11 @@ static void translate_quadstrip_uint2ushort_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (ushort)in[i+3]; - (out+j+0)[1] = (ushort)in[i+0]; - (out+j+0)[2] = (ushort)in[i+1]; + (out+j+0)[1] = (ushort)in[i+2]; + (out+j+0)[2] = (ushort)in[i+0]; (out+j+3)[0] = (ushort)in[i+3]; - (out+j+3)[1] = (ushort)in[i+1]; - (out+j+3)[2] = (ushort)in[i+2]; + (out+j+3)[1] = (ushort)in[i+0]; + (out+j+3)[2] = (ushort)in[i+1]; } } static void translate_polygon_uint2ushort_last2first( @@ -4165,11 +4165,11 @@ static void translate_quadstrip_uint2ushort_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (ushort)in[i+0]; - (out+j+0)[1] = (ushort)in[i+1]; + (out+j+0)[0] = (ushort)in[i+2]; + (out+j+0)[1] = (ushort)in[i+0]; (out+j+0)[2] = (ushort)in[i+3]; - (out+j+3)[0] = (ushort)in[i+1]; - (out+j+3)[1] = (ushort)in[i+2]; + (out+j+3)[0] = (ushort)in[i+0]; + (out+j+3)[1] = (ushort)in[i+1]; (out+j+3)[2] = (ushort)in[i+3]; } } @@ -4318,11 +4318,11 @@ static void translate_quadstrip_uint2uint_first2first( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+0]; - (out+j+0)[1] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+2]; + (out+j+0)[1] = (uint)in[i+0]; (out+j+0)[2] = (uint)in[i+3]; - (out+j+3)[0] = (uint)in[i+1]; - (out+j+3)[1] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+0]; + (out+j+3)[1] = (uint)in[i+1]; (out+j+3)[2] = (uint)in[i+3]; } } @@ -4471,12 +4471,12 @@ static void translate_quadstrip_uint2uint_first2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+0]; (out+j+0)[1] = (uint)in[i+3]; - (out+j+0)[2] = (uint)in[i+0]; - (out+j+3)[0] = (uint)in[i+2]; + (out+j+0)[2] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+1]; (out+j+3)[1] = (uint)in[i+3]; - (out+j+3)[2] = (uint)in[i+1]; + (out+j+3)[2] = (uint)in[i+0]; } } static void translate_polygon_uint2uint_first2last( @@ -4625,11 +4625,11 @@ static void translate_quadstrip_uint2uint_last2first( (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { (out+j+0)[0] = (uint)in[i+3]; - (out+j+0)[1] = (uint)in[i+0]; - (out+j+0)[2] = (uint)in[i+1]; + (out+j+0)[1] = (uint)in[i+2]; + (out+j+0)[2] = (uint)in[i+0]; (out+j+3)[0] = (uint)in[i+3]; - (out+j+3)[1] = (uint)in[i+1]; - (out+j+3)[2] = (uint)in[i+2]; + (out+j+3)[1] = (uint)in[i+0]; + (out+j+3)[2] = (uint)in[i+1]; } } static void translate_polygon_uint2uint_last2first( @@ -4777,11 +4777,11 @@ static void translate_quadstrip_uint2uint_last2last( unsigned i, j; (void)j; for (j = i = 0; j < nr; j+=6, i+=2) { - (out+j+0)[0] = (uint)in[i+0]; - (out+j+0)[1] = (uint)in[i+1]; + (out+j+0)[0] = (uint)in[i+2]; + (out+j+0)[1] = (uint)in[i+0]; (out+j+0)[2] = (uint)in[i+3]; - (out+j+3)[0] = (uint)in[i+1]; - (out+j+3)[1] = (uint)in[i+2]; + (out+j+3)[0] = (uint)in[i+0]; + (out+j+3)[1] = (uint)in[i+1]; (out+j+3)[2] = (uint)in[i+3]; } } diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py index 397eea306b..40b047bb58 100644 --- a/src/gallium/auxiliary/indices/u_indices_gen.py +++ b/src/gallium/auxiliary/indices/u_indices_gen.py @@ -139,6 +139,9 @@ def do_tri( intype, outtype, ptr, v0, v1, v2, inpv, outpv ): else: tri( intype, outtype, ptr, v2, v0, v1 ) +def do_quad( intype, outtype, ptr, v0, v1, v2, v3, inpv, outpv ): + do_tri( intype, outtype, ptr+'+0', v0, v1, v3, inpv, outpv ); + do_tri( intype, outtype, ptr+'+3', v1, v2, v3, inpv, outpv ); def name(intype, outtype, inpv, outpv, prim): if intype == GENERATE: @@ -234,8 +237,7 @@ def polygon(intype, outtype, inpv, outpv): def quads(intype, outtype, inpv, outpv): preamble(intype, outtype, inpv, outpv, prim='quads') print ' for (j = i = 0; j < nr; j+=6, i+=4) { ' - do_tri( intype, outtype, 'out+j+0', 'i+0', 'i+1', 'i+3', inpv, outpv ); - do_tri( intype, outtype, 'out+j+3', 'i+1', 'i+2', 'i+3', inpv, outpv ); + do_quad( intype, outtype, 'out+j', 'i+0', 'i+1', 'i+2', 'i+3', inpv, outpv ); print ' }' postamble() @@ -243,8 +245,7 @@ def quads(intype, outtype, inpv, outpv): def quadstrip(intype, outtype, inpv, outpv): preamble(intype, outtype, inpv, outpv, prim='quadstrip') print ' for (j = i = 0; j < nr; j+=6, i+=2) { ' - do_tri( intype, outtype, 'out+j+0', 'i+0', 'i+1', 'i+3', inpv, outpv ); - do_tri( intype, outtype, 'out+j+3', 'i+1', 'i+2', 'i+3', inpv, outpv ); + do_quad( intype, outtype, 'out+j', 'i+2', 'i+0', 'i+1', 'i+3', inpv, outpv ); print ' }' postamble() -- cgit v1.2.3 From 8569860c3d288ad5cd6558c9560fc9b404b64fb4 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 5 Feb 2009 19:43:36 +0200 Subject: nv04: fix pasto in nv04_surface_2d_init() Wrong hardware object being used, when compared with earlier code. Signed-off-by: Pekka Paalanen --- src/gallium/drivers/nv04/nv04_surface_2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 7529583151..2b84e6c529 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -391,7 +391,7 @@ nv04_surface_2d_init(struct nouveau_winsys *nvws) BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY, 1); OUT_RING (chan, ctx->ntfy->handle); BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_SURFACE, 1); - OUT_RING (chan, ctx->ntfy->handle); + OUT_RING (chan, ctx->surf2d->handle); BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_OPERATION, 1); OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY); BEGIN_RING(chan, ctx->rect, -- cgit v1.2.3 From a785a4ae2165c3b58c228f4de4b26b2c0800116c Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 5 Feb 2009 19:45:33 +0200 Subject: nv04-nv40: fix nv##_surface_copy() for flipped If do_flipp is true, it would first do the proper copy, height would wrap around to unsigned maximum, and then it attempts to do another copy. Return after doing the proper copy. Signed-off-by: Pekka Paalanen --- src/gallium/drivers/nv04/nv04_surface.c | 1 + src/gallium/drivers/nv10/nv10_surface.c | 1 + src/gallium/drivers/nv20/nv20_surface.c | 1 + src/gallium/drivers/nv30/nv30_surface.c | 1 + src/gallium/drivers/nv40/nv40_surface.c | 1 + 5 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface.c b/src/gallium/drivers/nv04/nv04_surface.c index 1d11f53f2a..14abf16679 100644 --- a/src/gallium/drivers/nv04/nv04_surface.c +++ b/src/gallium/drivers/nv04/nv04_surface.c @@ -47,6 +47,7 @@ nv04_surface_copy(struct pipe_context *pipe, boolean do_flip, eng2d->copy(eng2d, dest, destx, desty--, src, srcx, srcy++, width, 1); } + return; } eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); diff --git a/src/gallium/drivers/nv10/nv10_surface.c b/src/gallium/drivers/nv10/nv10_surface.c index 1093dfd62e..2538151063 100644 --- a/src/gallium/drivers/nv10/nv10_surface.c +++ b/src/gallium/drivers/nv10/nv10_surface.c @@ -47,6 +47,7 @@ nv10_surface_copy(struct pipe_context *pipe, boolean do_flip, eng2d->copy(eng2d, dest, destx, desty--, src, srcx, srcy++, width, 1); } + return; } eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); diff --git a/src/gallium/drivers/nv20/nv20_surface.c b/src/gallium/drivers/nv20/nv20_surface.c index a79974ce5e..6cd607583c 100644 --- a/src/gallium/drivers/nv20/nv20_surface.c +++ b/src/gallium/drivers/nv20/nv20_surface.c @@ -47,6 +47,7 @@ nv20_surface_copy(struct pipe_context *pipe, boolean do_flip, eng2d->copy(eng2d, dest, destx, desty--, src, srcx, srcy++, width, 1); } + return; } eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); diff --git a/src/gallium/drivers/nv30/nv30_surface.c b/src/gallium/drivers/nv30/nv30_surface.c index b46b6123cf..0f8dc12045 100644 --- a/src/gallium/drivers/nv30/nv30_surface.c +++ b/src/gallium/drivers/nv30/nv30_surface.c @@ -47,6 +47,7 @@ nv30_surface_copy(struct pipe_context *pipe, boolean do_flip, eng2d->copy(eng2d, dest, destx, desty--, src, srcx, srcy++, width, 1); } + return; } eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); diff --git a/src/gallium/drivers/nv40/nv40_surface.c b/src/gallium/drivers/nv40/nv40_surface.c index 68bbfce448..c4a5fb20d9 100644 --- a/src/gallium/drivers/nv40/nv40_surface.c +++ b/src/gallium/drivers/nv40/nv40_surface.c @@ -47,6 +47,7 @@ nv40_surface_copy(struct pipe_context *pipe, boolean do_flip, eng2d->copy(eng2d, dest, destx, desty--, src, srcx, srcy++, width, 1); } + return; } eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); -- cgit v1.2.3 From e6372853c221a5d64494ce75a6a323c479c55a86 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 5 Feb 2009 20:12:04 +0200 Subject: nv20: copy miptree flags from nv40 nv20_miptree_create() should set various flags. Copy stuff over from nv40. trivial/tri does not abort on nv04 swizzled copy anymore. I still miss my triangle. Signed-off-by: Pekka Paalanen --- src/gallium/drivers/nv20/nv20_miptree.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c index 89a4058700..c1155682dc 100644 --- a/src/gallium/drivers/nv20/nv20_miptree.c +++ b/src/gallium/drivers/nv20/nv20_miptree.c @@ -79,6 +79,8 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt) { struct pipe_winsys *ws = screen->winsys; struct nv20_miptree *mt; + unsigned buf_usage = PIPE_BUFFER_USAGE_PIXEL | + NOUVEAU_BUFFER_USAGE_TEXTURE; mt = MALLOC(sizeof(struct nv20_miptree)); if (!mt) @@ -87,10 +89,35 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt) mt->base.refcount = 1; mt->base.screen = screen; + /* Swizzled textures must be POT */ + if (pt->width[0] & (pt->width[0] - 1) || + pt->height[0] & (pt->height[0] - 1)) + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; + else + if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY | + PIPE_TEXTURE_USAGE_DISPLAY_TARGET)) + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; + else + if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC) + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; + else { + switch (pt->format) { + /* TODO: Figure out which formats can be swizzled */ + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_R16_SNORM: + break; + default: + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; + } + } + + if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC) + buf_usage |= PIPE_BUFFER_USAGE_CPU_READ_WRITE; + nv20_miptree_layout(mt); - mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL, - mt->total_size); + mt->buffer = ws->buffer_create(ws, 256, buf_usage, mt->total_size); if (!mt->buffer) { FREE(mt); return NULL; -- cgit v1.2.3 From be53dfa3b9ca4d1503fdbdf934569442175e30ef Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 5 Feb 2009 13:27:07 -0800 Subject: r300: Add framebuffer setup stub. --- src/gallium/drivers/r300/r300_emit.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index de5719db8d..c71b8d0b02 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -79,6 +79,22 @@ void r300_emit_dsa_state(struct r300_context* r300, END_CS; } +/* XXX add pitch, stride, z/stencil buf */ +void r300_emit_fb_state(struct r300_context* r300, + struct pipe_framebuffer_state* fb) +{ + CS_LOCALS(r300); + int i; + + BEGIN_CS((3 * fb->nr_cbufs) + 6); + for (i = 0; i < fb->nr_cbufs; i++) { + OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); + OUT_CS_RELOC(fb->cbufs[i]->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); + } + R300_PACIFY; + END_CS; +} + void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs) { struct r300_screen* r300screen = -- cgit v1.2.3 From 402d45d99b4533140aa706300da3154af2f376f0 Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Thu, 5 Feb 2009 22:23:40 +0100 Subject: r300: working trivial/clear for r5xx --- src/gallium/drivers/r300/r300_surface.c | 4 ++-- src/gallium/drivers/r300/r300_texture.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index e03f3de371..3db013cd7e 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -290,8 +290,8 @@ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); /* XXX this should not be so rigid and it still doesn't work right */ -OUT_CS_REG(R300_RB3D_COLORPITCH0, (w / 4) | R300_COLOR_TILE_ENABLE | - R300_COLOR_FORMAT_ARGB8888); +debug_printf("Buffer width (stride): %d\n", dest->stride); +OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) | R300_COLOR_FORMAT_ARGB8888); OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); /* XXX Packet3 */ OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 537425c1e2..f9ad14f12b 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -44,11 +44,11 @@ static void r300_setup_miptree(struct r300_texture* tex) /* Radeons enjoy things in multiples of 32. */ /* XXX NPOT -> 64, not 32 */ - stride = (base->nblocksx[i] * base->block.size + 31) & ~31; + stride = (base->nblocksx[i] * base->block.size + 63) & ~63; size = stride * base->nblocksy[i] * base->depth[i]; /* XXX 64 for NPOT */ - tex->offset[i] = (tex->size + 31) & ~31; + tex->offset[i] = (tex->size + 63) & ~63; tex->size = tex->offset[i] + size; } } @@ -72,7 +72,7 @@ static struct pipe_texture* r300_setup_miptree(tex); - tex->buffer = screen->buffer_create(screen, 32, + tex->buffer = screen->buffer_create(screen, 63, PIPE_BUFFER_USAGE_PIXEL, tex->size); @@ -130,7 +130,7 @@ static struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen, surface->nblocksy = texture->nblocksy[level]; /* XXX save the actual stride instead plz kthnxbai */ surface->stride = - (texture->nblocksx[level] * texture->block.size + 31) & ~31; + (texture->nblocksx[level] * texture->block.size + 63) & ~63; surface->offset = offset; surface->usage = flags; surface->status = PIPE_SURFACE_STATUS_DEFINED; -- cgit v1.2.3 From 2e70971e4f1ac5278e9da67341e8c39518308d20 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 6 Feb 2009 01:59:26 -0800 Subject: r300: Clean up CS counting. --- src/gallium/drivers/r300/r300_cs.h | 1 + src/gallium/drivers/r300/r300_surface.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 734ccb13d9..385b61a096 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -107,6 +107,7 @@ static uint32_t pack_float_32(float f) assert(bo); \ OUT_CS(offset); \ cs_winsys->write_cs_reloc(cs, bo, rd, wd, flags); \ + cs_count -= 2; \ } while (0) #define END_CS do { \ diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 3db013cd7e..1ed4a4e3bc 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -39,8 +39,8 @@ static void r300_surface_fill(struct pipe_context* pipe, g = (float)((color >> 8) & 0xff) / 255.0f; b = (float)((color >> 0) & 0xff) / 255.0f; debug_printf("r300: Filling surface %p at (%d,%d)," - " dimensions %dx%d, color 0x%x\n", - dest, x, y, w, h, color); + " dimensions %dx%d (stride %d), color 0x%x\n", + dest, x, y, w, h, dest->stride, color); /* Fallback? */ if (0) { @@ -52,7 +52,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } -BEGIN_CS((caps->is_r500) ? 309 : 322); +BEGIN_CS((caps->is_r500) ? 309 : 280); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; @@ -273,11 +273,14 @@ OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF02203); OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); +R300_PACIFY; +END_CS; r300_emit_blend_state(r300, &blend_clear_state); r300_emit_blend_color_state(r300, &blend_color_clear_state); r300_emit_dsa_state(r300, &dsa_clear_state); +BEGIN_CS(36); R300_PACIFY; /* Flush colorbuffer and blend caches. */ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, @@ -290,7 +293,6 @@ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); /* XXX this should not be so rigid and it still doesn't work right */ -debug_printf("Buffer width (stride): %d\n", dest->stride); OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) | R300_COLOR_FORMAT_ARGB8888); OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); /* XXX Packet3 */ -- cgit v1.2.3 From da795ff0a837eeb8c8f9d44987b374da2d4d2835 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 7 Feb 2009 00:18:34 +1000 Subject: radeon: remove include that breaks build in !OLD_PACKET path this path isn't enabled by default in any case. --- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index de3c3a15a7..31eea13f4e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" #include "tnl/tnl.h" -#include "tnl/tcontext.h" #include "radeon_context.h" #include "radeon_ioctl.h" -- cgit v1.2.3 From b2e779988eeb595187933fe2122d86f8ccfe059c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Feb 2009 09:57:28 -0700 Subject: mesa: meaningless whitespace change to see if git's working (ignore) --- Makefile | 1 + src/mesa/main/debug.c | 4 +-- src/mesa/main/mtypes.h | 10 ++++-- src/mesa/shader/shader_api.c | 62 +++++++++++++++++++++++++++++++++++ src/mesa/shader/slang/slang_compile.c | 18 ++++++++-- src/mesa/shader/slang/slang_link.c | 20 ++++++----- src/mesa/shader/slang/slang_log.c | 6 ++-- src/mesa/sources | 1 + 8 files changed, 102 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/Makefile b/Makefile index 419265df80..4d4c6a551a 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ default: $(TOP)/configs/current doxygen: cd doxygen && $(MAKE) + clean: -@touch $(TOP)/configs/current -@for dir in $(SUBDIRS) ; do \ diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 77fef32558..65970a53a9 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -164,9 +164,7 @@ static void add_debug_flags( const char *debug ) { "api", VERBOSE_API }, { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM }, - { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */ - { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */ + { "disassem", VERBOSE_DISASSEM } }; GLuint i; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 17dd3e6afd..509da06d09 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2162,6 +2162,13 @@ struct gl_shader_program }; +#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ +#define GLSL_LOG 0x2 /**< Write shaders to files */ +#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 */ + + /** * Context state for GLSL vertex/fragment shaders. */ @@ -2173,6 +2180,7 @@ struct gl_shader_state GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ void *MemPool; + GLbitfield Flags; /**< Mask of GLSL_x flags */ }; @@ -3163,8 +3171,6 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, - VERBOSE_GLSL = 0x2000, - VERBOSE_GLSL_DUMP = 0x4000 }; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index acee34dc5b..fb2a7e54fe 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -370,6 +370,31 @@ _mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller) } +/** + * Return mask of GLSL_x flags by examining the MESA_GLSL env var. + */ +static GLbitfield +get_shader_flags(void) +{ + GLbitfield flags = 0x0; + const char *env = _mesa_getenv("MESA_GLSL"); + + if (env) { + if (_mesa_strstr(env, "dump")) + flags |= GLSL_DUMP; + if (_mesa_strstr(env, "log")) + flags |= GLSL_LOG; + if (_mesa_strstr(env, "nopt")) + flags |= GLSL_NO_OPT; + else if (_mesa_strstr(env, "opt")) + flags |= GLSL_OPT; + if (_mesa_strstr(env, "uniform")) + flags |= GLSL_UNIFORMS; + } + + return flags; +} + /** * Initialize context's shader state. @@ -383,6 +408,7 @@ _mesa_init_shader_state(GLcontext * ctx) ctx->Shader.EmitHighLevelInstructions = GL_TRUE; ctx->Shader.EmitCondCodes = GL_TRUE; /* XXX probably want GL_FALSE... */ ctx->Shader.EmitComments = GL_FALSE; + ctx->Shader.Flags = get_shader_flags(); } @@ -1613,6 +1639,7 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; struct gl_uniform *uniform; GLint elems, offset; + GLenum basicType; if (!shProg || !shProg->LinkStatus) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)"); @@ -1636,19 +1663,35 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, switch (type) { case GL_FLOAT: + basicType = GL_FLOAT; + elems = 1; + break; case GL_INT: + basicType = GL_INT; elems = 1; break; case GL_FLOAT_VEC2: + basicType = GL_FLOAT; + elems = 2; + break; case GL_INT_VEC2: + basicType = GL_INT; elems = 2; break; case GL_FLOAT_VEC3: + basicType = GL_FLOAT; + elems = 3; + break; case GL_INT_VEC3: + basicType = GL_INT; elems = 3; break; case GL_FLOAT_VEC4: + basicType = GL_FLOAT; + elems = 4; + break; case GL_INT_VEC4: + basicType = GL_INT; elems = 4; break; default: @@ -1660,6 +1703,25 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, uniform = &shProg->Uniforms->Uniforms[location]; + if (ctx->Shader.Flags & GLSL_UNIFORMS) { + GLint i; + _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ", + shProg->Name, uniform->Name, location); + if (basicType == GL_INT) { + const GLint *v = (const GLint *) values; + for (i = 0; i < count * elems; i++) { + _mesa_printf("%d ", v[i]); + } + } + else { + const GLfloat *v = (const GLfloat *) values; + for (i = 0; i < count * elems; i++) { + _mesa_printf("%g ", v[i]); + } + } + _mesa_printf("\n"); + } + /* A uniform var may be used by both a vertex shader and a fragment * shader. We may need to update one or both shader's uniform here: */ diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 40460e0c7e..0c7881dd19 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -32,6 +32,7 @@ #include "main/context.h" #include "shader/program.h" #include "shader/programopt.h" +#include "shader/prog_optimize.h" #include "shader/prog_print.h" #include "shader/prog_parameter.h" #include "shader/grammar/grammar_mesa.h" @@ -2794,11 +2795,22 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) _mesa_print_program(shader->Program); #endif + if (success) { + if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) { + if ((ctx->Shader.Flags & GLSL_OPT) || shader->Pragmas.Optimize) { + /* apply program optimizations */ + _mesa_remove_extra_moves(shader->Program); + _mesa_remove_dead_code(shader->Program); + _mesa_consolidate_registers(shader->Program); + } + } + } + shader->CompileStatus = success; -#if 0 - _mesa_write_shader_to_file(shader); -#endif + if (ctx->Shader.Flags & GLSL_LOG) { + _mesa_write_shader_to_file(shader); + } return success; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 77bcda0871..4ee1beccd4 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -675,12 +675,12 @@ _slang_link(GLcontext *ctx, /* notify driver that a new fragment program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, &shProg->FragmentProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original fragment program:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Mesa original fragment program:\n"); _mesa_print_program(&fragProg->Base); _mesa_print_program_parameters(ctx, &fragProg->Base); - printf("Mesa post-link fragment program:\n"); + _mesa_printf("Mesa post-link fragment program:\n"); _mesa_print_program(&shProg->FragmentProgram->Base); _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); } @@ -693,22 +693,26 @@ _slang_link(GLcontext *ctx, /* notify driver that a new vertex program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original vertex program:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Mesa original vertex program:\n"); _mesa_print_program(&vertProg->Base); _mesa_print_program_parameters(ctx, &vertProg->Base); - printf("Mesa post-link vertex program:\n"); + _mesa_printf("Mesa post-link vertex program:\n"); _mesa_print_program(&shProg->VertexProgram->Base); _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); } } - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Varying vars:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Varying vars:\n"); _mesa_print_parameter_list(shProg->Varying); + if (shProg->InfoLog) { + _mesa_printf("Info Log: %s\n", shProg->InfoLog); + } } + shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram); } diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index d5576d7ee2..30729ba8d5 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -77,13 +77,11 @@ slang_info_log_message(slang_info_log * log, const char *prefix, slang_string_concat(log->text, msg); slang_string_concat(log->text, "\n"); - if (MESA_VERBOSE & VERBOSE_GLSL) { - _mesa_printf("Mesa: GLSL %s", log->text); - } - return 1; } +#define EXIT_SUCCESS 13 + int slang_info_log_print(slang_info_log * log, const char *msg, ...) { diff --git a/src/mesa/sources b/src/mesa/sources index 01a3fb89e6..a7210c134d 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -177,6 +177,7 @@ SHADER_SOURCES = \ shader/prog_execute.c \ shader/prog_instruction.c \ shader/prog_noise.c \ + shader/prog_optimize.c \ shader/prog_parameter.c \ shader/prog_print.c \ shader/prog_statevars.c \ -- cgit v1.2.3 From aafcc26642d5243944a1abb816c2657f644c0649 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Feb 2009 10:00:34 -0700 Subject: Revert "mesa: meaningless whitespace change to see if git's working (ignore)" This reverts commit b2e779988eeb595187933fe2122d86f8ccfe059c. I didn't mean to push this stuff yet. I'm having a bad git day... --- Makefile | 1 - src/mesa/main/debug.c | 4 ++- src/mesa/main/mtypes.h | 10 ++---- src/mesa/shader/shader_api.c | 62 ----------------------------------- src/mesa/shader/slang/slang_compile.c | 18 ++-------- src/mesa/shader/slang/slang_link.c | 20 +++++------ src/mesa/shader/slang/slang_log.c | 6 ++-- src/mesa/sources | 1 - 8 files changed, 20 insertions(+), 102 deletions(-) (limited to 'src') diff --git a/Makefile b/Makefile index 4d4c6a551a..419265df80 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,6 @@ default: $(TOP)/configs/current doxygen: cd doxygen && $(MAKE) - clean: -@touch $(TOP)/configs/current -@for dir in $(SUBDIRS) ; do \ diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 65970a53a9..77fef32558 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -164,7 +164,9 @@ static void add_debug_flags( const char *debug ) { "api", VERBOSE_API }, { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM } + { "disassem", VERBOSE_DISASSEM }, + { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */ + { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */ }; GLuint i; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 509da06d09..17dd3e6afd 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2162,13 +2162,6 @@ struct gl_shader_program }; -#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ -#define GLSL_LOG 0x2 /**< Write shaders to files */ -#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 */ - - /** * Context state for GLSL vertex/fragment shaders. */ @@ -2180,7 +2173,6 @@ struct gl_shader_state GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ void *MemPool; - GLbitfield Flags; /**< Mask of GLSL_x flags */ }; @@ -3171,6 +3163,8 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, + VERBOSE_GLSL = 0x2000, + VERBOSE_GLSL_DUMP = 0x4000 }; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index fb2a7e54fe..acee34dc5b 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -370,31 +370,6 @@ _mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller) } -/** - * Return mask of GLSL_x flags by examining the MESA_GLSL env var. - */ -static GLbitfield -get_shader_flags(void) -{ - GLbitfield flags = 0x0; - const char *env = _mesa_getenv("MESA_GLSL"); - - if (env) { - if (_mesa_strstr(env, "dump")) - flags |= GLSL_DUMP; - if (_mesa_strstr(env, "log")) - flags |= GLSL_LOG; - if (_mesa_strstr(env, "nopt")) - flags |= GLSL_NO_OPT; - else if (_mesa_strstr(env, "opt")) - flags |= GLSL_OPT; - if (_mesa_strstr(env, "uniform")) - flags |= GLSL_UNIFORMS; - } - - return flags; -} - /** * Initialize context's shader state. @@ -408,7 +383,6 @@ _mesa_init_shader_state(GLcontext * ctx) ctx->Shader.EmitHighLevelInstructions = GL_TRUE; ctx->Shader.EmitCondCodes = GL_TRUE; /* XXX probably want GL_FALSE... */ ctx->Shader.EmitComments = GL_FALSE; - ctx->Shader.Flags = get_shader_flags(); } @@ -1639,7 +1613,6 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; struct gl_uniform *uniform; GLint elems, offset; - GLenum basicType; if (!shProg || !shProg->LinkStatus) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)"); @@ -1663,35 +1636,19 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, switch (type) { case GL_FLOAT: - basicType = GL_FLOAT; - elems = 1; - break; case GL_INT: - basicType = GL_INT; elems = 1; break; case GL_FLOAT_VEC2: - basicType = GL_FLOAT; - elems = 2; - break; case GL_INT_VEC2: - basicType = GL_INT; elems = 2; break; case GL_FLOAT_VEC3: - basicType = GL_FLOAT; - elems = 3; - break; case GL_INT_VEC3: - basicType = GL_INT; elems = 3; break; case GL_FLOAT_VEC4: - basicType = GL_FLOAT; - elems = 4; - break; case GL_INT_VEC4: - basicType = GL_INT; elems = 4; break; default: @@ -1703,25 +1660,6 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, uniform = &shProg->Uniforms->Uniforms[location]; - if (ctx->Shader.Flags & GLSL_UNIFORMS) { - GLint i; - _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ", - shProg->Name, uniform->Name, location); - if (basicType == GL_INT) { - const GLint *v = (const GLint *) values; - for (i = 0; i < count * elems; i++) { - _mesa_printf("%d ", v[i]); - } - } - else { - const GLfloat *v = (const GLfloat *) values; - for (i = 0; i < count * elems; i++) { - _mesa_printf("%g ", v[i]); - } - } - _mesa_printf("\n"); - } - /* A uniform var may be used by both a vertex shader and a fragment * shader. We may need to update one or both shader's uniform here: */ diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 0c7881dd19..40460e0c7e 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -32,7 +32,6 @@ #include "main/context.h" #include "shader/program.h" #include "shader/programopt.h" -#include "shader/prog_optimize.h" #include "shader/prog_print.h" #include "shader/prog_parameter.h" #include "shader/grammar/grammar_mesa.h" @@ -2795,22 +2794,11 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) _mesa_print_program(shader->Program); #endif - if (success) { - if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) { - if ((ctx->Shader.Flags & GLSL_OPT) || shader->Pragmas.Optimize) { - /* apply program optimizations */ - _mesa_remove_extra_moves(shader->Program); - _mesa_remove_dead_code(shader->Program); - _mesa_consolidate_registers(shader->Program); - } - } - } - shader->CompileStatus = success; - if (ctx->Shader.Flags & GLSL_LOG) { - _mesa_write_shader_to_file(shader); - } +#if 0 + _mesa_write_shader_to_file(shader); +#endif return success; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 4ee1beccd4..77bcda0871 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -675,12 +675,12 @@ _slang_link(GLcontext *ctx, /* notify driver that a new fragment program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, &shProg->FragmentProgram->Base); - if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Mesa original fragment program:\n"); + if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { + printf("Mesa original fragment program:\n"); _mesa_print_program(&fragProg->Base); _mesa_print_program_parameters(ctx, &fragProg->Base); - _mesa_printf("Mesa post-link fragment program:\n"); + printf("Mesa post-link fragment program:\n"); _mesa_print_program(&shProg->FragmentProgram->Base); _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); } @@ -693,26 +693,22 @@ _slang_link(GLcontext *ctx, /* notify driver that a new vertex program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); - if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Mesa original vertex program:\n"); + if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { + printf("Mesa original vertex program:\n"); _mesa_print_program(&vertProg->Base); _mesa_print_program_parameters(ctx, &vertProg->Base); - _mesa_printf("Mesa post-link vertex program:\n"); + printf("Mesa post-link vertex program:\n"); _mesa_print_program(&shProg->VertexProgram->Base); _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); } } - if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Varying vars:\n"); + if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { + printf("Varying vars:\n"); _mesa_print_parameter_list(shProg->Varying); - if (shProg->InfoLog) { - _mesa_printf("Info Log: %s\n", shProg->InfoLog); - } } - shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram); } diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index 30729ba8d5..d5576d7ee2 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -77,11 +77,13 @@ slang_info_log_message(slang_info_log * log, const char *prefix, slang_string_concat(log->text, msg); slang_string_concat(log->text, "\n"); + if (MESA_VERBOSE & VERBOSE_GLSL) { + _mesa_printf("Mesa: GLSL %s", log->text); + } + return 1; } -#define EXIT_SUCCESS 13 - int slang_info_log_print(slang_info_log * log, const char *msg, ...) { diff --git a/src/mesa/sources b/src/mesa/sources index a7210c134d..01a3fb89e6 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -177,7 +177,6 @@ SHADER_SOURCES = \ shader/prog_execute.c \ shader/prog_instruction.c \ shader/prog_noise.c \ - shader/prog_optimize.c \ shader/prog_parameter.c \ shader/prog_print.c \ shader/prog_statevars.c \ -- cgit v1.2.3 From 6ce0c6e743b27cc284e8f164585cfe5892cd662a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Feb 2009 10:20:33 -0700 Subject: mesa: tweak output of _mesa_write_shader_to_file() Enclose GPU code in comments to the file can be re-fed back into GLSL compiler. --- src/mesa/shader/prog_print.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index fa1d3614bf..8b0f16e688 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -902,7 +902,9 @@ _mesa_write_shader_to_file(const struct gl_shader *shader) } else { fprintf(f, "/* GPU code */\n"); + fprintf(f, "/*\n"); _mesa_fprint_program_opt(f, shader->Program, PROG_PRINT_DEBUG, GL_TRUE); + fprintf(f, "*/\n"); } fclose(f); -- cgit v1.2.3 From e01a03d2220199a4541f2cb8b42035237a571aa4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Feb 2009 10:21:36 -0700 Subject: glsl: new MESA_GLSL env var for GLSL debugging features Replaces the VERBOSE_GLSL, VERBOSE_GLSL_DUMP flags which only worked in debug builds. MESA_GLSL will work both in debug and non-debug builds. Also add facility to dump glUniform() calls to stdout. --- src/mesa/main/debug.c | 4 +-- src/mesa/main/mtypes.h | 10 ++++-- src/mesa/shader/shader_api.c | 62 +++++++++++++++++++++++++++++++++++ src/mesa/shader/slang/slang_compile.c | 6 ++-- src/mesa/shader/slang/slang_link.c | 19 ++++++----- src/mesa/shader/slang/slang_log.c | 4 --- 6 files changed, 85 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 77fef32558..65970a53a9 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -164,9 +164,7 @@ static void add_debug_flags( const char *debug ) { "api", VERBOSE_API }, { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM }, - { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */ - { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */ + { "disassem", VERBOSE_DISASSEM } }; GLuint i; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 17dd3e6afd..509da06d09 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2162,6 +2162,13 @@ struct gl_shader_program }; +#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ +#define GLSL_LOG 0x2 /**< Write shaders to files */ +#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 */ + + /** * Context state for GLSL vertex/fragment shaders. */ @@ -2173,6 +2180,7 @@ struct gl_shader_state GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ void *MemPool; + GLbitfield Flags; /**< Mask of GLSL_x flags */ }; @@ -3163,8 +3171,6 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, - VERBOSE_GLSL = 0x2000, - VERBOSE_GLSL_DUMP = 0x4000 }; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index acee34dc5b..fb2a7e54fe 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -370,6 +370,31 @@ _mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller) } +/** + * Return mask of GLSL_x flags by examining the MESA_GLSL env var. + */ +static GLbitfield +get_shader_flags(void) +{ + GLbitfield flags = 0x0; + const char *env = _mesa_getenv("MESA_GLSL"); + + if (env) { + if (_mesa_strstr(env, "dump")) + flags |= GLSL_DUMP; + if (_mesa_strstr(env, "log")) + flags |= GLSL_LOG; + if (_mesa_strstr(env, "nopt")) + flags |= GLSL_NO_OPT; + else if (_mesa_strstr(env, "opt")) + flags |= GLSL_OPT; + if (_mesa_strstr(env, "uniform")) + flags |= GLSL_UNIFORMS; + } + + return flags; +} + /** * Initialize context's shader state. @@ -383,6 +408,7 @@ _mesa_init_shader_state(GLcontext * ctx) ctx->Shader.EmitHighLevelInstructions = GL_TRUE; ctx->Shader.EmitCondCodes = GL_TRUE; /* XXX probably want GL_FALSE... */ ctx->Shader.EmitComments = GL_FALSE; + ctx->Shader.Flags = get_shader_flags(); } @@ -1613,6 +1639,7 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; struct gl_uniform *uniform; GLint elems, offset; + GLenum basicType; if (!shProg || !shProg->LinkStatus) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)"); @@ -1636,19 +1663,35 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, switch (type) { case GL_FLOAT: + basicType = GL_FLOAT; + elems = 1; + break; case GL_INT: + basicType = GL_INT; elems = 1; break; case GL_FLOAT_VEC2: + basicType = GL_FLOAT; + elems = 2; + break; case GL_INT_VEC2: + basicType = GL_INT; elems = 2; break; case GL_FLOAT_VEC3: + basicType = GL_FLOAT; + elems = 3; + break; case GL_INT_VEC3: + basicType = GL_INT; elems = 3; break; case GL_FLOAT_VEC4: + basicType = GL_FLOAT; + elems = 4; + break; case GL_INT_VEC4: + basicType = GL_INT; elems = 4; break; default: @@ -1660,6 +1703,25 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, uniform = &shProg->Uniforms->Uniforms[location]; + if (ctx->Shader.Flags & GLSL_UNIFORMS) { + GLint i; + _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ", + shProg->Name, uniform->Name, location); + if (basicType == GL_INT) { + const GLint *v = (const GLint *) values; + for (i = 0; i < count * elems; i++) { + _mesa_printf("%d ", v[i]); + } + } + else { + const GLfloat *v = (const GLfloat *) values; + for (i = 0; i < count * elems; i++) { + _mesa_printf("%g ", v[i]); + } + } + _mesa_printf("\n"); + } + /* A uniform var may be used by both a vertex shader and a fragment * shader. We may need to update one or both shader's uniform here: */ diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 40460e0c7e..cfed977905 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2796,9 +2796,9 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->CompileStatus = success; -#if 0 - _mesa_write_shader_to_file(shader); -#endif + if (ctx->Shader.Flags & GLSL_LOG) { + _mesa_write_shader_to_file(shader); + } return success; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 77bcda0871..848a64f932 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -675,12 +675,12 @@ _slang_link(GLcontext *ctx, /* notify driver that a new fragment program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, &shProg->FragmentProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original fragment program:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Mesa pre-link fragment program:\n"); _mesa_print_program(&fragProg->Base); _mesa_print_program_parameters(ctx, &fragProg->Base); - printf("Mesa post-link fragment program:\n"); + _mesa_printf("Mesa post-link fragment program:\n"); _mesa_print_program(&shProg->FragmentProgram->Base); _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); } @@ -693,20 +693,23 @@ _slang_link(GLcontext *ctx, /* notify driver that a new vertex program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original vertex program:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Mesa pre-link vertex program:\n"); _mesa_print_program(&vertProg->Base); _mesa_print_program_parameters(ctx, &vertProg->Base); - printf("Mesa post-link vertex program:\n"); + _mesa_printf("Mesa post-link vertex program:\n"); _mesa_print_program(&shProg->VertexProgram->Base); _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); } } - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Varying vars:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Varying vars:\n"); _mesa_print_parameter_list(shProg->Varying); + if (shProg->InfoLog) { + _mesa_printf("Info Log: %s\n", shProg->InfoLog); + } } shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram); diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index d5576d7ee2..d7d2b4fbfd 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -77,10 +77,6 @@ slang_info_log_message(slang_info_log * log, const char *prefix, slang_string_concat(log->text, msg); slang_string_concat(log->text, "\n"); - if (MESA_VERBOSE & VERBOSE_GLSL) { - _mesa_printf("Mesa: GLSL %s", log->text); - } - return 1; } -- cgit v1.2.3 From 1df62651b2e9a8d0afd790738e2695a16ade1eeb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Feb 2009 10:47:31 -0700 Subject: swrast: return (0,0,0,1) when sampling incomplete textures, not (0,0,0,0) Fixes piglit shaders/fp-incomplete-tex test. --- src/mesa/swrast/s_fragprog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 58ef91ec01..bbb784c46e 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -84,7 +84,8 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, swizzle_texel(rgba, color, texObj->_Swizzle); } else { - color[0] = color[1] = color[2] = color[3] = 0.0F; + color[0] = color[1] = color[2] = 0.0F; + color[3] = 1.0F; } } @@ -126,7 +127,8 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], swizzle_texel(rgba, color, texObj->_Swizzle); } else { - color[0] = color[1] = color[2] = color[3] = 0.0F; + color[0] = color[1] = color[2] = 0.0F; + color[3] = 1.0F; } } -- cgit v1.2.3 From f6d23943cd289ed2b60ec01006fb155f22969749 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Feb 2009 10:48:38 -0700 Subject: mesa: fix tnl->render_inputs_bitset setup for fragment program texcoords Handle the case where there's no per-vertex texcoords but the fragment shader needs texcoords. Fixes piglit shaders/fp-generic/dph test. --- src/mesa/tnl/t_context.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 5e2a58249e..19ec556dcd 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -109,24 +109,28 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) tnl->pipeline.new_state |= new_state; - /* Calculate tnl->render_inputs: + /* Calculate tnl->render_inputs. This bitmask indicates which vertex + * attributes need to be emitted to the rasterizer. */ if (ctx->Visual.rgbMode) { GLuint i; RENDERINPUTS_ZERO( tnl->render_inputs_bitset ); RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS ); + if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) { RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 ); } + + if (NEED_SECONDARY_COLOR(ctx)) + RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 ); + for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - if (ctx->Texture._EnabledCoordUnits & (1 << i)) { + if (ctx->Texture._EnabledCoordUnits & (1 << i) || + (fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) { RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) ); } } - - if (NEED_SECONDARY_COLOR(ctx)) - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 ); } else { RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS ); -- cgit v1.2.3 From 5c8c728afe0e2a8e8819097ae1c2f3c738d9397b Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Fri, 6 Feb 2009 14:33:49 -0500 Subject: nouveau: Frontbuffer pitch needs to be set. --- src/gallium/drivers/nv04/nv04_miptree.c | 1 + src/gallium/drivers/nv10/nv10_miptree.c | 1 + src/gallium/drivers/nv20/nv20_miptree.c | 1 + src/gallium/drivers/nv30/nv30_miptree.c | 1 + src/gallium/drivers/nv40/nv40_miptree.c | 1 + 5 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_miptree.c b/src/gallium/drivers/nv04/nv04_miptree.c index fd908491e9..993c5ef5dd 100644 --- a/src/gallium/drivers/nv04/nv04_miptree.c +++ b/src/gallium/drivers/nv04/nv04_miptree.c @@ -87,6 +87,7 @@ nv04_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->base = *pt; mt->base.refcount = 1; mt->base.screen = pscreen; + mt->level[0].pitch = stride[0]; mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(pscreen, &mt->buffer, pb); diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c index bbd4b1e15c..9616135461 100644 --- a/src/gallium/drivers/nv10/nv10_miptree.c +++ b/src/gallium/drivers/nv10/nv10_miptree.c @@ -68,6 +68,7 @@ nv10_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->base = *pt; mt->base.refcount = 1; mt->base.screen = pscreen; + mt->level[0].pitch = stride[0]; mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(pscreen, &mt->buffer, pb); diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c index c1155682dc..ef7e9c5428 100644 --- a/src/gallium/drivers/nv20/nv20_miptree.c +++ b/src/gallium/drivers/nv20/nv20_miptree.c @@ -68,6 +68,7 @@ nv20_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->base = *pt; mt->base.refcount = 1; mt->base.screen = pscreen; + mt->level[0].pitch = stride[0]; mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(pscreen, &mt->buffer, pb); diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 5458f834aa..23f8829321 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -123,6 +123,7 @@ nv30_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->base = *pt; mt->base.refcount = 1; mt->base.screen = pscreen; + mt->level[0].pitch = stride[0]; mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(pscreen, &mt->buffer, pb); diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index e8cd104ea4..9bef23ad1f 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -124,6 +124,7 @@ nv40_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->base = *pt; mt->base.refcount = 1; mt->base.screen = pscreen; + mt->level[0].pitch = stride[0]; mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(pscreen, &mt->buffer, pb); -- cgit v1.2.3 From bb34072b940840757f2de1d2e7202b2868ec2a56 Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Fri, 6 Feb 2009 14:36:56 -0500 Subject: nouveau: Pass proper format to NV04_GDI_RECTANGLE_TEXT. --- src/gallium/drivers/nv04/nv04_surface_2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 2b84e6c529..b507e993f1 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -277,7 +277,7 @@ nv04_surface_fill(struct nv04_surface_2d *ctx, struct pipe_surface *dst, cs2d_format = nv04_surface_format(dst->format); assert(cs2d_format >= 0); - gdirect_format = nv04_surface_format(dst->format); + gdirect_format = nv04_rect_format(dst->format); assert(gdirect_format >= 0); WAIT_RING (chan, 16); -- cgit v1.2.3 From 776d86606cd8b250802730410d5e55a41944cf0a Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Fri, 6 Feb 2009 14:37:35 -0500 Subject: g3dvl: Catch up to gallium changes, fix build. --- src/gallium/state_trackers/g3dvl/vl_basic_csc.c | 10 ++++------ src/gallium/state_trackers/g3dvl/vl_context.c | 2 +- src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c | 10 ++++------ src/gallium/state_trackers/g3dvl/vl_surface.c | 10 +++++----- src/gallium/winsys/g3dvl/nouveau/Makefile | 4 +++- src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c | 2 +- src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c | 5 +++-- 7 files changed, 21 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c index 122c42ed0e..187a13a560 100644 --- a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c +++ b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c @@ -544,7 +544,7 @@ static int vlCreateDataBufs * to display a rendered surface * Quad is rendered as a tri strip */ - csc->vertex_bufs[0].pitch = sizeof(struct vlVertex2f); + csc->vertex_bufs[0].stride = sizeof(struct vlVertex2f); csc->vertex_bufs[0].max_index = 3; csc->vertex_bufs[0].buffer_offset = 0; csc->vertex_bufs[0].buffer = pipe_buffer_create @@ -573,7 +573,7 @@ static int vlCreateDataBufs * Create our texcoord buffer and texcoord buffer element * Texcoord buffer contains the TCs for mapping the rendered surface to the 4 vertices */ - csc->vertex_bufs[1].pitch = sizeof(struct vlVertex2f); + csc->vertex_bufs[1].stride = sizeof(struct vlVertex2f); csc->vertex_bufs[1].max_index = 3; csc->vertex_bufs[1].buffer_offset = 0; csc->vertex_bufs[1].buffer = pipe_buffer_create @@ -602,26 +602,24 @@ static int vlCreateDataBufs * Create our vertex shader's constant buffer * Const buffer contains scaling and translation vectors */ - csc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts); csc->vs_const_buf.buffer = pipe_buffer_create ( pipe->screen, 1, PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD, - csc->vs_const_buf.size + sizeof(struct vlVertexShaderConsts) ); /* * Create our fragment shader's constant buffer * Const buffer contains the color conversion matrix and bias vectors */ - csc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts); csc->fs_const_buf.buffer = pipe_buffer_create ( pipe->screen, 1, PIPE_BUFFER_USAGE_CONSTANT, - csc->fs_const_buf.size + sizeof(struct vlFragmentShaderConsts) ); /* diff --git a/src/gallium/state_trackers/g3dvl/vl_context.c b/src/gallium/state_trackers/g3dvl/vl_context.c index c4c4e23c15..65ddb9f01e 100644 --- a/src/gallium/state_trackers/g3dvl/vl_context.c +++ b/src/gallium/state_trackers/g3dvl/vl_context.c @@ -86,7 +86,7 @@ static int vlInitCommon(struct vlContext *context) } dsa.alpha.enabled = 0; dsa.alpha.func = PIPE_FUNC_ALWAYS; - dsa.alpha.ref = 0; + dsa.alpha.ref_value = 0; context->dsa = pipe->create_depth_stencil_alpha_state(pipe, &dsa); pipe->bind_depth_stencil_alpha_state(pipe, context->dsa); diff --git a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c index d53482f579..2176bb86d8 100644 --- a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c +++ b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c @@ -911,7 +911,7 @@ static int vlCreateDataBufs mc->macroblocks_per_picture = mbw * mbh; /* Create our vertex buffers */ - mc->vertex_bufs.ycbcr.pitch = sizeof(struct vlVertex2f) * 4; + mc->vertex_bufs.ycbcr.stride = sizeof(struct vlVertex2f) * 4; mc->vertex_bufs.ycbcr.max_index = 24 * mc->macroblocks_per_picture - 1; mc->vertex_bufs.ycbcr.buffer_offset = 0; mc->vertex_bufs.ycbcr.buffer = pipe_buffer_create @@ -924,7 +924,7 @@ static int vlCreateDataBufs for (i = 1; i < 3; ++i) { - mc->vertex_bufs.all[i].pitch = sizeof(struct vlVertex2f) * 2; + mc->vertex_bufs.all[i].stride = sizeof(struct vlVertex2f) * 2; mc->vertex_bufs.all[i].max_index = 24 * mc->macroblocks_per_picture - 1; mc->vertex_bufs.all[i].buffer_offset = 0; mc->vertex_bufs.all[i].buffer = pipe_buffer_create @@ -985,22 +985,20 @@ static int vlCreateDataBufs mc->vertex_elems[7].src_format = PIPE_FORMAT_R32G32_FLOAT; /* Create our constant buffer */ - mc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts); mc->vs_const_buf.buffer = pipe_buffer_create ( pipe->screen, DEFAULT_BUF_ALIGNMENT, PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD, - mc->vs_const_buf.size + sizeof(struct vlVertexShaderConsts) ); - mc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts); mc->fs_const_buf.buffer = pipe_buffer_create ( pipe->screen, DEFAULT_BUF_ALIGNMENT, PIPE_BUFFER_USAGE_CONSTANT, - mc->fs_const_buf.size + sizeof(struct vlFragmentShaderConsts) ); memcpy diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c index 0fa7b25b92..92388f7978 100644 --- a/src/gallium/state_trackers/g3dvl/vl_surface.c +++ b/src/gallium/state_trackers/g3dvl/vl_surface.c @@ -152,9 +152,9 @@ int vlPutPicture bind_pipe_drawable(pipe, drawable); - pipe->winsys->flush_frontbuffer + pipe->screen->flush_frontbuffer ( - pipe->winsys, + pipe->screen, csc->vlGetFrameBuffer(csc), pipe->priv ); @@ -172,13 +172,13 @@ int vlSurfaceGetStatus assert(surface->context); assert(status); - if (surface->render_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->render_fence, 0)) + if (surface->render_fence && !surface->context->pipe->screen->fence_signalled(surface->context->pipe->screen, surface->render_fence, 0)) { *status = vlResourceStatusRendering; return 0; } - if (surface->disp_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->disp_fence, 0)) + if (surface->disp_fence && !surface->context->pipe->screen->fence_signalled(surface->context->pipe->screen, surface->disp_fence, 0)) { *status = vlResourceStatusDisplaying; return 0; @@ -211,7 +211,7 @@ int vlSurfaceSync assert(surface->context); assert(surface->render_fence); - surface->context->pipe->winsys->fence_finish(surface->context->pipe->winsys, surface->render_fence, 0); + surface->context->pipe->screen->fence_finish(surface->context->pipe->screen, surface->render_fence, 0); return 0; } diff --git a/src/gallium/winsys/g3dvl/nouveau/Makefile b/src/gallium/winsys/g3dvl/nouveau/Makefile index 22d925b643..2997f6b79c 100644 --- a/src/gallium/winsys/g3dvl/nouveau/Makefile +++ b/src/gallium/winsys/g3dvl/nouveau/Makefile @@ -11,6 +11,7 @@ CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \ -I${GALLIUMDIR}/winsys/drm/nouveau \ -I${DRMDIR}/include \ -I${DRMDIR}/include/drm \ + -I${DRMDIR}/include/nouveau \ -I${GALLIUMDIR}/drivers \ -I${GALLIUMDIR}/auxiliary \ -I${DRIDIR}/include @@ -23,13 +24,14 @@ LDFLAGS += -L${DRMDIR}/lib \ -L${GALLIUMDIR}/auxiliary/translate \ -L${GALLIUMDIR}/auxiliary/rtasm \ -L${GALLIUMDIR}/auxiliary/cso_cache \ + -L${GALLIUMDIR}/drivers/nv04 \ -L${GALLIUMDIR}/drivers/nv10 \ -L${GALLIUMDIR}/drivers/nv20 \ -L${GALLIUMDIR}/drivers/nv30 \ -L${GALLIUMDIR}/drivers/nv40 \ -L${GALLIUMDIR}/drivers/nv50 -LIBS += -lnouveaudrm -ldriclient -ldrm -lnv10 -lnv20 -lnv30 -lnv40 -lnv50 -ldraw -ltgsi -ltranslate -lrtasm -lcso_cache -lm +LIBS += -lnouveaudrm -ldriclient -ldrm_nouveau -ldrm -lnv04 -lnv10 -lnv20 -lnv30 -lnv40 -lnv50 -ldraw -ltgsi -ltranslate -lrtasm -lcso_cache -lm ############################################# diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c b/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c index 658dafd910..b7c74f8299 100644 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c +++ b/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c @@ -4,7 +4,7 @@ #include #include -#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 11 +#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 12 #error nouveau_drm.h version does not match expected version #endif diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c b/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c index 16e6d5543c..864be37871 100644 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c +++ b/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c @@ -9,6 +9,7 @@ nouveau_copy_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf, const drm_clip_rect_t *rect) { struct nouveau_context_vl *nv = dri_drawable->private; + struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id]; drm_clip_rect_t *pbox; int nbox, i; @@ -20,7 +21,6 @@ nouveau_copy_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf, pbox = dri_drawable->cliprects; nbox = dri_drawable->num_cliprects; - nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf); for (i = 0; i < nbox; i++, pbox++) { int sx, sy, dx, dy, w, h; @@ -31,7 +31,8 @@ nouveau_copy_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf, w = pbox->x2 - pbox->x1; h = pbox->y2 - pbox->y1; - nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h); + pipe->surface_copy(pipe, FALSE, nv->base.frontbuffer, + dx, dy, surf, sx, sy, w, h); } FIRE_RING(nv->base.nvc->channel); -- cgit v1.2.3 From 80026428e3aa8f71ccd42d8d3b5e0a15c150dda2 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 6 Feb 2009 13:28:15 -0800 Subject: Rename winsys amd to radeon. --- src/gallium/winsys/drm/amd/Makefile | 32 --- src/gallium/winsys/drm/amd/SConscript | 29 -- src/gallium/winsys/drm/amd/amd_buffer.c | 239 ---------------- src/gallium/winsys/drm/amd/amd_buffer.h | 54 ---- src/gallium/winsys/drm/amd/amd_context.c | 306 --------------------- src/gallium/winsys/drm/amd/amd_context.h | 70 ----- src/gallium/winsys/drm/amd/amd_r300.c | 96 ------- src/gallium/winsys/drm/amd/amd_r300.h | 34 --- src/gallium/winsys/drm/amd/amd_screen.c | 288 ------------------- src/gallium/winsys/drm/amd/amd_screen.h | 41 --- src/gallium/winsys/drm/amd/amd_winsys_softpipe.c | 77 ------ src/gallium/winsys/drm/amd/amd_winsys_softpipe.h | 37 --- src/gallium/winsys/drm/radeon/Makefile | 32 +++ src/gallium/winsys/drm/radeon/SConscript | 29 ++ src/gallium/winsys/drm/radeon/radeon_buffer.c | 239 ++++++++++++++++ src/gallium/winsys/drm/radeon/radeon_buffer.h | 54 ++++ src/gallium/winsys/drm/radeon/radeon_context.c | 306 +++++++++++++++++++++ src/gallium/winsys/drm/radeon/radeon_context.h | 70 +++++ src/gallium/winsys/drm/radeon/radeon_r300.c | 96 +++++++ src/gallium/winsys/drm/radeon/radeon_r300.h | 34 +++ src/gallium/winsys/drm/radeon/radeon_screen.c | 288 +++++++++++++++++++ src/gallium/winsys/drm/radeon/radeon_screen.h | 41 +++ .../winsys/drm/radeon/radeon_winsys_softpipe.c | 77 ++++++ .../winsys/drm/radeon/radeon_winsys_softpipe.h | 37 +++ 24 files changed, 1303 insertions(+), 1303 deletions(-) delete mode 100644 src/gallium/winsys/drm/amd/Makefile delete mode 100644 src/gallium/winsys/drm/amd/SConscript delete mode 100644 src/gallium/winsys/drm/amd/amd_buffer.c delete mode 100644 src/gallium/winsys/drm/amd/amd_buffer.h delete mode 100644 src/gallium/winsys/drm/amd/amd_context.c delete mode 100644 src/gallium/winsys/drm/amd/amd_context.h delete mode 100644 src/gallium/winsys/drm/amd/amd_r300.c delete mode 100644 src/gallium/winsys/drm/amd/amd_r300.h delete mode 100644 src/gallium/winsys/drm/amd/amd_screen.c delete mode 100644 src/gallium/winsys/drm/amd/amd_screen.h delete mode 100644 src/gallium/winsys/drm/amd/amd_winsys_softpipe.c delete mode 100644 src/gallium/winsys/drm/amd/amd_winsys_softpipe.h create mode 100644 src/gallium/winsys/drm/radeon/Makefile create mode 100644 src/gallium/winsys/drm/radeon/SConscript create mode 100644 src/gallium/winsys/drm/radeon/radeon_buffer.c create mode 100644 src/gallium/winsys/drm/radeon/radeon_buffer.h create mode 100644 src/gallium/winsys/drm/radeon/radeon_context.c create mode 100644 src/gallium/winsys/drm/radeon/radeon_context.h create mode 100644 src/gallium/winsys/drm/radeon/radeon_r300.c create mode 100644 src/gallium/winsys/drm/radeon/radeon_r300.h create mode 100644 src/gallium/winsys/drm/radeon/radeon_screen.c create mode 100644 src/gallium/winsys/drm/radeon/radeon_screen.h create mode 100644 src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c create mode 100644 src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h (limited to 'src') diff --git a/src/gallium/winsys/drm/amd/Makefile b/src/gallium/winsys/drm/amd/Makefile deleted file mode 100644 index fb77873404..0000000000 --- a/src/gallium/winsys/drm/amd/Makefile +++ /dev/null @@ -1,32 +0,0 @@ - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = amd_dri.so - -MINIGLX_SOURCES = - -PIPE_DRIVERS = \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ - $(TOP)/src/gallium/drivers/r300/libr300.a - -DRIVER_SOURCES = \ - amd_buffer.c \ - amd_context.c \ - amd_r300.c \ - amd_screen.c \ - amd_winsys_softpipe.c - -C_SOURCES = \ - $(COMMON_GALLIUM_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - -DRIVER_DEFINES = -I../../../drivers/r300 - -include ../Makefile.template - -DRI_LIB_DEPS += -ldrm_radeon - -symlinks: diff --git a/src/gallium/winsys/drm/amd/SConscript b/src/gallium/winsys/drm/amd/SConscript deleted file mode 100644 index a4856da23c..0000000000 --- a/src/gallium/winsys/drm/amd/SConscript +++ /dev/null @@ -1,29 +0,0 @@ -Import('*') - -if 'mesa' in env['statetrackers']: - - env = drienv.Clone() - - DRIVER_SOURCES = [ - 'amd_buffer.c', - 'amd_context.c', - 'amd_screen.c', - 'amd_winsys_softpipe.c', - ] - - sources = \ - COMMON_GALLIUM_SOURCES + \ - DRIVER_SOURCES - - drivers = [ - softpipe, - r300 - ] - - # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions - env.SharedLibrary( - target ='amd_dri.so', - source = sources, - LIBS = drivers + mesa + auxiliaries + env['LIBS'], - ) - diff --git a/src/gallium/winsys/drm/amd/amd_buffer.c b/src/gallium/winsys/drm/amd/amd_buffer.c deleted file mode 100644 index 4b831c7fcc..0000000000 --- a/src/gallium/winsys/drm/amd/amd_buffer.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * 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 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 COPYRIGHT HOLDERS, AUTHORS - * 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#include -#include "dri_util.h" -#include "state_tracker/st_public.h" -#include "pipe/p_defines.h" -#include "pipe/p_inlines.h" -#include "amd_buffer.h" -#include "amd_screen.h" -#include "amd_context.h" -#include "radeon_bo.h" -#include "radeon_drm.h" - -static const char *amd_get_name(struct pipe_winsys *ws) -{ - return "AMD/DRI2"; -} - -static struct pipe_buffer *amd_buffer_create(struct pipe_winsys *ws, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct amd_pipe_winsys *amd_ws = (struct amd_pipe_winsys *)ws; - struct amd_pipe_buffer *amd_buffer; - uint32_t domain; - - amd_buffer = calloc(1, sizeof(*amd_buffer)); - if (amd_buffer == NULL) { - return NULL; - } - amd_buffer->base.refcount = 1; - amd_buffer->base.alignment = alignment; - amd_buffer->base.usage = usage; - amd_buffer->base.size = size; - - domain = 0; - - if (usage & PIPE_BUFFER_USAGE_PIXEL) { - domain |= RADEON_GEM_DOMAIN_VRAM; - } - if (usage & PIPE_BUFFER_USAGE_VERTEX) { - domain |= RADEON_GEM_DOMAIN_GTT; - } - - if (usage & PIPE_BUFFER_USAGE_INDEX) { - domain |= RADEON_GEM_DOMAIN_GTT; - } - amd_buffer->bo = radeon_bo_open(amd_ws->amd_screen->bom, 0, - size, alignment, domain, 0); - if (amd_buffer->bo == NULL) { - free(amd_buffer); - } - return &amd_buffer->base; -} - -static struct pipe_buffer *amd_buffer_user_create(struct pipe_winsys *ws, - void *ptr, - unsigned bytes) -{ - struct amd_pipe_buffer *amd_buffer; - - amd_buffer = (struct amd_pipe_buffer*)amd_buffer_create(ws, 0, 0, bytes); - if (amd_buffer == NULL) { - return NULL; - } - radeon_bo_map(amd_buffer->bo, 1); - memcpy(amd_buffer->bo->ptr, ptr, bytes); - radeon_bo_unmap(amd_buffer->bo); - return &amd_buffer->base; -} - -static void amd_buffer_del(struct pipe_winsys *ws, struct pipe_buffer *buffer) -{ - struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; - - radeon_bo_unref(amd_buffer->bo); - free(amd_buffer); -} - -static void *amd_buffer_map(struct pipe_winsys *ws, - struct pipe_buffer *buffer, - unsigned flags) -{ - struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; - int write = 0; - - if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { - write = 1; - } - if (radeon_bo_map(amd_buffer->bo, write)) - return NULL; - return amd_buffer->bo->ptr; -} - -static void amd_buffer_unmap(struct pipe_winsys *ws, struct pipe_buffer *buffer) -{ - struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; - - radeon_bo_unmap(amd_buffer->bo); -} - -static void amd_fence_reference(struct pipe_winsys *ws, - struct pipe_fence_handle **ptr, - struct pipe_fence_handle *pfence) -{ -} - -static int amd_fence_signalled(struct pipe_winsys *ws, - struct pipe_fence_handle *pfence, - unsigned flag) -{ - return 1; -} - -static int amd_fence_finish(struct pipe_winsys *ws, - struct pipe_fence_handle *pfence, - unsigned flag) -{ - return 0; -} - -static void amd_flush_frontbuffer(struct pipe_winsys *pipe_winsys, - struct pipe_surface *pipe_surface, - void *context_private) -{ - /* TODO: call dri2CopyRegion */ -} - -struct pipe_winsys *amd_pipe_winsys(struct amd_screen *amd_screen) -{ - struct amd_pipe_winsys *amd_ws; - - amd_ws = calloc(1, sizeof(struct amd_pipe_winsys)); - if (amd_ws == NULL) { - return NULL; - } - amd_ws->amd_screen = amd_screen; - - amd_ws->winsys.flush_frontbuffer = amd_flush_frontbuffer; - - amd_ws->winsys.buffer_create = amd_buffer_create; - amd_ws->winsys.buffer_destroy = amd_buffer_del; - amd_ws->winsys.user_buffer_create = amd_buffer_user_create; - amd_ws->winsys.buffer_map = amd_buffer_map; - amd_ws->winsys.buffer_unmap = amd_buffer_unmap; - - amd_ws->winsys.fence_reference = amd_fence_reference; - amd_ws->winsys.fence_signalled = amd_fence_signalled; - amd_ws->winsys.fence_finish = amd_fence_finish; - - amd_ws->winsys.get_name = amd_get_name; - - return &amd_ws->winsys; -} - -static struct pipe_buffer *amd_buffer_from_handle(struct amd_screen *amd_screen, - uint32_t handle) -{ - struct amd_pipe_buffer *amd_buffer; - struct radeon_bo *bo = NULL; - - bo = radeon_bo_open(amd_screen->bom, handle, 0, 0, 0, 0); - if (bo == NULL) { - return NULL; - } - amd_buffer = calloc(1, sizeof(struct amd_pipe_buffer)); - if (amd_buffer == NULL) { - radeon_bo_unref(bo); - return NULL; - } - amd_buffer->base.refcount = 1; - amd_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; - amd_buffer->bo = bo; - return &amd_buffer->base; -} - -struct pipe_surface *amd_surface_from_handle(struct amd_context *amd_context, - uint32_t handle, - enum pipe_format format, - int w, int h, int pitch) -{ - struct pipe_screen *pipe_screen = amd_context->pipe_screen; - struct pipe_winsys *pipe_winsys = amd_context->pipe_winsys; - struct pipe_texture tmpl; - struct pipe_surface *ps; - struct pipe_texture *pt; - struct pipe_buffer *pb; - - pb = amd_buffer_from_handle(amd_context->amd_screen, handle); - if (pb == NULL) { - return NULL; - } - memset(&tmpl, 0, sizeof(tmpl)); - tmpl.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET; - tmpl.target = PIPE_TEXTURE_2D; - tmpl.width[0] = w; - tmpl.height[0] = h; - tmpl.depth[0] = 1; - tmpl.format = format; - pf_get_block(tmpl.format, &tmpl.block); - tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w); - tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h); - - pt = pipe_screen->texture_blanket(pipe_screen, &tmpl, &pitch, pb); - if (pt == NULL) { - pipe_buffer_reference(pipe_screen, &pb, NULL); - } - ps = pipe_screen->get_tex_surface(pipe_screen, pt, 0, 0, 0, - PIPE_BUFFER_USAGE_GPU_WRITE); - return ps; -} diff --git a/src/gallium/winsys/drm/amd/amd_buffer.h b/src/gallium/winsys/drm/amd/amd_buffer.h deleted file mode 100644 index 238ca572ae..0000000000 --- a/src/gallium/winsys/drm/amd/amd_buffer.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * 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 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 COPYRIGHT HOLDERS, AUTHORS - * 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#ifndef AMD_BUFFER_H -#define AMD_BUFFER_H - -#include "pipe/internal/p_winsys_screen.h" -#include "amd_screen.h" -#include "amd_context.h" -#include "radeon_bo.h" - -struct amd_pipe_buffer { - struct pipe_buffer base; - struct radeon_bo *bo; -}; - -struct amd_pipe_winsys { - struct pipe_winsys winsys; - struct amd_screen *amd_screen; -}; - -struct pipe_winsys *amd_pipe_winsys(struct amd_screen *amd_screen); -struct pipe_surface *amd_surface_from_handle(struct amd_context *amd_context, - uint32_t handle, - enum pipe_format format, - int w, int h, int pitch); - -#endif diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/amd/amd_context.c deleted file mode 100644 index e089cf6874..0000000000 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * 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 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 COPYRIGHT HOLDERS, AUTHORS - * 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#include -#include "dri_util.h" -#include "pipe/p_defines.h" -#include "pipe/p_inlines.h" -#include "state_tracker/st_public.h" -#include "state_tracker/st_context.h" -#include "amd_screen.h" -#include "amd_context.h" -#include "amd_buffer.h" -#include "amd_winsys_softpipe.h" - -#define need_GL_ARB_fragment_program -#define need_GL_ARB_multisample -#define need_GL_ARB_point_parameters -#define need_GL_ARB_shader_objects -#define need_GL_ARB_texture_compression -#define need_GL_ARB_vertex_buffer_object -#define need_GL_ARB_vertex_program -#define need_GL_ARB_vertex_shader -#define need_GL_EXT_blend_color -#define need_GL_EXT_blend_equation_separate -#define need_GL_EXT_blend_func_separate -#define need_GL_EXT_blend_minmax -#define need_GL_EXT_cull_vertex -#define need_GL_EXT_compiled_vertex_array -#define need_GL_EXT_fog_coord -#define need_GL_EXT_framebuffer_object -#define need_GL_EXT_multi_draw_arrays -#define need_GL_EXT_secondary_color -#define need_GL_VERSION_2_0 -#define need_GL_VERSION_2_1 -#include "extension_helper.h" - -/** - * Extension strings exported by the amd driver. - */ -const struct dri_extension amd_card_extensions[] = { - {"GL_ARB_multitexture", NULL}, - {"GL_ARB_texture_border_clamp", NULL}, - {"GL_ARB_texture_rectangle", NULL}, - {"GL_ARB_pixel_buffer_object", NULL}, - {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, - {"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_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, - {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions}, - {"GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions}, - {"GL_EXT_blend_color", GL_EXT_blend_color_functions}, - {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions}, - {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, - {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, - {"GL_EXT_blend_subtract", NULL}, - {"GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions}, - {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions}, - {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions}, - {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions}, - {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions}, - {"GL_EXT_packed_depth_stencil", NULL}, - {"GL_EXT_pixel_buffer_object", NULL}, - {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, - {"GL_EXT_stencil_wrap", NULL}, - {NULL, NULL} -}; - -static void amd_update_renderbuffers(__DRIcontext *dri_context, - __DRIdrawable *dri_drawable) -{ - struct amd_framebuffer *amd_fb; - struct amd_context *amd_context; - unsigned attachments[10]; - __DRIbuffer *buffers; - __DRIscreen *screen; - int i, count; - - amd_context = dri_context->driverPrivate; - screen = dri_drawable->driScreenPriv; - amd_fb = dri_drawable->driverPrivate; - for (count = 0, i = 0; count < 6; count++) { - if (amd_fb->attachments & (1 << count)) { - attachments[i++] = count; - } - } - - buffers = (*screen->dri2.loader->getBuffers)(dri_drawable, - &dri_drawable->w, - &dri_drawable->h, - attachments, - i, - &count, - dri_drawable->loaderPrivate); - if (buffers == NULL) { - return; - } - - /* set one cliprect to cover the whole dri_drawable */ - dri_drawable->x = 0; - dri_drawable->y = 0; - dri_drawable->backX = 0; - dri_drawable->backY = 0; - dri_drawable->numClipRects = 1; - dri_drawable->pClipRects[0].x1 = 0; - dri_drawable->pClipRects[0].y1 = 0; - dri_drawable->pClipRects[0].x2 = dri_drawable->w; - dri_drawable->pClipRects[0].y2 = dri_drawable->h; - dri_drawable->numBackClipRects = 1; - dri_drawable->pBackClipRects[0].x1 = 0; - dri_drawable->pBackClipRects[0].y1 = 0; - dri_drawable->pBackClipRects[0].x2 = dri_drawable->w; - dri_drawable->pBackClipRects[0].y2 = dri_drawable->h; - - for (i = 0; i < count; i++) { - struct pipe_surface *ps; - enum pipe_format format = 0; - int index = 0; - - switch (buffers[i].attachment) { - case __DRI_BUFFER_FRONT_LEFT: - index = ST_SURFACE_FRONT_LEFT; - switch (buffers[i].cpp) { - case 4: - format = PIPE_FORMAT_A8R8G8B8_UNORM; - break; - case 2: - format = PIPE_FORMAT_R5G6B5_UNORM; - break; - default: - /* FIXME: error */ - return; - } - break; - case __DRI_BUFFER_BACK_LEFT: - index = ST_SURFACE_BACK_LEFT; - switch (buffers[i].cpp) { - case 4: - format = PIPE_FORMAT_A8R8G8B8_UNORM; - break; - case 2: - format = PIPE_FORMAT_R5G6B5_UNORM; - break; - default: - /* FIXME: error */ - return; - } - break; - case __DRI_BUFFER_STENCIL: - case __DRI_BUFFER_DEPTH: - index = ST_SURFACE_DEPTH; - switch (buffers[i].cpp) { - case 4: - format = PIPE_FORMAT_Z24S8_UNORM; - break; - case 2: - format = PIPE_FORMAT_Z16_UNORM; - break; - default: - /* FIXME: error */ - return; - } - break; - case __DRI_BUFFER_ACCUM: - default: - fprintf(stderr, - "unhandled buffer attach event, attacment type %d\n", - buffers[i].attachment); - return; - } - - ps = amd_surface_from_handle(amd_context, - buffers[i].name, - format, - dri_drawable->w, - dri_drawable->h, - buffers[i].pitch); - assert(ps); - st_set_framebuffer_surface(amd_fb->st_framebuffer, index, ps); - } - st_resize_framebuffer(amd_fb->st_framebuffer, - dri_drawable->w, - dri_drawable->h); -} - -GLboolean amd_context_create(const __GLcontextModes *visual, - __DRIcontextPrivate *dri_context, - void *shared_context) -{ - __DRIscreenPrivate *dri_screen; - struct amd_context *amd_context; - struct amd_screen *amd_screen; - struct pipe_context *pipe; - struct st_context *shared_st_context = NULL; - - dri_context->driverPrivate = NULL; - amd_context = calloc(1, sizeof(struct amd_context)); - if (amd_context == NULL) { - return GL_FALSE; - } - - if (shared_context) { - shared_st_context = ((struct amd_context*)shared_context)->st_context; - } - - dri_screen = dri_context->driScreenPriv; - amd_screen = dri_screen->private; - amd_context->dri_screen = dri_screen; - amd_context->amd_screen = amd_screen; - amd_context->drm_fd = dri_screen->fd; - - amd_context->pipe_winsys = amd_pipe_winsys(amd_screen); - if (amd_context->pipe_winsys == NULL) { - free(amd_context); - return GL_FALSE; - } - - if (!getenv("AMD_SOFTPIPE")) { - fprintf(stderr, "Creating r300 context...\n"); - pipe = - r300_create_context(NULL, - amd_context->pipe_winsys, - amd_create_r300_winsys(amd_context->drm_fd)); - amd_context->pipe_screen = pipe->screen; - } else { - pipe = amd_create_softpipe(amd_context); - } - amd_context->st_context = st_create_context(pipe, visual, - shared_st_context); - driInitExtensions(amd_context->st_context->ctx, - amd_card_extensions, GL_TRUE); - dri_context->driverPrivate = amd_context; - return GL_TRUE; -} - -void amd_context_destroy(__DRIcontextPrivate *dri_context) -{ - struct amd_context *amd_context; - - amd_context = dri_context->driverPrivate; - st_finish(amd_context->st_context); - st_destroy_context(amd_context->st_context); - free(amd_context); -} - -GLboolean amd_context_bind(__DRIcontextPrivate *dri_context, - __DRIdrawablePrivate *dri_drawable, - __DRIdrawablePrivate *dri_readable) -{ - struct amd_framebuffer *drawable; - struct amd_framebuffer *readable; - struct amd_context *amd_context; - - if (dri_context == NULL) { - st_make_current(NULL, NULL, NULL); - return GL_TRUE; - } - - amd_context = dri_context->driverPrivate; - drawable = dri_drawable->driverPrivate; - readable = dri_readable->driverPrivate; - st_make_current(amd_context->st_context, - drawable->st_framebuffer, - readable->st_framebuffer); - - amd_update_renderbuffers(dri_context, dri_drawable); - if (dri_drawable != dri_readable) { - amd_update_renderbuffers(dri_context, dri_readable); - } - return GL_TRUE; -} - -GLboolean amd_context_unbind(__DRIcontextPrivate *dri_context) -{ - struct amd_context *amd_context; - - amd_context = dri_context->driverPrivate; - st_flush(amd_context->st_context, PIPE_FLUSH_RENDER_CACHE, NULL); - return GL_TRUE; -} diff --git a/src/gallium/winsys/drm/amd/amd_context.h b/src/gallium/winsys/drm/amd/amd_context.h deleted file mode 100644 index 12557c40c4..0000000000 --- a/src/gallium/winsys/drm/amd/amd_context.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * 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 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 COPYRIGHT HOLDERS, AUTHORS - * 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#ifndef AMD_CONTEXT_H -#define AMD_CONTEXT_H - -#include "dri_util.h" -#include "state_tracker/st_public.h" -#include "state_tracker/st_context.h" -#include "amd_screen.h" - -#include "amd_r300.h" - -struct amd_framebuffer { - struct st_framebuffer *st_framebuffer; - unsigned attachments; -}; - -struct amd_context { - /* st */ - struct st_context *st_context; - /* pipe */ - struct pipe_screen *pipe_screen; - struct pipe_winsys *pipe_winsys; - /* DRI */ - __DRIscreenPrivate *dri_screen; - __DRIdrawablePrivate *dri_drawable; - __DRIdrawablePrivate *dri_readable; - /* DRM */ - int drm_fd; - /* AMD */ - struct amd_screen *amd_screen; -}; - -GLboolean amd_context_create(const __GLcontextModes*, - __DRIcontextPrivate*, - void*); -void amd_context_destroy(__DRIcontextPrivate*); -GLboolean amd_context_bind(__DRIcontextPrivate*, - __DRIdrawablePrivate*, - __DRIdrawablePrivate*); -GLboolean amd_context_unbind(__DRIcontextPrivate*); - -#endif diff --git a/src/gallium/winsys/drm/amd/amd_r300.c b/src/gallium/winsys/drm/amd/amd_r300.c deleted file mode 100644 index 04295e8281..0000000000 --- a/src/gallium/winsys/drm/amd/amd_r300.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2008 Corbin Simpson - * - * 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 "amd_r300.h" - -static boolean amd_r300_check_cs(struct radeon_cs* cs, int size) -{ - /* XXX check size here, lazy ass! */ - return TRUE; -} - -static void amd_r300_write_cs_reloc(struct radeon_cs* cs, - struct pipe_buffer* pbuffer, - uint32_t rd, - uint32_t wd, - uint32_t flags) -{ - radeon_cs_write_reloc(cs, ((struct amd_pipe_buffer*)pbuffer)->bo, rd, wd, flags); -} - -static void amd_r300_flush_cs(struct radeon_cs* cs) -{ - radeon_cs_emit(cs); - radeon_cs_erase(cs); -} - -/* Helper function to do the ioctls needed for setup and init. */ -static void do_ioctls(struct r300_winsys* winsys, int fd) -{ - drm_radeon_getparam_t gp; - uint32_t target; - int retval; - - /* XXX is this cast safe? */ - gp.value = (int*)⌖ - - /* First, get PCI ID */ - gp.param = RADEON_PARAM_DEVICE_ID; - retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); - if (retval) { - fprintf(stderr, "%s: Failed to get PCI ID, error number %d", - __FUNCTION__, retval); - exit(1); - } - winsys->pci_id = target; - - /* Then, get the number of pixel pipes */ - gp.param = RADEON_PARAM_NUM_GB_PIPES; - retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); - if (retval) { - fprintf(stderr, "%s: Failed to get GB pipe count, error number %d", - __FUNCTION__, retval); - exit(1); - } - winsys->gb_pipes = target; - -} - -struct r300_winsys* amd_create_r300_winsys(int fd) -{ - struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys)); - - do_ioctls(winsys, fd); - - struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); - - winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4); - - winsys->check_cs = amd_r300_check_cs; - winsys->begin_cs = radeon_cs_begin; - winsys->write_cs_dword = radeon_cs_write_dword; - winsys->write_cs_reloc = amd_r300_write_cs_reloc; - winsys->end_cs = radeon_cs_end; - winsys->flush_cs = amd_r300_flush_cs; - - return winsys; -} diff --git a/src/gallium/winsys/drm/amd/amd_r300.h b/src/gallium/winsys/drm/amd/amd_r300.h deleted file mode 100644 index d80c23594c..0000000000 --- a/src/gallium/winsys/drm/amd/amd_r300.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2008 Corbin Simpson - * - * 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. */ - -/* XXX WTF is this! I shouldn't have to include those first three! FUCK! */ -#include -#include -#include "drm.h" -#include "radeon_drm.h" -#include "radeon_cs.h" - -#include "r300_winsys.h" - -#include "amd_buffer.h" - -struct r300_winsys* amd_create_r300_winsys(int fd); diff --git a/src/gallium/winsys/drm/amd/amd_screen.c b/src/gallium/winsys/drm/amd/amd_screen.c deleted file mode 100644 index d62b47f36d..0000000000 --- a/src/gallium/winsys/drm/amd/amd_screen.c +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * 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 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 COPYRIGHT HOLDERS, AUTHORS - * 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#include -#include "pipe/p_screen.h" -#include "pipe/p_defines.h" -#include "pipe/p_inlines.h" -#include "pipe/p_context.h" -#include "pipe/p_state.h" -#include "state_tracker/st_public.h" -#include "state_tracker/st_context.h" -#include "utils.h" -#include "xf86drm.h" -#include "drm.h" -#include "dri_util.h" -#include "amd_screen.h" -#include "amd_context.h" -#include "amd_buffer.h" -#include "radeon_bo.h" -#include "radeon_bo_gem.h" -#include "radeon_drm.h" - -extern const struct dri_extension amd_card_extensions[]; - -static const __DRIextension *amd_screen_extensions[] = { - &driReadDrawableExtension, - &driCopySubBufferExtension.base, - &driSwapControlExtension.base, - &driFrameTrackingExtension.base, - &driMediaStreamCounterExtension.base, - NULL -}; - -static __DRIconfig **amd_fill_in_modes(unsigned pixel_bits, - unsigned depth_bits, - GLboolean have_back_buffer) -{ - __DRIconfig **configs; - unsigned depth_buffer_factor; - unsigned back_buffer_factor; - unsigned num_modes; - GLenum fb_format; - GLenum fb_type; - uint8_t depth_bits_array[3]; - uint8_t stencil_bits_array[3]; - uint8_t msaa_samples_array[1]; - /* TODO: pageflipping ? */ - static const GLenum back_buffer_modes[] = { - GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML - }; - - stencil_bits_array[0] = 0; - stencil_bits_array[1] = 0; - if (depth_bits == 24) { - stencil_bits_array[2] = 8; - num_modes = 3; - } - - depth_bits_array[0] = 0; - depth_bits_array[1] = depth_bits; - depth_bits_array[2] = depth_bits; - depth_buffer_factor = (depth_bits == 24) ? 3 : 2; - - back_buffer_factor = (have_back_buffer) ? 3 : 1; - - msaa_samples_array[0] = 0; - - if (pixel_bits == 16) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; - } else { - fb_format = GL_BGRA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } - - configs = (__DRIconfig **)driCreateConfigs(fb_format, - fb_type, - depth_bits_array, - stencil_bits_array, - depth_buffer_factor, - back_buffer_modes, - back_buffer_factor, - msaa_samples_array, - 1); - if (configs == NULL) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", - __FILE__, __LINE__); - return NULL; - } - return configs; -} - -static void amd_screen_destroy(__DRIscreenPrivate *dri_screen) -{ - struct amd_screen *amd_screen = (struct amd_screen*)dri_screen->private; - - radeon_bo_manager_gem_dtor(amd_screen->bom); - dri_screen = NULL; - free(amd_screen); -} - -static const __DRIconfig **amd_screen_init(__DRIscreenPrivate *dri_screen) -{ - struct amd_screen *amd_screen; - - /* 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, amd_card_extensions, GL_FALSE); - - amd_screen = calloc(1, sizeof(struct amd_screen)); - if (amd_screen == NULL) { - fprintf(stderr, "\nERROR! Allocating private area failed\n"); - return NULL; - } - dri_screen->private = (void*)amd_screen; - dri_screen->extensions = amd_screen_extensions; - amd_screen->dri_screen = dri_screen; - - amd_screen->bom = radeon_bo_manager_gem_ctor(dri_screen->fd); - if (amd_screen->bom == NULL) { - amd_screen_destroy(dri_screen); - return NULL; - } - - return driConcatConfigs(amd_fill_in_modes(16, 16, 1), - amd_fill_in_modes(32, 24, 1)); -} - -static boolean amd_buffer_create(__DRIscreenPrivate *dri_screen, - __DRIdrawablePrivate *dri_drawable, - const __GLcontextModes *visual, - boolean is_pixmap) -{ - if (is_pixmap) { - /* TODO: implement ? */ - return GL_FALSE; - } else { - enum pipe_format color_format, depth_format, stencil_format; - struct amd_framebuffer *amd_fb; - - amd_fb = calloc(1, sizeof(struct amd_framebuffer)); - if (amd_fb == NULL) { - return GL_FALSE; - } - - switch (visual->redBits) { - case 5: - color_format = PIPE_FORMAT_R5G6B5_UNORM; - break; - default: - color_format = PIPE_FORMAT_A8R8G8B8_UNORM; - break; - } - - switch (visual->depthBits) { - case 24: - depth_format = PIPE_FORMAT_S8Z24_UNORM; - break; - case 16: - depth_format = PIPE_FORMAT_Z16_UNORM; - break; - default: - depth_format = PIPE_FORMAT_NONE; - break; - } - - switch (visual->stencilBits) { - case 8: - /* force depth format */ - depth_format = PIPE_FORMAT_S8Z24_UNORM; - stencil_format = PIPE_FORMAT_S8Z24_UNORM; - break; - default: - stencil_format = PIPE_FORMAT_NONE; - break; - } - - amd_fb->st_framebuffer = st_create_framebuffer(visual, - color_format, - depth_format, - stencil_format, - dri_drawable->w, - dri_drawable->h, - (void*)amd_fb); - if (amd_fb->st_framebuffer == NULL) { - free(amd_fb); - return GL_FALSE; - } - dri_drawable->driverPrivate = (void *) amd_fb; - - amd_fb->attachments = (1 << __DRI_BUFFER_FRONT_LEFT); - if (visual->doubleBufferMode) { - amd_fb->attachments |= (1 << __DRI_BUFFER_BACK_LEFT); - } - if (visual->depthBits || visual->stencilBits) { - amd_fb->attachments |= (1 << __DRI_BUFFER_DEPTH); - } - - return GL_TRUE; - } -} - -static void amd_buffer_destroy(__DRIdrawablePrivate * dri_drawable) -{ - struct amd_framebuffer *amd_fb; - - amd_fb = dri_drawable->driverPrivate; - assert(amd_fb->st_framebuffer); - st_unreference_framebuffer(amd_fb->st_framebuffer); - free(amd_fb); -} - -static void amd_swap_buffers(__DRIdrawablePrivate *dri_drawable) -{ - struct amd_framebuffer *amd_fb; - struct pipe_surface *back_surf = NULL; - - amd_fb = dri_drawable->driverPrivate; - assert(amd_fb); - assert(amd_fb->st_framebuffer); - - st_get_framebuffer_surface(amd_fb->st_framebuffer, - ST_SURFACE_BACK_LEFT, - &back_surf); - if (back_surf) { - st_notify_swapbuffers(amd_fb->st_framebuffer); - /* TODO: do we want to do anythings ? */ - st_notify_swapbuffers_complete(amd_fb->st_framebuffer); - } -} - -/** - * Called via glXCopySubBufferMESA() to copy a subrect of the back - * buffer to the front buffer/screen. - */ -static void amd_copy_sub_buffer(__DRIdrawablePrivate *dri_drawable, - int x, int y, int w, int h) -{ - /* TODO: ... */ -} - -const struct __DriverAPIRec driDriverAPI = { - .InitScreen = NULL, - .DestroyScreen = amd_screen_destroy, - .CreateContext = amd_context_create, - .DestroyContext = amd_context_destroy, - .CreateBuffer = amd_buffer_create, - .DestroyBuffer = amd_buffer_destroy, - .SwapBuffers = amd_swap_buffers, - .MakeCurrent = amd_context_bind, - .UnbindContext = amd_context_unbind, - .CopySubBuffer = amd_copy_sub_buffer, - .InitScreen2 = amd_screen_init, -}; diff --git a/src/gallium/winsys/drm/amd/amd_screen.h b/src/gallium/winsys/drm/amd/amd_screen.h deleted file mode 100644 index 2617393f2e..0000000000 --- a/src/gallium/winsys/drm/amd/amd_screen.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * 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 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 COPYRIGHT HOLDERS, AUTHORS - * 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#ifndef AMD_SCREEN_H -#define AMD_SCREEN_H - -#include "dri_util.h" -#include "radeon_bo.h" - -struct amd_screen { - __DRIscreenPrivate *dri_screen; - struct radeon_bo_manager *bom; -}; - -#endif diff --git a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c b/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c deleted file mode 100644 index b9b2a0e8b8..0000000000 --- a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Keith Whitwell - */ -#include -#include "imports.h" -#include "pipe/p_defines.h" -#include "pipe/p_format.h" -#include "softpipe/sp_winsys.h" -#include "amd_context.h" -#include "amd_winsys_softpipe.h" - -struct amd_softpipe_winsys { - struct softpipe_winsys sp_winsys; - struct amd_context *amd_context; -}; - -/** - * Return list of surface formats supported by this driver. - */ -static boolean amd_is_format_supported(struct softpipe_winsys *sws, uint format) -{ - switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - return TRUE; - default: - break; - }; - return FALSE; -} - -struct pipe_context *amd_create_softpipe(struct amd_context *amd_context) -{ - struct amd_softpipe_winsys *amd_sp_ws; - struct pipe_screen *pipe_screen; - - pipe_screen = softpipe_create_screen(amd_context->pipe_winsys); - - amd_sp_ws = CALLOC_STRUCT(amd_softpipe_winsys); - if (amd_sp_ws == NULL) { - return NULL; - } - amd_context->pipe_screen = pipe_screen; - amd_sp_ws->amd_context = amd_context; - amd_sp_ws->sp_winsys.is_format_supported = amd_is_format_supported; - return softpipe_create(pipe_screen, - amd_context->pipe_winsys, - &amd_sp_ws->sp_winsys); -} diff --git a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h b/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h deleted file mode 100644 index e5b68cf8a5..0000000000 --- a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * 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 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 COPYRIGHT HOLDERS, AUTHORS - * 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#ifndef AMD_WINSYS_SOFTPIPE_H -#define AMD_WINSYS_SOFTPIPE_H - -#include "amd_context.h" - -struct pipe_context *amd_create_softpipe(struct amd_context *amd_context); - -#endif diff --git a/src/gallium/winsys/drm/radeon/Makefile b/src/gallium/winsys/drm/radeon/Makefile new file mode 100644 index 0000000000..dca1e3233a --- /dev/null +++ b/src/gallium/winsys/drm/radeon/Makefile @@ -0,0 +1,32 @@ + +TOP = ../../../../.. +include $(TOP)/configs/current + +LIBNAME = radeon_dri.so + +MINIGLX_SOURCES = + +PIPE_DRIVERS = \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ + $(TOP)/src/gallium/drivers/r300/libr300.a + +DRIVER_SOURCES = \ + radeon_buffer.c \ + radeon_context.c \ + radeon_r300.c \ + radeon_screen.c \ + radeon_winsys_softpipe.c + +C_SOURCES = \ + $(COMMON_GALLIUM_SOURCES) \ + $(DRIVER_SOURCES) + +ASM_SOURCES = + +DRIVER_DEFINES = -I../../../drivers/r300 + +include ../Makefile.template + +DRI_LIB_DEPS += -ldrm_radeon + +symlinks: diff --git a/src/gallium/winsys/drm/radeon/SConscript b/src/gallium/winsys/drm/radeon/SConscript new file mode 100644 index 0000000000..2435211a32 --- /dev/null +++ b/src/gallium/winsys/drm/radeon/SConscript @@ -0,0 +1,29 @@ +Import('*') + +if 'mesa' in env['statetrackers']: + + env = drienv.Clone() + + DRIVER_SOURCES = [ + 'radeon_buffer.c', + 'radeon_context.c', + 'radeon_screen.c', + 'radeon_winsys_softpipe.c', + ] + + sources = \ + COMMON_GALLIUM_SOURCES + \ + DRIVER_SOURCES + + drivers = [ + softpipe, + r300 + ] + + # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions + env.SharedLibrary( + target ='radeon_dri.so', + source = sources, + LIBS = drivers + mesa + auxiliaries + env['LIBS'], + ) + diff --git a/src/gallium/winsys/drm/radeon/radeon_buffer.c b/src/gallium/winsys/drm/radeon/radeon_buffer.c new file mode 100644 index 0000000000..259a505c0a --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_buffer.c @@ -0,0 +1,239 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#include +#include "dri_util.h" +#include "state_tracker/st_public.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "radeon_buffer.h" +#include "radeon_screen.h" +#include "radeon_context.h" +#include "radeon_bo.h" +#include "radeon_drm.h" + +static const char *radeon_get_name(struct pipe_winsys *ws) +{ + return "RADEON/DRI2"; +} + +static struct pipe_buffer *radeon_buffer_create(struct pipe_winsys *ws, + unsigned alignment, + unsigned usage, + unsigned size) +{ + struct radeon_pipe_winsys *radeon_ws = (struct radeon_pipe_winsys *)ws; + struct radeon_pipe_buffer *radeon_buffer; + uint32_t domain; + + radeon_buffer = calloc(1, sizeof(*radeon_buffer)); + if (radeon_buffer == NULL) { + return NULL; + } + radeon_buffer->base.refcount = 1; + radeon_buffer->base.alignment = alignment; + radeon_buffer->base.usage = usage; + radeon_buffer->base.size = size; + + domain = 0; + + if (usage & PIPE_BUFFER_USAGE_PIXEL) { + domain |= RADEON_GEM_DOMAIN_VRAM; + } + if (usage & PIPE_BUFFER_USAGE_VERTEX) { + domain |= RADEON_GEM_DOMAIN_GTT; + } + + if (usage & PIPE_BUFFER_USAGE_INDEX) { + domain |= RADEON_GEM_DOMAIN_GTT; + } + radeon_buffer->bo = radeon_bo_open(radeon_ws->radeon_screen->bom, 0, + size, alignment, domain, 0); + if (radeon_buffer->bo == NULL) { + free(radeon_buffer); + } + return &radeon_buffer->base; +} + +static struct pipe_buffer *radeon_buffer_user_create(struct pipe_winsys *ws, + void *ptr, + unsigned bytes) +{ + struct radeon_pipe_buffer *radeon_buffer; + + radeon_buffer = (struct radeon_pipe_buffer*)radeon_buffer_create(ws, 0, 0, bytes); + if (radeon_buffer == NULL) { + return NULL; + } + radeon_bo_map(radeon_buffer->bo, 1); + memcpy(radeon_buffer->bo->ptr, ptr, bytes); + radeon_bo_unmap(radeon_buffer->bo); + return &radeon_buffer->base; +} + +static void radeon_buffer_del(struct pipe_winsys *ws, struct pipe_buffer *buffer) +{ + struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; + + radeon_bo_unref(radeon_buffer->bo); + free(radeon_buffer); +} + +static void *radeon_buffer_map(struct pipe_winsys *ws, + struct pipe_buffer *buffer, + unsigned flags) +{ + struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; + int write = 0; + + if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { + write = 1; + } + if (radeon_bo_map(radeon_buffer->bo, write)) + return NULL; + return radeon_buffer->bo->ptr; +} + +static void radeon_buffer_unmap(struct pipe_winsys *ws, struct pipe_buffer *buffer) +{ + struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; + + radeon_bo_unmap(radeon_buffer->bo); +} + +static void radeon_fence_reference(struct pipe_winsys *ws, + struct pipe_fence_handle **ptr, + struct pipe_fence_handle *pfence) +{ +} + +static int radeon_fence_signalled(struct pipe_winsys *ws, + struct pipe_fence_handle *pfence, + unsigned flag) +{ + return 1; +} + +static int radeon_fence_finish(struct pipe_winsys *ws, + struct pipe_fence_handle *pfence, + unsigned flag) +{ + return 0; +} + +static void radeon_flush_frontbuffer(struct pipe_winsys *pipe_winsys, + struct pipe_surface *pipe_surface, + void *context_private) +{ + /* TODO: call dri2CopyRegion */ +} + +struct pipe_winsys *radeon_pipe_winsys(struct radeon_screen *radeon_screen) +{ + struct radeon_pipe_winsys *radeon_ws; + + radeon_ws = calloc(1, sizeof(struct radeon_pipe_winsys)); + if (radeon_ws == NULL) { + return NULL; + } + radeon_ws->radeon_screen = radeon_screen; + + radeon_ws->winsys.flush_frontbuffer = radeon_flush_frontbuffer; + + radeon_ws->winsys.buffer_create = radeon_buffer_create; + radeon_ws->winsys.buffer_destroy = radeon_buffer_del; + radeon_ws->winsys.user_buffer_create = radeon_buffer_user_create; + radeon_ws->winsys.buffer_map = radeon_buffer_map; + radeon_ws->winsys.buffer_unmap = radeon_buffer_unmap; + + radeon_ws->winsys.fence_reference = radeon_fence_reference; + radeon_ws->winsys.fence_signalled = radeon_fence_signalled; + radeon_ws->winsys.fence_finish = radeon_fence_finish; + + radeon_ws->winsys.get_name = radeon_get_name; + + return &radeon_ws->winsys; +} + +static struct pipe_buffer *radeon_buffer_from_handle(struct radeon_screen *radeon_screen, + uint32_t handle) +{ + struct radeon_pipe_buffer *radeon_buffer; + struct radeon_bo *bo = NULL; + + bo = radeon_bo_open(radeon_screen->bom, handle, 0, 0, 0, 0); + if (bo == NULL) { + return NULL; + } + radeon_buffer = calloc(1, sizeof(struct radeon_pipe_buffer)); + if (radeon_buffer == NULL) { + radeon_bo_unref(bo); + return NULL; + } + radeon_buffer->base.refcount = 1; + radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; + radeon_buffer->bo = bo; + return &radeon_buffer->base; +} + +struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context, + uint32_t handle, + enum pipe_format format, + int w, int h, int pitch) +{ + struct pipe_screen *pipe_screen = radeon_context->pipe_screen; + struct pipe_winsys *pipe_winsys = radeon_context->pipe_winsys; + struct pipe_texture tmpl; + struct pipe_surface *ps; + struct pipe_texture *pt; + struct pipe_buffer *pb; + + pb = radeon_buffer_from_handle(radeon_context->radeon_screen, handle); + if (pb == NULL) { + return NULL; + } + memset(&tmpl, 0, sizeof(tmpl)); + tmpl.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + tmpl.target = PIPE_TEXTURE_2D; + tmpl.width[0] = w; + tmpl.height[0] = h; + tmpl.depth[0] = 1; + tmpl.format = format; + pf_get_block(tmpl.format, &tmpl.block); + tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w); + tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h); + + pt = pipe_screen->texture_blanket(pipe_screen, &tmpl, &pitch, pb); + if (pt == NULL) { + pipe_buffer_reference(pipe_screen, &pb, NULL); + } + ps = pipe_screen->get_tex_surface(pipe_screen, pt, 0, 0, 0, + PIPE_BUFFER_USAGE_GPU_WRITE); + return ps; +} diff --git a/src/gallium/winsys/drm/radeon/radeon_buffer.h b/src/gallium/winsys/drm/radeon/radeon_buffer.h new file mode 100644 index 0000000000..c626c20229 --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_buffer.h @@ -0,0 +1,54 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef RADEON_BUFFER_H +#define RADEON_BUFFER_H + +#include "pipe/internal/p_winsys_screen.h" +#include "radeon_screen.h" +#include "radeon_context.h" +#include "radeon_bo.h" + +struct radeon_pipe_buffer { + struct pipe_buffer base; + struct radeon_bo *bo; +}; + +struct radeon_pipe_winsys { + struct pipe_winsys winsys; + struct radeon_screen *radeon_screen; +}; + +struct pipe_winsys *radeon_pipe_winsys(struct radeon_screen *radeon_screen); +struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context, + uint32_t handle, + enum pipe_format format, + int w, int h, int pitch); + +#endif diff --git a/src/gallium/winsys/drm/radeon/radeon_context.c b/src/gallium/winsys/drm/radeon/radeon_context.c new file mode 100644 index 0000000000..a9d1577634 --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_context.c @@ -0,0 +1,306 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#include +#include "dri_util.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "state_tracker/st_public.h" +#include "state_tracker/st_context.h" +#include "radeon_screen.h" +#include "radeon_context.h" +#include "radeon_buffer.h" +#include "radeon_winsys_softpipe.h" + +#define need_GL_ARB_fragment_program +#define need_GL_ARB_multisample +#define need_GL_ARB_point_parameters +#define need_GL_ARB_shader_objects +#define need_GL_ARB_texture_compression +#define need_GL_ARB_vertex_buffer_object +#define need_GL_ARB_vertex_program +#define need_GL_ARB_vertex_shader +#define need_GL_EXT_blend_color +#define need_GL_EXT_blend_equation_separate +#define need_GL_EXT_blend_func_separate +#define need_GL_EXT_blend_minmax +#define need_GL_EXT_cull_vertex +#define need_GL_EXT_compiled_vertex_array +#define need_GL_EXT_fog_coord +#define need_GL_EXT_framebuffer_object +#define need_GL_EXT_multi_draw_arrays +#define need_GL_EXT_secondary_color +#define need_GL_VERSION_2_0 +#define need_GL_VERSION_2_1 +#include "extension_helper.h" + +/** + * Extension strings exported by the radeon driver. + */ +const struct dri_extension radeon_card_extensions[] = { + {"GL_ARB_multitexture", NULL}, + {"GL_ARB_texture_border_clamp", NULL}, + {"GL_ARB_texture_rectangle", NULL}, + {"GL_ARB_pixel_buffer_object", NULL}, + {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, + {"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_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, + {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions}, + {"GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions}, + {"GL_EXT_blend_color", GL_EXT_blend_color_functions}, + {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions}, + {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, + {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, + {"GL_EXT_blend_subtract", NULL}, + {"GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions}, + {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions}, + {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions}, + {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions}, + {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions}, + {"GL_EXT_packed_depth_stencil", NULL}, + {"GL_EXT_pixel_buffer_object", NULL}, + {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, + {"GL_EXT_stencil_wrap", NULL}, + {NULL, NULL} +}; + +static void radeon_update_renderbuffers(__DRIcontext *dri_context, + __DRIdrawable *dri_drawable) +{ + struct radeon_framebuffer *radeon_fb; + struct radeon_context *radeon_context; + unsigned attachments[10]; + __DRIbuffer *buffers; + __DRIscreen *screen; + int i, count; + + radeon_context = dri_context->driverPrivate; + screen = dri_drawable->driScreenPriv; + radeon_fb = dri_drawable->driverPrivate; + for (count = 0, i = 0; count < 6; count++) { + if (radeon_fb->attachments & (1 << count)) { + attachments[i++] = count; + } + } + + buffers = (*screen->dri2.loader->getBuffers)(dri_drawable, + &dri_drawable->w, + &dri_drawable->h, + attachments, + i, + &count, + dri_drawable->loaderPrivate); + if (buffers == NULL) { + return; + } + + /* set one cliprect to cover the whole dri_drawable */ + dri_drawable->x = 0; + dri_drawable->y = 0; + dri_drawable->backX = 0; + dri_drawable->backY = 0; + dri_drawable->numClipRects = 1; + dri_drawable->pClipRects[0].x1 = 0; + dri_drawable->pClipRects[0].y1 = 0; + dri_drawable->pClipRects[0].x2 = dri_drawable->w; + dri_drawable->pClipRects[0].y2 = dri_drawable->h; + dri_drawable->numBackClipRects = 1; + dri_drawable->pBackClipRects[0].x1 = 0; + dri_drawable->pBackClipRects[0].y1 = 0; + dri_drawable->pBackClipRects[0].x2 = dri_drawable->w; + dri_drawable->pBackClipRects[0].y2 = dri_drawable->h; + + for (i = 0; i < count; i++) { + struct pipe_surface *ps; + enum pipe_format format = 0; + int index = 0; + + switch (buffers[i].attachment) { + case __DRI_BUFFER_FRONT_LEFT: + index = ST_SURFACE_FRONT_LEFT; + switch (buffers[i].cpp) { + case 4: + format = PIPE_FORMAT_A8R8G8B8_UNORM; + break; + case 2: + format = PIPE_FORMAT_R5G6B5_UNORM; + break; + default: + /* FIXME: error */ + return; + } + break; + case __DRI_BUFFER_BACK_LEFT: + index = ST_SURFACE_BACK_LEFT; + switch (buffers[i].cpp) { + case 4: + format = PIPE_FORMAT_A8R8G8B8_UNORM; + break; + case 2: + format = PIPE_FORMAT_R5G6B5_UNORM; + break; + default: + /* FIXME: error */ + return; + } + break; + case __DRI_BUFFER_STENCIL: + case __DRI_BUFFER_DEPTH: + index = ST_SURFACE_DEPTH; + switch (buffers[i].cpp) { + case 4: + format = PIPE_FORMAT_Z24S8_UNORM; + break; + case 2: + format = PIPE_FORMAT_Z16_UNORM; + break; + default: + /* FIXME: error */ + return; + } + break; + case __DRI_BUFFER_ACCUM: + default: + fprintf(stderr, + "unhandled buffer attach event, attacment type %d\n", + buffers[i].attachment); + return; + } + + ps = radeon_surface_from_handle(radeon_context, + buffers[i].name, + format, + dri_drawable->w, + dri_drawable->h, + buffers[i].pitch); + assert(ps); + st_set_framebuffer_surface(radeon_fb->st_framebuffer, index, ps); + } + st_resize_framebuffer(radeon_fb->st_framebuffer, + dri_drawable->w, + dri_drawable->h); +} + +GLboolean radeon_context_create(const __GLcontextModes *visual, + __DRIcontextPrivate *dri_context, + void *shared_context) +{ + __DRIscreenPrivate *dri_screen; + struct radeon_context *radeon_context; + struct radeon_screen *radeon_screen; + struct pipe_context *pipe; + struct st_context *shared_st_context = NULL; + + dri_context->driverPrivate = NULL; + radeon_context = calloc(1, sizeof(struct radeon_context)); + if (radeon_context == NULL) { + return GL_FALSE; + } + + if (shared_context) { + shared_st_context = ((struct radeon_context*)shared_context)->st_context; + } + + dri_screen = dri_context->driScreenPriv; + radeon_screen = dri_screen->private; + radeon_context->dri_screen = dri_screen; + radeon_context->radeon_screen = radeon_screen; + radeon_context->drm_fd = dri_screen->fd; + + radeon_context->pipe_winsys = radeon_pipe_winsys(radeon_screen); + if (radeon_context->pipe_winsys == NULL) { + free(radeon_context); + return GL_FALSE; + } + + if (!getenv("RADEON_SOFTPIPE")) { + fprintf(stderr, "Creating r300 context...\n"); + pipe = + r300_create_context(NULL, + radeon_context->pipe_winsys, + radeon_create_r300_winsys(radeon_context->drm_fd)); + radeon_context->pipe_screen = pipe->screen; + } else { + pipe = radeon_create_softpipe(radeon_context); + } + radeon_context->st_context = st_create_context(pipe, visual, + shared_st_context); + driInitExtensions(radeon_context->st_context->ctx, + radeon_card_extensions, GL_TRUE); + dri_context->driverPrivate = radeon_context; + return GL_TRUE; +} + +void radeon_context_destroy(__DRIcontextPrivate *dri_context) +{ + struct radeon_context *radeon_context; + + radeon_context = dri_context->driverPrivate; + st_finish(radeon_context->st_context); + st_destroy_context(radeon_context->st_context); + free(radeon_context); +} + +GLboolean radeon_context_bind(__DRIcontextPrivate *dri_context, + __DRIdrawablePrivate *dri_drawable, + __DRIdrawablePrivate *dri_readable) +{ + struct radeon_framebuffer *drawable; + struct radeon_framebuffer *readable; + struct radeon_context *radeon_context; + + if (dri_context == NULL) { + st_make_current(NULL, NULL, NULL); + return GL_TRUE; + } + + radeon_context = dri_context->driverPrivate; + drawable = dri_drawable->driverPrivate; + readable = dri_readable->driverPrivate; + st_make_current(radeon_context->st_context, + drawable->st_framebuffer, + readable->st_framebuffer); + + radeon_update_renderbuffers(dri_context, dri_drawable); + if (dri_drawable != dri_readable) { + radeon_update_renderbuffers(dri_context, dri_readable); + } + return GL_TRUE; +} + +GLboolean radeon_context_unbind(__DRIcontextPrivate *dri_context) +{ + struct radeon_context *radeon_context; + + radeon_context = dri_context->driverPrivate; + st_flush(radeon_context->st_context, PIPE_FLUSH_RENDER_CACHE, NULL); + return GL_TRUE; +} diff --git a/src/gallium/winsys/drm/radeon/radeon_context.h b/src/gallium/winsys/drm/radeon/radeon_context.h new file mode 100644 index 0000000000..d7222b4469 --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_context.h @@ -0,0 +1,70 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef RADEON_CONTEXT_H +#define RADEON_CONTEXT_H + +#include "dri_util.h" +#include "state_tracker/st_public.h" +#include "state_tracker/st_context.h" +#include "radeon_screen.h" + +#include "radeon_r300.h" + +struct radeon_framebuffer { + struct st_framebuffer *st_framebuffer; + unsigned attachments; +}; + +struct radeon_context { + /* st */ + struct st_context *st_context; + /* pipe */ + struct pipe_screen *pipe_screen; + struct pipe_winsys *pipe_winsys; + /* DRI */ + __DRIscreenPrivate *dri_screen; + __DRIdrawablePrivate *dri_drawable; + __DRIdrawablePrivate *dri_readable; + /* DRM */ + int drm_fd; + /* RADEON */ + struct radeon_screen *radeon_screen; +}; + +GLboolean radeon_context_create(const __GLcontextModes*, + __DRIcontextPrivate*, + void*); +void radeon_context_destroy(__DRIcontextPrivate*); +GLboolean radeon_context_bind(__DRIcontextPrivate*, + __DRIdrawablePrivate*, + __DRIdrawablePrivate*); +GLboolean radeon_context_unbind(__DRIcontextPrivate*); + +#endif diff --git a/src/gallium/winsys/drm/radeon/radeon_r300.c b/src/gallium/winsys/drm/radeon/radeon_r300.c new file mode 100644 index 0000000000..8fe2375e34 --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_r300.c @@ -0,0 +1,96 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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_r300.h" + +static boolean radeon_r300_check_cs(struct radeon_cs* cs, int size) +{ + /* XXX check size here, lazy ass! */ + return TRUE; +} + +static void radeon_r300_write_cs_reloc(struct radeon_cs* cs, + struct pipe_buffer* pbuffer, + uint32_t rd, + uint32_t wd, + uint32_t flags) +{ + radeon_cs_write_reloc(cs, ((struct radeon_pipe_buffer*)pbuffer)->bo, rd, wd, flags); +} + +static void radeon_r300_flush_cs(struct radeon_cs* cs) +{ + radeon_cs_emit(cs); + radeon_cs_erase(cs); +} + +/* Helper function to do the ioctls needed for setup and init. */ +static void do_ioctls(struct r300_winsys* winsys, int fd) +{ + drm_radeon_getparam_t gp; + uint32_t target; + int retval; + + /* XXX is this cast safe? */ + gp.value = (int*)⌖ + + /* First, get PCI ID */ + gp.param = RADEON_PARAM_DEVICE_ID; + retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); + if (retval) { + fprintf(stderr, "%s: Failed to get PCI ID, error number %d", + __FUNCTION__, retval); + exit(1); + } + winsys->pci_id = target; + + /* Then, get the number of pixel pipes */ + gp.param = RADEON_PARAM_NUM_GB_PIPES; + retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); + if (retval) { + fprintf(stderr, "%s: Failed to get GB pipe count, error number %d", + __FUNCTION__, retval); + exit(1); + } + winsys->gb_pipes = target; + +} + +struct r300_winsys* radeon_create_r300_winsys(int fd) +{ + struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys)); + + do_ioctls(winsys, fd); + + struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd); + + winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4); + + winsys->check_cs = radeon_r300_check_cs; + winsys->begin_cs = radeon_cs_begin; + winsys->write_cs_dword = radeon_cs_write_dword; + winsys->write_cs_reloc = radeon_r300_write_cs_reloc; + winsys->end_cs = radeon_cs_end; + winsys->flush_cs = radeon_r300_flush_cs; + + return winsys; +} diff --git a/src/gallium/winsys/drm/radeon/radeon_r300.h b/src/gallium/winsys/drm/radeon/radeon_r300.h new file mode 100644 index 0000000000..8ed95a3a9b --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_r300.h @@ -0,0 +1,34 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +/* XXX WTF is this! I shouldn't have to include those first three! FUCK! */ +#include +#include +#include "drm.h" +#include "radeon_drm.h" +#include "radeon_cs.h" + +#include "r300_winsys.h" + +#include "radeon_buffer.h" + +struct r300_winsys* radeon_create_r300_winsys(int fd); diff --git a/src/gallium/winsys/drm/radeon/radeon_screen.c b/src/gallium/winsys/drm/radeon/radeon_screen.c new file mode 100644 index 0000000000..e31caff0bf --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_screen.c @@ -0,0 +1,288 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#include +#include "pipe/p_screen.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "pipe/p_context.h" +#include "pipe/p_state.h" +#include "state_tracker/st_public.h" +#include "state_tracker/st_context.h" +#include "utils.h" +#include "xf86drm.h" +#include "drm.h" +#include "dri_util.h" +#include "radeon_screen.h" +#include "radeon_context.h" +#include "radeon_buffer.h" +#include "radeon_bo.h" +#include "radeon_bo_gem.h" +#include "radeon_drm.h" + +extern const struct dri_extension radeon_card_extensions[]; + +static const __DRIextension *radeon_screen_extensions[] = { + &driReadDrawableExtension, + &driCopySubBufferExtension.base, + &driSwapControlExtension.base, + &driFrameTrackingExtension.base, + &driMediaStreamCounterExtension.base, + NULL +}; + +static __DRIconfig **radeon_fill_in_modes(unsigned pixel_bits, + unsigned depth_bits, + GLboolean have_back_buffer) +{ + __DRIconfig **configs; + unsigned depth_buffer_factor; + unsigned back_buffer_factor; + unsigned num_modes; + GLenum fb_format; + GLenum fb_type; + uint8_t depth_bits_array[3]; + uint8_t stencil_bits_array[3]; + uint8_t msaa_samples_array[1]; + /* TODO: pageflipping ? */ + static const GLenum back_buffer_modes[] = { + GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML + }; + + stencil_bits_array[0] = 0; + stencil_bits_array[1] = 0; + if (depth_bits == 24) { + stencil_bits_array[2] = 8; + num_modes = 3; + } + + depth_bits_array[0] = 0; + depth_bits_array[1] = depth_bits; + depth_bits_array[2] = depth_bits; + depth_buffer_factor = (depth_bits == 24) ? 3 : 2; + + back_buffer_factor = (have_back_buffer) ? 3 : 1; + + msaa_samples_array[0] = 0; + + if (pixel_bits == 16) { + fb_format = GL_RGB; + fb_type = GL_UNSIGNED_SHORT_5_6_5; + } else { + fb_format = GL_BGRA; + fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; + } + + configs = (__DRIconfig **)driCreateConfigs(fb_format, + fb_type, + depth_bits_array, + stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, + back_buffer_factor, + msaa_samples_array, + 1); + if (configs == NULL) { + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", + __FILE__, __LINE__); + return NULL; + } + return configs; +} + +static void radeon_screen_destroy(__DRIscreenPrivate *dri_screen) +{ + struct radeon_screen *radeon_screen = (struct radeon_screen*)dri_screen->private; + + radeon_bo_manager_gem_dtor(radeon_screen->bom); + dri_screen = NULL; + free(radeon_screen); +} + +static const __DRIconfig **radeon_screen_init(__DRIscreenPrivate *dri_screen) +{ + struct radeon_screen *radeon_screen; + + /* 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, radeon_card_extensions, GL_FALSE); + + radeon_screen = calloc(1, sizeof(struct radeon_screen)); + if (radeon_screen == NULL) { + fprintf(stderr, "\nERROR! Allocating private area failed\n"); + return NULL; + } + dri_screen->private = (void*)radeon_screen; + dri_screen->extensions = radeon_screen_extensions; + radeon_screen->dri_screen = dri_screen; + + radeon_screen->bom = radeon_bo_manager_gem_ctor(dri_screen->fd); + if (radeon_screen->bom == NULL) { + radeon_screen_destroy(dri_screen); + return NULL; + } + + return driConcatConfigs(radeon_fill_in_modes(16, 16, 1), + radeon_fill_in_modes(32, 24, 1)); +} + +static boolean radeon_buffer_create(__DRIscreenPrivate *dri_screen, + __DRIdrawablePrivate *dri_drawable, + const __GLcontextModes *visual, + boolean is_pixmap) +{ + if (is_pixmap) { + /* TODO: implement ? */ + return GL_FALSE; + } else { + enum pipe_format color_format, depth_format, stencil_format; + struct radeon_framebuffer *radeon_fb; + + radeon_fb = calloc(1, sizeof(struct radeon_framebuffer)); + if (radeon_fb == NULL) { + return GL_FALSE; + } + + switch (visual->redBits) { + case 5: + color_format = PIPE_FORMAT_R5G6B5_UNORM; + break; + default: + color_format = PIPE_FORMAT_A8R8G8B8_UNORM; + break; + } + + switch (visual->depthBits) { + case 24: + depth_format = PIPE_FORMAT_S8Z24_UNORM; + break; + case 16: + depth_format = PIPE_FORMAT_Z16_UNORM; + break; + default: + depth_format = PIPE_FORMAT_NONE; + break; + } + + switch (visual->stencilBits) { + case 8: + /* force depth format */ + depth_format = PIPE_FORMAT_S8Z24_UNORM; + stencil_format = PIPE_FORMAT_S8Z24_UNORM; + break; + default: + stencil_format = PIPE_FORMAT_NONE; + break; + } + + radeon_fb->st_framebuffer = st_create_framebuffer(visual, + color_format, + depth_format, + stencil_format, + dri_drawable->w, + dri_drawable->h, + (void*)radeon_fb); + if (radeon_fb->st_framebuffer == NULL) { + free(radeon_fb); + return GL_FALSE; + } + dri_drawable->driverPrivate = (void *) radeon_fb; + + radeon_fb->attachments = (1 << __DRI_BUFFER_FRONT_LEFT); + if (visual->doubleBufferMode) { + radeon_fb->attachments |= (1 << __DRI_BUFFER_BACK_LEFT); + } + if (visual->depthBits || visual->stencilBits) { + radeon_fb->attachments |= (1 << __DRI_BUFFER_DEPTH); + } + + return GL_TRUE; + } +} + +static void radeon_buffer_destroy(__DRIdrawablePrivate * dri_drawable) +{ + struct radeon_framebuffer *radeon_fb; + + radeon_fb = dri_drawable->driverPrivate; + assert(radeon_fb->st_framebuffer); + st_unreference_framebuffer(radeon_fb->st_framebuffer); + free(radeon_fb); +} + +static void radeon_swap_buffers(__DRIdrawablePrivate *dri_drawable) +{ + struct radeon_framebuffer *radeon_fb; + struct pipe_surface *back_surf = NULL; + + radeon_fb = dri_drawable->driverPrivate; + assert(radeon_fb); + assert(radeon_fb->st_framebuffer); + + st_get_framebuffer_surface(radeon_fb->st_framebuffer, + ST_SURFACE_BACK_LEFT, + &back_surf); + if (back_surf) { + st_notify_swapbuffers(radeon_fb->st_framebuffer); + /* TODO: do we want to do anythings ? */ + st_notify_swapbuffers_complete(radeon_fb->st_framebuffer); + } +} + +/** + * Called via glXCopySubBufferMESA() to copy a subrect of the back + * buffer to the front buffer/screen. + */ +static void radeon_copy_sub_buffer(__DRIdrawablePrivate *dri_drawable, + int x, int y, int w, int h) +{ + /* TODO: ... */ +} + +const struct __DriverAPIRec driDriverAPI = { + .InitScreen = NULL, + .DestroyScreen = radeon_screen_destroy, + .CreateContext = radeon_context_create, + .DestroyContext = radeon_context_destroy, + .CreateBuffer = radeon_buffer_create, + .DestroyBuffer = radeon_buffer_destroy, + .SwapBuffers = radeon_swap_buffers, + .MakeCurrent = radeon_context_bind, + .UnbindContext = radeon_context_unbind, + .CopySubBuffer = radeon_copy_sub_buffer, + .InitScreen2 = radeon_screen_init, +}; diff --git a/src/gallium/winsys/drm/radeon/radeon_screen.h b/src/gallium/winsys/drm/radeon/radeon_screen.h new file mode 100644 index 0000000000..01b7fa6531 --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_screen.h @@ -0,0 +1,41 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef RADEON_SCREEN_H +#define RADEON_SCREEN_H + +#include "dri_util.h" +#include "radeon_bo.h" + +struct radeon_screen { + __DRIscreenPrivate *dri_screen; + struct radeon_bo_manager *bom; +}; + +#endif diff --git a/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c new file mode 100644 index 0000000000..8402e1fa5a --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c @@ -0,0 +1,77 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ +/* + * Authors: Keith Whitwell + */ +#include +#include "imports.h" +#include "pipe/p_defines.h" +#include "pipe/p_format.h" +#include "softpipe/sp_winsys.h" +#include "radeon_context.h" +#include "radeon_winsys_softpipe.h" + +struct radeon_softpipe_winsys { + struct softpipe_winsys sp_winsys; + struct radeon_context *radeon_context; +}; + +/** + * Return list of surface formats supported by this driver. + */ +static boolean radeon_is_format_supported(struct softpipe_winsys *sws, uint format) +{ + switch (format) { + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + return TRUE; + default: + break; + }; + return FALSE; +} + +struct pipe_context *radeon_create_softpipe(struct radeon_context *radeon_context) +{ + struct radeon_softpipe_winsys *radeon_sp_ws; + struct pipe_screen *pipe_screen; + + pipe_screen = softpipe_create_screen(radeon_context->pipe_winsys); + + radeon_sp_ws = CALLOC_STRUCT(radeon_softpipe_winsys); + if (radeon_sp_ws == NULL) { + return NULL; + } + radeon_context->pipe_screen = pipe_screen; + radeon_sp_ws->radeon_context = radeon_context; + radeon_sp_ws->sp_winsys.is_format_supported = radeon_is_format_supported; + return softpipe_create(pipe_screen, + radeon_context->pipe_winsys, + &radeon_sp_ws->sp_winsys); +} diff --git a/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h new file mode 100644 index 0000000000..519eab769c --- /dev/null +++ b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h @@ -0,0 +1,37 @@ +/* + * Copyright © 2008 Jérôme Glisse + * 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 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 COPYRIGHT HOLDERS, AUTHORS + * 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + */ +/* + * Authors: + * Jérôme Glisse + */ +#ifndef RADEON_WINSYS_SOFTPIPE_H +#define RADEON_WINSYS_SOFTPIPE_H + +#include "radeon_context.h" + +struct pipe_context *radeon_create_softpipe(struct radeon_context *radeon_context); + +#endif -- cgit v1.2.3 From 32cd1a0345eaf1f4da8a60a4ac2145ff51383d59 Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Sat, 7 Feb 2009 12:53:30 -0500 Subject: nouveau: Need to surface_copy() without a pipe context. --- src/gallium/drivers/nv30/nv30_screen.c | 29 +++++++++++++---------------- src/gallium/drivers/nv40/nv40_screen.c | 31 +++++++++++++------------------ src/gallium/drivers/nv50/nv50_context.h | 5 +++++ src/gallium/drivers/nv50/nv50_miptree.c | 8 ++++---- src/gallium/drivers/nv50/nv50_surface.c | 2 +- 5 files changed, 36 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index 2bc83f815b..e3c9b42044 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -127,6 +127,14 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen, return FALSE; } +static struct pipe_buffer * +nv30_surface_buffer(struct pipe_surface *surf) +{ + struct nv30_miptree *mt = (struct nv30_miptree *)surf->texture; + + return mt->buffer; +} + static void * nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface, unsigned flags ) @@ -134,7 +142,6 @@ nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface, struct pipe_winsys *ws = screen->winsys; struct pipe_surface *surface_to_map; void *map; - struct nv30_miptree *nv30mt = (struct nv30_miptree *)surface->texture; if (!(surface->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) { struct nv30_miptree *mt = (struct nv30_miptree *)surface->texture; @@ -163,7 +170,7 @@ nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface, assert(surface_to_map); - map = ws->buffer_map(ws, nv30mt->buffer, flags); + map = ws->buffer_map(ws, nv30_surface_buffer(surface_to_map), flags); if (!map) return NULL; @@ -175,7 +182,6 @@ nv30_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface) { struct pipe_winsys *ws = screen->winsys; struct pipe_surface *surface_to_unmap; - struct nv30_miptree *nv30mt = (struct nv30_miptree *)surface->texture; /* TODO: Copy from shadow just before push buffer is flushed instead. There are probably some programs that map/unmap excessively @@ -192,15 +198,14 @@ nv30_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface) assert(surface_to_unmap); - ws->buffer_unmap(ws, nv30mt->buffer); + ws->buffer_unmap(ws, nv30_surface_buffer(surface_to_unmap)); if (surface_to_unmap != surface) { struct nv30_screen *nvscreen = nv30_screen(screen); - nvscreen->nvws->surface_copy(nvscreen->nvws, - surface, 0, 0, - surface_to_unmap, 0, 0, - surface->width, surface->height); + nvscreen->eng2d->copy(nvscreen->eng2d, surface, 0, 0, + surface_to_unmap, 0, 0, + surface->width, surface->height); } } @@ -220,14 +225,6 @@ nv30_screen_destroy(struct pipe_screen *pscreen) FREE(pscreen); } -static struct pipe_buffer * -nv30_surface_buffer(struct pipe_surface *surf) -{ - struct nv30_miptree *mt = (struct nv30_miptree *)surf->texture; - - return mt->buffer; -} - struct pipe_screen * nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) { diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c index a2b124d228..88a329ea24 100644 --- a/src/gallium/drivers/nv40/nv40_screen.c +++ b/src/gallium/drivers/nv40/nv40_screen.c @@ -136,6 +136,14 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen, return FALSE; } +static struct pipe_buffer * +nv40_surface_buffer(struct pipe_surface *surf) +{ + struct nv40_miptree *mt = (struct nv40_miptree *)surf->texture; + + return mt->buffer; +} + static void * nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface, unsigned flags ) @@ -143,7 +151,6 @@ nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface, struct pipe_winsys *ws = screen->winsys; struct pipe_surface *surface_to_map; void *map; - struct nv40_miptree *mt; if (!(surface->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) { struct nv40_miptree *mt = (struct nv40_miptree *)surface->texture; @@ -171,8 +178,7 @@ nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface, surface_to_map = surface; assert(surface_to_map); - mt = (struct nv40_miptree *)surface_to_map->texture; - map = ws->buffer_map(ws, mt->buffer, flags); + map = ws->buffer_map(ws, nv40_surface_buffer(surface_to_map), flags); if (!map) return NULL; @@ -184,7 +190,6 @@ nv40_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface) { struct pipe_winsys *ws = screen->winsys; struct pipe_surface *surface_to_unmap; - struct nv40_miptree *mt; /* TODO: Copy from shadow just before push buffer is flushed instead. There are probably some programs that map/unmap excessively @@ -201,16 +206,14 @@ nv40_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface) assert(surface_to_unmap); - mt = (struct nv40_miptree *)surface_to_unmap->texture; - ws->buffer_unmap(ws, mt->buffer); + ws->buffer_unmap(ws, nv40_surface_buffer(surface_to_unmap)); if (surface_to_unmap != surface) { struct nv40_screen *nvscreen = nv40_screen(screen); - nvscreen->nvws->surface_copy(nvscreen->nvws, - surface, 0, 0, - surface_to_unmap, 0, 0, - surface->width, surface->height); + nvscreen->eng2d->copy(nvscreen->eng2d, surface, 0, 0, + surface_to_unmap, 0, 0, + surface->width, surface->height); } } @@ -230,14 +233,6 @@ nv40_screen_destroy(struct pipe_screen *pscreen) FREE(pscreen); } -static struct pipe_buffer * -nv40_surface_buffer(struct pipe_surface *surf) -{ - struct nv40_miptree *mt = (struct nv40_miptree *)surf->texture; - - return mt->buffer; -} - struct pipe_screen * nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) { diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 6a11572590..1e9d45cb34 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -167,6 +167,11 @@ extern void nv50_init_query_functions(struct nv50_context *nv50); extern void nv50_screen_init_miptree_functions(struct pipe_screen *pscreen); +extern int +nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst, + int dx, int dy, struct pipe_surface *src, int sx, int sy, + int w, int h); + /* nv50_draw.c */ extern struct draw_stage *nv50_draw_render_stage(struct nv50_context *nv50); diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index a6ef76ff75..91091d53f5 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -166,7 +166,7 @@ void nv50_miptree_sync(struct pipe_screen *pscreen, struct nv50_miptree *mt, unsigned level, unsigned image) { - struct nouveau_winsys *nvws = nv50_screen(pscreen)->nvws; + struct nv50_screen *nvscreen = nv50_screen(pscreen); struct nv50_miptree_level *lvl = &mt->level[level]; struct pipe_surface *dst, *src; unsigned face = 0, zslice = 0; @@ -197,7 +197,7 @@ nv50_miptree_sync(struct pipe_screen *pscreen, struct nv50_miptree *mt, dst = pscreen->get_tex_surface(pscreen, &mt->base, face, level, zslice, PIPE_BUFFER_USAGE_GPU_READ); - nvws->surface_copy(nvws, dst, 0, 0, src, 0, 0, dst->width, dst->height); + nv50_surface_do_copy(nvscreen, dst, 0, 0, src, 0, 0, dst->width, dst->height); pscreen->tex_surface_release(pscreen, &dst); pscreen->tex_surface_release(pscreen, &src); @@ -208,7 +208,7 @@ static void nv50_miptree_sync_cpu(struct pipe_screen *pscreen, struct nv50_miptree *mt, unsigned level, unsigned image) { - struct nouveau_winsys *nvws = nv50_screen(pscreen)->nvws; + struct nv50_screen *nvscreen = nv50_screen(pscreen); struct nv50_miptree_level *lvl = &mt->level[level]; struct pipe_surface *dst, *src; unsigned face = 0, zslice = 0; @@ -229,7 +229,7 @@ nv50_miptree_sync_cpu(struct pipe_screen *pscreen, struct nv50_miptree *mt, dst = pscreen->get_tex_surface(pscreen, &mt->base, face, level, zslice, PIPE_BUFFER_USAGE_CPU_READ); - nvws->surface_copy(nvws, dst, 0, 0, src, 0, 0, dst->width, dst->height); + nv50_surface_do_copy(nvscreen, dst, 0, 0, src, 0, 0, dst->width, dst->height); pscreen->tex_surface_release(pscreen, &dst); pscreen->tex_surface_release(pscreen, &src); diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index b3c04505cf..f2dd2eb30b 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -102,7 +102,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) return 0; } -static int +int nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst, int dx, int dy, struct pipe_surface *src, int sx, int sy, int w, int h) -- cgit v1.2.3 From b46611633c5da6fa23ee17bce22939fe20ef194e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 11:20:08 -0700 Subject: mesa: fix logic error in computing enableBits in update_texture_state() If we had a vertex shader but no fragment shader (i.e. fixed function) we didn't get the right enabled texture targets. Fixes blank/white texture problem. --- src/mesa/main/texstate.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index f7a4d8b323..be6ce18689 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -488,25 +488,27 @@ update_texture_state( GLcontext *ctx ) texUnit->_ReallyEnabled = 0; texUnit->_GenFlags = 0; - /* Get the bitmask of texture enables. + /* Get the bitmask of texture target enables. * enableBits will be a mask of the TEXTURE_*_BIT flags indicating * which texture targets are enabled (fixed function) or referenced * by a fragment shader/program. When multiple flags are set, we'll * settle on the one with highest priority (see texture_override below). */ - if (fprog || vprog) { - enableBits = 0x0; - if (fprog) - enableBits |= fprog->Base.TexturesUsed[unit]; - if (vprog) - enableBits |= vprog->Base.TexturesUsed[unit]; + enableBits = 0x0; + if (vprog) { + enableBits |= vprog->Base.TexturesUsed[unit]; + } + if (fprog) { + enableBits |= fprog->Base.TexturesUsed[unit]; } else { - if (!texUnit->Enabled) - continue; - enableBits = texUnit->Enabled; + /* fixed-function fragment program */ + enableBits |= texUnit->Enabled; } + if (enableBits == 0x0) + continue; + ASSERT(texUnit->Current1D); ASSERT(texUnit->Current2D); ASSERT(texUnit->Current3D); -- cgit v1.2.3 From 2a50dde0f5a44b06ba5d07ce96e4da5e264d18ae Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 11:21:44 -0700 Subject: mesa: minor clean-ups, remove unneeded conditional --- src/mesa/main/texstate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index be6ce18689..df40d61c93 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -468,9 +468,8 @@ update_texture_state( GLcontext *ctx ) } } - ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are - * actual changes. - */ + /* TODO: only set this if there are actual changes */ + ctx->NewState |= _NEW_TEXTURE; ctx->Texture._EnabledUnits = 0; ctx->Texture._GenFlags = 0; @@ -540,8 +539,9 @@ update_texture_state( GLcontext *ctx ) continue; } - if (texUnit->_ReallyEnabled) - ctx->Texture._EnabledUnits |= (1 << unit); + /* if we get here, we know this texture unit is enabled */ + + ctx->Texture._EnabledUnits |= (1 << unit); if (texUnit->EnvMode == GL_COMBINE || texUnit->EnvMode == GL_COMBINE4_NV) { -- cgit v1.2.3 From 671fed4d0191734babfe28c7729f2e7cfa7ad8d7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 11:40:20 -0700 Subject: mesa: code refactoring: move texcombine code into update_tex_combine() --- src/mesa/main/texstate.c | 167 ++++++++++++++++++++++++++--------------------- 1 file changed, 92 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index df40d61c93..7761af7589 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -436,6 +436,96 @@ texture_override(GLcontext *ctx, } +/** + * Examine texture unit's combine/env state to update derived state. + */ +static void +update_tex_combine(GLcontext *ctx, struct gl_texture_unit *texUnit) +{ + /* Set the texUnit->_CurrentCombine field to point to the user's combiner + * state, or the combiner state which is derived from traditional texenv + * mode. + */ + if (texUnit->EnvMode == GL_COMBINE || + texUnit->EnvMode == GL_COMBINE4_NV) { + texUnit->_CurrentCombine = & texUnit->Combine; + } + else { + const struct gl_texture_object *texObj = texUnit->_Current; + GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; + if (format == GL_COLOR_INDEX) { + format = GL_RGBA; /* a bit of a hack */ + } + else if (format == GL_DEPTH_COMPONENT || + format == GL_DEPTH_STENCIL_EXT) { + format = texObj->DepthMode; + } + calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format); + texUnit->_CurrentCombine = & texUnit->_EnvMode; + } + + /* Determine number of source RGB terms in the combiner function */ + switch (texUnit->_CurrentCombine->ModeRGB) { + case GL_REPLACE: + texUnit->_CurrentCombine->_NumArgsRGB = 1; + break; + case GL_ADD: + case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + texUnit->_CurrentCombine->_NumArgsRGB = 4; + else + texUnit->_CurrentCombine->_NumArgsRGB = 2; + break; + case GL_MODULATE: + case GL_SUBTRACT: + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + texUnit->_CurrentCombine->_NumArgsRGB = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + texUnit->_CurrentCombine->_NumArgsRGB = 3; + break; + default: + texUnit->_CurrentCombine->_NumArgsRGB = 0; + _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state"); + return; + } + + /* Determine number of source Alpha terms in the combiner function */ + switch (texUnit->_CurrentCombine->ModeA) { + case GL_REPLACE: + texUnit->_CurrentCombine->_NumArgsA = 1; + break; + case GL_ADD: + case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + texUnit->_CurrentCombine->_NumArgsA = 4; + else + texUnit->_CurrentCombine->_NumArgsA = 2; + break; + case GL_MODULATE: + case GL_SUBTRACT: + texUnit->_CurrentCombine->_NumArgsA = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + texUnit->_CurrentCombine->_NumArgsA = 3; + break; + default: + texUnit->_CurrentCombine->_NumArgsA = 0; + _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state"); + break; + } +} + + /** * \note This routine refers to derived texture matrix values to * compute the ENABLE_TEXMAT flags, but is only called on @@ -543,83 +633,10 @@ update_texture_state( GLcontext *ctx ) ctx->Texture._EnabledUnits |= (1 << unit); - if (texUnit->EnvMode == GL_COMBINE || - texUnit->EnvMode == GL_COMBINE4_NV) { - texUnit->_CurrentCombine = & texUnit->Combine; - } - else { - const struct gl_texture_object *texObj = texUnit->_Current; - GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; - if (format == GL_COLOR_INDEX) { - format = GL_RGBA; /* a bit of a hack */ - } - else if (format == GL_DEPTH_COMPONENT - || format == GL_DEPTH_STENCIL_EXT) { - format = texObj->DepthMode; - } - calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format); - texUnit->_CurrentCombine = & texUnit->_EnvMode; - } - - switch (texUnit->_CurrentCombine->ModeRGB) { - case GL_REPLACE: - texUnit->_CurrentCombine->_NumArgsRGB = 1; - break; - case GL_ADD: - case GL_ADD_SIGNED: - if (texUnit->EnvMode == GL_COMBINE4_NV) - texUnit->_CurrentCombine->_NumArgsRGB = 4; - else - texUnit->_CurrentCombine->_NumArgsRGB = 2; - break; - case GL_MODULATE: - case GL_SUBTRACT: - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - texUnit->_CurrentCombine->_NumArgsRGB = 2; - break; - case GL_INTERPOLATE: - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - texUnit->_CurrentCombine->_NumArgsRGB = 3; - break; - default: - texUnit->_CurrentCombine->_NumArgsRGB = 0; - _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state"); - return; - } - - switch (texUnit->_CurrentCombine->ModeA) { - case GL_REPLACE: - texUnit->_CurrentCombine->_NumArgsA = 1; - break; - case GL_ADD: - case GL_ADD_SIGNED: - if (texUnit->EnvMode == GL_COMBINE4_NV) - texUnit->_CurrentCombine->_NumArgsA = 4; - else - texUnit->_CurrentCombine->_NumArgsA = 2; - break; - case GL_MODULATE: - case GL_SUBTRACT: - texUnit->_CurrentCombine->_NumArgsA = 2; - break; - case GL_INTERPOLATE: - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - texUnit->_CurrentCombine->_NumArgsA = 3; - break; - default: - texUnit->_CurrentCombine->_NumArgsA = 0; - _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state"); - break; - } + update_tex_combine(ctx, texUnit); } + /* Determine which texture coordinate sets are actually needed */ if (fprog) { const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1; -- cgit v1.2.3 From 266fe93a87d5c0c21e9e7960699104e0e8bd54b4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 11:49:52 -0700 Subject: mesa: debug code for printing info about textures, writing teximages to disk --- src/mesa/main/debug.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/debug.h | 3 ++ 2 files changed, 102 insertions(+) (limited to 'src') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 65970a53a9..90a3bf1f04 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -24,9 +24,13 @@ #include "mtypes.h" #include "context.h" +#include "hash.h" #include "imports.h" #include "debug.h" #include "get.h" +#include "texobj.h" +#include "texformat.h" + /** * Primitive names @@ -219,3 +223,98 @@ _mesa_init_debug( GLcontext *ctx ) add_debug_flags(c); } + +/* + * Write ppm file + */ +static void +write_ppm(const char *filename, const GLubyte *buffer, int width, int height, + int comps, int rcomp, int gcomp, int bcomp) +{ + FILE *f = fopen( filename, "w" ); + if (f) { + int i, x, y; + const GLubyte *ptr = buffer; + fprintf(f,"P6\n"); + fprintf(f,"# ppm-file created by osdemo.c\n"); + fprintf(f,"%i %i\n", width,height); + fprintf(f,"255\n"); + fclose(f); + f = fopen( filename, "ab" ); /* reopen in binary append mode */ + for (y=height-1; y>=0; y--) { + for (x=0; xImage[0][0]; + if (img) { + char s[100]; + + /* make filename */ + sprintf(s, "/tmp/teximage%u.ppm", texObj->Name); + + switch (img->TexFormat->MesaFormat) { + case MESA_FORMAT_RGBA8888: + write_ppm(s, img->Data, img->Width, img->Height, 4, 3, 2, 1); + break; + case MESA_FORMAT_ARGB8888: + write_ppm(s, img->Data, img->Width, img->Height, 4, 2, 1, 0); + break; + default: + printf("XXXX unsupported mesa tex format %d in %s\n", + img->TexFormat->MesaFormat, __FUNCTION__); + } + } +} + + +static GLboolean DumpImages; + + +static void +dump_texture_cb(GLuint id, void *data, void *userData) +{ + struct gl_texture_object *texObj = (struct gl_texture_object *) data; + (void) userData; + int i; + + printf("Texture %u\n", texObj->Name); + printf(" Target 0x%x\n", texObj->Target); + for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { + struct gl_texture_image *texImg = texObj->Image[0][i]; + if (texImg) { + printf(" Image %u: %d x %d x %d at %p\n", i, + texImg->Width, texImg->Height, texImg->Depth, texImg->Data); + if (DumpImages && i == 0) { + write_texture_image(texObj); + } + } + } +} + + +/** + * Print basic info about all texture objext to stdout. + * If dumpImages is true, write PPM of level[0] image to a file. + */ +void +_mesa_dump_textures(GLboolean dumpImages) +{ + GET_CURRENT_CONTEXT(ctx); + DumpImages = dumpImages; + _mesa_HashDeleteAll(ctx->Shared->TexObjects, dump_texture_cb, ctx); +} diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index 94d99c384b..1862ec75b7 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -57,4 +57,7 @@ extern void _mesa_init_debug( GLcontext *ctx ); #endif +extern void +_mesa_dump_textures(GLboolean dumpImages); + #endif -- cgit v1.2.3 From 5199774dc6a2a65d24ac26fe15715654f2568a02 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 11:50:24 -0700 Subject: mesa: minor fixes to incomplete texture debug code --- src/mesa/main/texobj.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 0fee21c490..b4e30c8bb7 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -393,8 +393,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, */ if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { char s[100]; - _mesa_sprintf(s, "obj %p (%d) base level = %d is invalid", - (void *) t, t->Name, baseLevel); + _mesa_sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s); t->_Complete = GL_FALSE; return; @@ -403,8 +402,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Always need the base level image */ if (!t->Image[0][baseLevel]) { char s[100]; - _mesa_sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL", - (void *) t, t->Name, baseLevel); + _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel); incomplete(t, s); t->_Complete = GL_FALSE; return; -- cgit v1.2.3 From c2a8d73d5aa0e17fa790d4ccf404422e9e9ac119 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 12:59:40 -0700 Subject: cell: compile fix: pipe_constant_buffer no longer has size field --- src/gallium/drivers/cell/ppu/cell_draw_arrays.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index 67949b73dd..644496db40 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -51,7 +51,7 @@ cell_map_constant_buffers(struct cell_context *sp) struct pipe_winsys *ws = sp->pipe.winsys; uint i; for (i = 0; i < 2; i++) { - if (sp->constants[i].size) { + if (sp->constants[i].buffer && sp->constants[i].buffer->size) { sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer, PIPE_BUFFER_USAGE_CPU_READ); cell_flush_buffer_range(sp, sp->mapped_constants[i], @@ -61,7 +61,7 @@ cell_map_constant_buffers(struct cell_context *sp) draw_set_mapped_constant_buffer(sp->draw, sp->mapped_constants[PIPE_SHADER_VERTEX], - sp->constants[PIPE_SHADER_VERTEX].size); + sp->constants[PIPE_SHADER_VERTEX].buffer->size); } static void @@ -70,7 +70,7 @@ cell_unmap_constant_buffers(struct cell_context *sp) struct pipe_winsys *ws = sp->pipe.winsys; uint i; for (i = 0; i < 2; i++) { - if (sp->constants[i].size) + if (sp->constants[i].buffer && sp->constants[i].buffer->size) ws->buffer_unmap(ws, sp->constants[i].buffer); sp->mapped_constants[i] = NULL; } -- cgit v1.2.3 From 830e320e2ad9a3918d867d8233c25bb2c54fa55a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 13:01:02 -0700 Subject: cell: compile fix: pipe_constant_buffer no longer has size field --- src/gallium/drivers/cell/ppu/cell_state_emit.c | 2 +- src/gallium/drivers/cell/ppu/cell_state_shader.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c index 39b85faeb8..ff529fe22c 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_emit.c +++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c @@ -239,7 +239,7 @@ cell_emit_state(struct cell_context *cell) if (cell->dirty & (CELL_NEW_FS_CONSTANTS)) { const uint shader = PIPE_SHADER_FRAGMENT; - const uint num_const = cell->constants[shader].size / sizeof(float); + const uint num_const = cell->constants[shader].buffer->size / sizeof(float); uint i, j; float *buf = cell_batch_alloc16(cell, ROUNDUP16(32 + num_const * sizeof(float))); uint32_t *ibuf = (uint32_t *) buf; diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index 990f23e170..4914a27db3 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -197,7 +197,6 @@ cell_set_constant_buffer(struct pipe_context *pipe, pipe_buffer_reference(pipe->screen, &cell->constants[shader].buffer, buf->buffer); - cell->constants[shader].size = buf->size; if (shader == PIPE_SHADER_VERTEX) cell->dirty |= CELL_NEW_VS_CONSTANTS; -- cgit v1.2.3 From 96d230e107abcf4c105e6e7c871124f246763222 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 13:01:53 -0700 Subject: cell: compile fix: alpha.ref is now alpha.ref_value --- src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 2 +- src/gallium/drivers/cell/spu/spu_per_fragment_op.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c index 9bdc71b676..66d4b3b6a3 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c +++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c @@ -161,7 +161,7 @@ gen_alpha_test(const struct pipe_depth_stencil_alpha_state *dsa, if ((dsa->alpha.func != PIPE_FUNC_NEVER) && (dsa->alpha.func != PIPE_FUNC_ALWAYS)) { /* load/splat the alpha reference float value */ - spe_load_float(f, ref_reg, dsa->alpha.ref); + spe_load_float(f, ref_reg, dsa->alpha.ref_value); } /* emit code to do the alpha comparison, updating 'mask' */ diff --git a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c index 683664e8a4..eba9f95cf1 100644 --- a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c +++ b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c @@ -85,7 +85,7 @@ spu_fallback_fragment_ops(uint x, uint y, * Do alpha test */ if (spu.depth_stencil_alpha.alpha.enabled) { - vector float ref = spu_splats(spu.depth_stencil_alpha.alpha.ref); + vector float ref = spu_splats(spu.depth_stencil_alpha.alpha.ref_value); vector unsigned int amask; switch (spu.depth_stencil_alpha.alpha.func) { -- cgit v1.2.3 From b59117a697ac168da9dacb922d491449fe591264 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 13:02:27 -0700 Subject: cell: compile fix: no-op xlib_create_brw_screen() for Cell build --- src/gallium/winsys/xlib/xlib_brw_screen.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/winsys/xlib/xlib_brw_screen.c b/src/gallium/winsys/xlib/xlib_brw_screen.c index 51740a9af6..8e1bfab2f5 100644 --- a/src/gallium/winsys/xlib/xlib_brw_screen.c +++ b/src/gallium/winsys/xlib/xlib_brw_screen.c @@ -325,6 +325,7 @@ xlib_create_brw_winsys( void ) static struct pipe_screen * xlib_create_brw_screen( void ) { +#ifndef GALLIUM_CELL struct pipe_winsys *winsys; struct pipe_screen *screen; @@ -342,6 +343,7 @@ fail: if (winsys) winsys->destroy( winsys ); +#endif return NULL; } -- cgit v1.2.3 From 2473ded88684aed33de5ba6494ac4ce8cf7e2226 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 13:03:24 -0700 Subject: softpipe: simplify an assertion --- src/gallium/drivers/softpipe/sp_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index 7af8398193..3eed0d0d29 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -270,7 +270,7 @@ softpipe_tex_surface_release(struct pipe_screen *screen, * needed post-processing to put them into hardware layout, this is * where it would happen. For softpipe, nothing to do. */ - assert ((*s)->texture); + assert(surf->texture); if (--surf->refcount == 0) { pipe_texture_reference(&surf->texture, NULL); FREE(surf); -- cgit v1.2.3 From 91948cd1a2fd33a4147a6dac35122a2ab5f97ded Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 13:04:53 -0700 Subject: cell: compile fix: many updates to cell texture code for new surface mapping The Cell texture code really needs a thorough inspection and clean-up someday... --- src/gallium/drivers/cell/ppu/cell_texture.c | 81 +++++++++++++++-------------- 1 file changed, 42 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index 4f16e2c6af..9ba995ab7d 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -307,9 +307,8 @@ cell_twiddle_texture(struct pipe_screen *screen, const uint texHeight = ct->base.height[level]; const uint bufWidth = align(texWidth, TILE_SIZE); const uint bufHeight = align(texHeight, TILE_SIZE); - const void *map = pipe_buffer_map(screen, surface->buffer, - PIPE_BUFFER_USAGE_CPU_READ); - const uint *src = (const uint *) ((const ubyte *) map + surface->offset); + const void *map = screen->surface_map(screen, surface, PIPE_BUFFER_USAGE_CPU_READ); + const uint *src = (const uint *) map; switch (ct->base.format) { case PIPE_FORMAT_A8R8G8B8_UNORM: @@ -324,12 +323,12 @@ cell_twiddle_texture(struct pipe_screen *screen, /* allocate buffer for tiled data now */ struct pipe_winsys *ws = screen->winsys; uint bytes = bufWidth * bufHeight * 4 * numFaces; - ct->tiled_buffer[level] = ws->buffer_create(ws, 16, - PIPE_BUFFER_USAGE_PIXEL, - bytes); + ct->tiled_buffer[level] = + ws->buffer_create(ws, 16, PIPE_BUFFER_USAGE_PIXEL, bytes); /* and map it */ - ct->tiled_mapped[level] = ws->buffer_map(ws, ct->tiled_buffer[level], - PIPE_BUFFER_USAGE_GPU_READ); + ct->tiled_mapped[level] = + ws->buffer_map(ws, ct->tiled_buffer[level], + PIPE_BUFFER_USAGE_GPU_READ); } dst = (uint *) ((ubyte *) ct->tiled_mapped[level] + offset); @@ -338,11 +337,11 @@ cell_twiddle_texture(struct pipe_screen *screen, } break; default: - printf("Cell: twiddle unsupported texture format %s\n", pf_name(ct->base.format)); - ; + printf("Cell: twiddle unsupported texture format %s\n", + pf_name(ct->base.format)); } - pipe_buffer_unmap(screen, surface->buffer); + screen->surface_unmap(screen, surface); } @@ -357,8 +356,7 @@ cell_untwiddle_texture(struct pipe_screen *screen, const uint level = surface->level; const uint texWidth = ct->base.width[level]; const uint texHeight = ct->base.height[level]; - const void *map = pipe_buffer_map(screen, surface->buffer, - PIPE_BUFFER_USAGE_CPU_READ); + const void *map = screen->surface_map(screen, surface, PIPE_BUFFER_USAGE_CPU_READ); const uint *src = (const uint *) ((const ubyte *) map + surface->offset); switch (ct->base.format) { @@ -384,11 +382,12 @@ cell_untwiddle_texture(struct pipe_screen *screen, default: { ct->untiled_data[level] = NULL; - printf("Cell: untwiddle unsupported texture format %s\n", pf_name(ct->base.format)); + printf("Cell: untwiddle unsupported texture format %s\n", + pf_name(ct->base.format)); } } - pipe_buffer_unmap(screen, surface->buffer); + screen->surface_unmap(screen, surface); } @@ -398,15 +397,13 @@ cell_get_tex_surface(struct pipe_screen *screen, unsigned face, unsigned level, unsigned zslice, unsigned usage) { - struct pipe_winsys *ws = screen->winsys; struct cell_texture *ct = cell_texture(pt); struct pipe_surface *ps; - ps = ws->surface_alloc(ws); + ps = CALLOC_STRUCT(pipe_surface); if (ps) { - assert(ps->refcount); - assert(ps->winsys); - pipe_buffer_reference(screen, &ps->buffer, ct->buffer); + ps->refcount = 1; + pipe_texture_reference(&ps->texture, pt); ps->format = pt->format; ps->block = pt->block; ps->width = pt->width[level]; @@ -425,9 +422,9 @@ cell_get_tex_surface(struct pipe_screen *screen, ps->zslice = zslice; if (pt->target == PIPE_TEXTURE_CUBE || pt->target == PIPE_TEXTURE_3D) { - ps->offset += ((pt->target == PIPE_TEXTURE_CUBE) ? face : zslice) * - ps->nblocksy * - ps->stride; + ps->offset += ((pt->target == PIPE_TEXTURE_CUBE) ? face : zslice) * + ps->nblocksy * + ps->stride; } else { assert(face == 0); @@ -449,18 +446,27 @@ cell_tex_surface_release(struct pipe_screen *screen, { struct cell_texture *ct = cell_texture((*s)->texture); const uint level = (*s)->level; + struct pipe_surface *surf = *s; - if (((*s)->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level])) + if ((surf->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level])) { align_free(ct->untiled_data[level]); ct->untiled_data[level] = NULL; } - /* XXX if done rendering to teximage, re-tile */ + if ((ct->base.tex_usage & PIPE_TEXTURE_USAGE_SAMPLER) && + (surf->usage & PIPE_BUFFER_USAGE_CPU_WRITE)) { + /* convert from linear to tiled layout */ + cell_twiddle_texture(screen, surf); + } - pipe_texture_reference(&(*s)->texture, NULL); + /* XXX if done rendering to teximage, re-tile */ - screen->winsys->surface_release(screen->winsys, s); + if (--surf->refcount == 0) { + pipe_texture_reference(&surf->texture, NULL); + FREE(surf); + } + *s = NULL; } @@ -475,17 +481,20 @@ cell_surface_map(struct pipe_screen *screen, assert(ct); +#if 0 if (flags & ~surface->usage) { assert(0); return NULL; } +#endif - map = pipe_buffer_map( screen, surface->buffer, flags ); - if (map == NULL) + map = pipe_buffer_map( screen, ct->buffer, flags ); + if (map == NULL) { return NULL; - else - { - if ((surface->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level])) { + } + else { + if ((surface->usage & PIPE_BUFFER_USAGE_CPU_READ) && + (ct->untiled_data[level])) { return (void *) ((ubyte *) ct->untiled_data[level] + surface->offset); } else { @@ -503,13 +512,7 @@ cell_surface_unmap(struct pipe_screen *screen, assert(ct); - if ((ct->base.tex_usage & PIPE_TEXTURE_USAGE_SAMPLER) && - (surface->usage & PIPE_BUFFER_USAGE_CPU_WRITE)) { - /* convert from linear to tiled layout */ - cell_twiddle_texture(screen, surface); - } - - pipe_buffer_unmap( screen, surface->buffer ); + pipe_buffer_unmap( screen, ct->buffer ); } -- cgit v1.2.3 From 19a1bc8270cbb8fd62a440d2132c699de74182c2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Feb 2009 13:05:38 -0700 Subject: cell: remove unused var --- src/gallium/drivers/cell/ppu/cell_state_shader.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index 4914a27db3..bf517ea563 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -186,7 +186,6 @@ cell_set_constant_buffer(struct pipe_context *pipe, const struct pipe_constant_buffer *buf) { struct cell_context *cell = cell_context(pipe); - struct pipe_winsys *ws = pipe->winsys; assert(shader < PIPE_SHADER_TYPES); assert(index == 0); -- cgit v1.2.3 From ea3398cf3395fd36ac6edc717f2680361ac5e239 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 8 Feb 2009 01:01:26 -0800 Subject: r300: Update to match pipe_surface changes. --- src/gallium/drivers/r300/r300_context.h | 4 ++++ src/gallium/drivers/r300/r300_emit.c | 4 +++- src/gallium/drivers/r300/r300_screen.c | 6 ++++-- src/gallium/drivers/r300/r300_surface.c | 3 ++- src/gallium/drivers/r300/r300_texture.c | 4 ---- 5 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index fb91c172f4..376c57639d 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -179,8 +179,12 @@ static struct r300_context* r300_context(struct pipe_context* context) { void r300_init_state_functions(struct r300_context* r300); void r300_init_surface_functions(struct r300_context* r300); +/* Fun with includes: r300_winsys also declares this prototype. + * We'll just step out in that case... */ +#ifndef R300_WINSYS_H struct pipe_context* r300_create_context(struct pipe_screen* screen, struct pipe_winsys* winsys, struct r300_winsys* r300_winsys); +#endif #endif /* R300_CONTEXT_H */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index c71b8d0b02..585a9e729d 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -84,12 +84,14 @@ void r300_emit_fb_state(struct r300_context* r300, struct pipe_framebuffer_state* fb) { CS_LOCALS(r300); + struct r300_texture* tex; int i; BEGIN_CS((3 * fb->nr_cbufs) + 6); for (i = 0; i < fb->nr_cbufs; i++) { + tex = (struct r300_texture*)fb->cbufs[i]->texture; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); - OUT_CS_RELOC(fb->cbufs[i]->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); } R300_PACIFY; END_CS; diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index fd916fadbe..8ed66a1660 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -214,7 +214,8 @@ static void* r300_surface_map(struct pipe_screen* screen, struct pipe_surface* surface, unsigned flags) { - char* map = pipe_buffer_map(screen, surface->buffer, flags); + struct r300_texture* tex = (struct r300_texture*)surface->texture; + char* map = pipe_buffer_map(screen, tex->buffer, flags); if (!map) { return NULL; @@ -226,7 +227,8 @@ static void* r300_surface_map(struct pipe_screen* screen, static void r300_surface_unmap(struct pipe_screen* screen, struct pipe_surface* surface) { - pipe_buffer_unmap(screen, surface->buffer); + struct r300_texture* tex = (struct r300_texture*)surface->texture; + pipe_buffer_unmap(screen, tex->buffer); } static void r300_destroy_screen(struct pipe_screen* pscreen) diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 1ed4a4e3bc..bbd2ade64a 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -33,6 +33,7 @@ static void r300_surface_fill(struct pipe_context* pipe, struct r300_context* r300 = r300_context(pipe); CS_LOCALS(r300); struct r300_capabilities* caps = ((struct r300_screen*)pipe->screen)->caps; + struct r300_texture* tex = (struct r300_texture*)dest->texture; int i; float r, g, b, a; r = (float)((color >> 16) & 0xff) / 255.0f; @@ -291,7 +292,7 @@ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); -OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); +OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); /* XXX this should not be so rigid and it still doesn't work right */ OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) | R300_COLOR_FORMAT_ARGB8888); OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index f9ad14f12b..7f57656a78 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -121,7 +121,6 @@ static struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen, if (surface) { surface->refcount = 1; pipe_texture_reference(&surface->texture, texture); - pipe_buffer_reference(screen, &surface->buffer, tex->buffer); surface->format = texture->format; surface->width = texture->width[level]; surface->height = texture->height[level]; @@ -148,7 +147,6 @@ static void r300_tex_surface_release(struct pipe_screen* screen, if (s->refcount <= 0) { pipe_texture_reference(&s->texture, NULL); - pipe_buffer_reference(screen, &s->buffer, NULL); FREE(s); } @@ -180,8 +178,6 @@ static struct pipe_texture* /* XXX tex->stride = *stride; */ - pipe_buffer_reference(screen, &tex->buffer, buffer); - return (struct pipe_texture*)tex; } -- cgit v1.2.3 From 360e700a43ce3914d7f336593f380562ca190898 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 8 Feb 2009 01:07:03 -0800 Subject: r300: Add SW TCL paths for clear. This should make things work for people on RSxxx chipsets. --- src/gallium/drivers/r300/r300_surface.c | 61 +++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index bbd2ade64a..1e1f96a7f9 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -153,7 +153,17 @@ OUT_CS_REG(0x4F34, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); R300_PACIFY; -OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x21030003); +if (caps->has_tcl) { + OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, + (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)); +} else { + OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, + (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)); +} OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000000); OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688); OUT_CS_REG(R300_VAP_VTX_STATE_CNTL, 0x1); @@ -173,7 +183,11 @@ OUT_CS_32F((float)y); OUT_CS_32F(1.0); OUT_CS_32F(0.0); -OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0001C000); +if (caps->has_tcl) { + OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE | + R300_PS_UCP_MODE_CLIP_AS_TRIFAN); +} + OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); @@ -257,23 +271,32 @@ if (caps->is_r500) { } /* XXX these magic numbers should be explained when * this becomes a cached state object */ -OUT_CS_REG(R300_VAP_CNTL, 0xA | (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); -OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000); -OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000); -OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001); -R300_PACIFY; -/* XXX translate these back into normal instructions */ -OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); -OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF00203); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10001); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248001); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF02203); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); -OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); +if (caps->has_tcl) { + OUT_CS_REG(R300_VAP_CNTL, 0xA | + (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | + (0xB << R300_VF_MAX_VTX_NUM_SHIFT) | + (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); + OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000); + OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000); + OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001); + R300_PACIFY; + /* XXX translate these back into normal instructions */ + OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); + OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF00203); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10001); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248001); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF02203); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); +} else { + OUT_CS_REG(R300_VAP_CNTL, 0xA | + (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | + (0x5 << R300_VF_MAX_VTX_NUM_SHIFT) | + (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); +} R300_PACIFY; END_CS; -- cgit v1.2.3 From 5425c4aa28721072085f128e902f5679ba31a963 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 8 Feb 2009 02:03:29 -0800 Subject: r300: Accidentally removed a pipe_buffer_reference that should be there. --- src/gallium/drivers/r300/r300_texture.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 7f57656a78..ff812c09f8 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -178,6 +178,8 @@ static struct pipe_texture* /* XXX tex->stride = *stride; */ + pipe_buffer_reference(screen, &tex->buffer, buffer); + return (struct pipe_texture*)tex; } -- cgit v1.2.3 From ea7ca7607a97a1c13248f7aef1948b5ccb6423e0 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Sun, 8 Feb 2009 16:42:56 +0100 Subject: nouveau: upload and swizzle each mipmap level in turn --- src/gallium/drivers/nv04/nv04_surface_2d.c | 66 +++++++++++++++++------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index b507e993f1..1892055418 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -107,6 +107,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, const unsigned sub_h = h > max_h ? max_h : h; unsigned cx = 0; unsigned cy = 0; + int i, offset = 0; /* POT or GTFO */ assert(!(w & (w - 1)) && !(h & (h - 1))); @@ -125,34 +126,43 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1); OUT_RING (chan, swzsurf->handle); - for (cy = 0; cy < h; cy += sub_h) { - for (cx = 0; cx < w; cx += sub_w) { - BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx, cy) * - dst->block.size, NOUVEAU_BO_GART | - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - - BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); - OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE); - OUT_RING (chan, nv04_scaled_image_format(src->format)); - OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY); - OUT_RING (chan, 0); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, 0); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, 1 << 20); - OUT_RING (chan, 1 << 20); - - BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, src->stride | - NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | - NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); - OUT_RELOCl(chan, src_bo, src->offset + cy * src->stride + - cx * src->block.size, NOUVEAU_BO_GART | - NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RING (chan, 0); - } + /* Upload, then swizzle each mipmap level in turn */ + for (i=0; itexture->last_level; i++) { + + for (cy = 0; cy < h; cy += sub_h) { + for (cx = 0; cx < w; cx += sub_w) { + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); + OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx, cy) * + dst->block.size + offset, NOUVEAU_BO_GART | + NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); + OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE); + OUT_RING (chan, nv04_scaled_image_format(src->format)); + OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY); + OUT_RING (chan, 0); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, 0); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, 1 << 20); + OUT_RING (chan, 1 << 20); + + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, src->stride | + NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | + NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); + OUT_RELOCl(chan, src_bo, src->offset + cy * src->stride + + cx * src->block.size + offset, NOUVEAU_BO_GART | + NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + OUT_RING (chan, 0); + } + } + + w >>= 1; + h >>= 1; + /* FIXME: need to know how many bytes per pixel */ + offset += align(w * h * 2, 64); } return 0; -- cgit v1.2.3 From b907d4cd8fafe719b4f87d877562829548937485 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Sun, 8 Feb 2009 17:03:47 +0100 Subject: nouveau: include and calc offset before changing dimensions for next level --- src/gallium/drivers/nv04/nv04_surface_2d.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 1892055418..1b5d980468 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -1,6 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_format.h" #include "util/u_memory.h" +#include "util/u_math.h" #include "nouveau/nouveau_winsys.h" #include "nouveau/nouveau_util.h" @@ -159,10 +160,10 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, } } + /* FIXME: need to know how many bytes per pixel */ + offset += align(w * h * 2 /*src->block.size*/, 64); w >>= 1; h >>= 1; - /* FIXME: need to know how many bytes per pixel */ - offset += align(w * h * 2, 64); } return 0; -- cgit v1.2.3 From 49002698193784dacffcbf993de26fcdd42c523e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 07:55:08 -0700 Subject: mesa: rework _mesa_reference_framebuffer() to look like _mesa_reference_renderbuffer() _mesa_unreference_framebuffer() is deprecated since _mesa_reference_framebuffer(ptr, NULL) can be used instead. --- src/mesa/main/framebuffer.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 52fd3c9d81..351bf6959a 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -223,19 +223,36 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr, /* no change */ return; } + if (*ptr) { - _mesa_unreference_framebuffer(ptr); + /* unreference old renderbuffer */ + GLboolean deleteFlag = GL_FALSE; + struct gl_framebuffer *oldFb = *ptr; + + _glthread_LOCK_MUTEX(oldFb->Mutex); + ASSERT(oldFb->RefCount > 0); + oldFb->RefCount--; + deleteFlag = (oldFb->RefCount == 0); + _glthread_UNLOCK_MUTEX(oldFb->Mutex); + + if (deleteFlag) + oldFb->Delete(oldFb); + + *ptr = NULL; } assert(!*ptr); - assert(fb); - _glthread_LOCK_MUTEX(fb->Mutex); - fb->RefCount++; - _glthread_UNLOCK_MUTEX(fb->Mutex); - *ptr = fb; + + if (fb) { + _glthread_LOCK_MUTEX(fb->Mutex); + fb->RefCount++; + _glthread_UNLOCK_MUTEX(fb->Mutex); + *ptr = fb; + } } /** + * XXX this function is deprecated. * Undo/remove a reference to a framebuffer object. * Decrement the framebuffer object's reference count and delete it when * the refcount hits zero. @@ -244,21 +261,7 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr, void _mesa_unreference_framebuffer(struct gl_framebuffer **fb) { - assert(fb); - if (*fb) { - GLboolean deleteFlag = GL_FALSE; - - _glthread_LOCK_MUTEX((*fb)->Mutex); - ASSERT((*fb)->RefCount > 0); - (*fb)->RefCount--; - deleteFlag = ((*fb)->RefCount == 0); - _glthread_UNLOCK_MUTEX((*fb)->Mutex); - - if (deleteFlag) - (*fb)->Delete(*fb); - - *fb = NULL; - } + _mesa_reference_framebuffer(fb, NULL); } -- cgit v1.2.3 From 4fece21315dcb4bc44b950f9c71cb1f46288bfd5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 09:53:58 -0700 Subject: mesa: remove old 'sources' file in favor of 'sources.mak' --- src/mesa/sources | 303 ------------------------------------------------------- 1 file changed, 303 deletions(-) delete mode 100644 src/mesa/sources (limited to 'src') diff --git a/src/mesa/sources b/src/mesa/sources deleted file mode 100644 index 643c625b5b..0000000000 --- a/src/mesa/sources +++ /dev/null @@ -1,303 +0,0 @@ -### Lists of source files, included by Makefiles - -MAIN_SOURCES = \ - main/api_arrayelt.c \ - main/api_exec.c \ - main/api_loopback.c \ - main/api_noop.c \ - main/api_validate.c \ - main/accum.c \ - main/attrib.c \ - main/arrayobj.c \ - main/blend.c \ - main/bufferobj.c \ - main/buffers.c \ - main/clear.c \ - main/clip.c \ - main/colortab.c \ - main/context.c \ - main/convolve.c \ - main/debug.c \ - main/depth.c \ - main/depthstencil.c \ - main/dlist.c \ - main/dlopen.c \ - main/drawpix.c \ - main/enable.c \ - main/enums.c \ - main/eval.c \ - main/execmem.c \ - main/extensions.c \ - main/fbobject.c \ - main/feedback.c \ - main/ffvertex_prog.c \ - main/fog.c \ - main/framebuffer.c \ - main/get.c \ - main/getstring.c \ - main/hash.c \ - main/hint.c \ - main/histogram.c \ - main/image.c \ - main/imports.c \ - main/light.c \ - main/lines.c \ - main/matrix.c \ - main/mipmap.c \ - main/mm.c \ - main/multisample.c \ - main/pixel.c \ - main/pixelstore.c \ - main/points.c \ - main/polygon.c \ - main/queryobj.c \ - main/rastpos.c \ - main/rbadaptors.c \ - main/readpix.c \ - main/renderbuffer.c \ - main/scissor.c \ - main/shaders.c \ - main/state.c \ - main/stencil.c \ - main/texcompress.c \ - main/texcompress_s3tc.c \ - main/texcompress_fxt1.c \ - main/texenv.c \ - main/texenvprogram.c \ - main/texformat.c \ - main/texgen.c \ - main/teximage.c \ - main/texobj.c \ - main/texparam.c \ - main/texrender.c \ - main/texstate.c \ - main/texstore.c \ - main/varray.c \ - main/vtxfmt.c - -GLAPI_SOURCES = \ - main/dispatch.c \ - glapi/glapi.c \ - glapi/glapi_getproc.c \ - glapi/glthread.c - -MATH_SOURCES = \ - math/m_debug_clip.c \ - math/m_debug_norm.c \ - math/m_debug_xform.c \ - math/m_eval.c \ - math/m_matrix.c \ - math/m_translate.c \ - math/m_vector.c \ - math/m_xform.c - -SWRAST_SOURCES = \ - swrast/s_aaline.c \ - swrast/s_aatriangle.c \ - swrast/s_accum.c \ - swrast/s_alpha.c \ - swrast/s_atifragshader.c \ - swrast/s_bitmap.c \ - swrast/s_blend.c \ - swrast/s_blit.c \ - swrast/s_buffers.c \ - swrast/s_copypix.c \ - swrast/s_context.c \ - swrast/s_depth.c \ - swrast/s_drawpix.c \ - 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 \ - swrast/s_points.c \ - swrast/s_readpix.c \ - swrast/s_span.c \ - swrast/s_stencil.c \ - swrast/s_texcombine.c \ - swrast/s_texfilter.c \ - swrast/s_texstore.c \ - swrast/s_triangle.c \ - swrast/s_zoom.c - -SWRAST_SETUP_SOURCES = \ - swrast_setup/ss_context.c \ - swrast_setup/ss_triangle.c - -TNL_SOURCES = \ - tnl/t_context.c \ - tnl/t_pipeline.c \ - tnl/t_draw.c \ - tnl/t_rasterpos.c \ - tnl/t_vb_program.c \ - tnl/t_vb_render.c \ - tnl/t_vb_texgen.c \ - tnl/t_vb_texmat.c \ - tnl/t_vb_vertex.c \ - tnl/t_vb_cull.c \ - tnl/t_vb_fog.c \ - tnl/t_vb_light.c \ - tnl/t_vb_normals.c \ - tnl/t_vb_points.c \ - tnl/t_vp_build.c \ - tnl/t_vertex.c \ - tnl/t_vertex_sse.c \ - tnl/t_vertex_generic.c - -VBO_SOURCES = \ - vbo/vbo_context.c \ - vbo/vbo_exec.c \ - vbo/vbo_exec_api.c \ - vbo/vbo_exec_array.c \ - vbo/vbo_exec_draw.c \ - vbo/vbo_exec_eval.c \ - vbo/vbo_rebase.c \ - vbo/vbo_split.c \ - vbo/vbo_split_copy.c \ - vbo/vbo_split_inplace.c \ - vbo/vbo_save.c \ - vbo/vbo_save_api.c \ - vbo/vbo_save_draw.c \ - vbo/vbo_save_loopback.c - - -SHADER_SOURCES = \ - shader/arbprogparse.c \ - shader/arbprogram.c \ - shader/atifragshader.c \ - shader/grammar/grammar_mesa.c \ - shader/nvfragparse.c \ - shader/nvprogram.c \ - shader/nvvertparse.c \ - shader/program.c \ - shader/prog_cache.c \ - shader/prog_debug.c \ - shader/prog_execute.c \ - shader/prog_instruction.c \ - shader/prog_noise.c \ - shader/prog_parameter.c \ - shader/prog_print.c \ - shader/prog_statevars.c \ - shader/prog_uniform.c \ - shader/programopt.c \ - shader/shader_api.c \ - -SLANG_SOURCES = \ - shader/slang/slang_builtin.c \ - shader/slang/slang_codegen.c \ - shader/slang/slang_compile.c \ - shader/slang/slang_compile_function.c \ - shader/slang/slang_compile_operation.c \ - shader/slang/slang_compile_struct.c \ - shader/slang/slang_compile_variable.c \ - shader/slang/slang_emit.c \ - shader/slang/slang_ir.c \ - shader/slang/slang_label.c \ - shader/slang/slang_link.c \ - shader/slang/slang_log.c \ - shader/slang/slang_mem.c \ - shader/slang/slang_preprocess.c \ - shader/slang/slang_print.c \ - shader/slang/slang_simplify.c \ - shader/slang/slang_storage.c \ - shader/slang/slang_typeinfo.c \ - shader/slang/slang_vartable.c \ - shader/slang/slang_utility.c - -ASM_C_SOURCES = \ - x86/common_x86.c \ - x86/x86.c \ - x86/3dnow.c \ - x86/sse.c \ - x86/rtasm/x86sse.c \ - sparc/sparc.c \ - ppc/common_ppc.c \ - x86-64/x86-64.c - -X86_SOURCES = \ - x86/common_x86_asm.S \ - x86/x86_xform2.S \ - x86/x86_xform3.S \ - x86/x86_xform4.S \ - x86/x86_cliptest.S \ - x86/mmx_blend.S \ - x86/3dnow_xform1.S \ - x86/3dnow_xform2.S \ - x86/3dnow_xform3.S \ - x86/3dnow_xform4.S \ - x86/3dnow_normal.S \ - x86/sse_xform1.S \ - x86/sse_xform2.S \ - x86/sse_xform3.S \ - x86/sse_xform4.S \ - x86/sse_normal.S \ - x86/read_rgba_span_x86.S - -X86_API = \ - x86/glapi_x86.S - -X86-64_SOURCES = \ - x86-64/xform4.S - -X86-64_API = \ - x86-64/glapi_x86-64.S - -SPARC_SOURCES = \ - sparc/clip.S \ - sparc/norm.S \ - sparc/xform.S - -SPARC_API = \ - sparc/glapi_sparc.S - -COMMON_DRIVER_SOURCES = \ - drivers/common/driverfuncs.c - - - -### All the core C sources - -MESA_SOURCES = \ - $(MAIN_SOURCES) \ - $(MATH_SOURCES) \ - $(VBO_SOURCES) \ - $(TNL_SOURCES) \ - $(SHADER_SOURCES) \ - $(SWRAST_SOURCES) \ - $(SWRAST_SETUP_SOURCES) \ - $(COMMON_DRIVER_SOURCES) \ - $(ASM_C_SOURCES) \ - $(SLANG_SOURCES) - -ALL_SOURCES = \ - $(MESA_SOURCES) \ - $(GLAPI_SOURCES) \ - $(MESA_ASM_SOURCES) \ - $(COMMON_DRIVER_SOURCES) - - -### Object files - -MESA_OBJECTS = \ - $(MESA_SOURCES:.c=.o) \ - $(MESA_ASM_SOURCES:.S=.o) - -GLAPI_OBJECTS = \ - $(GLAPI_SOURCES:.c=.o) \ - $(GLAPI_ASM_SOURCES:.S=.o) - - -COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o) - - - -### Include directories -### XXX we should be able to trim this down to just -Iinclude/ and -Isrc/mesa/ -### since most #includes have been changed from #include "mtypes.h" to -### #include "main/mtypes.h", etc. - -INCLUDE_DIRS = \ - -I$(TOP)/include \ - -I$(TOP)/src/mesa -- cgit v1.2.3 From 71e64fc30b4f57bd93daf004bc04af7181391f4d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 09:54:33 -0700 Subject: swrast: fix typo: s/drapix/drawpix/ --- src/mesa/swrast/s_drawpix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 2fc9fd0d50..700f76d4bc 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -881,7 +881,7 @@ _swrast_DrawPixels( GLcontext *ctx, swrast_render_finish(ctx); - _mesa_unmap_drapix_pbo(ctx, unpack); + _mesa_unmap_drawpix_pbo(ctx, unpack); } -- cgit v1.2.3 From 87e44d9003d6fdd4b9be911ad1aa4de1f87068d9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 09:54:52 -0700 Subject: mesa: prefix #includes with main/ --- src/mesa/tnl/t_rasterpos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c index dfbe0f1806..14d79eab54 100644 --- a/src/mesa/tnl/t_rasterpos.c +++ b/src/mesa/tnl/t_rasterpos.c @@ -26,11 +26,11 @@ #include "main/glheader.h" #include "main/colormac.h" #include "main/context.h" -#include "feedback.h" -#include "light.h" +#include "main/feedback.h" +#include "main/light.h" #include "main/macros.h" -#include "rastpos.h" -#include "simple_list.h" +#include "main/rastpos.h" +#include "main/simple_list.h" #include "main/mtypes.h" #include "math/m_matrix.h" -- cgit v1.2.3 From 3c15e02783ed5e908d7668c39786337d62e51d12 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 10:12:11 -0700 Subject: softpipe: add null ptr check in softpipe_map_constant_buffers() Fixes segfault regression in progs/glsl/identity.c --- src/gallium/drivers/softpipe/sp_draw_arrays.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index ecc9d00319..7e3a25e34b 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -47,16 +47,22 @@ static void softpipe_map_constant_buffers(struct softpipe_context *sp) { struct pipe_winsys *ws = sp->pipe.winsys; - uint i; + uint i, size; + for (i = 0; i < PIPE_SHADER_TYPES; i++) { if (sp->constants[i].buffer && sp->constants[i].buffer->size) sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer, PIPE_BUFFER_USAGE_CPU_READ); } + if (sp->constants[PIPE_SHADER_VERTEX].buffer) + size = sp->constants[PIPE_SHADER_VERTEX].buffer->size; + else + size = 0; + draw_set_mapped_constant_buffer(sp->draw, sp->mapped_constants[PIPE_SHADER_VERTEX], - sp->constants[PIPE_SHADER_VERTEX].buffer->size); + size); } static void -- cgit v1.2.3 From abbe96cb6e7581a52652030e40442b943a482840 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 10:17:58 -0700 Subject: mesa: added new linux-gallium and linux-gallium-debug configs Also, remove gallium-related things from configs/default. They're in linux-gallium now. So the default builds are the same as they have been for Mesa/master. --- Makefile | 2 ++ configs/default | 12 ++---------- configs/linux-gallium | 22 ++++++++++++++++++++++ configs/linux-gallium-debug | 8 ++++++++ src/mesa/Makefile | 4 ++++ src/mesa/sources.mak | 28 ++++++++++++++++++++-------- 6 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 configs/linux-gallium create mode 100644 configs/linux-gallium-debug (limited to 'src') diff --git a/Makefile b/Makefile index c79fb1cb28..24cfbe5922 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,8 @@ linux-dri-x86-64 \ linux-dri-ppc \ linux-dri-xcb \ linux-egl \ +linux-gallium \ +linux-gallium-debug \ linux-indirect \ linux-fbdev \ linux-glide \ diff --git a/configs/default b/configs/default index 13bda58f18..ec8d51ccfe 100644 --- a/configs/default +++ b/configs/default @@ -79,24 +79,16 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2 # Directories to build LIB_DIR = lib -SRC_DIRS = mesa gallium egl gallium/winsys glu glut/glx glew glw +SRC_DIRS = mesa egl glu glut/glx glew glw GLU_DIRS = sgi -DRIVER_DIRS = +DRIVER_DIRS = x11 osmesa # Which subdirs under $(TOP)/progs/ to enter: PROGRAM_DIRS = demos redbook samples glsl xdemos # EGL directories EGL_DRIVERS_DIRS = demo -# Gallium directories and -GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util indices -GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a) -GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv04 nv10 nv20 nv30 nv40 nv50 failover trace -GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) -GALLIUM_WINSYS_DIRS = xlib egl_xlib - -# Library dependencies #EXTRA_LIB_PATH ?= GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) diff --git a/configs/linux-gallium b/configs/linux-gallium new file mode 100644 index 0000000000..b046f248ec --- /dev/null +++ b/configs/linux-gallium @@ -0,0 +1,22 @@ +# Configuration for Linux / Gallium + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-gallium + + +# Directories to build (adds gallium to SRC_DIRS) +SRC_DIRS = mesa gallium egl gallium/winsys glu glut/glx glew glw + + +# don't build old/conventional Mesa drivers +DRIVER_DIRS = + + +# Gallium directories and +GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util indices +GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a) +GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv04 nv10 nv20 nv30 nv40 nv50 failover trace +GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) +GALLIUM_WINSYS_DIRS = xlib egl_xlib + diff --git a/configs/linux-gallium-debug b/configs/linux-gallium-debug new file mode 100644 index 0000000000..111c43b884 --- /dev/null +++ b/configs/linux-gallium-debug @@ -0,0 +1,8 @@ +# Configuration for Linux / Gallium for debug + +include $(TOP)/configs/linux-gallium + +CONFIG_NAME = linux-gallium-debug + +OPT_FLAGS = -g -ansi -pedantic +DEFINES += -DDEBUG -DDEBUG_MATH diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 552c20e0b9..22ef05c335 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -32,6 +32,10 @@ default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs libmesa.a: $(MESA_OBJECTS) @ $(MKLIB) -o mesa -static $(MESA_OBJECTS) +# Make archive of subset of core mesa object files for gallium +libmesagallium.a: $(MESA_GALLIUM_OBJECTS) + @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) + # Make archive of gl* API dispatcher functions only libglapi.a: $(GLAPI_OBJECTS) @if [ "${WINDOW_SYSTEM}" = "dri" ] ; then \ diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 8940670d5b..13ec1fa454 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -91,7 +91,7 @@ MATH_SOURCES = \ math/m_vector.c \ math/m_xform.c -__SWRAST_SOURCES = \ +SWRAST_SOURCES = \ swrast/s_aaline.c \ swrast/s_aatriangle.c \ swrast/s_accum.c \ @@ -122,11 +122,11 @@ __SWRAST_SOURCES = \ swrast/s_triangle.c \ swrast/s_zoom.c -__SWRAST_SETUP_SOURCES = \ +SWRAST_SETUP_SOURCES = \ swrast_setup/ss_context.c \ swrast_setup/ss_triangle.c -__TNL_SOURCES = \ +TNL_SOURCES = \ tnl/t_context.c \ tnl/t_pipeline.c \ tnl/t_draw.c \ @@ -162,7 +162,7 @@ VBO_SOURCES = \ vbo/vbo_save_draw.c \ vbo/vbo_save_loopback.c -__VF_SOURCES = \ +VF_SOURCES = \ vf/vf.c \ vf/vf_generic.c \ vf/vf_sse.c @@ -299,7 +299,7 @@ SPARC_SOURCES = \ SPARC_API = \ sparc/glapi_sparc.S -__COMMON_DRIVER_SOURCES = \ +COMMON_DRIVER_SOURCES = \ drivers/common/driverfuncs.c @@ -310,19 +310,27 @@ MESA_SOURCES = \ $(MAIN_SOURCES) \ $(MATH_SOURCES) \ $(VBO_SOURCES) \ - $(STATETRACKER_SOURCES) \ $(TNL_SOURCES) \ $(SHADER_SOURCES) \ $(SWRAST_SOURCES) \ $(SWRAST_SETUP_SOURCES) \ + $(COMMON_DRIVER_SOURCES)\ $(ASM_C_SOURCES) \ $(SLANG_SOURCES) ALL_SOURCES = \ $(MESA_SOURCES) \ $(GLAPI_SOURCES) \ - $(MESA_ASM_SOURCES) \ - $(COMMON_DRIVER_SOURCES) + $(MESA_ASM_SOURCES) + +MESA_GALLIUM_SOURCES = \ + $(MAIN_SOURCES) \ + $(MATH_SOURCES) \ + $(VBO_SOURCES) \ + $(STATETRACKER_SOURCES) \ + $(SHADER_SOURCES) \ + $(ASM_C_SOURCES) \ + $(SLANG_SOURCES) ### Object files @@ -331,6 +339,10 @@ MESA_OBJECTS = \ $(MESA_SOURCES:.c=.o) \ $(MESA_ASM_SOURCES:.S=.o) +MESA_GALLIUM_OBJECTS = \ + $(MESA_GALLIUM_SOURCES:.c=.o) \ + $(MESA_ASM_SOURCES:.S=.o) + GLAPI_OBJECTS = \ $(GLAPI_SOURCES:.c=.o) \ $(GLAPI_ASM_SOURCES:.S=.o) -- cgit v1.2.3 From 2438161823630a6e647c105ad92cf2b0cd740d00 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 10:37:38 -0700 Subject: mesa: build/use libmesagallium.a for gallium builds This contains the core mesa code but excludes things not needed for gallium such as tnl/, swrast/, swrast_setup/, etc. --- src/gallium/winsys/drm/Makefile.template | 4 ++-- src/gallium/winsys/egl_xlib/Makefile | 2 +- src/gallium/winsys/xlib/Makefile | 2 +- src/mesa/Makefile | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/Makefile.template b/src/gallium/winsys/drm/Makefile.template index 211f4d875e..6756640c4e 100644 --- a/src/gallium/winsys/drm/Makefile.template +++ b/src/gallium/winsys/drm/Makefile.template @@ -1,9 +1,9 @@ # -*-makefile-*- MESA_MODULES = \ - $(TOP)/src/mesa/libmesa.a \ + $(TOP)/src/mesa/libmesagallium.a \ $(GALLIUM_AUXILIARIES) - + COMMON_GALLIUM_SOURCES = \ $(TOP)/src/mesa/drivers/dri/common/utils.c \ $(TOP)/src/mesa/drivers/dri/common/vblank.c \ diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile index 76f1b56da4..02ac47caa4 100644 --- a/src/gallium/winsys/egl_xlib/Makefile +++ b/src/gallium/winsys/egl_xlib/Makefile @@ -34,7 +34,7 @@ LIBS = \ # mesa code, as done for ES 1.x, 2.x, OpenVG, etc) UNUSED_LIBS = \ $(TOP)/src/mesa/libglapi.a \ - $(TOP)/src/mesa/libmesa.a \ + $(TOP)/src/mesa/libmesagallium.a \ LOCAL_CFLAGS = -D_EGL_PLATFORM_X=1 diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 8c2892d49b..9d70f3cb9c 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -47,7 +47,7 @@ LIBS = \ $(GALLIUM_DRIVERS) \ $(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \ $(TOP)/src/mesa/libglapi.a \ - $(TOP)/src/mesa/libmesa.a \ + $(TOP)/src/mesa/libmesagallium.a \ $(GALLIUM_AUXILIARIES) \ $(CELL_SPU_LIB) \ diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 22ef05c335..78b71d4676 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -21,7 +21,8 @@ include sources.mak # Default: build dependencies, then asm_subdirs, then convenience # libs (.a) and finally the device drivers: -default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs +default: depend asm_subdirs libmesa.a libmesagallium.a libglapi.a \ + driver_subdirs -- cgit v1.2.3 From 123299546fccc0814d08c6258ed9e64a356f7607 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 9 Feb 2009 18:11:05 +0000 Subject: indices: Fix typo. --- src/gallium/auxiliary/indices/u_indices_gen.c | 480 ++++++++++++------------- src/gallium/auxiliary/indices/u_indices_gen.py | 2 +- 2 files changed, 241 insertions(+), 241 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/indices/u_indices_gen.c b/src/gallium/auxiliary/indices/u_indices_gen.c index 01953c3244..4c05b3eedb 100644 --- a/src/gallium/auxiliary/indices/u_indices_gen.c +++ b/src/gallium/auxiliary/indices/u_indices_gen.c @@ -1133,7 +1133,7 @@ static void translate_points_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1146,7 +1146,7 @@ static void translate_lines_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1160,7 +1160,7 @@ static void translate_linestrip_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1174,7 +1174,7 @@ static void translate_lineloop_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1190,7 +1190,7 @@ static void translate_tris_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1205,7 +1205,7 @@ static void translate_tristrip_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1220,7 +1220,7 @@ static void translate_trifan_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1235,7 +1235,7 @@ static void translate_quads_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1253,7 +1253,7 @@ static void translate_quadstrip_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1271,7 +1271,7 @@ static void translate_polygon_ubyte2ushort_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1286,7 +1286,7 @@ static void translate_points_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1299,7 +1299,7 @@ static void translate_lines_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1313,7 +1313,7 @@ static void translate_linestrip_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1327,7 +1327,7 @@ static void translate_lineloop_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1343,7 +1343,7 @@ static void translate_tris_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1358,7 +1358,7 @@ static void translate_tristrip_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1373,7 +1373,7 @@ static void translate_trifan_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1388,7 +1388,7 @@ static void translate_quads_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1406,7 +1406,7 @@ static void translate_quadstrip_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1424,7 +1424,7 @@ static void translate_polygon_ubyte2ushort_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1439,7 +1439,7 @@ static void translate_points_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1452,7 +1452,7 @@ static void translate_lines_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1466,7 +1466,7 @@ static void translate_linestrip_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1480,7 +1480,7 @@ static void translate_lineloop_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1496,7 +1496,7 @@ static void translate_tris_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1511,7 +1511,7 @@ static void translate_tristrip_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1526,7 +1526,7 @@ static void translate_trifan_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1541,7 +1541,7 @@ static void translate_quads_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1559,7 +1559,7 @@ static void translate_quadstrip_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1577,7 +1577,7 @@ static void translate_polygon_ubyte2ushort_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1592,7 +1592,7 @@ static void translate_points_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1605,7 +1605,7 @@ static void translate_lines_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1619,7 +1619,7 @@ static void translate_linestrip_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1633,7 +1633,7 @@ static void translate_lineloop_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1649,7 +1649,7 @@ static void translate_tris_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1664,7 +1664,7 @@ static void translate_tristrip_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1679,7 +1679,7 @@ static void translate_trifan_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1694,7 +1694,7 @@ static void translate_quads_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1712,7 +1712,7 @@ static void translate_quadstrip_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1730,7 +1730,7 @@ static void translate_polygon_ubyte2ushort_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -1745,7 +1745,7 @@ static void translate_points_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1758,7 +1758,7 @@ static void translate_lines_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1772,7 +1772,7 @@ static void translate_linestrip_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1786,7 +1786,7 @@ static void translate_lineloop_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1802,7 +1802,7 @@ static void translate_tris_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1817,7 +1817,7 @@ static void translate_tristrip_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1832,7 +1832,7 @@ static void translate_trifan_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1847,7 +1847,7 @@ static void translate_quads_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1865,7 +1865,7 @@ static void translate_quadstrip_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1883,7 +1883,7 @@ static void translate_polygon_ubyte2uint_first2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1898,7 +1898,7 @@ static void translate_points_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1911,7 +1911,7 @@ static void translate_lines_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1925,7 +1925,7 @@ static void translate_linestrip_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1939,7 +1939,7 @@ static void translate_lineloop_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1955,7 +1955,7 @@ static void translate_tris_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1970,7 +1970,7 @@ static void translate_tristrip_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -1985,7 +1985,7 @@ static void translate_trifan_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2000,7 +2000,7 @@ static void translate_quads_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2018,7 +2018,7 @@ static void translate_quadstrip_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2036,7 +2036,7 @@ static void translate_polygon_ubyte2uint_first2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2051,7 +2051,7 @@ static void translate_points_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2064,7 +2064,7 @@ static void translate_lines_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2078,7 +2078,7 @@ static void translate_linestrip_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2092,7 +2092,7 @@ static void translate_lineloop_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2108,7 +2108,7 @@ static void translate_tris_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2123,7 +2123,7 @@ static void translate_tristrip_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2138,7 +2138,7 @@ static void translate_trifan_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2153,7 +2153,7 @@ static void translate_quads_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2171,7 +2171,7 @@ static void translate_quadstrip_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2189,7 +2189,7 @@ static void translate_polygon_ubyte2uint_last2first( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2204,7 +2204,7 @@ static void translate_points_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2217,7 +2217,7 @@ static void translate_lines_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2231,7 +2231,7 @@ static void translate_linestrip_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2245,7 +2245,7 @@ static void translate_lineloop_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2261,7 +2261,7 @@ static void translate_tris_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2276,7 +2276,7 @@ static void translate_tristrip_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2291,7 +2291,7 @@ static void translate_trifan_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2306,7 +2306,7 @@ static void translate_quads_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2324,7 +2324,7 @@ static void translate_quadstrip_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2342,7 +2342,7 @@ static void translate_polygon_ubyte2uint_last2last( unsigned nr, void *_out ) { - const ubyte*in = (const ubyte*)in; + const ubyte*in = (const ubyte*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2357,7 +2357,7 @@ static void translate_points_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2370,7 +2370,7 @@ static void translate_lines_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2384,7 +2384,7 @@ static void translate_linestrip_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2398,7 +2398,7 @@ static void translate_lineloop_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2414,7 +2414,7 @@ static void translate_tris_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2429,7 +2429,7 @@ static void translate_tristrip_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2444,7 +2444,7 @@ static void translate_trifan_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2459,7 +2459,7 @@ static void translate_quads_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2477,7 +2477,7 @@ static void translate_quadstrip_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2495,7 +2495,7 @@ static void translate_polygon_ushort2ushort_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2510,7 +2510,7 @@ static void translate_points_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2523,7 +2523,7 @@ static void translate_lines_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2537,7 +2537,7 @@ static void translate_linestrip_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2551,7 +2551,7 @@ static void translate_lineloop_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2567,7 +2567,7 @@ static void translate_tris_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2582,7 +2582,7 @@ static void translate_tristrip_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2597,7 +2597,7 @@ static void translate_trifan_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2612,7 +2612,7 @@ static void translate_quads_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2630,7 +2630,7 @@ static void translate_quadstrip_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2648,7 +2648,7 @@ static void translate_polygon_ushort2ushort_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2663,7 +2663,7 @@ static void translate_points_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2676,7 +2676,7 @@ static void translate_lines_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2690,7 +2690,7 @@ static void translate_linestrip_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2704,7 +2704,7 @@ static void translate_lineloop_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2720,7 +2720,7 @@ static void translate_tris_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2735,7 +2735,7 @@ static void translate_tristrip_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2750,7 +2750,7 @@ static void translate_trifan_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2765,7 +2765,7 @@ static void translate_quads_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2783,7 +2783,7 @@ static void translate_quadstrip_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2801,7 +2801,7 @@ static void translate_polygon_ushort2ushort_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2816,7 +2816,7 @@ static void translate_points_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2829,7 +2829,7 @@ static void translate_lines_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2843,7 +2843,7 @@ static void translate_linestrip_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2857,7 +2857,7 @@ static void translate_lineloop_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2873,7 +2873,7 @@ static void translate_tris_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2888,7 +2888,7 @@ static void translate_tristrip_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2903,7 +2903,7 @@ static void translate_trifan_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2918,7 +2918,7 @@ static void translate_quads_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2936,7 +2936,7 @@ static void translate_quadstrip_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2954,7 +2954,7 @@ static void translate_polygon_ushort2ushort_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -2969,7 +2969,7 @@ static void translate_points_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2982,7 +2982,7 @@ static void translate_lines_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -2996,7 +2996,7 @@ static void translate_linestrip_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3010,7 +3010,7 @@ static void translate_lineloop_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3026,7 +3026,7 @@ static void translate_tris_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3041,7 +3041,7 @@ static void translate_tristrip_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3056,7 +3056,7 @@ static void translate_trifan_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3071,7 +3071,7 @@ static void translate_quads_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3089,7 +3089,7 @@ static void translate_quadstrip_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3107,7 +3107,7 @@ static void translate_polygon_ushort2uint_first2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3122,7 +3122,7 @@ static void translate_points_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3135,7 +3135,7 @@ static void translate_lines_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3149,7 +3149,7 @@ static void translate_linestrip_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3163,7 +3163,7 @@ static void translate_lineloop_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3179,7 +3179,7 @@ static void translate_tris_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3194,7 +3194,7 @@ static void translate_tristrip_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3209,7 +3209,7 @@ static void translate_trifan_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3224,7 +3224,7 @@ static void translate_quads_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3242,7 +3242,7 @@ static void translate_quadstrip_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3260,7 +3260,7 @@ static void translate_polygon_ushort2uint_first2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3275,7 +3275,7 @@ static void translate_points_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3288,7 +3288,7 @@ static void translate_lines_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3302,7 +3302,7 @@ static void translate_linestrip_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3316,7 +3316,7 @@ static void translate_lineloop_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3332,7 +3332,7 @@ static void translate_tris_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3347,7 +3347,7 @@ static void translate_tristrip_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3362,7 +3362,7 @@ static void translate_trifan_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3377,7 +3377,7 @@ static void translate_quads_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3395,7 +3395,7 @@ static void translate_quadstrip_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3413,7 +3413,7 @@ static void translate_polygon_ushort2uint_last2first( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3428,7 +3428,7 @@ static void translate_points_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3441,7 +3441,7 @@ static void translate_lines_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3455,7 +3455,7 @@ static void translate_linestrip_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3469,7 +3469,7 @@ static void translate_lineloop_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3485,7 +3485,7 @@ static void translate_tris_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3500,7 +3500,7 @@ static void translate_tristrip_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3515,7 +3515,7 @@ static void translate_trifan_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3530,7 +3530,7 @@ static void translate_quads_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3548,7 +3548,7 @@ static void translate_quadstrip_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3566,7 +3566,7 @@ static void translate_polygon_ushort2uint_last2last( unsigned nr, void *_out ) { - const ushort*in = (const ushort*)in; + const ushort*in = (const ushort*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -3581,7 +3581,7 @@ static void translate_points_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3594,7 +3594,7 @@ static void translate_lines_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3608,7 +3608,7 @@ static void translate_linestrip_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3622,7 +3622,7 @@ static void translate_lineloop_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3638,7 +3638,7 @@ static void translate_tris_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3653,7 +3653,7 @@ static void translate_tristrip_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3668,7 +3668,7 @@ static void translate_trifan_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3683,7 +3683,7 @@ static void translate_quads_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3701,7 +3701,7 @@ static void translate_quadstrip_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3719,7 +3719,7 @@ static void translate_polygon_uint2ushort_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3734,7 +3734,7 @@ static void translate_points_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3747,7 +3747,7 @@ static void translate_lines_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3761,7 +3761,7 @@ static void translate_linestrip_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3775,7 +3775,7 @@ static void translate_lineloop_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3791,7 +3791,7 @@ static void translate_tris_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3806,7 +3806,7 @@ static void translate_tristrip_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3821,7 +3821,7 @@ static void translate_trifan_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3836,7 +3836,7 @@ static void translate_quads_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3854,7 +3854,7 @@ static void translate_quadstrip_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3872,7 +3872,7 @@ static void translate_polygon_uint2ushort_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3887,7 +3887,7 @@ static void translate_points_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3900,7 +3900,7 @@ static void translate_lines_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3914,7 +3914,7 @@ static void translate_linestrip_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3928,7 +3928,7 @@ static void translate_lineloop_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3944,7 +3944,7 @@ static void translate_tris_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3959,7 +3959,7 @@ static void translate_tristrip_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3974,7 +3974,7 @@ static void translate_trifan_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -3989,7 +3989,7 @@ static void translate_quads_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4007,7 +4007,7 @@ static void translate_quadstrip_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4025,7 +4025,7 @@ static void translate_polygon_uint2ushort_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4040,7 +4040,7 @@ static void translate_points_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4053,7 +4053,7 @@ static void translate_lines_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4067,7 +4067,7 @@ static void translate_linestrip_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4081,7 +4081,7 @@ static void translate_lineloop_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4097,7 +4097,7 @@ static void translate_tris_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4112,7 +4112,7 @@ static void translate_tristrip_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4127,7 +4127,7 @@ static void translate_trifan_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4142,7 +4142,7 @@ static void translate_quads_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4160,7 +4160,7 @@ static void translate_quadstrip_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4178,7 +4178,7 @@ static void translate_polygon_uint2ushort_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; @@ -4193,7 +4193,7 @@ static void translate_points_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4206,7 +4206,7 @@ static void translate_lines_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4220,7 +4220,7 @@ static void translate_linestrip_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4234,7 +4234,7 @@ static void translate_lineloop_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4250,7 +4250,7 @@ static void translate_tris_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4265,7 +4265,7 @@ static void translate_tristrip_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4280,7 +4280,7 @@ static void translate_trifan_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4295,7 +4295,7 @@ static void translate_quads_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4313,7 +4313,7 @@ static void translate_quadstrip_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4331,7 +4331,7 @@ static void translate_polygon_uint2uint_first2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4346,7 +4346,7 @@ static void translate_points_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4359,7 +4359,7 @@ static void translate_lines_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4373,7 +4373,7 @@ static void translate_linestrip_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4387,7 +4387,7 @@ static void translate_lineloop_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4403,7 +4403,7 @@ static void translate_tris_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4418,7 +4418,7 @@ static void translate_tristrip_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4433,7 +4433,7 @@ static void translate_trifan_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4448,7 +4448,7 @@ static void translate_quads_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4466,7 +4466,7 @@ static void translate_quadstrip_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4484,7 +4484,7 @@ static void translate_polygon_uint2uint_first2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4499,7 +4499,7 @@ static void translate_points_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4512,7 +4512,7 @@ static void translate_lines_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4526,7 +4526,7 @@ static void translate_linestrip_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4540,7 +4540,7 @@ static void translate_lineloop_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4556,7 +4556,7 @@ static void translate_tris_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4571,7 +4571,7 @@ static void translate_tristrip_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4586,7 +4586,7 @@ static void translate_trifan_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4601,7 +4601,7 @@ static void translate_quads_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4619,7 +4619,7 @@ static void translate_quadstrip_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4637,7 +4637,7 @@ static void translate_polygon_uint2uint_last2first( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4652,7 +4652,7 @@ static void translate_points_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4665,7 +4665,7 @@ static void translate_lines_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4679,7 +4679,7 @@ static void translate_linestrip_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4693,7 +4693,7 @@ static void translate_lineloop_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4709,7 +4709,7 @@ static void translate_tris_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4724,7 +4724,7 @@ static void translate_tristrip_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4739,7 +4739,7 @@ static void translate_trifan_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4754,7 +4754,7 @@ static void translate_quads_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4772,7 +4772,7 @@ static void translate_quadstrip_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; @@ -4790,7 +4790,7 @@ static void translate_polygon_uint2uint_last2last( unsigned nr, void *_out ) { - const uint*in = (const uint*)in; + const uint*in = (const uint*)_in; uint *out = (uint*)_out; unsigned i, j; (void)j; diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py index 40b047bb58..0dc58d0cd0 100644 --- a/src/gallium/auxiliary/indices/u_indices_gen.py +++ b/src/gallium/auxiliary/indices/u_indices_gen.py @@ -157,7 +157,7 @@ def preamble(intype, outtype, inpv, outpv, prim): print ' void *_out )' print '{' if intype != GENERATE: - print ' const ' + intype + '*in = (const ' + intype + '*)in;' + print ' const ' + intype + '*in = (const ' + intype + '*)_in;' print ' ' + outtype + ' *out = (' + outtype + '*)_out;' print ' unsigned i, j;' print ' (void)j;' -- cgit v1.2.3 From e13593678f62941db06b7ae1a21b81c643371659 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 11:16:20 -0700 Subject: re-add MSAA support (cherry picked from commit f7d80aa00611917bc8ce637136d982b151b8f44f) This also involved adding the new MSAA fields to driCreateConfigs(). Also, re-add prog_instructions->Sampler field for i965 driver. Will have to revisit that. --- configs/linux-dri | 13 +++------- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 6 +++-- src/mesa/drivers/dri/i810/i810screen.c | 4 ++- src/mesa/drivers/dri/intel/intel_screen.c | 11 +++++--- src/mesa/drivers/dri/mach64/mach64_screen.c | 4 ++- src/mesa/drivers/dri/mga/mga_xmesa.c | 4 ++- src/mesa/drivers/dri/r128/r128_screen.c | 39 +++++++++++++++-------------- src/mesa/drivers/dri/radeon/radeon_screen.c | 5 ++-- src/mesa/drivers/dri/savage/savage_xmesa.c | 5 ++-- src/mesa/drivers/dri/sis/sis_screen.c | 4 ++- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 4 ++- src/mesa/drivers/dri/unichrome/via_screen.c | 4 ++- src/mesa/shader/prog_instruction.h | 2 +- 13 files changed, 60 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/configs/linux-dri b/configs/linux-dri index c667a386f3..dc2ab4f9d9 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -57,16 +57,9 @@ PROGRAM_DIRS := egl $(PROGRAM_DIRS) # EGL directories EGL_DRIVERS_DIRS = demo glx -DRIVER_DIRS = +DRIVER_DIRS = dri WINDOW_SYSTEM = dri GALLIUM_WINSYS_DIRS = drm -# gamma are missing because they have not been converted to use the new -# interface. - -# XXX: need to figure out a way for gallium and non-gallium builds to -# coexist: -# - -#DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \ -# savage sis tdfx trident unichrome ffb +DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \ + savage sis tdfx trident unichrome ffb diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 0cdbbd0ace..eb086e3055 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -628,6 +628,7 @@ ffbFillInModes( __DRIscreenPrivate *psp, uint8_t depth_bits_array[3]; uint8_t stencil_bits_array[3]; + uint8_t msaa_samples_array[1]; depth_bits_array[0] = 0; depth_bits_array[1] = depth_bits; @@ -656,9 +657,10 @@ ffbFillInModes( __DRIscreenPrivate *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, - back_buffer_factor); + back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); return NULL; } diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 48603f5d79..6d7cf1f38b 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -77,6 +77,7 @@ i810FillInModes( __DRIscreenPrivate *psp, uint8_t depth_bits_array[2]; uint8_t stencil_bits_array[2]; + uint8_t msaa_samples_array[1]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; @@ -94,7 +95,8 @@ i810FillInModes( __DRIscreenPrivate *psp, configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor); + back_buffer_modes, back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index e17f18a98f..f29e0e966b 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -478,6 +478,7 @@ intelFillInModes(__DRIscreenPrivate *psp, uint8_t depth_bits_array[3]; uint8_t stencil_bits_array[3]; + uint8_t msaa_samples_array[1]; depth_bits_array[0] = 0; depth_bits_array[1] = depth_bits; @@ -509,7 +510,9 @@ intelFillInModes(__DRIscreenPrivate *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, - back_buffer_factor); + back_buffer_factor, + msaa_samples_array, 1); + if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); @@ -679,7 +682,7 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) static const GLenum back_buffer_modes[] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - uint8_t depth_bits[4], stencil_bits[4]; + uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1]; int color; const __DRIconfig **configs = NULL; @@ -748,7 +751,9 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) stencil_bits, ARRAY_SIZE(depth_bits), back_buffer_modes, - ARRAY_SIZE(back_buffer_modes)); + ARRAY_SIZE(back_buffer_modes), + msaa_samples_array, ARRAY_SIZE(msaa_samples_array)); + if (configs == NULL) configs = new_configs; else diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 6bfb4c32b1..59a3573898 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -93,6 +93,7 @@ mach64FillInModes( __DRIscreenPrivate *psp, uint8_t depth_bits_array[2]; uint8_t stencil_bits_array[2]; + uint8_t msaa_samples_array[1]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; @@ -119,7 +120,8 @@ mach64FillInModes( __DRIscreenPrivate *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, - back_buffer_factor); + back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 2d0f387cdc..98185a6c9e 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -129,6 +129,7 @@ mgaFillInModes( __DRIscreenPrivate *psp, uint8_t depth_bits_array[3]; uint8_t stencil_bits_array[3]; + uint8_t msaa_samples_array[1]; depth_bits_array[0] = 0; @@ -158,7 +159,8 @@ mgaFillInModes( __DRIscreenPrivate *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor); + back_buffer_modes, back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index cb3a147dba..e72ca45be9 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -422,7 +422,7 @@ r128FillInModes( __DRIscreenPrivate *psp, uint8_t depth_bits_array[2]; uint8_t stencil_bits_array[2]; - + uint8_t msaa_samples_array[1]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; @@ -446,26 +446,27 @@ r128FillInModes( __DRIscreenPrivate *psp, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - configs = driCreateConfigs(fb_format, fb_type, - depth_bits_array, stencil_bits_array, - depth_buffer_factor, back_buffer_modes, - back_buffer_factor); - if (configs == NULL) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, - __LINE__); - return NULL; - } + configs = driCreateConfigs(fb_format, fb_type, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, back_buffer_modes, + back_buffer_factor, + msaa_samples_array, 1); + if (configs == NULL) { + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, + __LINE__); + return NULL; + } - /* Mark the visual as slow if there are "fake" stencil bits. - */ - for (i = 0; configs[i]; i++) { - m = &configs[i]->modes; - if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) { - m->visualRating = GLX_SLOW_CONFIG; - } - } + /* Mark the visual as slow if there are "fake" stencil bits. + */ + for (i = 0; configs[i]; i++) { + m = &configs[i]->modes; + if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) { + m->visualRating = GLX_SLOW_CONFIG; + } + } - return (const __DRIconfig **) configs; + return (const __DRIconfig **) configs; } diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index f5665c4af1..b52a084777 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -276,7 +276,7 @@ radeonFillInModes( __DRIscreenPrivate *psp, uint8_t depth_bits_array[2]; uint8_t stencil_bits_array[2]; - + uint8_t msaa_samples_array[1]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; @@ -303,7 +303,8 @@ radeonFillInModes( __DRIscreenPrivate *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor); + back_buffer_modes, back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index c5decb093a..ba4008e644 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -910,7 +910,7 @@ savageFillInModes( __DRIscreenPrivate *psp, uint8_t depth_bits_array[2]; uint8_t stencil_bits_array[2]; - + uint8_t msaa_samples_array[1]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; @@ -937,7 +937,8 @@ savageFillInModes( __DRIscreenPrivate *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor); + back_buffer_modes, back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index b1a5d15236..e31b5223f7 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -77,6 +77,7 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp) }; uint8_t depth_bits_array[4]; uint8_t stencil_bits_array[4]; + uint8_t msaa_samples_array[1]; depth_bits_array[0] = 0; stencil_bits_array[0] = 0; @@ -100,7 +101,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp) configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor); + back_buffer_modes, back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); return NULL; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index cd22b84951..90a4a2c3c0 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -361,6 +361,7 @@ tdfxFillInModes(__DRIscreenPrivate *psp, static const GLenum db_modes[2] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML }; uint8_t depth_bits_array[4]; uint8_t stencil_bits_array[4]; + uint8_t msaa_samples_array[1]; if(deep) { depth_bits_array[0] = 0; depth_bits_array[1] = 24; @@ -383,7 +384,8 @@ tdfxFillInModes(__DRIscreenPrivate *psp, depth_bits_array, stencil_bits_array, deep ? 2 : 4, - db_modes, 2); + db_modes, 2, + msaa_samples_array, 1); } /** diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 988f9935ac..c25b87b4a4 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -342,6 +342,7 @@ viaFillInModes( __DRIscreenPrivate *psp, */ static const uint8_t depth_bits_array[4] = { 0, 16, 24, 32 }; static const uint8_t stencil_bits_array[4] = { 0, 0, 8, 0 }; + uint8_t msaa_samples_array[1]; const unsigned depth_buffer_factor = 3; if ( pixel_bits == 16 ) { @@ -356,7 +357,8 @@ viaFillInModes( __DRIscreenPrivate *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, - back_buffer_factor); + back_buffer_factor, + msaa_samples_array, 1); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index f978334ab2..c649b3db5e 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -418,7 +418,7 @@ struct prog_instruction */ GLint BranchTarget; -#if 0 +#if 01 /* XXX just use this for i965 driver for now! */ /** * For TEX instructions in shaders, the sampler to use for the * texture lookup. -- cgit v1.2.3 From 60b3fe6c19eb881f6193ba46450c0c9f559a10e5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 12:12:09 -0700 Subject: i965: need to disable current shader, if any, in intel_clear_tris() Fixes bad background in all the progs/glsl/ tests. --- src/mesa/drivers/dri/intel/intel_clear.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index f95d055e62..a47c4d4050 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -39,6 +39,7 @@ #include "main/macros.h" #include "main/matrix.h" #include "main/texstate.h" +#include "main/shaders.h" #include "main/stencil.h" #include "main/varray.h" #include "glapi/dispatch.h" @@ -71,6 +72,7 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) struct gl_framebuffer *fb = ctx->DrawBuffer; int i; GLboolean saved_fp_enable = GL_FALSE, saved_vp_enable = GL_FALSE; + GLboolean saved_shader_program = 0; unsigned int saved_active_texture; assert((mask & ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT | @@ -109,6 +111,10 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) saved_vp_enable = GL_TRUE; _mesa_Disable(GL_VERTEX_PROGRAM_ARB); } + if (ctx->Extensions.ARB_shader_objects && ctx->Shader.CurrentProgram) { + saved_shader_program = ctx->Shader.CurrentProgram->Name; + _mesa_UseProgramObjectARB(0); + } if (ctx->Texture._EnabledUnits != 0) { int i; @@ -215,6 +221,9 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) if (saved_vp_enable) _mesa_Enable(GL_VERTEX_PROGRAM_ARB); + if (saved_shader_program) + _mesa_UseProgramObjectARB(saved_shader_program); + _mesa_PopClientAttrib(); _mesa_PopAttrib(); } -- cgit v1.2.3 From d52294439c80c99a4bfa2c7ecc65efa67f095a3f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 08:30:55 -0700 Subject: mesa: replace _mesa_unreference_framebuffer() with _mesa_reference_framebuffer() --- src/mesa/main/context.c | 8 ++++---- src/mesa/main/fbobject.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 608942979f..62c4473356 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1304,10 +1304,10 @@ _mesa_free_context_data( GLcontext *ctx ) } /* unreference WinSysDraw/Read buffers */ - _mesa_unreference_framebuffer(&ctx->WinSysDrawBuffer); - _mesa_unreference_framebuffer(&ctx->WinSysReadBuffer); - _mesa_unreference_framebuffer(&ctx->DrawBuffer); - _mesa_unreference_framebuffer(&ctx->ReadBuffer); + _mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL); + _mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL); + _mesa_reference_framebuffer(&ctx->DrawBuffer, NULL); + _mesa_reference_framebuffer(&ctx->ReadBuffer, NULL); _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL); _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index d08ad33902..f5e17c7675 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1268,7 +1268,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) /* But the object will not be freed until it's no longer * bound in any context. */ - _mesa_unreference_framebuffer(&fb); + _mesa_reference_framebuffer(&fb, NULL); } } } -- cgit v1.2.3 From 7eb5a2892d3d89f4b1800311babb40af1ec7d4e5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 08:31:28 -0700 Subject: mesa: replace _mesa_unreference_framebuffer() with _mesa_reference_framebuffer() --- src/mesa/drivers/allegro/amesa.c | 2 +- src/mesa/drivers/fbdev/glfbdev.c | 2 +- src/mesa/drivers/glide/fxapi.c | 4 ++-- src/mesa/drivers/osmesa/osmesa.c | 2 +- src/mesa/drivers/x11/xm_api.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c index a9d8f62f92..0744677d2b 100644 --- a/src/mesa/drivers/allegro/amesa.c +++ b/src/mesa/drivers/allegro/amesa.c @@ -338,7 +338,7 @@ void AMesaDestroyBuffer(AMesaBuffer buffer) { if (buffer->Screen) destroy_bitmap(buffer->Screen); if (buffer->Background) destroy_bitmap(buffer->Background); - _mesa_unreference_framebuffer(&buffer->GLBuffer); + _mesa_reference_framebuffer(&buffer->GLBuffer, NULL); free(buffer); } diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 3c874ba57a..531558dc4d 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -685,7 +685,7 @@ glFBDevDestroyBuffer( GLFBDevBufferPtr buffer ) } { struct gl_framebuffer *fb = &buffer->glframebuffer; - _mesa_unreference_framebuffer(&fb); + _mesa_reference_framebuffer(&fb, NULL); } } } diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index b7708fd636..238f491599 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -728,7 +728,7 @@ errorhandler: FREE(fxMesa->fogTable); } if (fxMesa->glBuffer) { - _mesa_unreference_framebuffer(&fxMesa->glBuffer); + _mesa_reference_framebuffer(&fxMesa->glBuffer, NULL); } if (fxMesa->glVis) { _mesa_destroy_visual(fxMesa->glVis); @@ -828,7 +828,7 @@ fxMesaDestroyContext(fxMesaContext fxMesa) fxDDDestroyFxMesaContext(fxMesa); /* must be before _mesa_destroy_context */ _mesa_destroy_visual(fxMesa->glVis); _mesa_destroy_context(fxMesa->glCtx); - _mesa_unreference_framebuffer(&fxMesa->glBuffer); + _mesa_reference_framebuffer(&fxMesa->glBuffer, NULL); fxTMClose(fxMesa); /* must be after _mesa_destroy_context */ FREE(fxMesa); diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index f2367bbbb7..904659e345 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1310,7 +1310,7 @@ OSMesaDestroyContext( OSMesaContext osmesa ) _swrast_DestroyContext( &osmesa->mesa ); _mesa_destroy_visual( osmesa->gl_visual ); - _mesa_unreference_framebuffer( &osmesa->gl_buffer ); + _mesa_reference_framebuffer( &osmesa->gl_buffer, NULL ); _mesa_free_context_data( &osmesa->mesa ); _mesa_free( osmesa ); diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 00ce3ba723..2a8c3a4fd3 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -492,7 +492,7 @@ xmesa_free_buffer(XMesaBuffer buffer) b->frontxrb->drawable = 0; /* Unreference. If count = zero we'll really delete the buffer */ - _mesa_unreference_framebuffer(&fb); + _mesa_reference_framebuffer(&fb, NULL); return; } -- cgit v1.2.3 From 88f3656ea7ae57d22141225db0c5d90ceab420dd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 12:43:09 -0700 Subject: swrast: use ASSIGN_4V() macro --- src/mesa/swrast/s_fragprog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index bbb784c46e..c6601f5593 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -84,8 +84,7 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, swizzle_texel(rgba, color, texObj->_Swizzle); } else { - color[0] = color[1] = color[2] = 0.0F; - color[3] = 1.0F; + ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F); } } @@ -127,8 +126,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], swizzle_texel(rgba, color, texObj->_Swizzle); } else { - color[0] = color[1] = color[2] = 0.0F; - color[3] = 1.0F; + ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F); } } -- cgit v1.2.3 From 37c768b36aad22ecad48c7caab272354383e26a7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 13:50:36 -0700 Subject: mesa: add no-change testing for a few more texture parameters --- src/mesa/main/texparam.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 8df22fe9e2..db512b21aa 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -262,8 +262,10 @@ set_tex_parameteri(GLcontext *ctx, case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; + if (texObj->GenerateMipmap != params[0]) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; + } } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -275,8 +277,10 @@ set_tex_parameteri(GLcontext *ctx, if (ctx->Extensions.ARB_shadow && (params[0] == GL_NONE || params[0] == GL_COMPARE_R_TO_TEXTURE_ARB)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareMode = params[0]; + if (texObj->CompareMode != params[0]) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareMode = params[0]; + } } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -286,6 +290,8 @@ set_tex_parameteri(GLcontext *ctx, case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { + if (texObj->CompareFunc == params[0]) + return; switch (params[0]) { case GL_LEQUAL: case GL_GEQUAL: @@ -319,8 +325,10 @@ set_tex_parameteri(GLcontext *ctx, (params[0] == GL_LUMINANCE || params[0] == GL_INTENSITY || params[0] == GL_ALPHA)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->DepthMode = params[0]; + if (texObj->DepthMode != params[0]) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->DepthMode = params[0]; + } } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -415,6 +423,8 @@ set_tex_parameterf(GLcontext *ctx, case GL_TEXTURE_MAX_ANISOTROPY_EXT: if (ctx->Extensions.EXT_texture_filter_anisotropic) { + if (texObj->MaxAnisotropy == params[0]) + return; if (params[0] < 1.0) { _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); return; @@ -432,8 +442,10 @@ set_tex_parameterf(GLcontext *ctx, case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: if (ctx->Extensions.ARB_shadow_ambient) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); + if (texObj->CompareFailValue != params[0]) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); + } } else { _mesa_error(ctx, GL_INVALID_ENUM, -- cgit v1.2.3 From aad3f546a046fe40b771e5d5f965b29189821d51 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 13:58:32 -0700 Subject: mesa: avoid setting texObj->_Complete = GL_FALSE when there's no state change Avoid a little bit of unneeded state validation and fixes a bug where the texture complete flags was set to false, but we didn't signal _NEW_TEXTURE. Fixes piglit tex1d-2dborder failure. --- src/mesa/main/texparam.c | 68 ++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index db512b21aa..865aae8627 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -3,7 +3,7 @@ * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 1999-2009 VMware, Inc. 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"), @@ -165,6 +165,20 @@ set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz) } +/** + * This is called just prior to changing any texture object state. + * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE + * state flag and then mark the texture object as 'incomplete' so that any + * per-texture derived state gets recomputed. + */ +static INLINE void +flush(GLcontext *ctx, struct gl_texture_object *texObj) +{ + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->_Complete = GL_FALSE; +} + + /** Set an integer-valued texture parameter */ static void set_tex_parameteri(GLcontext *ctx, @@ -178,7 +192,7 @@ set_tex_parameteri(GLcontext *ctx, switch (params[0]) { case GL_NEAREST: case GL_LINEAR: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->MinFilter = params[0]; return; case GL_NEAREST_MIPMAP_NEAREST: @@ -186,7 +200,7 @@ set_tex_parameteri(GLcontext *ctx, case GL_NEAREST_MIPMAP_LINEAR: case GL_LINEAR_MIPMAP_LINEAR: if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->MinFilter = params[0]; return; } @@ -202,7 +216,7 @@ set_tex_parameteri(GLcontext *ctx, switch (params[0]) { case GL_NEAREST: case GL_LINEAR: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->MagFilter = params[0]; return; default: @@ -214,7 +228,7 @@ set_tex_parameteri(GLcontext *ctx, if (texObj->WrapS == params[0]) return; if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->WrapS = params[0]; } return; @@ -223,7 +237,7 @@ set_tex_parameteri(GLcontext *ctx, if (texObj->WrapT == params[0]) return; if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->WrapT = params[0]; } return; @@ -232,7 +246,7 @@ set_tex_parameteri(GLcontext *ctx, if (texObj->WrapR == params[0]) return; if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->WrapR = params[0]; } return; @@ -245,7 +259,7 @@ set_tex_parameteri(GLcontext *ctx, _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); return; } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->BaseLevel = params[0]; return; @@ -256,14 +270,14 @@ set_tex_parameteri(GLcontext *ctx, _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); return; } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->MaxLevel = params[0]; return; case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { if (texObj->GenerateMipmap != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; } } @@ -278,7 +292,7 @@ set_tex_parameteri(GLcontext *ctx, (params[0] == GL_NONE || params[0] == GL_COMPARE_R_TO_TEXTURE_ARB)) { if (texObj->CompareMode != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->CompareMode = params[0]; } } @@ -295,7 +309,7 @@ set_tex_parameteri(GLcontext *ctx, switch (params[0]) { case GL_LEQUAL: case GL_GEQUAL: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->CompareFunc = params[0]; return; case GL_EQUAL: @@ -305,7 +319,7 @@ set_tex_parameteri(GLcontext *ctx, case GL_ALWAYS: case GL_NEVER: if (ctx->Extensions.EXT_shadow_funcs) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->CompareFunc = params[0]; return; } @@ -326,7 +340,7 @@ set_tex_parameteri(GLcontext *ctx, params[0] == GL_INTENSITY || params[0] == GL_ALPHA)) { if (texObj->DepthMode != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->DepthMode = params[0]; } } @@ -359,7 +373,7 @@ set_tex_parameteri(GLcontext *ctx, } ASSERT(comp < 4); if (swz >= 0) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->Swizzle[comp] = params[0]; set_swizzle_component(&texObj->_Swizzle, comp, swz); return; @@ -371,7 +385,7 @@ set_tex_parameteri(GLcontext *ctx, case GL_TEXTURE_SWIZZLE_RGBA_EXT: if (ctx->Extensions.EXT_texture_swizzle) { GLuint comp; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); for (comp = 0; comp < 4; comp++) { const GLint swz = comp_to_swizzle(params[comp]); if (swz >= 0) { @@ -405,19 +419,19 @@ set_tex_parameterf(GLcontext *ctx, case GL_TEXTURE_MIN_LOD: if (texObj->MinLod == params[0]) return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->MinLod = params[0]; return; case GL_TEXTURE_MAX_LOD: if (texObj->MaxLod == params[0]) return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->MaxLod = params[0]; return; case GL_TEXTURE_PRIORITY: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); return; @@ -429,7 +443,7 @@ set_tex_parameterf(GLcontext *ctx, _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); return; } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); /* clamp to max, that's what NVIDIA does */ texObj->MaxAnisotropy = MIN2(params[0], ctx->Const.MaxTextureMaxAnisotropy); @@ -443,7 +457,7 @@ set_tex_parameterf(GLcontext *ctx, case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: if (ctx->Extensions.ARB_shadow_ambient) { if (texObj->CompareFailValue != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); } } @@ -457,14 +471,14 @@ set_tex_parameterf(GLcontext *ctx, /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */ if (ctx->Extensions.EXT_texture_lod_bias) { if (texObj->LodBias != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->LodBias = params[0]; } } break; case GL_TEXTURE_BORDER_COLOR: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); + flush(ctx, texObj); texObj->BorderColor[RCOMP] = params[0]; texObj->BorderColor[GCOMP] = params[1]; texObj->BorderColor[BCOMP] = params[2]; @@ -515,8 +529,6 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) set_tex_parameterf(ctx, texObj, pname, ¶m); } - texObj->_Complete = GL_FALSE; - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m); } @@ -572,8 +584,6 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) set_tex_parameterf(ctx, texObj, pname, params); } - texObj->_Complete = GL_FALSE; - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { ctx->Driver.TexParameter(ctx, target, texObj, pname, params); } @@ -609,8 +619,6 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) set_tex_parameteri(ctx, texObj, pname, ¶m); } - texObj->_Complete = GL_FALSE; - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { GLfloat fparam = (GLfloat) param; ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam); @@ -658,8 +666,6 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) set_tex_parameteri(ctx, texObj, pname, params); } - texObj->_Complete = GL_FALSE; - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { GLfloat fparams[4]; fparams[0] = INT_TO_FLOAT(params[0]); -- cgit v1.2.3 From cb3c54ea86344242545dd29f936e53853d3a5ea4 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 9 Feb 2009 17:57:22 +0100 Subject: fix _mesa_get_teximage for srgb textures --- src/mesa/main/texstore.c | 63 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 2b06796aba..6360ca15f8 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3699,14 +3699,37 @@ is_srgb_teximage(const struct gl_texture_image *texImage) 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; } } -#endif /* FEATURE_EXT_texture_sRGB */ +/** + * Convert a float value from linear space to a + * non-linear sRGB value in [0, 255]. + * Not terribly efficient. + */ +static INLINE GLfloat +linear_to_nonlinear(GLfloat cl) +{ + /* can't have values outside [0, 1] */ + GLfloat cs; + if (cl < 0.0031308) { + cs = 12.92 * cl; + } + else { + cs = 1.055 * _mesa_pow(cl, 0.41666) - 0.055; + } + return cs; +} + +#endif /* FEATURE_EXT_texture_sRGB */ /** * This is the software fallback for Driver.GetTexImage(). @@ -3823,16 +3846,34 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, } #if FEATURE_EXT_texture_sRGB else if (is_srgb_teximage(texImage)) { - /* no pixel transfer and no non-linear to linear conversion */ - const GLint comps = texImage->TexFormat->TexelBytes; - const GLint rowstride = comps * texImage->RowStride; - MEMCPY(dest, - (const GLubyte *) texImage->Data + row * rowstride, - comps * width * sizeof(GLubyte)); - /* FIXME: isn't it necessary to still do component assigning - according to format/type? */ - /* FIXME: need to do something else for compressed srgb textures - (currently will return values converted to linear) */ + /* 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->TexFormat->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->TexFormat->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->TexFormat->BaseFormat == GL_RGB || + texImage->TexFormat->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 /*image xfer ops*/); } #endif /* FEATURE_EXT_texture_sRGB */ else { -- cgit v1.2.3 From 93da69def4ec6b3a8088cf603f6800d73e0a9793 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 9 Feb 2009 23:10:16 +0100 Subject: mesa: fixes for srgb formats swizzling in fetch/store srgba/sargb functions fixed (consistent with equivalent non-srgb formats now). --- src/mesa/main/texformat_tmp.h | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 08b6d8f12f..275340cabd 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1223,11 +1223,11 @@ static void store_texel_srgb8(struct gl_texture_image *texImage, static void FETCH(srgba8)(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - texel[RCOMP] = nonlinear_to_linear(src[0]); - texel[GCOMP] = nonlinear_to_linear(src[1]); - texel[BCOMP] = nonlinear_to_linear(src[2]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[3]); /* linear! */ + 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 @@ -1235,11 +1235,8 @@ 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; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; - dst[3] = rgba[ACOMP]; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); } #endif @@ -1247,11 +1244,11 @@ static void store_texel_srgba8(struct gl_texture_image *texImage, static void FETCH(sargb8)(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - texel[RCOMP] = nonlinear_to_linear(src[1]); - texel[GCOMP] = nonlinear_to_linear(src[2]); - texel[BCOMP] = nonlinear_to_linear(src[3]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[0]); /* linear! */ + 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 @@ -1259,11 +1256,8 @@ 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; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - dst[0] = rgba[ACOMP]; - dst[1] = rgba[RCOMP]; - dst[2] = rgba[GCOMP]; - dst[3] = rgba[BCOMP]; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); } #endif -- cgit v1.2.3 From 7e0bc2eb8df6f83a67410cd422b709981f88cd87 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 15:41:06 -0700 Subject: mesa: add x86/rtasm/x86sse.c to fix linux-x86 build --- src/mesa/sources.mak | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 13ec1fa454..dfafbc982b 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -259,6 +259,7 @@ ASM_C_SOURCES = \ x86/x86.c \ x86/3dnow.c \ x86/sse.c \ + x86/rtasm/x86sse.c \ sparc/sparc.c \ ppc/common_ppc.c \ x86-64/x86-64.c -- cgit v1.2.3 From 42523a83b332c9a0b128ba5ceca7c5fcd5a1d6c6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 9 Feb 2009 21:08:49 +0000 Subject: wgl: s/0x%p/%p/g Rather not have 0x prefix, than 0x0x in certain platforms. --- src/gallium/state_trackers/wgl/icd/stw_icd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/icd/stw_icd.c b/src/gallium/state_trackers/wgl/icd/stw_icd.c index 70e346a539..5c78c19f92 100644 --- a/src/gallium/state_trackers/wgl/icd/stw_icd.c +++ b/src/gallium/state_trackers/wgl/icd/stw_icd.c @@ -183,7 +183,7 @@ DrvDescribePixelFormat( r = stw_pixelformat_describe( hdc, iPixelFormat, cjpfd, ppfd ); - debug_printf( "%s( 0x%p, %d, %u, 0x%p ) = %d\n", + debug_printf( "%s( %p, %d, %u, %p ) = %d\n", __FUNCTION__, hdc, iPixelFormat, cjpfd, ppfd, r ); return r; @@ -210,7 +210,7 @@ DrvGetProcAddress( r = stw_get_proc_address( lpszProc ); - debug_printf( "%s( \", __FUNCTION__%s\" ) = 0x%p\n", lpszProc, r ); + debug_printf( "%s( \", __FUNCTION__%s\" ) = %p\n", lpszProc, r ); return r; } @@ -254,7 +254,7 @@ DrvSetCallbackProcs( INT nProcs, PROC *pProcs ) { - debug_printf( "%s( %d, 0x%p )\n", __FUNCTION__, nProcs, pProcs ); + debug_printf( "%s( %d, %p )\n", __FUNCTION__, nProcs, pProcs ); return; } @@ -272,7 +272,7 @@ DrvSetContext( struct stw_context *ctx; GLDISPATCHTABLE *disp = &cpt.glDispatchTable; - debug_printf( "%s( 0x%p, %u, 0x%p )\n", __FUNCTION__, hdc, dhglrc, pfnSetProcTable ); + debug_printf( "%s( %p, %u, %p )\n", __FUNCTION__, hdc, dhglrc, pfnSetProcTable ); ctx = lookup_context( dhglrc ); if (ctx == NULL) @@ -646,7 +646,7 @@ DrvSetPixelFormat( r = stw_pixelformat_set( hdc, iPixelFormat ); - debug_printf( "%s( 0x%p, %d ) = %s\n", __FUNCTION__, hdc, iPixelFormat, r ? "TRUE" : "FALSE" ); + debug_printf( "%s( %p, %d ) = %s\n", __FUNCTION__, hdc, iPixelFormat, r ? "TRUE" : "FALSE" ); return r; } @@ -665,7 +665,7 @@ BOOL APIENTRY DrvSwapBuffers( HDC hdc ) { - debug_printf( "%s( 0x%p )\n", __FUNCTION__, hdc ); + debug_printf( "%s( %p )\n", __FUNCTION__, hdc ); return stw_swap_buffers( hdc ); } @@ -686,5 +686,7 @@ DrvValidateVersion( { debug_printf( "%s( %u )\n", __FUNCTION__, ulVersion ); + /* TODO: get the expected version from the winsys */ + return ulVersion == 1; } -- cgit v1.2.3 From aeed92952efaac0b3519aeb141de18e17f0f454c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 11:35:26 +0000 Subject: glut: DESCRIPTION .def clause deprecated. --- src/glut/glx/glut.def | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/glut/glx/glut.def b/src/glut/glx/glut.def index d5e0e0cf2a..90010815e4 100644 --- a/src/glut/glx/glut.def +++ b/src/glut/glx/glut.def @@ -1,9 +1,4 @@ -DESCRIPTION 'OpenGL Utility Toolkit for Win32' - -VERSION 3.7 - EXPORTS - glutAddMenuEntry glutAddSubMenu glutAttachMenu @@ -128,4 +123,3 @@ EXPORTS glutBitmapTimesRoman24 ; __glutSetFCB ; __glutGetFCB - -- cgit v1.2.3 From 5b0807b72f16a4835e4b28aa8a66e9bcd867d383 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 11:36:48 +0000 Subject: glut: Use the official WGL functions. Especially using wglGetPixelFormat instead of GetPixelFormat causes problems with opengl32.dll and drivers that not hack around this issue. --- src/glut/glx/SConscript | 1 - src/glut/glx/glutint.h | 38 ++++++++------------------------------ src/glut/glx/win32_glx.c | 2 +- 3 files changed, 9 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript index cb442ba027..938fec03df 100644 --- a/src/glut/glx/SConscript +++ b/src/glut/glx/SConscript @@ -10,7 +10,6 @@ target = 'glut32' env.Replace(CPPDEFINES = [ 'BUILD_GLUT32', 'GLUT_BUILDING_LIB', - 'MESA', 'NDEBUG', 'GLUT_NO_WARNING_DISABLE', ]) diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h index fe4e038add..ba30af60f0 100644 --- a/src/glut/glx/glutint.h +++ b/src/glut/glx/glutint.h @@ -32,10 +32,6 @@ #include -#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__) -#include -#endif - #ifndef _WIN32 /* added by BrianP: */ #ifndef APIENTRY @@ -48,24 +44,6 @@ /* GLUT_BUILDING_LIB is used by to 1) not #pragma link with the GLUT library, and 2) avoid the Win32 atexit hack. */ -/* This must be done after is included. MESA is defined - if the is supplied by Brian Paul's Mesa library. */ -#if defined(MESA) && defined(_WIN32) -/* Mesa implements "wgl" versions of GDI entry points needed for - using OpenGL. Map these "wgl" versions to the GDI names via - macros. */ -#define ChoosePixelFormat wglChoosePixelFormat -#define DescribePixelFormat wglDescribePixelFormat -#define GetPixelFormat wglGetPixelFormat -#define SetPixelFormat wglSetPixelFormat -#define SwapBuffers wglSwapBuffers -#define GetCurrentContext wglGetCurrentContext -#define GetCurrentDC wglGetCurrentDC -#define MakeCurrent wglMakeCurrent -#define CreateContext wglCreateContext -#define DeleteContext wglDeleteContext -#endif /* MESA */ - #ifdef SUPPORT_FORTRAN #include #endif @@ -572,27 +550,27 @@ typedef struct { #ifdef _WIN32 #define MAKE_CURRENT_LAYER(window) \ { \ - HGLRC currentContext = GetCurrentContext(); \ - HDC currentDc = GetCurrentDC(); \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ \ if (currentContext != window->renderCtx \ || currentDc != window->renderDc) { \ - MakeCurrent(window->renderDc, window->renderCtx); \ + wglMakeCurrent(window->renderDc, window->renderCtx); \ } \ } #define MAKE_CURRENT_WINDOW(window) \ { \ - HGLRC currentContext = GetCurrentContext(); \ - HDC currentDc = GetCurrentDC(); \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ \ if (currentContext != window->ctx || currentDc != window->hdc) { \ - MakeCurrent(window->hdc, window->ctx); \ + wglMakeCurrent(window->hdc, window->ctx); \ } \ } #define MAKE_CURRENT_OVERLAY(overlay) \ - MakeCurrent(overlay->hdc, overlay->ctx) + wglMakeCurrent(overlay->hdc, overlay->ctx) #define UNMAKE_CURRENT() \ - MakeCurrent(NULL, NULL) + wglMakeCurrent(NULL, NULL) #define SWAP_BUFFERS_WINDOW(window) \ SwapBuffers(window->hdc) #define SWAP_BUFFERS_LAYER(window) \ diff --git a/src/glut/glx/win32_glx.c b/src/glut/glx/win32_glx.c index ecfff44b93..3522e606ec 100644 --- a/src/glut/glx/win32_glx.c +++ b/src/glut/glx/win32_glx.c @@ -22,7 +22,7 @@ glXCreateContext(Display * display, XVisualInfo * visinfo, routine. */ HGLRC context; - context = CreateContext(XHDC); + context = wglCreateContext(XHDC); #if 0 /* XXX GLUT doesn't support it now, so don't worry about display list -- cgit v1.2.3 From 9fb9ee9d241c99a76e15af2db328332dfecf586d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 11:37:23 +0000 Subject: stw: Hack for applications which use wglSetPixelFormat instead of SetPixelFormat. --- src/gallium/state_trackers/wgl/shared/stw_pixelformat.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c index 12b5ac6d91..84b7b287b9 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c +++ b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c @@ -256,6 +256,14 @@ stw_pixelformat_set( return FALSE; currentpixelformat = iPixelFormat; + + /* Some applications mistakenly use the undocumented wglSetPixelFormat + * function instead of SetPixelFormat, so we call SetPixelFormat here to + * avoid opengl32.dll's wglCreateContext to fail */ + if (GetPixelFormat(hdc) == 0) { + SetPixelFormat(hdc, iPixelFormat, NULL); + } + return TRUE; } -- cgit v1.2.3 From 67e988a06c8ff5896da9df7ce1c7fc118352c8a3 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 11:50:54 +0000 Subject: wgl: Fix null pointer reference. --- src/gallium/state_trackers/wgl/icd/stw_icd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/icd/stw_icd.c b/src/gallium/state_trackers/wgl/icd/stw_icd.c index 5c78c19f92..8fa9f4e667 100644 --- a/src/gallium/state_trackers/wgl/icd/stw_icd.c +++ b/src/gallium/state_trackers/wgl/icd/stw_icd.c @@ -89,6 +89,9 @@ lookup_context( DHGLRC dhglrc ) dhglrc >= DRV_CONTEXT_MAX) return NULL; + if(!stw_icd) + return NULL; + return stw_icd->ctx_array[dhglrc - 1].ctx; } -- cgit v1.2.3 From eaf15db895e3a5c6c5ccc2f23a4f0fa522855868 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 10 Feb 2009 13:47:49 +0100 Subject: gallium: Fixups for driCreateConfigs MSAA support. Add the MSAA samples array or make sure its contents are initialized. --- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 2 ++ src/mesa/drivers/dri/i810/i810screen.c | 2 ++ src/mesa/drivers/dri/intel/intel_screen.c | 4 ++++ src/mesa/drivers/dri/mach64/mach64_screen.c | 2 ++ src/mesa/drivers/dri/mga/mga_xmesa.c | 2 ++ src/mesa/drivers/dri/r128/r128_screen.c | 2 ++ src/mesa/drivers/dri/radeon/radeon_screen.c | 4 +++- src/mesa/drivers/dri/savage/savage_xmesa.c | 2 ++ src/mesa/drivers/dri/sis/sis_screen.c | 2 ++ src/mesa/drivers/dri/swrast/swrast.c | 5 ++++- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 2 ++ src/mesa/drivers/dri/unichrome/via_screen.c | 2 +- 12 files changed, 28 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index eb086e3055..00bdcec7a6 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -642,6 +642,8 @@ ffbFillInModes( __DRIscreenPrivate *psp, stencil_bits_array[1] = 0; stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1; back_buffer_factor = (have_back_buffer) ? 3 : 1; diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 6d7cf1f38b..9a5a39c1db 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -89,6 +89,8 @@ i810FillInModes( __DRIscreenPrivate *psp, stencil_bits_array[0] = 0; stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index f29e0e966b..4c06170cdf 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -495,6 +495,8 @@ intelFillInModes(__DRIscreenPrivate *psp, stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1; back_buffer_factor = (have_back_buffer) ? 3 : 1; @@ -733,6 +735,8 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) depth_bits[3] = 24; stencil_bits[3] = 8; + msaa_samples_array[0] = 0; + fb_format[0] = GL_RGB; fb_type[0] = GL_UNSIGNED_SHORT_5_6_5; diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 59a3573898..43e59594dd 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -105,6 +105,8 @@ mach64FillInModes( __DRIscreenPrivate *psp, stencil_bits_array[0] = 0; stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 98185a6c9e..926534d6df 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -144,6 +144,8 @@ mgaFillInModes( __DRIscreenPrivate *psp, stencil_bits_array[1] = 0; stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index e72ca45be9..7cda4ca5d3 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -434,6 +434,8 @@ r128FillInModes( __DRIscreenPrivate *psp, stencil_bits_array[0] = 0; stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index b52a084777..56c22faafa 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -288,6 +288,8 @@ radeonFillInModes( __DRIscreenPrivate *psp, stencil_bits_array[0] = 0; stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; @@ -304,7 +306,7 @@ radeonFillInModes( __DRIscreenPrivate *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index ba4008e644..326d595352 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -922,6 +922,8 @@ savageFillInModes( __DRIscreenPrivate *psp, stencil_bits_array[0] = 0; stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index e31b5223f7..9eb27fef08 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -88,6 +88,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp) depth_bits_array[3] = 32; stencil_bits_array[3] = 0; + msaa_samples_array[0] = 0; + depth_buffer_factor = 4; back_buffer_factor = 2; diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index a90b30b49d..b00f4ff2fe 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -147,6 +147,7 @@ swrastFillInModes(__DRIscreen *psp, uint8_t depth_bits_array[4]; uint8_t stencil_bits_array[4]; + uint8_t msaa_samples_array[1]; depth_bits_array[0] = 0; depth_bits_array[1] = 0; @@ -161,6 +162,8 @@ swrastFillInModes(__DRIscreen *psp, stencil_bits_array[2] = 0; stencil_bits_array[3] = (stencil_bits == 0) ? 8 : stencil_bits; + msaa_samples_array[0] = 0; + depth_buffer_factor = 4; back_buffer_factor = 2; @@ -190,7 +193,7 @@ swrastFillInModes(__DRIscreen *psp, configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, - back_buffer_factor); + back_buffer_factor, msaa_samples_array, 1); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 90a4a2c3c0..6d509a4d88 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -378,6 +378,8 @@ tdfxFillInModes(__DRIscreenPrivate *psp, stencil_bits_array[3] = 8; } + msaa_samples_array[0] = 0; + return driCreateConfigs( deep ? GL_RGBA : GL_RGB, deep ? GL_UNSIGNED_INT_8_8_8_8 : GL_UNSIGNED_SHORT_5_6_5, diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index c25b87b4a4..e9f566161c 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -342,7 +342,7 @@ viaFillInModes( __DRIscreenPrivate *psp, */ static const uint8_t depth_bits_array[4] = { 0, 16, 24, 32 }; static const uint8_t stencil_bits_array[4] = { 0, 0, 8, 0 }; - uint8_t msaa_samples_array[1]; + uint8_t msaa_samples_array[1] = { 0 }; const unsigned depth_buffer_factor = 3; if ( pixel_bits == 16 ) { -- cgit v1.2.3 From dc6cc4f9da25725d0b8f6efe571a5430fb399de5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 13:40:00 +0000 Subject: mesa: Compare formats using nominal bytes per pixel. This is a temporary fix which works for the formats we care so far. The real fix would be abandon the concept "nominal bytes per pixel" entirely in Mesa, and use macropixels instead, as done in gallium interfaces already. --- src/mesa/state_tracker/st_cb_texture.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index d08229b57a..9279a768c8 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1417,9 +1417,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 || - stObj->pt->block.size != cpp || - stObj->pt->block.width != 1 || - stObj->pt->block.height != 1 || + stObj->pt->block.size/stObj->pt->block.width != cpp || /* Nominal bytes per pixel */ stObj->pt->compressed != firstImage->base.IsCompressed) { pipe_texture_release(&stObj->pt); ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER; -- cgit v1.2.3 From a88e2544eeb0a93b23ab2383905fef44c056040c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 10 Feb 2009 14:03:43 +0000 Subject: vmw/icd: remove bogus current_context value --- src/gallium/state_trackers/wgl/icd/stw_icd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/icd/stw_icd.c b/src/gallium/state_trackers/wgl/icd/stw_icd.c index 70e346a539..e160004aea 100644 --- a/src/gallium/state_trackers/wgl/icd/stw_icd.c +++ b/src/gallium/state_trackers/wgl/icd/stw_icd.c @@ -44,8 +44,6 @@ struct stw_icd struct { struct stw_context *ctx; } ctx_array[DRV_CONTEXT_MAX]; - - DHGLRC ctx_current; }; @@ -232,9 +230,10 @@ DrvReleaseContext( { struct stw_context *ctx; - if (dhglrc != stw_icd->ctx_current) - goto fail; - + /* XXX: The expectation is that ctx is the same context which is + * current for this thread. We should check that and return False + * if not the case. + */ ctx = lookup_context( dhglrc ); if (ctx == NULL) goto fail; @@ -242,7 +241,6 @@ DrvReleaseContext( if (stw_make_current( NULL, NULL ) == FALSE) goto fail; - stw_icd->ctx_current = 0; return TRUE; fail: -- cgit v1.2.3 From bf3930453cb85977510863e5cfba8487e09c093e Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:12:34 +0100 Subject: gallium: Rename Size member of TGSI token to NrTokens. Driver writers often got confused and assumed Size to be the number of immediate values in Immediate declaration. --- src/gallium/include/pipe/p_shader_tokens.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index ad43d799f3..35df70e7b7 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -64,7 +64,7 @@ struct tgsi_processor struct tgsi_token { unsigned Type : 4; /**< TGSI_TOKEN_TYPE_x */ - unsigned Size : 8; /**< UINT */ + unsigned NrTokens : 8; /**< UINT */ unsigned Padding : 19; unsigned Extended : 1; /**< BOOL */ }; @@ -107,7 +107,7 @@ enum tgsi_file_type { struct tgsi_declaration { unsigned Type : 4; /**< TGSI_TOKEN_TYPE_DECLARATION */ - unsigned Size : 8; /**< UINT */ + unsigned NrTokens : 8; /**< UINT */ unsigned File : 4; /**< one of TGSI_FILE_x */ unsigned UsageMask : 4; /**< bitmask of TGSI_WRITEMASK_x flags */ unsigned Interpolate : 4; /**< one of TGSI_INTERPOLATE_x */ @@ -145,7 +145,7 @@ struct tgsi_declaration_semantic struct tgsi_immediate { unsigned Type : 4; /**< TGSI_TOKEN_TYPE_IMMEDIATE */ - unsigned Size : 8; /**< UINT */ + unsigned NrTokens : 8; /**< UINT */ unsigned DataType : 4; /**< one of TGSI_IMM_x */ unsigned Padding : 15; unsigned Extended : 1; /**< BOOL */ @@ -442,7 +442,7 @@ struct tgsi_immediate_float32 struct tgsi_instruction { unsigned Type : 4; /* TGSI_TOKEN_TYPE_INSTRUCTION */ - unsigned Size : 8; /* UINT */ + unsigned NrTokens : 8; /* UINT */ unsigned Opcode : 8; /* TGSI_OPCODE_ */ unsigned Saturate : 2; /* TGSI_SAT_ */ unsigned NumDstRegs : 2; /* UINT */ @@ -458,7 +458,7 @@ struct tgsi_instruction * * Then, tgsi_instruction::NumSrcRegs of tgsi_src_register follow. * - * tgsi_instruction::Size contains the total number of words that make the + * tgsi_instruction::NrTokens contains the total number of words that make the * instruction, including the instruction word. */ -- cgit v1.2.3 From 5ecd0b0890fd48656e46c017830a9f5d6b906aae Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:14:31 +0100 Subject: tgsi: Fix build -- rename Size to NrTokens. --- src/gallium/auxiliary/tgsi/tgsi_build.c | 20 ++++++++++---------- src/gallium/auxiliary/tgsi/tgsi_dump.c | 4 ++-- src/gallium/auxiliary/tgsi/tgsi_dump_c.c | 4 ++-- src/gallium/auxiliary/tgsi/tgsi_exec.c | 2 +- src/gallium/auxiliary/tgsi/tgsi_parse.c | 4 ++-- src/gallium/auxiliary/tgsi/tgsi_ppc.c | 2 +- src/gallium/auxiliary/tgsi/tgsi_sse2.c | 2 +- src/gallium/auxiliary/tgsi/tgsi_text.c | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index fd02c2c87c..17886540cf 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -114,7 +114,7 @@ tgsi_default_declaration( void ) struct tgsi_declaration declaration; declaration.Type = TGSI_TOKEN_TYPE_DECLARATION; - declaration.Size = 1; + declaration.NrTokens = 1; declaration.File = TGSI_FILE_NULL; declaration.UsageMask = TGSI_WRITEMASK_XYZW; declaration.Interpolate = TGSI_INTERPOLATE_CONSTANT; @@ -160,9 +160,9 @@ declaration_grow( struct tgsi_declaration *declaration, struct tgsi_header *header ) { - assert( declaration->Size < 0xFF ); + assert( declaration->NrTokens < 0xFF ); - declaration->Size++; + declaration->NrTokens++; header_bodysize_grow( header ); } @@ -308,7 +308,7 @@ tgsi_default_immediate( void ) struct tgsi_immediate immediate; immediate.Type = TGSI_TOKEN_TYPE_IMMEDIATE; - immediate.Size = 1; + immediate.NrTokens = 1; immediate.DataType = TGSI_IMM_FLOAT32; immediate.Padding = 0; immediate.Extended = 0; @@ -345,9 +345,9 @@ immediate_grow( struct tgsi_immediate *immediate, struct tgsi_header *header ) { - assert( immediate->Size < 0xFF ); + assert( immediate->NrTokens < 0xFF ); - immediate->Size++; + immediate->NrTokens++; header_bodysize_grow( header ); } @@ -384,7 +384,7 @@ tgsi_build_full_immediate( *immediate = tgsi_build_immediate( header ); - for( i = 0; i < full_imm->Immediate.Size - 1; i++ ) { + for( i = 0; i < full_imm->Immediate.NrTokens - 1; i++ ) { struct tgsi_immediate_float32 *if32; if( maxsize <= size ) @@ -411,7 +411,7 @@ tgsi_default_instruction( void ) struct tgsi_instruction instruction; instruction.Type = TGSI_TOKEN_TYPE_INSTRUCTION; - instruction.Size = 1; + instruction.NrTokens = 1; instruction.Opcode = TGSI_OPCODE_MOV; instruction.Saturate = TGSI_SAT_NONE; instruction.NumDstRegs = 1; @@ -453,9 +453,9 @@ instruction_grow( struct tgsi_instruction *instruction, struct tgsi_header *header ) { - assert (instruction->Size < 0xFF); + assert (instruction->NrTokens < 0xFF); - instruction->Size++; + instruction->NrTokens++; header_bodysize_grow( header ); } diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index 2ed8c2bf07..ab2b1f2c58 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -285,7 +285,7 @@ iter_immediate( ENM( imm->Immediate.DataType, immediate_type_names ); TXT( " { " ); - for (i = 0; i < imm->Immediate.Size - 1; i++) { + for (i = 0; i < imm->Immediate.NrTokens - 1; i++) { switch (imm->Immediate.DataType) { case TGSI_IMM_FLOAT32: FLT( imm->u.ImmediateFloat32[i].Float ); @@ -294,7 +294,7 @@ iter_immediate( assert( 0 ); } - if (i < imm->Immediate.Size - 2) + if (i < imm->Immediate.NrTokens - 2) TXT( ", " ); } TXT( " }" ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump_c.c b/src/gallium/auxiliary/tgsi/tgsi_dump_c.c index c575b6c3e1..2ecf1e2f14 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump_c.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump_c.c @@ -283,7 +283,7 @@ dump_immediate_verbose( UIX( imm->Immediate.Padding ); } - for( i = 0; i < imm->Immediate.Size - 1; i++ ) { + for( i = 0; i < imm->Immediate.NrTokens - 1; i++ ) { EOL(); switch( imm->Immediate.DataType ) { case TGSI_IMM_FLOAT32: @@ -675,7 +675,7 @@ tgsi_dump_c( ENM( parse.FullToken.Token.Type, TGSI_TOKEN_TYPES ); if( ignored ) { TXT( "\nSize : " ); - UID( parse.FullToken.Token.Size ); + UID( parse.FullToken.Token.NrTokens ); if( deflt || parse.FullToken.Token.Extended ) { TXT( "\nExtended : " ); UID( parse.FullToken.Token.Extended ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index a182e679da..ab641efb60 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -202,7 +202,7 @@ tgsi_exec_machine_bind_shader( case TGSI_TOKEN_TYPE_IMMEDIATE: { - uint size = parse.FullToken.FullImmediate.Immediate.Size - 1; + uint size = parse.FullToken.FullImmediate.Immediate.NrTokens - 1; assert( size % 4 == 0 ); assert( mach->ImmLimit + size / 4 <= TGSI_EXEC_NUM_IMMEDIATES ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c index 2cd56e413a..d374b16f9a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_parse.c +++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c @@ -155,8 +155,8 @@ tgsi_parse_token( switch (imm->Immediate.DataType) { case TGSI_IMM_FLOAT32: imm->u.Pointer = MALLOC( - sizeof( struct tgsi_immediate_float32 ) * (imm->Immediate.Size - 1) ); - for( i = 0; i < imm->Immediate.Size - 1; i++ ) { + sizeof( struct tgsi_immediate_float32 ) * (imm->Immediate.NrTokens - 1) ); + for( i = 0; i < imm->Immediate.NrTokens - 1; i++ ) { next_token( ctx, (struct tgsi_immediate_float32 *) &imm->u.ImmediateFloat32[i] ); } break; diff --git a/src/gallium/auxiliary/tgsi/tgsi_ppc.c b/src/gallium/auxiliary/tgsi/tgsi_ppc.c index 1a4db47501..f365030e52 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ppc.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ppc.c @@ -1327,7 +1327,7 @@ tgsi_emit_ppc(const struct tgsi_token *tokens, case TGSI_TOKEN_TYPE_IMMEDIATE: /* splat each immediate component into a float[4] vector for SoA */ { - const uint size = parse.FullToken.FullImmediate.Immediate.Size - 1; + const uint size = parse.FullToken.FullImmediate.Immediate.NrTokens - 1; uint i; assert(size <= 4); assert(num_immediates < TGSI_EXEC_NUM_IMMEDIATES); diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c index cac44af7f4..481ba89c5e 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c @@ -2671,7 +2671,7 @@ tgsi_emit_sse2( case TGSI_TOKEN_TYPE_IMMEDIATE: /* simply copy the immediate values into the next immediates[] slot */ { - const uint size = parse.FullToken.FullImmediate.Immediate.Size - 1; + const uint size = parse.FullToken.FullImmediate.Immediate.NrTokens - 1; uint i; assert(size <= 4); assert(num_immediates < TGSI_EXEC_NUM_IMMEDIATES); diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 9454563361..1e822fbbea 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -1023,7 +1023,7 @@ static boolean parse_immediate( struct translate_ctx *ctx ) ctx->cur++; imm = tgsi_default_full_immediate(); - imm.Immediate.Size += 4; + imm.Immediate.NrTokens += 4; imm.Immediate.DataType = TGSI_IMM_FLOAT32; imm.u.Pointer = values; -- cgit v1.2.3 From e3028baff2a313baac4a5aea494532605bb8f37a Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:16:00 +0100 Subject: draw: Fix build -- rename Size to NrTokens. --- src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 2 +- src/gallium/auxiliary/draw/draw_vs_aos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index b764d9c518..a0f9716dac 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -256,7 +256,7 @@ pstip_transform_inst(struct tgsi_transform_context *ctx, struct tgsi_full_immediate immed; uint size = 4; immed = tgsi_default_full_immediate(); - immed.Immediate.Size = 1 + size; /* one for the token itself */ + immed.Immediate.NrTokens = 1 + size; /* one for the token itself */ immed.u.Pointer = (void *) value; ctx->emit_immediate(ctx, &immed); } diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.c b/src/gallium/auxiliary/draw/draw_vs_aos.c index 6817f29c2a..0c693a4a65 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos.c @@ -1870,7 +1870,7 @@ static boolean note_immediate( struct aos_compilation *cp, unsigned pos = cp->num_immediates++; unsigned j; - for (j = 0; j < imm->Immediate.Size; j++) { + for (j = 0; j < imm->Immediate.NrTokens - 1; j++) { cp->vaos->machine->immediate[pos][j] = imm->u.ImmediateFloat32[j].Float; } -- cgit v1.2.3 From a872b518c9179f7ee639feb4de81c62fbf25f4f6 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:16:35 +0100 Subject: gallivm: Fix build -- rename Size to NrTokens. --- src/gallium/auxiliary/gallivm/tgsitollvm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp index 6b18a68fe6..5b08200d14 100644 --- a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp +++ b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp @@ -160,7 +160,7 @@ translate_immediate(Storage *storage, { float vec[4]; int i; - for (i = 0; i < imm->Immediate.Size - 1; ++i) { + for (i = 0; i < imm->Immediate.NrTokens - 1; ++i) { switch (imm->Immediate.DataType) { case TGSI_IMM_FLOAT32: vec[i] = imm->u.ImmediateFloat32[i].Float; @@ -179,7 +179,7 @@ translate_immediateir(StorageSoa *storage, { float vec[4]; int i; - for (i = 0; i < imm->Immediate.Size - 1; ++i) { + for (i = 0; i < imm->Immediate.NrTokens - 1; ++i) { switch (imm->Immediate.DataType) { case TGSI_IMM_FLOAT32: vec[i] = imm->u.ImmediateFloat32[i].Float; -- cgit v1.2.3 From 0020e1d10870e0d24c62e3060a7efb9a6472666d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:17:17 +0100 Subject: i915: Fix build -- rename Size to NrTokens. --- src/gallium/drivers/i915simple/i915_fpc_translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/i915simple/i915_fpc_translate.c b/src/gallium/drivers/i915simple/i915_fpc_translate.c index 43d62c5176..d92bdc1bc6 100644 --- a/src/gallium/drivers/i915simple/i915_fpc_translate.c +++ b/src/gallium/drivers/i915simple/i915_fpc_translate.c @@ -964,7 +964,7 @@ i915_translate_instructions(struct i915_fp_compile *p, = &parse.FullToken.FullImmediate; const uint pos = p->num_immediates++; uint j; - for (j = 0; j < imm->Immediate.Size; j++) { + for (j = 0; j < imm->Immediate.NrTokens - 1; j++) { p->immediates[pos][j] = imm->u.ImmediateFloat32[j].Float; } } -- cgit v1.2.3 From 276de3ffcf0294225926ca015fbec54d9d3b47ad Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:17:41 +0100 Subject: brw: Fix build -- rename Size to NrTokens. --- src/gallium/drivers/i965simple/brw_vs_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/i965simple/brw_vs_emit.c b/src/gallium/drivers/i965simple/brw_vs_emit.c index 34dbc0624d..e03d653482 100644 --- a/src/gallium/drivers/i965simple/brw_vs_emit.c +++ b/src/gallium/drivers/i965simple/brw_vs_emit.c @@ -1293,7 +1293,7 @@ void brw_vs_emit(struct brw_vs_compile *c) break; case TGSI_TOKEN_TYPE_IMMEDIATE: { struct tgsi_full_immediate *imm = &parse.FullToken.FullImmediate; - /*assert(imm->Immediate.Size == 4);*/ + assert(imm->Immediate.NrTokens == 4 + 1); c->prog_data.imm_buf[c->prog_data.num_imm][0] = imm->u.ImmediateFloat32[0].Float; c->prog_data.imm_buf[c->prog_data.num_imm][1] = imm->u.ImmediateFloat32[1].Float; c->prog_data.imm_buf[c->prog_data.num_imm][2] = imm->u.ImmediateFloat32[2].Float; -- cgit v1.2.3 From adc68472601991bfd714876ae9b54d2a50f8839b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:18:03 +0100 Subject: nv20: Fix build -- rename Size to NrTokens. --- src/gallium/drivers/nv20/nv20_vertprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv20/nv20_vertprog.c b/src/gallium/drivers/nv20/nv20_vertprog.c index a885fcd7a5..5db0e807ff 100644 --- a/src/gallium/drivers/nv20/nv20_vertprog.c +++ b/src/gallium/drivers/nv20/nv20_vertprog.c @@ -613,7 +613,7 @@ nv20_vertprog_translate(struct nv20_context *nv20, imm = &parse.FullToken.FullImmediate; assert(imm->Immediate.DataType == TGSI_IMM_FLOAT32); -// assert(imm->Immediate.Size == 4); + assert(imm->Immediate.NrTokens == 4 + 1); vpc->imm[vpc->nr_imm++] = constant(vpc, -1, imm->u.ImmediateFloat32[0].Float, -- cgit v1.2.3 From 844034dee5567b57705669917b6273fa71546be0 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:18:19 +0100 Subject: nv30: Fix build -- rename Size to NrTokens. --- src/gallium/drivers/nv30/nv30_vertprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_vertprog.c b/src/gallium/drivers/nv30/nv30_vertprog.c index 72824559e8..d262725057 100644 --- a/src/gallium/drivers/nv30/nv30_vertprog.c +++ b/src/gallium/drivers/nv30/nv30_vertprog.c @@ -613,7 +613,7 @@ nv30_vertprog_translate(struct nv30_context *nv30, imm = &parse.FullToken.FullImmediate; assert(imm->Immediate.DataType == TGSI_IMM_FLOAT32); -// assert(imm->Immediate.Size == 4); + assert(imm->Immediate.NrTokens == 4 + 1); vpc->imm[vpc->nr_imm++] = constant(vpc, -1, imm->u.ImmediateFloat32[0].Float, -- cgit v1.2.3 From 2644985367874591b8c79c76a2ddd96c603c417f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Feb 2009 15:18:32 +0100 Subject: nv40: Fix build -- rename Size to NrTokens. --- src/gallium/drivers/nv40/nv40_vertprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv40/nv40_vertprog.c b/src/gallium/drivers/nv40/nv40_vertprog.c index 1392fe956f..0862386638 100644 --- a/src/gallium/drivers/nv40/nv40_vertprog.c +++ b/src/gallium/drivers/nv40/nv40_vertprog.c @@ -784,7 +784,7 @@ nv40_vertprog_translate(struct nv40_context *nv40, imm = &parse.FullToken.FullImmediate; assert(imm->Immediate.DataType == TGSI_IMM_FLOAT32); -// assert(imm->Immediate.Size == 4); + assert(imm->Immediate.NrTokens == 4 + 1); vpc->imm[vpc->nr_imm++] = constant(vpc, -1, imm->u.ImmediateFloat32[0].Float, -- cgit v1.2.3 From 43e6272ae5c03f663cfdd98f35b0b0028bc5d252 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 10 Feb 2009 16:23:02 +0100 Subject: gallium: Introduce new subdirs build variables (based on gallium-xorg-driver/commit 270ce504052d415870a25ab59818b2309eb8ac13) --- configs/default | 3 +++ configs/linux-dri | 4 +++- src/gallium/Makefile | 2 +- src/gallium/state_trackers/Makefile | 2 +- src/gallium/winsys/drm/Makefile | 10 +++++----- 5 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/configs/default b/configs/default index 13bda58f18..3a49c5a969 100644 --- a/configs/default +++ b/configs/default @@ -89,11 +89,14 @@ PROGRAM_DIRS = demos redbook samples glsl xdemos EGL_DRIVERS_DIRS = demo # Gallium directories and +GALLIUM_DIRS = auxiliary drivers state_trackers GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util indices GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a) GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv04 nv10 nv20 nv30 nv40 nv50 failover trace GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) GALLIUM_WINSYS_DIRS = xlib egl_xlib +GALLIUM_WINSYS_DRM_DIRS = +GALLIUM_STATE_TRACKERS_DIRS = glx # Library dependencies diff --git a/configs/linux-dri b/configs/linux-dri index dc2ab4f9d9..8632170408 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -59,7 +59,9 @@ EGL_DRIVERS_DIRS = demo glx DRIVER_DIRS = dri WINDOW_SYSTEM = dri -GALLIUM_WINSYS_DIRS = drm +GALLIUM_WINSYS_DIRS = drm +GALLIUM_WINSYS_DRM_DIRS = intel nouveau +GALLIUM_STATE_TRACKERS_DIRS = egl DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \ savage sis tdfx trident unichrome ffb diff --git a/src/gallium/Makefile b/src/gallium/Makefile index c7b594d084..875314f6c3 100644 --- a/src/gallium/Makefile +++ b/src/gallium/Makefile @@ -2,7 +2,7 @@ TOP = ../.. include $(TOP)/configs/current -SUBDIRS = auxiliary drivers state_trackers +SUBDIRS = $(GALLIUM_DIRS) # Note winsys/ needs to be built after src/mesa diff --git a/src/gallium/state_trackers/Makefile b/src/gallium/state_trackers/Makefile index 07b3fbf311..265ca468c2 100644 --- a/src/gallium/state_trackers/Makefile +++ b/src/gallium/state_trackers/Makefile @@ -2,7 +2,7 @@ TOP = ../../.. include $(TOP)/configs/current -SUBDIRS = glx +SUBDIRS = $(GALLIUM_STATE_TRACKERS_DIRS) default: subdirs diff --git a/src/gallium/winsys/drm/Makefile b/src/gallium/winsys/drm/Makefile index f466ce6c3c..d2af5705f0 100644 --- a/src/gallium/winsys/drm/Makefile +++ b/src/gallium/winsys/drm/Makefile @@ -1,10 +1,10 @@ -# src/mesa/drivers/dri/Makefile +# src/gallium/winsys/drm/Makefile TOP = ../../../.. include $(TOP)/configs/current - +SUBDIRS = $(GALLIUM_WINSYS_DRM_DIRS) default: $(TOP)/$(LIB_DIR) subdirs @@ -14,7 +14,7 @@ $(TOP)/$(LIB_DIR): subdirs: - @for dir in $(DRI_DIRS) ; do \ + @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ (cd $$dir && $(MAKE)) || exit 1 ; \ fi \ @@ -22,7 +22,7 @@ subdirs: install: - @for dir in $(DRI_DIRS) ; do \ + @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ (cd $$dir && $(MAKE) install) || exit 1 ; \ fi \ @@ -30,7 +30,7 @@ install: clean: - @for dir in $(DRI_DIRS) ; do \ + @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ (cd $$dir && $(MAKE) clean) ; \ fi \ -- cgit v1.2.3 From 94665aa648f8b9015f9eabdddad092b006faf70a Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 10 Feb 2009 16:16:15 +0100 Subject: gallium: Install DRI drivers into lib/gallium --- src/gallium/winsys/drm/Makefile | 6 +++--- src/gallium/winsys/drm/Makefile.template | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/Makefile b/src/gallium/winsys/drm/Makefile index d2af5705f0..a84fcd8418 100644 --- a/src/gallium/winsys/drm/Makefile +++ b/src/gallium/winsys/drm/Makefile @@ -6,11 +6,11 @@ include $(TOP)/configs/current SUBDIRS = $(GALLIUM_WINSYS_DRM_DIRS) -default: $(TOP)/$(LIB_DIR) subdirs +default: $(TOP)/$(LIB_DIR)/gallium subdirs -$(TOP)/$(LIB_DIR): - -mkdir $(TOP)/$(LIB_DIR) +$(TOP)/$(LIB_DIR)/gallium: + -mkdir -p $(TOP)/$(LIB_DIR)/gallium subdirs: diff --git a/src/gallium/winsys/drm/Makefile.template b/src/gallium/winsys/drm/Makefile.template index 6756640c4e..cccf8abdfd 100644 --- a/src/gallium/winsys/drm/Makefile.template +++ b/src/gallium/winsys/drm/Makefile.template @@ -79,7 +79,7 @@ SHARED_INCLUDES = \ ##### TARGETS ##### -default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR)/$(LIBNAME_EGL) +default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME_EGL) $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template @@ -93,11 +93,11 @@ $(LIBNAME_EGL): $(WINSYS_OBJECTS) $(LIBS) $(OBJECTS) $(MKLIB_OPTIONS) $(WINSYS_OBJECTS) $(PIPE_DRIVERS) $(WINOBJ) $(DRI_LIB_DEPS) \ --whole-archive $(LIBS) $(GALLIUM_AUXILIARIES) --no-whole-archive $(DRIVER_EXTRAS) -$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) - $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) +$(TOP)/$(LIB_DIR)/gallium/$(LIBNAME): $(LIBNAME) + $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium -$(TOP)/$(LIB_DIR)/$(LIBNAME_EGL): $(LIBNAME_EGL) - $(INSTALL) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR) +$(TOP)/$(LIB_DIR)/gallium/$(LIBNAME_EGL): $(LIBNAME_EGL) + $(INSTALL) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR)/gallium depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) rm -f depend -- cgit v1.2.3 From 1789dc8015d75b996a546a94f88d8cdaa3c7e8c4 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 10 Feb 2009 16:17:32 +0100 Subject: gallium: Don't rebuild common drm code --- src/gallium/winsys/drm/intel/gem/Makefile.template | 6 +++--- src/gallium/winsys/drm/nouveau/common/Makefile.template | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/intel/gem/Makefile.template b/src/gallium/winsys/drm/intel/gem/Makefile.template index 557070ae02..b60e978894 100644 --- a/src/gallium/winsys/drm/intel/gem/Makefile.template +++ b/src/gallium/winsys/drm/intel/gem/Makefile.template @@ -36,11 +36,11 @@ INCLUDES = \ ##### TARGETS ##### -default: depend symlinks $(LIBNAME) +default: depend symlinks lib$(LIBNAME).a -$(LIBNAME): $(OBJECTS) Makefile Makefile.template - $(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS) +lib$(LIBNAME).a: $(OBJECTS) Makefile Makefile.template + $(TOP)/bin/mklib -o $(LIBNAME) -static $(OBJECTS) $(DRIVER_LIBS) depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) diff --git a/src/gallium/winsys/drm/nouveau/common/Makefile.template b/src/gallium/winsys/drm/nouveau/common/Makefile.template index e40836e0a8..f0d098bb1c 100644 --- a/src/gallium/winsys/drm/nouveau/common/Makefile.template +++ b/src/gallium/winsys/drm/nouveau/common/Makefile.template @@ -31,11 +31,11 @@ INCLUDES = \ ##### TARGETS ##### -default: depend symlinks $(LIBNAME) +default: depend symlinks lib$(LIBNAME).a -$(LIBNAME): $(OBJECTS) Makefile Makefile.template - $(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS) +lib$(LIBNAME).a: $(OBJECTS) Makefile Makefile.template + $(TOP)/bin/mklib -o $(LIBNAME) -static $(OBJECTS) $(DRIVER_LIBS) depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) -- cgit v1.2.3 From 767b1acbb757186bde30973394f256ab7498a075 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 10 Feb 2009 17:43:25 +0100 Subject: mesa: Build both software rasterizers for debug But put the gallium one in lib/gallium --- configs/default | 2 +- src/gallium/winsys/xlib/Makefile | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/configs/default b/configs/default index 3a49c5a969..4c8698ccc4 100644 --- a/configs/default +++ b/configs/default @@ -81,7 +81,7 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2 LIB_DIR = lib SRC_DIRS = mesa gallium egl gallium/winsys glu glut/glx glew glw GLU_DIRS = sgi -DRIVER_DIRS = +DRIVER_DIRS = x11 osmesa # Which subdirs under $(TOP)/progs/ to enter: PROGRAM_DIRS = demos redbook samples glsl xdemos diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 9d70f3cb9c..bb187cc14a 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -62,15 +62,17 @@ LIBS = \ -default: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) +default: $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME) +$(TOP)/$(LIB_DIR)/gallium: + @ mkdir -p $(TOP)/$(LIB_DIR)/gallium # Make the libGL.so library -$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefile +$(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefile $(TOP)/bin/mklib -o $(GL_LIB) \ -linker "$(CC)" \ -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ - -install $(TOP)/$(LIB_DIR) \ + -install $(TOP)/$(LIB_DIR)/gallium \ $(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \ --start-group $(LIBS) --end-group $(GL_LIB_DEPS) -- cgit v1.2.3 From 2f0811054fd53db776531428eef1f6960f180f38 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 18:09:10 +0100 Subject: nouveau: recalc sub width and height for each mipmap level --- src/gallium/drivers/nv04/nv04_surface_2d.c | 39 ++++++++++++++++++------------ 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 1b5d980468..a8aa12cb8f 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -104,11 +104,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst)); const unsigned max_w = 1024; const unsigned max_h = 1024; - const unsigned sub_w = w > max_w ? max_w : w; - const unsigned sub_h = h > max_h ? max_h : h; - unsigned cx = 0; - unsigned cy = 0; - int i, offset = 0; + int i, src_offset = src->offset, dst_offset = dst->offset, src_stride = src->stride; /* POT or GTFO */ assert(!(w & (w - 1)) && !(h & (h - 1))); @@ -116,10 +112,6 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, 1); OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); - OUT_RING (chan, nv04_surface_format(dst->format) | - log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | - log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1); OUT_RELOCo(chan, src_bo, @@ -129,12 +121,23 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, /* Upload, then swizzle each mipmap level in turn */ for (i=0; itexture->last_level; i++) { + unsigned sub_w, sub_h; + unsigned cx, cy; + + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); + OUT_RING (chan, nv04_surface_format(dst->format) | + log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | + log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); + + sub_w = w > max_w ? max_w : w; + sub_h = h > max_h ? max_h : h; for (cy = 0; cy < h; cy += sub_h) { for (cx = 0; cx < w; cx += sub_w) { + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx, cy) * - dst->block.size + offset, NOUVEAU_BO_GART | + OUT_RELOCl(chan, dst_bo, dst_offset + nv04_swizzle_bits(cx, cy) * + dst->block.size, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); @@ -150,18 +153,22 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4); OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, src->stride | + OUT_RING (chan, src_stride | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); - OUT_RELOCl(chan, src_bo, src->offset + cy * src->stride + - cx * src->block.size + offset, NOUVEAU_BO_GART | + OUT_RELOCl(chan, src_bo, src_offset + cy * src_stride + + cx * src->block.size, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); OUT_RING (chan, 0); } } - /* FIXME: need to know how many bytes per pixel */ - offset += align(w * h * 2 /*src->block.size*/, 64); + /* FIXME: need to find next offset for both source and dest */ + src_offset += w * h * dst->block.size; + /*src_offset = align(src_offset, 64);*/ + dst_offset += w * h * dst->block.size; + /*dst_offset = align(dst_offset, 64);*/ + src_stride >>= 1; w >>= 1; h >>= 1; } -- cgit v1.2.3 From b20a1b28b7e581304701c5802e8627003e461e45 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 18:31:41 +0100 Subject: Missing: tgsi: Fix build -- rename Size to NrTokens. --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 5b5707fa1c..8b9b18f94d 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -188,7 +188,7 @@ make_immediate(const float *value, uint size) struct tgsi_full_immediate imm; imm = tgsi_default_full_immediate(); - imm.Immediate.Size += size; + imm.Immediate.NrTokens += size; imm.Immediate.DataType = TGSI_IMM_FLOAT32; imm.u.Pointer = value; return imm; -- cgit v1.2.3 From 00ee308ab3e7da2a2939845e0f0a24b8a0925025 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 16:18:22 +0000 Subject: pipebuffer: Drop reliance on pipe_winsys. --- .../auxiliary/pipebuffer/pb_buffer_fenced.c | 37 +++++++++++----------- .../auxiliary/pipebuffer/pb_buffer_fenced.h | 32 +++++++++++++++++-- src/gallium/auxiliary/pipebuffer/pb_bufmgr.h | 5 +-- .../auxiliary/pipebuffer/pb_bufmgr_fenced.c | 4 +-- 4 files changed, 54 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 61afdfe82a..f9e6226436 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -44,7 +44,6 @@ #include "pipe/p_compiler.h" #include "pipe/p_error.h" #include "pipe/p_debug.h" -#include "pipe/internal/p_winsys_screen.h" #include "pipe/p_thread.h" #include "util/u_memory.h" #include "util/u_double_list.h" @@ -64,7 +63,7 @@ struct fenced_buffer_list { pipe_mutex mutex; - struct pipe_winsys *winsys; + struct pb_fence_ops *ops; size_t numDelayed; @@ -140,12 +139,12 @@ static INLINE void _fenced_buffer_remove(struct fenced_buffer_list *fenced_list, struct fenced_buffer *fenced_buf) { - struct pipe_winsys *winsys = fenced_list->winsys; + struct pb_fence_ops *ops = fenced_list->ops; assert(fenced_buf->fence); assert(fenced_buf->list == fenced_list); - winsys->fence_reference(winsys, &fenced_buf->fence, NULL); + ops->fence_reference(ops, &fenced_buf->fence, NULL); fenced_buf->flags &= ~PIPE_BUFFER_USAGE_GPU_READ_WRITE; assert(fenced_buf->head.prev); @@ -168,7 +167,7 @@ static INLINE enum pipe_error _fenced_buffer_finish(struct fenced_buffer *fenced_buf) { struct fenced_buffer_list *fenced_list = fenced_buf->list; - struct pipe_winsys *winsys = fenced_list->winsys; + struct pb_fence_ops *ops = fenced_list->ops; #if 0 debug_warning("waiting for GPU"); @@ -176,7 +175,7 @@ _fenced_buffer_finish(struct fenced_buffer *fenced_buf) assert(fenced_buf->fence); if(fenced_buf->fence) { - if(winsys->fence_finish(winsys, fenced_buf->fence, 0) != 0) { + if(ops->fence_finish(ops, fenced_buf->fence, 0) != 0) { return PIPE_ERROR; } /* Remove from the fenced list */ @@ -196,7 +195,7 @@ static void _fenced_buffer_list_check_free(struct fenced_buffer_list *fenced_list, int wait) { - struct pipe_winsys *winsys = fenced_list->winsys; + struct pb_fence_ops *ops = fenced_list->ops; struct list_head *curr, *next; struct fenced_buffer *fenced_buf; struct pipe_fence_handle *prev_fence = NULL; @@ -209,15 +208,15 @@ _fenced_buffer_list_check_free(struct fenced_buffer_list *fenced_list, if(fenced_buf->fence != prev_fence) { int signaled; if (wait) - signaled = winsys->fence_finish(winsys, fenced_buf->fence, 0); + signaled = ops->fence_finish(ops, fenced_buf->fence, 0); else - signaled = winsys->fence_signalled(winsys, fenced_buf->fence, 0); + signaled = ops->fence_signalled(ops, fenced_buf->fence, 0); if (signaled != 0) break; prev_fence = fenced_buf->fence; } else { - assert(winsys->fence_signalled(winsys, fenced_buf->fence, 0) == 0); + assert(ops->fence_signalled(ops, fenced_buf->fence, 0) == 0); } _fenced_buffer_remove(fenced_list, fenced_buf); @@ -237,14 +236,14 @@ fenced_buffer_destroy(struct pb_buffer *buf) pipe_mutex_lock(fenced_list->mutex); assert(fenced_buf->base.base.refcount == 0); if (fenced_buf->fence) { - struct pipe_winsys *winsys = fenced_list->winsys; - if(winsys->fence_signalled(winsys, fenced_buf->fence, 0) == 0) { + struct pb_fence_ops *ops = fenced_list->ops; + if(ops->fence_signalled(ops, fenced_buf->fence, 0) == 0) { struct list_head *curr, *prev; curr = &fenced_buf->head; prev = curr->prev; do { fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head); - assert(winsys->fence_signalled(winsys, fenced_buf->fence, 0) == 0); + assert(ops->fence_signalled(ops, fenced_buf->fence, 0) == 0); _fenced_buffer_remove(fenced_list, fenced_buf); curr = prev; prev = curr->prev; @@ -366,11 +365,11 @@ fenced_buffer_fence(struct pb_buffer *buf, { struct fenced_buffer *fenced_buf; struct fenced_buffer_list *fenced_list; - struct pipe_winsys *winsys; + struct pb_fence_ops *ops; fenced_buf = fenced_buffer(buf); fenced_list = fenced_buf->list; - winsys = fenced_list->winsys; + ops = fenced_list->ops; if(fence == fenced_buf->fence) { /* Nothing to do */ @@ -384,7 +383,7 @@ fenced_buffer_fence(struct pb_buffer *buf, if (fenced_buf->fence) _fenced_buffer_remove(fenced_list, fenced_buf); if (fence) { - winsys->fence_reference(winsys, &fenced_buf->fence, fence); + ops->fence_reference(ops, &fenced_buf->fence, fence); fenced_buf->flags |= fenced_buf->validation_flags; _fenced_buffer_add(fenced_buf); } @@ -447,7 +446,7 @@ fenced_buffer_create(struct fenced_buffer_list *fenced_list, struct fenced_buffer_list * -fenced_buffer_list_create(struct pipe_winsys *winsys) +fenced_buffer_list_create(struct pb_fence_ops *ops) { struct fenced_buffer_list *fenced_list; @@ -455,7 +454,7 @@ fenced_buffer_list_create(struct pipe_winsys *winsys) if (!fenced_list) return NULL; - fenced_list->winsys = winsys; + fenced_list->ops = ops; LIST_INITHEAD(&fenced_list->delayed); @@ -494,6 +493,8 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list) pipe_mutex_unlock(fenced_list->mutex); + fenced_list->ops->destroy(fenced_list->ops); + FREE(fenced_list); } diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h index b15c676194..d1c9d4c17d 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h @@ -59,7 +59,6 @@ extern "C" { #endif -struct pipe_winsys; struct pipe_buffer; struct pipe_fence_handle; @@ -70,13 +69,42 @@ struct pipe_fence_handle; struct fenced_buffer_list; +struct pb_fence_ops +{ + void (*destroy)( struct pb_fence_ops *ops ); + + /** Set ptr = fence, with reference counting */ + void (*fence_reference)( struct pb_fence_ops *ops, + struct pipe_fence_handle **ptr, + struct pipe_fence_handle *fence ); + + /** + * Checks whether the fence has been signalled. + * \param flags driver-specific meaning + * \return zero on success. + */ + int (*fence_signalled)( struct pb_fence_ops *ops, + struct pipe_fence_handle *fence, + unsigned flag ); + + /** + * Wait for the fence to finish. + * \param flags driver-specific meaning + * \return zero on success. + */ + int (*fence_finish)( struct pb_fence_ops *ops, + struct pipe_fence_handle *fence, + unsigned flag ); +}; + + /** * Create a fenced buffer list. * * See also fenced_bufmgr_create for a more convenient way to use this. */ struct fenced_buffer_list * -fenced_buffer_list_create(struct pipe_winsys *winsys); +fenced_buffer_list_create(struct pb_fence_ops *ops); /** diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h index 0a8264a924..fec8db91c7 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h @@ -61,7 +61,6 @@ extern "C" { struct pb_desc; struct pipe_buffer; -struct pipe_winsys; /** @@ -163,6 +162,8 @@ pb_cache_manager_create(struct pb_manager *provider, unsigned usecs); +struct pb_fence_ops; + /** * Fenced buffer manager. * @@ -174,7 +175,7 @@ pb_cache_manager_create(struct pb_manager *provider, */ struct pb_manager * fenced_bufmgr_create(struct pb_manager *provider, - struct pipe_winsys *winsys); + struct pb_fence_ops *ops); struct pb_manager * diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c index 513ed28ca6..47e9fee533 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c @@ -122,7 +122,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr) struct pb_manager * fenced_bufmgr_create(struct pb_manager *provider, - struct pipe_winsys *winsys) + struct pb_fence_ops *ops) { struct fenced_pb_manager *fenced_mgr; @@ -138,7 +138,7 @@ fenced_bufmgr_create(struct pb_manager *provider, fenced_mgr->base.flush = fenced_bufmgr_flush; fenced_mgr->provider = provider; - fenced_mgr->fenced_list = fenced_buffer_list_create(winsys); + fenced_mgr->fenced_list = fenced_buffer_list_create(ops); if(!fenced_mgr->fenced_list) { FREE(fenced_mgr); return NULL; -- cgit v1.2.3 From 02401cbaf021833c77c501d697d912f295546f58 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 18:44:08 +0100 Subject: nouveau: dst offset is correct --- src/gallium/drivers/nv04/nv04_surface_2d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index a8aa12cb8f..ad11b2fd45 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -163,11 +163,9 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, } } - /* FIXME: need to find next offset for both source and dest */ - src_offset += w * h * dst->block.size; - /*src_offset = align(src_offset, 64);*/ + /* FIXME: need to find next offset for source */ + /*src_offset += w * h * src->block.size;*/ dst_offset += w * h * dst->block.size; - /*dst_offset = align(dst_offset, 64);*/ src_stride >>= 1; w >>= 1; h >>= 1; -- cgit v1.2.3 From ebb864da9e98003be9ea388013ae4385d341e46f Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 10 Feb 2009 18:11:44 +0000 Subject: wgl: mutex-protect the shared stw_icd struct --- src/gallium/state_trackers/wgl/icd/stw_icd.c | 211 ++++++++++++++++++--------- 1 file changed, 138 insertions(+), 73 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/icd/stw_icd.c b/src/gallium/state_trackers/wgl/icd/stw_icd.c index e160004aea..2cefc5c812 100644 --- a/src/gallium/state_trackers/wgl/icd/stw_icd.c +++ b/src/gallium/state_trackers/wgl/icd/stw_icd.c @@ -31,6 +31,7 @@ #include "GL/gl.h" #include "pipe/p_debug.h" +#include "pipe/p_thread.h" #include "shared/stw_public.h" #include "icd/stw_icd.h" @@ -41,6 +42,11 @@ struct stw_icd { + pipe_mutex mutex; + + GLCLTPROCTABLE cpt; + boolean cpt_initialized; + struct { struct stw_context *ctx; } ctx_array[DRV_CONTEXT_MAX]; @@ -60,6 +66,8 @@ stw_icd_init( void ) stw_icd = &stw_icd_storage; memset(stw_icd, 0, sizeof *stw_icd); + pipe_mutex_init( stw_icd->mutex ); + return TRUE; } @@ -70,24 +78,30 @@ stw_icd_cleanup(void) if(!stw_icd) return; + + pipe_mutex_lock( stw_icd->mutex ); + { + /* Ensure all contexts are destroyed */ + for (i = 0; i < DRV_CONTEXT_MAX; i++) + if (stw_icd->ctx_array[i].ctx) + stw_delete_context( stw_icd->ctx_array[i].ctx ); + } + pipe_mutex_unlock( stw_icd->mutex ); - /* Ensure all contexts are destroyed */ - for (i = 0; i < DRV_CONTEXT_MAX; i++) - if (stw_icd->ctx_array[i].ctx) - stw_delete_context( stw_icd->ctx_array[i].ctx ); - + pipe_mutex_init( stw_icd->mutex ); stw_icd = NULL; } static struct stw_context * -lookup_context( DHGLRC dhglrc ) +lookup_context( struct stw_icd *icd, + DHGLRC dhglrc ) { if (dhglrc == 0 || dhglrc >= DRV_CONTEXT_MAX) return NULL; - return stw_icd->ctx_array[dhglrc - 1].ctx; + return icd->ctx_array[dhglrc - 1].ctx; } BOOL APIENTRY @@ -96,14 +110,22 @@ DrvCopyContext( DHGLRC dhrcDest, UINT fuMask ) { - struct stw_context *src = lookup_context( dhrcSource ); - struct stw_context *dst = lookup_context( dhrcDest ); + BOOL ret = FALSE; + + pipe_mutex_lock( stw_icd->mutex ); + { + struct stw_context *src = lookup_context( stw_icd, dhrcSource ); + struct stw_context *dst = lookup_context( stw_icd, dhrcDest ); - if (src == NULL || - dst == NULL) - return FALSE; + if (src == NULL || dst == NULL) + goto done; - return stw_copy_context( src, dst, fuMask ); + ret = stw_copy_context( src, dst, fuMask ); + } +done: + pipe_mutex_unlock( stw_icd->mutex ); + + return ret; } DHGLRC APIENTRY @@ -111,23 +133,34 @@ DrvCreateLayerContext( HDC hdc, INT iLayerPlane ) { - DWORD i; + DHGLRC handle = 0;; + + pipe_mutex_lock( stw_icd->mutex ); + { + int i; + + for (i = 0; i < DRV_CONTEXT_MAX; i++) { + if (stw_icd->ctx_array[i].ctx == NULL) + break; + } - for (i = 0; i < DRV_CONTEXT_MAX; i++) { - if (stw_icd->ctx_array[i].ctx == NULL) - goto found_slot; + /* No slot available, fail: + */ + if (i == DRV_CONTEXT_MAX) + goto done; + + stw_icd->ctx_array[i].ctx = stw_create_context( hdc, iLayerPlane ); + if (stw_icd->ctx_array[i].ctx == NULL) + goto done; + + /* success: + */ + handle = (DHGLRC) i + 1; } - - /* No slot available, fail: - */ - return 0; - -found_slot: - stw_icd->ctx_array[i].ctx = stw_create_context( hdc, iLayerPlane ); - if (stw_icd->ctx_array[i].ctx == NULL) - return 0; +done: + pipe_mutex_unlock( stw_icd->mutex ); - return (DHGLRC) i + 1; + return handle; } DHGLRC APIENTRY @@ -141,20 +174,27 @@ BOOL APIENTRY DrvDeleteContext( DHGLRC dhglrc ) { - struct stw_context *ctx; + BOOL ret = FALSE; - ctx = lookup_context( dhglrc ); - if (ctx == NULL) - goto fail; + pipe_mutex_lock( stw_icd->mutex ); + { + struct stw_context *ctx; - if (stw_delete_context( ctx ) == FALSE) - goto fail; + ctx = lookup_context( stw_icd, dhglrc ); + if (ctx == NULL) + goto done; + + if (stw_delete_context( ctx ) == FALSE) + goto done; + + stw_icd->ctx_array[dhglrc - 1].ctx = NULL; + ret = TRUE; - stw_icd->ctx_array[dhglrc - 1].ctx = NULL; - return TRUE; + } +done: + pipe_mutex_unlock( stw_icd->mutex ); -fail: - return FALSE; + return ret; } BOOL APIENTRY @@ -228,23 +268,29 @@ BOOL APIENTRY DrvReleaseContext( DHGLRC dhglrc ) { - struct stw_context *ctx; + BOOL ret = FALSE; - /* XXX: The expectation is that ctx is the same context which is - * current for this thread. We should check that and return False - * if not the case. - */ - ctx = lookup_context( dhglrc ); - if (ctx == NULL) - goto fail; + pipe_mutex_lock( stw_icd->mutex ); + { + struct stw_context *ctx; - if (stw_make_current( NULL, NULL ) == FALSE) - goto fail; + /* XXX: The expectation is that ctx is the same context which is + * current for this thread. We should check that and return False + * if not the case. + */ + ctx = lookup_context( stw_icd, dhglrc ); + if (ctx == NULL) + goto done; - return TRUE; + if (stw_make_current( NULL, NULL ) == FALSE) + goto done; -fail: - return FALSE; + ret = TRUE; + } +done: + pipe_mutex_unlock( stw_icd->mutex ); + + return ret; } void APIENTRY @@ -257,31 +303,15 @@ DrvSetCallbackProcs( return; } -#define GPA_GL( NAME ) disp->NAME = gl##NAME -static GLCLTPROCTABLE cpt; +static void init_proc_table( GLCLTPROCTABLE *cpt ) +{ + GLDISPATCHTABLE *disp = &cpt->glDispatchTable; -PGLCLTPROCTABLE APIENTRY -DrvSetContext( - HDC hdc, - DHGLRC dhglrc, - PFN_SETPROCTABLE pfnSetProcTable ) -{ - struct stw_context *ctx; - GLDISPATCHTABLE *disp = &cpt.glDispatchTable; - - debug_printf( "%s( 0x%p, %u, 0x%p )\n", __FUNCTION__, hdc, dhglrc, pfnSetProcTable ); - - ctx = lookup_context( dhglrc ); - if (ctx == NULL) - return NULL; - - if (!stw_make_current( hdc, ctx )) - return NULL; - - memset( &cpt, 0, sizeof( cpt ) ); - cpt.cEntries = OPENGL_VERSION_110_ENTRIES; + memset( cpt, 0, sizeof *cpt ); + cpt->cEntries = OPENGL_VERSION_110_ENTRIES; +#define GPA_GL( NAME ) disp->NAME = gl##NAME GPA_GL( NewList ); GPA_GL( EndList ); GPA_GL( CallList ); @@ -618,8 +648,43 @@ DrvSetContext( GPA_GL( TexSubImage2D ); GPA_GL( PopClientAttrib ); GPA_GL( PushClientAttrib ); +} + +PGLCLTPROCTABLE APIENTRY +DrvSetContext( + HDC hdc, + DHGLRC dhglrc, + PFN_SETPROCTABLE pfnSetProcTable ) +{ + PGLCLTPROCTABLE result = NULL; + + pipe_mutex_lock( stw_icd->mutex ); + { + struct stw_context *ctx; + + debug_printf( "%s( 0x%p, %u, 0x%p )\n", + __FUNCTION__, hdc, dhglrc, pfnSetProcTable ); + + /* Although WGL allows different dispatch entrypoints per + */ + if (!stw_icd->cpt_initialized) { + init_proc_table( &stw_icd->cpt ); + stw_icd->cpt_initialized = TRUE; + } + + ctx = lookup_context( stw_icd, dhglrc ); + if (ctx == NULL) + goto done; + + if (!stw_make_current( hdc, ctx )) + goto done; + + result = &stw_icd->cpt; + } +done: + pipe_mutex_unlock( stw_icd->mutex ); - return &cpt; + return result; } int APIENTRY -- cgit v1.2.3 From f54149a3a3dde8056a8db9b9ac7cef32885946d7 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 10 Feb 2009 18:21:41 +0000 Subject: wgl: return before locking if stw_icd is NULL --- src/gallium/state_trackers/wgl/icd/stw_icd.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/icd/stw_icd.c b/src/gallium/state_trackers/wgl/icd/stw_icd.c index e4f3c669e2..1aa4b8a6e2 100644 --- a/src/gallium/state_trackers/wgl/icd/stw_icd.c +++ b/src/gallium/state_trackers/wgl/icd/stw_icd.c @@ -76,7 +76,7 @@ stw_icd_cleanup(void) { int i; - if(!stw_icd) + if (!stw_icd) return; pipe_mutex_lock( stw_icd->mutex ); @@ -115,6 +115,9 @@ DrvCopyContext( { BOOL ret = FALSE; + if (!stw_icd) + return FALSE; + pipe_mutex_lock( stw_icd->mutex ); { struct stw_context *src = lookup_context( stw_icd, dhrcSource ); @@ -136,7 +139,10 @@ DrvCreateLayerContext( HDC hdc, INT iLayerPlane ) { - DHGLRC handle = 0;; + DHGLRC handle = 0; + + if (!stw_icd) + return handle; pipe_mutex_lock( stw_icd->mutex ); { @@ -179,6 +185,9 @@ DrvDeleteContext( { BOOL ret = FALSE; + if (!stw_icd) + return ret; + pipe_mutex_lock( stw_icd->mutex ); { struct stw_context *ctx; @@ -273,6 +282,9 @@ DrvReleaseContext( { BOOL ret = FALSE; + if (!stw_icd) + return ret; + pipe_mutex_lock( stw_icd->mutex ); { struct stw_context *ctx; @@ -661,6 +673,9 @@ DrvSetContext( { PGLCLTPROCTABLE result = NULL; + if (!stw_icd) + return result; + pipe_mutex_lock( stw_icd->mutex ); { struct stw_context *ctx; -- cgit v1.2.3 From 0cd28c4a1b5a48b28be256a808f310fe995e9c7e Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 21:20:06 +0100 Subject: nouveau: revert most parts of recent mipmap+swizzle stuff. We only need to find right src and dst offset for given mipmap level. --- src/gallium/drivers/nv04/nv04_surface_2d.c | 93 ++++++++++++++---------------- 1 file changed, 43 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index ad11b2fd45..538f823319 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -104,7 +104,10 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst)); const unsigned max_w = 1024; const unsigned max_h = 1024; - int i, src_offset = src->offset, dst_offset = dst->offset, src_stride = src->stride; + const unsigned sub_w = w > max_w ? max_w : w; + const unsigned sub_h = h > max_h ? max_h : h; + unsigned cx, cy; + int i, src_offset = src->offset, dst_offset = dst->offset; /* POT or GTFO */ assert(!(w & (w - 1)) && !(h & (h - 1))); @@ -113,62 +116,52 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); + OUT_RING (chan, nv04_surface_format(dst->format) | + log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | + log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1); OUT_RELOCo(chan, src_bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1); OUT_RING (chan, swzsurf->handle); - /* Upload, then swizzle each mipmap level in turn */ - for (i=0; itexture->last_level; i++) { - unsigned sub_w, sub_h; - unsigned cx, cy; - - BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); - OUT_RING (chan, nv04_surface_format(dst->format) | - log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | - log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); - - sub_w = w > max_w ? max_w : w; - sub_h = h > max_h ? max_h : h; - - for (cy = 0; cy < h; cy += sub_h) { - for (cx = 0; cx < w; cx += sub_w) { - - BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, dst_bo, dst_offset + nv04_swizzle_bits(cx, cy) * - dst->block.size, NOUVEAU_BO_GART | - NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); - - BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); - OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE); - OUT_RING (chan, nv04_scaled_image_format(src->format)); - OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY); - OUT_RING (chan, 0); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, 0); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, 1 << 20); - OUT_RING (chan, 1 << 20); - - BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4); - OUT_RING (chan, sub_h << 16 | sub_w); - OUT_RING (chan, src_stride | - NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | - NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); - OUT_RELOCl(chan, src_bo, src_offset + cy * src_stride + - cx * src->block.size, NOUVEAU_BO_GART | - NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RING (chan, 0); - } - } - - /* FIXME: need to find next offset for source */ - /*src_offset += w * h * src->block.size;*/ + /* FIXME: Find right src and dst offset, given mipmap level */ + for (i=0; ilevel; i++) { + src_offset += w * h * src->block.size; dst_offset += w * h * dst->block.size; - src_stride >>= 1; - w >>= 1; - h >>= 1; + } + + for (cy = 0; cy < h; cy += sub_h) { + for (cx = 0; cx < w; cx += sub_w) { + + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); + OUT_RELOCl(chan, dst_bo, dst_offset + nv04_swizzle_bits(cx, cy) * + dst->block.size, NOUVEAU_BO_GART | + NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); + + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); + OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE); + OUT_RING (chan, nv04_scaled_image_format(src->format)); + OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY); + OUT_RING (chan, 0); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, 0); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, 1 << 20); + OUT_RING (chan, 1 << 20); + + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4); + OUT_RING (chan, sub_h << 16 | sub_w); + OUT_RING (chan, src->stride | + NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | + NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); + OUT_RELOCl(chan, src_bo, src_offset + cy * src->stride + + cx * src->block.size, NOUVEAU_BO_GART | + NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + OUT_RING (chan, 0); + } } return 0; -- cgit v1.2.3 From fa9fcf5e8fc1a1fbd25b0943050c51104acb0397 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 21:22:29 +0100 Subject: nouveau: do not forget to half dimension. --- src/gallium/drivers/nv04/nv04_surface_2d.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 538f823319..63f212556f 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -106,7 +106,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, const unsigned max_h = 1024; const unsigned sub_w = w > max_w ? max_w : w; const unsigned sub_h = h > max_h ? max_h : h; - unsigned cx, cy; + unsigned cx, cy, level_w, level_h; int i, src_offset = src->offset, dst_offset = dst->offset; /* POT or GTFO */ @@ -128,9 +128,13 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, OUT_RING (chan, swzsurf->handle); /* FIXME: Find right src and dst offset, given mipmap level */ + level_w = w; + level_h = h; for (i=0; ilevel; i++) { - src_offset += w * h * src->block.size; - dst_offset += w * h * dst->block.size; + src_offset += level_w * level_h * src->block.size; + dst_offset += level_w * level_h * dst->block.size; + level_w >>= 1; + level_h >>= 1; } for (cy = 0; cy < h; cy += sub_h) { -- cgit v1.2.3 From 53069cbf290c7de7cc1bf813815e8ef7d5d886a4 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 21:57:40 +0100 Subject: nouveau: we already have the right src offset --- src/gallium/drivers/nv04/nv04_surface_2d.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 63f212556f..d220c21c49 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -107,7 +107,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, const unsigned sub_w = w > max_w ? max_w : w; const unsigned sub_h = h > max_h ? max_h : h; unsigned cx, cy, level_w, level_h; - int i, src_offset = src->offset, dst_offset = dst->offset; + int i, dst_offset = dst->offset; /* POT or GTFO */ assert(!(w & (w - 1)) && !(h & (h - 1))); @@ -131,7 +131,6 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, level_w = w; level_h = h; for (i=0; ilevel; i++) { - src_offset += level_w * level_h * src->block.size; dst_offset += level_w * level_h * dst->block.size; level_w >>= 1; level_h >>= 1; @@ -161,7 +160,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, OUT_RING (chan, src->stride | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); - OUT_RELOCl(chan, src_bo, src_offset + cy * src->stride + + OUT_RELOCl(chan, src_bo, src->offset + cy * src->stride + cx * src->block.size, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); OUT_RING (chan, 0); -- cgit v1.2.3 From 7b66b24c2ea127aa8f58f38a0cf4e834b58c2aa7 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 22:04:56 +0100 Subject: nouveau: stop with 0 dimension --- src/gallium/drivers/nv04/nv04_surface_2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index d220c21c49..ffb17ea4ca 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -130,7 +130,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, /* FIXME: Find right src and dst offset, given mipmap level */ level_w = w; level_h = h; - for (i=0; ilevel; i++) { + for (i=0; ilevel && level_w && level_h; i++) { dst_offset += level_w * level_h * dst->block.size; level_w >>= 1; level_h >>= 1; -- cgit v1.2.3 From 24c379badba888bd58cd759865e454e02235c65a Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 22:22:06 +0100 Subject: nouveau: revert all my changes here, not the right way --- src/gallium/drivers/nv04/nv04_surface_2d.c | 31 +++++++++--------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index ffb17ea4ca..8530849689 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -1,7 +1,6 @@ #include "pipe/p_context.h" #include "pipe/p_format.h" #include "util/u_memory.h" -#include "util/u_math.h" #include "nouveau/nouveau_winsys.h" #include "nouveau/nouveau_util.h" @@ -106,8 +105,8 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, const unsigned max_h = 1024; const unsigned sub_w = w > max_w ? max_w : w; const unsigned sub_h = h > max_h ? max_h : h; - unsigned cx, cy, level_w, level_h; - int i, dst_offset = dst->offset; + unsigned cx = 0; + unsigned cy = 0; /* POT or GTFO */ assert(!(w & (w - 1)) && !(h & (h - 1))); @@ -118,29 +117,19 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_FORMAT, 1); OUT_RING (chan, nv04_surface_format(dst->format) | - log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | - log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); - + log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT | + log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT); + BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1); OUT_RELOCo(chan, src_bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1); OUT_RING (chan, swzsurf->handle); - /* FIXME: Find right src and dst offset, given mipmap level */ - level_w = w; - level_h = h; - for (i=0; ilevel && level_w && level_h; i++) { - dst_offset += level_w * level_h * dst->block.size; - level_w >>= 1; - level_h >>= 1; - } - for (cy = 0; cy < h; cy += sub_h) { for (cx = 0; cx < w; cx += sub_w) { - BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, dst_bo, dst_offset + nv04_swizzle_bits(cx, cy) * + OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx, cy) * dst->block.size, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); @@ -259,8 +248,7 @@ nv04_surface_copy(struct nv04_surface_2d *ctx, struct pipe_surface *dst, assert(src->format == dst->format); /* Setup transfer to swizzle the texture to vram if needed */ - /* FIXME/TODO: check proper limits of this operation */ - if (src_linear ^ dst_linear) { + if (src_linear && !dst_linear && w > 1 && h > 1) { nv04_surface_copy_swizzle(ctx, dst, dx, dy, src, sx, sy, w, h); return; } @@ -268,7 +256,8 @@ nv04_surface_copy(struct nv04_surface_2d *ctx, struct pipe_surface *dst, /* NV_CONTEXT_SURFACES_2D has buffer alignment restrictions, fallback * to NV_MEMORY_TO_MEMORY_FORMAT in this case. */ - if ((src->offset & 63) || (dst->offset & 63)) { + if ((src->offset & 63) || (dst->offset & 63) || + (src->stride & 63) || (dst->stride & 63)) { nv04_surface_copy_m2mf(ctx, dst, dx, dy, src, sx, sy, w, h); return; } @@ -457,5 +446,3 @@ nv04_surface_2d_init(struct nouveau_winsys *nvws) ctx->fill = nv04_surface_fill; return ctx; } - - -- cgit v1.2.3 From c2be521d24eddb907ff556c0a8ec854a157ef9bc Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 10 Feb 2009 22:22:55 +0100 Subject: nouveau: nv30: fix miptree organization to have swizzled texture+mipmap at the right places --- src/gallium/drivers/nv30/nv30_miptree.c | 41 ++++++++++++++++++++++----------- src/gallium/drivers/nv30/nv30_screen.c | 2 ++ 2 files changed, 30 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 23f8829321..fe13f50ebb 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -8,10 +8,14 @@ static void nv30_miptree_layout(struct nv30_miptree *nv30mt) { struct pipe_texture *pt = &nv30mt->base; - boolean swizzled = FALSE; uint width = pt->width[0], height = pt->height[0], depth = pt->depth[0]; uint offset = 0; - int nr_faces, l, f, pitch; + int nr_faces, l, f; + uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER | + PIPE_TEXTURE_USAGE_DEPTH_STENCIL | + PIPE_TEXTURE_USAGE_RENDER_TARGET | + PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_PRIMARY); if (pt->target == PIPE_TEXTURE_CUBE) { nr_faces = 6; @@ -22,7 +26,6 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt) nr_faces = 1; } - pitch = pt->width[0]; for (l = 0; l <= pt->last_level; l++) { pt->width[l] = width; pt->height[l] = height; @@ -30,11 +33,11 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt) pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); - if (swizzled) - pitch = pt->nblocksx[l]; - pitch = align(pitch, 64); + if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) + nv30mt->level[l].pitch = align(pt->width[0] * pt->block.size, 64); + else + nv30mt->level[l].pitch = pt->width[l] * pt->block.size; - nv30mt->level[l].pitch = pitch * pt->block.size; nv30mt->level[l].image_offset = CALLOC(nr_faces, sizeof(unsigned)); @@ -44,10 +47,17 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt) } for (f = 0; f < nr_faces; f++) { - for (l = 0; l <= pt->last_level; l++) { + for (l = 0; l < pt->last_level; l++) { nv30mt->level[l].image_offset[f] = offset; - offset += nv30mt->level[l].pitch * pt->height[l]; + + if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) + offset += align(nv30mt->level[l].pitch * pt->height[l], 64); + else + offset += nv30mt->level[l].pitch * pt->height[l]; } + + nv30mt->level[l].image_offset[f] = offset; + offset += nv30mt->level[l].pitch * pt->height[l]; } nv30mt->total_size = offset; @@ -74,7 +84,8 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY | - PIPE_TEXTURE_USAGE_DISPLAY_TARGET)) ++ PIPE_TEXTURE_USAGE_DISPLAY_TARGET | ++ PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC) @@ -85,7 +96,11 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_X8R8G8B8_UNORM: case PIPE_FORMAT_R16_SNORM: - break; + { + if (debug_get_bool_option("NOUVEAU_NO_SWIZZLE", FALSE)) + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; + break; + } default: mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; } @@ -148,8 +163,8 @@ nv30_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt) } if (mt->shadow_tex) { - assert(mt->shadow_surface); - pscreen->tex_surface_release(pscreen, &mt->shadow_surface); + if (mt->shadow_surface) + pscreen->tex_surface_release(pscreen, &mt->shadow_surface); nv30_miptree_release(pscreen, &mt->shadow_tex); } diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index e3c9b42044..c97a73f0b1 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -206,6 +206,8 @@ nv30_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface) nvscreen->eng2d->copy(nvscreen->eng2d, surface, 0, 0, surface_to_unmap, 0, 0, surface->width, surface->height); + + screen->tex_surface_release(screen, &surface_to_unmap); } } -- cgit v1.2.3 From 14d808f8fdc41a26cea5264e47a24c903e54ce93 Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Tue, 10 Feb 2009 16:36:33 -0500 Subject: nouveau: nv40 swizzled mipmap fixes. --- src/gallium/drivers/nv04/nv04_surface_2d.c | 4 ++-- src/gallium/drivers/nv40/nv40_miptree.c | 38 +++++++++++++++++++++--------- src/gallium/drivers/nv40/nv40_screen.c | 2 ++ 3 files changed, 31 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 8530849689..230cfd17dd 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -105,8 +105,8 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, const unsigned max_h = 1024; const unsigned sub_w = w > max_w ? max_w : w; const unsigned sub_h = h > max_h ? max_h : h; - unsigned cx = 0; - unsigned cy = 0; + unsigned cx; + unsigned cy; /* POT or GTFO */ assert(!(w & (w - 1)) && !(h & (h - 1))); diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index 9bef23ad1f..e4f8df910a 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -10,7 +10,12 @@ nv40_miptree_layout(struct nv40_miptree *mt) struct pipe_texture *pt = &mt->base; uint width = pt->width[0], height = pt->height[0], depth = pt->depth[0]; uint offset = 0; - int nr_faces, l, f, pitch; + int nr_faces, l, f; + uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER | + PIPE_TEXTURE_USAGE_DEPTH_STENCIL | + PIPE_TEXTURE_USAGE_RENDER_TARGET | + PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_PRIMARY); if (pt->target == PIPE_TEXTURE_CUBE) { nr_faces = 6; @@ -21,7 +26,6 @@ nv40_miptree_layout(struct nv40_miptree *mt) nr_faces = 1; } - pitch = pt->width[0]; for (l = 0; l <= pt->last_level; l++) { pt->width[l] = width; pt->height[l] = height; @@ -29,11 +33,11 @@ nv40_miptree_layout(struct nv40_miptree *mt) pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); - if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) - pitch = pt->nblocksx[l]; - pitch = align(pitch, 64); + if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) + mt->level[l].pitch = align(pt->width[0] * pt->block.size, 64); + else + mt->level[l].pitch = pt->width[l] * pt->block.size; - mt->level[l].pitch = pitch * pt->block.size; mt->level[l].image_offset = CALLOC(nr_faces, sizeof(unsigned)); @@ -43,10 +47,17 @@ nv40_miptree_layout(struct nv40_miptree *mt) } for (f = 0; f < nr_faces; f++) { - for (l = 0; l <= pt->last_level; l++) { + for (l = 0; l < pt->last_level; l++) { mt->level[l].image_offset[f] = offset; - offset += mt->level[l].pitch * pt->height[l]; + + if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) + offset += align(mt->level[l].pitch * pt->height[l], 64); + else + offset += mt->level[l].pitch * pt->height[l]; } + + mt->level[l].image_offset[f] = offset; + offset += mt->level[l].pitch * pt->height[l]; } mt->total_size = offset; @@ -75,7 +86,8 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY | - PIPE_TEXTURE_USAGE_DISPLAY_TARGET)) + PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC) @@ -86,7 +98,11 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_X8R8G8B8_UNORM: case PIPE_FORMAT_R16_SNORM: + { + if (debug_get_bool_option("NOUVEAU_NO_SWIZZLE", FALSE)) + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; break; + } default: mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; } @@ -149,8 +165,8 @@ nv40_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt) } if (mt->shadow_tex) { - assert(mt->shadow_surface); - pscreen->tex_surface_release(pscreen, &mt->shadow_surface); + if (mt->shadow_surface) + pscreen->tex_surface_release(pscreen, &mt->shadow_surface); nv40_miptree_release(pscreen, &mt->shadow_tex); } diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c index 88a329ea24..2372bc8441 100644 --- a/src/gallium/drivers/nv40/nv40_screen.c +++ b/src/gallium/drivers/nv40/nv40_screen.c @@ -214,6 +214,8 @@ nv40_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface) nvscreen->eng2d->copy(nvscreen->eng2d, surface, 0, 0, surface_to_unmap, 0, 0, surface->width, surface->height); + + screen->tex_surface_release(screen, &surface_to_unmap); } } -- cgit v1.2.3 From 46ae1abbac6837d051c10b2e8b57eab3d4958ff4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Feb 2009 15:35:25 -0700 Subject: mesa: fix/change state validation order for program/texture state Program state needs to be updated before texture state since the later depends on the former. Fixes piglit texgen failure. The second time through the modes (press 't' three times) we disable the fragment program and return to conventional texture mode. State validation failed here because update_texture() saw stale fragment program state. --- src/mesa/main/state.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 6fe54c753f..2c3177b9e2 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -429,6 +429,18 @@ _mesa_update_state_locked( GLcontext *ctx ) if (MESA_VERBOSE & VERBOSE_STATE) _mesa_print_state("_mesa_update_state", new_state); + if (ctx->FragmentProgram._MaintainTexEnvProgram) { + prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR); + } + if (ctx->VertexProgram._MaintainTnlProgram) { + prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | + _NEW_TRANSFORM | _NEW_POINT | + _NEW_FOG | _NEW_LIGHT | + _MESA_NEW_NEED_EYE_COORDS); + } + if (new_state & prog_flags) + update_program( ctx ); + if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION)) _mesa_update_modelview_project( ctx, new_state ); @@ -488,19 +500,6 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & _MESA_NEW_NEED_EYE_COORDS) _mesa_update_tnl_spaces( ctx, new_state ); - if (ctx->FragmentProgram._MaintainTexEnvProgram) { - prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR); - } - if (ctx->VertexProgram._MaintainTnlProgram) { - prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | - _NEW_TRANSFORM | _NEW_POINT | - _NEW_FOG | _NEW_LIGHT | - _MESA_NEW_NEED_EYE_COORDS); - } - if (new_state & prog_flags) - update_program( ctx ); - - /* * Give the driver a chance to act upon the new_state flags. -- cgit v1.2.3 From 1ed5fe5cbfb64c57997ec46684748f8ae516d19c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Feb 2009 15:43:05 -0700 Subject: mesa: s/_IMAGE_NEW_TRANSFER_STATE/_MESA_NEW_TRANSFER_STATE/ to be more consistant with other flags --- src/mesa/main/mtypes.h | 8 +++++++- src/mesa/main/pixel.c | 2 +- src/mesa/main/state.c | 2 +- src/mesa/main/teximage.c | 22 +++++++++++----------- 4 files changed, 20 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 509da06d09..92bce76ad5 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2842,6 +2842,10 @@ struct gl_matrix_stack /*@}*/ +/** + * Composite state flags + */ +/*@{*/ #define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \ _NEW_TEXTURE | \ _NEW_POINT | \ @@ -2851,7 +2855,9 @@ struct gl_matrix_stack #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ _NEW_TEXTURE) -#define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX) +#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL | \ + _NEW_COLOR_MATRIX) +/*@}*/ diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 8d24a201f0..52781e048e 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -828,7 +828,7 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) /* References ColorMatrix.type (derived above). */ - if (new_state & _IMAGE_NEW_TRANSFER_STATE) + if (new_state & _MESA_NEW_TRANSFER_STATE) update_image_transfer_state(ctx); } diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 2c3177b9e2..19d58b596f 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -463,7 +463,7 @@ _mesa_update_state_locked( GLcontext *ctx ) _mesa_update_stencil( ctx ); #if FEATURE_pixel_transfer - if (new_state & _IMAGE_NEW_TRANSFER_STATE) + if (new_state & _MESA_NEW_TRANSFER_STATE) _mesa_update_pixel( ctx, new_state ); #endif diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 9519d89e4a..18ca8450d3 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2420,7 +2420,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -2526,7 +2526,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -2627,7 +2627,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -2720,7 +2720,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve @@ -2780,7 +2780,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve @@ -2840,7 +2840,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset, @@ -2896,7 +2896,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve @@ -2961,7 +2961,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve @@ -3029,7 +3029,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); if (copytexsubimage_error_check1(ctx, 1, target, level)) @@ -3084,7 +3084,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); if (copytexsubimage_error_check1(ctx, 2, target, level)) @@ -3139,7 +3139,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); if (copytexsubimage_error_check1(ctx, 3, target, level)) -- cgit v1.2.3 From c936a6083e2a0bace5f3937bd2c90371aedd9bea Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Feb 2009 10:12:44 -0700 Subject: intel: minor reformatting, comments --- src/mesa/drivers/dri/intel/intel_swapbuffers.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_swapbuffers.c b/src/mesa/drivers/dri/intel/intel_swapbuffers.c index c135166435..7d035b9f6e 100644 --- a/src/mesa/drivers/dri/intel/intel_swapbuffers.c +++ b/src/mesa/drivers/dri/intel/intel_swapbuffers.c @@ -43,7 +43,6 @@ GLuint intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv) { - if (!intel->intelScreen->driScrnPriv->dri2.enabled && intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { volatile drm_i915_sarea_t *sarea = intel->sarea; @@ -77,11 +76,14 @@ intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv) return flags; } else { - return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; + return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; } } +/** + * Called from driSwapBuffers() + */ void intelSwapBuffers(__DRIdrawablePrivate * dPriv) { @@ -130,7 +132,6 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv) intel_fb->swap_ust = ust; } drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE); - } else { /* XXX this shouldn't be an error but we can't handle it for now */ @@ -138,6 +139,10 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv) } } + +/** + * Called from driCopySubBuffer() + */ void intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h) { -- cgit v1.2.3 From 537d3ed6f3112fdf16fd853ada0e0bcc8bd83227 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Feb 2009 16:28:25 -0700 Subject: mesa: another fix for program/texture state validation This fixes a regression introduced in 46ae1abbac6837d051c10b2e8b57eab3d4958ff4 Break program validation into two steps, do part before texture state validation and do the rest after: 1. Determine Vertex/Fragment _Enabled state. 2. Update texture state. 3. Determine pointers to current Vertex/Fragment programs (which may involve generating new "fixed-function" programs). See comments in the code for more details of the dependencies. --- src/mesa/main/state.c | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 19d58b596f..3cf70d6a3c 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -173,13 +173,16 @@ update_arrays( GLcontext *ctx ) } +/** + * Update the following fields: + * ctx->VertexProgram._Enabled + * ctx->FragmentProgram._Enabled + * ctx->ATIFragmentShader._Enabled + * This needs to be done before texture state validation. + */ static void -update_program(GLcontext *ctx) +update_program_enables(GLcontext *ctx) { - const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; - const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; - const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; - /* These _Enabled flags indicate if the program is enabled AND valid. */ ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled && ctx->VertexProgram.Current->Base.Instructions; @@ -187,6 +190,25 @@ update_program(GLcontext *ctx) && ctx->FragmentProgram.Current->Base.Instructions; ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled && ctx->ATIFragmentShader.Current->Instructions[0]; +} + + +/** + * Update vertex/fragment program state. In particular, update these fields: + * ctx->VertexProgram._Current + * ctx->VertexProgram._TnlProgram, + * These point to the highest priority enabled vertex/fragment program or are + * NULL if fixed-function processing is to be done. + * + * This function needs to be called after texture state validation in case + * we're generating a fragment program from fixed-function texture state. + */ +static void +update_program(GLcontext *ctx) +{ + const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; + const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; + const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; /* * Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current @@ -429,6 +451,7 @@ _mesa_update_state_locked( GLcontext *ctx ) if (MESA_VERBOSE & VERBOSE_STATE) _mesa_print_state("_mesa_update_state", new_state); + /* Determine which state flags effect vertex/fragment program state */ if (ctx->FragmentProgram._MaintainTexEnvProgram) { prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR); } @@ -438,8 +461,13 @@ _mesa_update_state_locked( GLcontext *ctx ) _NEW_FOG | _NEW_LIGHT | _MESA_NEW_NEED_EYE_COORDS); } + + /* + * Now update derived state info + */ + if (new_state & prog_flags) - update_program( ctx ); + update_program_enables( ctx ); if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION)) _mesa_update_modelview_project( ctx, new_state ); @@ -500,6 +528,8 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & _MESA_NEW_NEED_EYE_COORDS) _mesa_update_tnl_spaces( ctx, new_state ); + if (new_state & prog_flags) + update_program( ctx ); /* * Give the driver a chance to act upon the new_state flags. -- cgit v1.2.3 From 9fd26daec24f21dbe17afcb2e2ab272667ee9a69 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Feb 2009 16:30:24 -0700 Subject: mesa: remove the unused _mesa_UpdateTexEnvProgram() function --- src/mesa/main/texenvprogram.c | 36 ------------------------------------ src/mesa/main/texenvprogram.h | 2 -- 2 files changed, 38 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 066f3bd0be..d1f03405c1 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1261,39 +1261,3 @@ _mesa_get_fixed_func_fragment_program(GLcontext *ctx) return prog; } - - - -/** - * If _MaintainTexEnvProgram is set we'll generate a fragment program that - * implements the current texture env/combine mode. - * This function generates that program and puts it into effect. - */ -void -_mesa_UpdateTexEnvProgram( GLcontext *ctx ) -{ - const struct gl_fragment_program *prev = ctx->FragmentProgram._Current; - - ASSERT(ctx->FragmentProgram._MaintainTexEnvProgram); - - /* If a conventional fragment program/shader isn't in effect... */ - if (!ctx->FragmentProgram._Enabled && - (!ctx->Shader.CurrentProgram || - !ctx->Shader.CurrentProgram->FragmentProgram) ) - { - struct gl_fragment_program *newProg; - - newProg = _mesa_get_fixed_func_fragment_program(ctx); - - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, newProg); - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, newProg); - } - - /* Tell the driver about the change. Could define a new target for - * this? - */ - if (ctx->FragmentProgram._Current != prev && ctx->Driver.BindProgram) { - ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, - (struct gl_program *) ctx->FragmentProgram._Current); - } -} diff --git a/src/mesa/main/texenvprogram.h b/src/mesa/main/texenvprogram.h index a7aa60cf37..0a162d2e7a 100644 --- a/src/mesa/main/texenvprogram.h +++ b/src/mesa/main/texenvprogram.h @@ -32,6 +32,4 @@ extern struct gl_fragment_program * _mesa_get_fixed_func_fragment_program(GLcontext *ctx); -extern void _mesa_UpdateTexEnvProgram( GLcontext *ctx ); - #endif -- cgit v1.2.3 From 680c708deeb4d18474cf7ba86c587dede51d3633 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 8 Feb 2009 15:22:34 +0100 Subject: dri2: Initialize variables for the getbuffers round-trip reduction. Missed setting the initial values which usually didn't hurt at runtime. --- src/glx/x11/dri2_glx.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index 41861d5d27..b878f05dda 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -170,6 +170,7 @@ static __GLXDRIdrawable *dri2CreateDrawable(__GLXscreenConfigs *psc, pdraw->base.xDrawable = xDrawable; pdraw->base.drawable = drawable; pdraw->base.psc = psc; + pdraw->bufferCount = 0; pdraw->configureSeqno = ~0; DRI2CreateDrawable(psc->dpy, xDrawable); @@ -440,6 +441,7 @@ _X_HIDDEN __GLXDRIdisplay *dri2CreateDisplay(Display *dpy) dri2ConfigureNotifyProc); pdp->driPatch = 0; + pdp->configureSeqno = 0; pdp->base.destroyDisplay = dri2DestroyDisplay; pdp->base.createScreen = dri2CreateScreen; -- cgit v1.2.3 From f967e8b507990f0d7986e0f83924e6587d70200d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 8 Feb 2009 15:26:30 +0100 Subject: dri2: Don't crash if the server returns more buffers than expected. --- src/glx/x11/dri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c index 3b48cd9c1c..f967432b99 100644 --- a/src/glx/x11/dri2.c +++ b/src/glx/x11/dri2.c @@ -253,7 +253,7 @@ DRI2Buffer *DRI2GetBuffers(Display *dpy, XID drawable, *height = rep.height; *outCount = rep.count; - buffers = Xmalloc(count * sizeof buffers[0]); + buffers = Xmalloc(rep.count * sizeof buffers[0]); if (buffers == NULL) { _XEatData(dpy, rep.count * sizeof repBuffer); UnlockDisplay(dpy); -- cgit v1.2.3 From f82f1ffba9f2e5971a6a3f3927ae3b22b798bab2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 8 Feb 2009 15:39:51 +0100 Subject: intel: don't crash when dri2 tells us about buffers we don't care about. --- src/mesa/drivers/dri/intel/intel_context.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 0d9487b99a..7a93801ee0 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -254,6 +254,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) return; } + if (rb == NULL) + continue; + if (rb->region) { dri_bo_flink(rb->region->buffer, &name); if (name == buffers[i].name) -- cgit v1.2.3 From d11981e0d722282894b5012d37b2960ee3fbfac2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 Feb 2009 15:25:30 +0100 Subject: intel: Fix some state leakage of {Client,}ActiveTexture in metaops. Found while debugging cairo-gl. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 1 + src/mesa/drivers/dri/intel/intel_pixel_draw.c | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 3a01f63dc7..1db7f5594e 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -495,6 +495,7 @@ intel_texture_bitmap(GLcontext * ctx, texcoords[3][1] = 1.0; _mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices); + _mesa_ClientActiveTextureARB(GL_TEXTURE0); _mesa_TexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &texcoords); _mesa_Enable(GL_VERTEX_ARRAY); _mesa_Enable(GL_TEXTURE_COORD_ARRAY); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index bb36649dac..0c9cf08ab9 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -72,6 +72,7 @@ intel_texture_drawpixels(GLcontext * ctx, GLfloat vertices[4][4]; GLfloat texcoords[4][2]; GLfloat z; + GLint old_active_texture; /* We're going to mess with texturing with no regard to existing texture * state, so if there is some set up we have to bail. @@ -125,6 +126,7 @@ intel_texture_drawpixels(GLcontext * ctx, /* XXX: pixel store stuff */ _mesa_Disable(GL_POLYGON_STIPPLE); + old_active_texture = ctx->Texture.CurrentUnit; _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); _mesa_Enable(GL_TEXTURE_2D); _mesa_GenTextures(1, &texname); @@ -176,12 +178,15 @@ intel_texture_drawpixels(GLcontext * ctx, texcoords[3][1] = 1.0; _mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices); + _mesa_ClientActiveTextureARB(GL_TEXTURE0); _mesa_TexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &texcoords); _mesa_Enable(GL_VERTEX_ARRAY); _mesa_Enable(GL_TEXTURE_COORD_ARRAY); CALL_DrawArrays(ctx->Exec, (GL_TRIANGLE_FAN, 0, 4)); intel_meta_restore_transform(intel); + + _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); _mesa_PopClientAttrib(); _mesa_PopAttrib(); @@ -209,6 +214,7 @@ intel_stencil_drawpixels(GLcontext * ctx, struct gl_pixelstore_attrib old_unpack; GLstencil *stencil_pixels; int row; + GLint old_active_texture; if (format != GL_STENCIL_INDEX) return GL_FALSE; @@ -270,6 +276,7 @@ intel_stencil_drawpixels(GLcontext * ctx, GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); old_fb_name = ctx->DrawBuffer->Name; + old_active_texture = ctx->Texture.CurrentUnit; _mesa_Disable(GL_POLYGON_STIPPLE); _mesa_Disable(GL_DEPTH_TEST); @@ -355,6 +362,7 @@ intel_stencil_drawpixels(GLcontext * ctx, texcoords[3][1] = 1.0; _mesa_VertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &vertices); + _mesa_ClientActiveTextureARB(GL_TEXTURE0); _mesa_TexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &texcoords); _mesa_Enable(GL_VERTEX_ARRAY); _mesa_Enable(GL_TEXTURE_COORD_ARRAY); @@ -362,6 +370,7 @@ intel_stencil_drawpixels(GLcontext * ctx, intel_meta_restore_transform(intel); + _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, old_fb_name); _mesa_PopClientAttrib(); -- cgit v1.2.3 From 0b63f6449e095fa3b5ef510e1c1eadc2e0e0ea36 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 Feb 2009 14:55:31 +0100 Subject: intel: Speed up glDrawPixels(GL_ALPHA) by using an alpha texture format. --- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 0c9cf08ab9..7be7ea82b3 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -73,6 +73,7 @@ intel_texture_drawpixels(GLcontext * ctx, GLfloat texcoords[4][2]; GLfloat z; GLint old_active_texture; + GLenum internalFormat; /* We're going to mess with texturing with no regard to existing texture * state, so if there is some set up we have to bail. @@ -134,11 +135,11 @@ intel_texture_drawpixels(GLcontext * ctx, _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); _mesa_TexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - /* - _mesa_TexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); - _mesa_TexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE); - */ - _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, format, + if (type == GL_ALPHA) + internalFormat = GL_ALPHA; + else + internalFormat = GL_RGBA; + _mesa_TexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, 0, format, type, pixels); intel_meta_set_passthrough_transform(intel); -- cgit v1.2.3 From 01bc4d441fd6821ad9fc20d5e9544e4e587e4ff0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 Feb 2009 15:55:15 -0800 Subject: intel: Don't do the extra MI_FLUSH in flushing except when doing glFlush(). Everything other than "make sure the last rendering ends up visible on the screen" doesn't need that behavior. --- src/mesa/drivers/dri/intel/intel_context.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 7a93801ee0..d7ccfa0605 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -365,9 +365,8 @@ intelInvalidateState(GLcontext * ctx, GLuint new_state) intel->vtbl.invalidate_state( intel, new_state ); } - -void -intelFlush(GLcontext * ctx) +static void +intel_flush(GLcontext *ctx, GLboolean needs_mi_flush) { struct intel_context *intel = intel_context(ctx); @@ -381,12 +380,25 @@ intelFlush(GLcontext * ctx) * lands onscreen in a timely manner, even if the X Server doesn't trigger * a flush for us. */ - intel_batchbuffer_emit_mi_flush(intel->batch); + if (needs_mi_flush) + intel_batchbuffer_emit_mi_flush(intel->batch); if (intel->batch->map != intel->batch->ptr) intel_batchbuffer_flush(intel->batch); } +void +intelFlush(GLcontext * ctx) +{ + intel_flush(ctx, GL_FALSE); +} + +static void +intel_glFlush(GLcontext *ctx) +{ + intel_flush(ctx, GL_TRUE); +} + void intelFinish(GLcontext * ctx) { @@ -413,7 +425,7 @@ intelInitDriverFunctions(struct dd_function_table *functions) { _mesa_init_driver_functions(functions); - functions->Flush = intelFlush; + functions->Flush = intel_glFlush; functions->Finish = intelFinish; functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; -- cgit v1.2.3 From 0cb295584ff2e3d442029fe9e079f69fafaf8dd9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Feb 2009 14:22:26 -0800 Subject: tdfx: Fix begin/endquery for current API. --- src/mesa/drivers/dri/tdfx/tdfx_dd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c index 2cef079515..8472df607a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c @@ -110,13 +110,13 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name ) static void -tdfxBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) +tdfxBeginQuery(GLcontext *ctx, struct gl_query_object *q) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); (void) q; - if (target == GL_SAMPLES_PASSED_ARB) { + if (q->Target == GL_SAMPLES_PASSED_ARB) { LOCK_HARDWARE(fxMesa); fxMesa->Glide.grFinish(); fxMesa->Glide.grReset(GR_STATS_PIXELS); @@ -126,14 +126,14 @@ tdfxBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) static void -tdfxEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) +tdfxEndQuery(GLcontext *ctx, struct gl_query_object *q) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); FxI32 total_pixels; FxI32 z_fail_pixels; - if (target == GL_SAMPLES_PASSED_ARB) { + if (q->Target == GL_SAMPLES_PASSED_ARB) { LOCK_HARDWARE(fxMesa); fxMesa->Glide.grFinish(); -- cgit v1.2.3 From e7ee7a549d9250b0020b2773f5146d2e1197c231 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Feb 2009 14:24:06 -0800 Subject: trident: Fix signedness warning. --- src/mesa/drivers/dri/trident/trident_vb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/trident/trident_vb.c b/src/mesa/drivers/dri/trident/trident_vb.c index b231f5ef15..055a914595 100644 --- a/src/mesa/drivers/dri/trident/trident_vb.c +++ b/src/mesa/drivers/dri/trident/trident_vb.c @@ -402,7 +402,7 @@ void tridentInitVB( GLcontext *ctx ) tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - tmesa->verts = (char *)ALIGN_MALLOC( size * 16 * 4, 32 ); + tmesa->verts = (GLubyte *)ALIGN_MALLOC( size * 16 * 4, 32 ); { static int firsttime = 1; -- cgit v1.2.3 From a49ff9f95e1654c7ee05101e68df51211ad81450 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Feb 2009 14:27:16 -0800 Subject: sis: fix signedness warnings --- src/mesa/drivers/dri/sis/sis_alloc.c | 8 ++++---- src/mesa/drivers/dri/sis/sis_tris.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/sis/sis_alloc.c b/src/mesa/drivers/dri/sis/sis_alloc.c index 4ca4052803..ce34e44da2 100644 --- a/src/mesa/drivers/dri/sis/sis_alloc.c +++ b/src/mesa/drivers/dri/sis/sis_alloc.c @@ -137,7 +137,7 @@ sisAllocZStencilBuffer( sisContextPtr smesa ) { int cpp = ( smesa->glCtx->Visual.depthBits + smesa->glCtx->Visual.stencilBits ) / 8; - unsigned char *addr; + char *addr; smesa->depth.bpp = cpp * 8; smesa->depth.pitch = ALIGNMENT(smesa->driDrawable->w * cpp, 4); @@ -150,7 +150,7 @@ sisAllocZStencilBuffer( sisContextPtr smesa ) addr = (char *)ALIGNMENT((unsigned long)addr, Z_BUFFER_HW_ALIGNMENT); smesa->depth.map = addr; - smesa->depth.offset = addr - smesa->FbBase; + smesa->depth.offset = addr - (char *)smesa->FbBase; /* stencil buffer is same as depth buffer */ smesa->stencil.size = smesa->depth.size; @@ -173,7 +173,7 @@ void sisAllocBackbuffer( sisContextPtr smesa ) { int cpp = smesa->bytesPerPixel; - unsigned char *addr; + char *addr; smesa->back.bpp = smesa->bytesPerPixel * 8; smesa->back.pitch = ALIGNMENT(smesa->driDrawable->w * cpp, 4); @@ -186,7 +186,7 @@ sisAllocBackbuffer( sisContextPtr smesa ) addr = (char *)ALIGNMENT((unsigned long)addr, DRAW_BUFFER_HW_ALIGNMENT); smesa->back.map = addr; - smesa->back.offset = addr - smesa->FbBase; + smesa->back.offset = addr - (char *)smesa->FbBase; } void diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index 095941aea2..76d12d07b3 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -994,7 +994,7 @@ sisFlushPrimsLocked(sisContextPtr smesa) MMIO(REG_3D_PrimitiveSet, smesa->dwPrimitiveSet); } while (smesa->vb_last < smesa->vb_cur) { - sis_emit_func(smesa, smesa->vb_last); + sis_emit_func(smesa, (char *)smesa->vb_last); smesa->vb_last += incr; } mWait3DCmdQueue(1); -- cgit v1.2.3 From 5d5ae371eaeca7e33e638af3aee1ae8e162db0a7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Feb 2009 14:30:38 -0800 Subject: intel: Add x8r8g8b8 visuals to DRI1 fbconfigs alongside a8r8gb8. This involved fixing driConcatConfigs to not return const (which had made a mess of a previous patch too). --- src/mesa/drivers/dri/common/utils.c | 6 ++-- src/mesa/drivers/dri/common/utils.h | 4 +-- src/mesa/drivers/dri/intel/intel_screen.c | 60 ++++++++++++++++++------------- src/mesa/drivers/dri/swrast/swrast.c | 9 ++--- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 17 ++++----- 5 files changed, 54 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 5175ab0abb..6b44ed9a67 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -754,10 +754,10 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, return configs; } -const __DRIconfig **driConcatConfigs(const __DRIconfig **a, - const __DRIconfig **b) +__DRIconfig **driConcatConfigs(__DRIconfig **a, + __DRIconfig **b) { - const __DRIconfig **all; + __DRIconfig **all; int i, j, index; i = 0; diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index a4ef509247..9e9e5bc224 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -134,8 +134,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, const GLenum * db_modes, unsigned num_db_modes, const uint8_t * msaa_samples, unsigned num_msaa_modes); -const __DRIconfig **driConcatConfigs(const __DRIconfig **a, - const __DRIconfig **b); +__DRIconfig **driConcatConfigs(__DRIconfig **a, + __DRIconfig **b); int driGetConfigAttrib(const __DRIconfig *config, diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 4c06170cdf..a52271158c 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -465,8 +465,6 @@ intelFillInModes(__DRIscreenPrivate *psp, __GLcontextModes *m; unsigned depth_buffer_factor; unsigned back_buffer_factor; - GLenum fb_format; - GLenum fb_type; int i; /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't @@ -501,20 +499,33 @@ intelFillInModes(__DRIscreenPrivate *psp, back_buffer_factor = (have_back_buffer) ? 3 : 1; if (pixel_bits == 16) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; + configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, back_buffer_modes, + back_buffer_factor, + msaa_samples_array, 1); } else { - fb_format = GL_BGRA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; + __DRIconfig **configs_a8r8g8b8; + __DRIconfig **configs_x8r8g8b8; + + configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, + depth_bits_array, + stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, + back_buffer_factor, + msaa_samples_array, 1); + configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV, + depth_bits_array, + stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, + back_buffer_factor, + msaa_samples_array, 1); + configs = driConcatConfigs(configs_a8r8g8b8, configs_x8r8g8b8); } - configs = driCreateConfigs(fb_format, fb_type, - depth_bits_array, stencil_bits_array, - depth_buffer_factor, back_buffer_modes, - back_buffer_factor, - msaa_samples_array, 1); - if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); @@ -686,7 +697,7 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) }; uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1]; int color; - const __DRIconfig **configs = NULL; + __DRIconfig **configs = NULL; /* Calling driInitExtensions here, with a NULL context pointer, * does not actually enable the extensions. It just makes sure @@ -747,17 +758,16 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV; for (color = 0; color < ARRAY_SIZE(fb_format); color++) { - const __DRIconfig **new_configs; - - new_configs = (const __DRIconfig **) - driCreateConfigs(fb_format[color], fb_type[color], - depth_bits, - stencil_bits, - ARRAY_SIZE(depth_bits), - back_buffer_modes, - ARRAY_SIZE(back_buffer_modes), - msaa_samples_array, ARRAY_SIZE(msaa_samples_array)); - + __DRIconfig **new_configs; + + new_configs = driCreateConfigs(fb_format[color], fb_type[color], + depth_bits, + stencil_bits, + ARRAY_SIZE(depth_bits), + back_buffer_modes, + ARRAY_SIZE(back_buffer_modes), + msaa_samples_array, + ARRAY_SIZE(msaa_samples_array)); if (configs == NULL) configs = new_configs; else @@ -770,7 +780,7 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) return NULL; } - return configs; + return (const __DRIconfig **)configs; } const struct __DriverAPIRec driDriverAPI = { diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index b00f4ff2fe..2e7f11327e 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -127,7 +127,7 @@ setupLoaderExtensions(__DRIscreen *psp, } } -static const __DRIconfig ** +static __DRIconfig ** swrastFillInModes(__DRIscreen *psp, unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer) @@ -200,7 +200,7 @@ swrastFillInModes(__DRIscreen *psp, return NULL; } - return (const __DRIconfig **)configs; + return configs; } static __DRIscreen * @@ -209,7 +209,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, { static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; - const __DRIconfig **configs8, **configs16, **configs24, **configs32; + __DRIconfig **configs8, **configs16, **configs24, **configs32; (void) data; @@ -231,7 +231,8 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, configs16 = driConcatConfigs(configs8, configs16); configs24 = driConcatConfigs(configs16, configs24); - *driver_configs = driConcatConfigs(configs24, configs32); + *driver_configs = (const __DRIconfig **) + driConcatConfigs(configs24, configs32); driInitExtensions( NULL, card_extensions, GL_FALSE ); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 6d509a4d88..5f2f5cfff5 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -380,14 +380,15 @@ tdfxFillInModes(__DRIscreenPrivate *psp, msaa_samples_array[0] = 0; - return driCreateConfigs( - deep ? GL_RGBA : GL_RGB, - deep ? GL_UNSIGNED_INT_8_8_8_8 : GL_UNSIGNED_SHORT_5_6_5, - depth_bits_array, - stencil_bits_array, - deep ? 2 : 4, - db_modes, 2, - msaa_samples_array, 1); + return (const __DRIconfig **) + driCreateConfigs(deep ? GL_RGBA : GL_RGB, + deep ? GL_UNSIGNED_INT_8_8_8_8 : + GL_UNSIGNED_SHORT_5_6_5, + depth_bits_array, + stencil_bits_array, + deep ? 2 : 4, + db_modes, 2, + msaa_samples_array, 1); } /** -- cgit v1.2.3 From 8cadf6c0a152a5945e34ea8f6d9935ee399e6ae1 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 11 Feb 2009 13:50:43 +0000 Subject: mesa: Move statements after declarations. --- src/mesa/main/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 90a3bf1f04..fcef093ac3 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -289,8 +289,8 @@ static void dump_texture_cb(GLuint id, void *data, void *userData) { struct gl_texture_object *texObj = (struct gl_texture_object *) data; - (void) userData; int i; + (void) userData; printf("Texture %u\n", texObj->Name); printf(" Target 0x%x\n", texObj->Target); -- cgit v1.2.3 From 7892bdfc8ac5d1f29009025904eef009b687bff2 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 11 Feb 2009 13:51:34 +0000 Subject: wgl: Add a few more stubs. I wonder why we need this... It is only necessary for the MSVC build. MinGW does not require them. --- src/gallium/state_trackers/wgl/shared/stw_quirks.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/shared/stw_quirks.c b/src/gallium/state_trackers/wgl/shared/stw_quirks.c index bf1ec3fee7..0961ce3bb0 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_quirks.c +++ b/src/gallium/state_trackers/wgl/shared/stw_quirks.c @@ -55,9 +55,12 @@ void gl_dispatch_stub_560(void){} void gl_dispatch_stub_561(void){} void gl_dispatch_stub_565(void){} void gl_dispatch_stub_566(void){} +void gl_dispatch_stub_570(void){} void gl_dispatch_stub_577(void){} void gl_dispatch_stub_578(void){} +void gl_dispatch_stub_582(void){} void gl_dispatch_stub_603(void){} +void gl_dispatch_stub_607(void){} void gl_dispatch_stub_645(void){} void gl_dispatch_stub_646(void){} void gl_dispatch_stub_647(void){} @@ -67,6 +70,7 @@ void gl_dispatch_stub_650(void){} void gl_dispatch_stub_651(void){} void gl_dispatch_stub_652(void){} void gl_dispatch_stub_653(void){} +void gl_dispatch_stub_657(void){} void gl_dispatch_stub_733(void){} void gl_dispatch_stub_734(void){} void gl_dispatch_stub_735(void){} @@ -79,6 +83,7 @@ void gl_dispatch_stub_746(void){} void gl_dispatch_stub_760(void){} void gl_dispatch_stub_761(void){} void gl_dispatch_stub_763(void){} +void gl_dispatch_stub_764(void){} void gl_dispatch_stub_765(void){} void gl_dispatch_stub_766(void){} void gl_dispatch_stub_767(void){} -- cgit v1.2.3 From 98a053cfd4b5bcb6d704f1282892e99bb2052c5f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 11 Feb 2009 13:52:11 +0000 Subject: mesa: Use the stdio wrappers. snprint symbol does not exist in Windows. --- src/mesa/shader/prog_print.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index d0ed22e98e..ce48767a87 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -218,48 +218,48 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, switch (mode) { case PROG_PRINT_DEBUG: if (relAddr) - sprintf(str, "%s[ADDR+%d]", file_string(f, mode), index); + _mesa_sprintf(str, "%s[ADDR+%d]", file_string(f, mode), index); else - sprintf(str, "%s[%d]", file_string(f, mode), index); + _mesa_sprintf(str, "%s[%d]", file_string(f, mode), index); break; case PROG_PRINT_ARB: switch (f) { case PROGRAM_INPUT: - sprintf(str, "%s", arb_input_attrib_string(index, prog->Target)); + _mesa_sprintf(str, "%s", arb_input_attrib_string(index, prog->Target)); break; case PROGRAM_OUTPUT: - sprintf(str, "%s", arb_output_attrib_string(index, prog->Target)); + _mesa_sprintf(str, "%s", arb_output_attrib_string(index, prog->Target)); break; case PROGRAM_TEMPORARY: - sprintf(str, "temp%d", index); + _mesa_sprintf(str, "temp%d", index); break; case PROGRAM_ENV_PARAM: - sprintf(str, "program.env[%d]", index); + _mesa_sprintf(str, "program.env[%d]", index); break; case PROGRAM_LOCAL_PARAM: - sprintf(str, "program.local[%d]", index); + _mesa_sprintf(str, "program.local[%d]", index); break; case PROGRAM_VARYING: /* extension */ - sprintf(str, "varying[%d]", index); + _mesa_sprintf(str, "varying[%d]", index); break; case PROGRAM_CONSTANT: /* extension */ - sprintf(str, "constant[%d]", index); + _mesa_sprintf(str, "constant[%d]", index); break; case PROGRAM_UNIFORM: /* extension */ - sprintf(str, "uniform[%d]", index); + _mesa_sprintf(str, "uniform[%d]", index); break; case PROGRAM_STATE_VAR: { struct gl_program_parameter *param = prog->Parameters->Parameters + index; char *state = _mesa_program_state_string(param->StateIndexes); - sprintf(str, state); + _mesa_sprintf(str, state); _mesa_free(state); } break; case PROGRAM_ADDRESS: - sprintf(str, "A%d", index); + _mesa_sprintf(str, "A%d", index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); @@ -270,30 +270,30 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, switch (f) { case PROGRAM_INPUT: if (prog->Target == GL_VERTEX_PROGRAM_ARB) - sprintf(str, "v[%d]", index); + _mesa_sprintf(str, "v[%d]", index); else - sprintf(str, "f[%d]", index); + _mesa_sprintf(str, "f[%d]", index); break; case PROGRAM_OUTPUT: - sprintf(str, "o[%d]", index); + _mesa_sprintf(str, "o[%d]", index); break; case PROGRAM_TEMPORARY: - sprintf(str, "R%d", index); + _mesa_sprintf(str, "R%d", index); break; case PROGRAM_ENV_PARAM: - sprintf(str, "c[%d]", index); + _mesa_sprintf(str, "c[%d]", index); break; case PROGRAM_VARYING: /* extension */ - sprintf(str, "varying[%d]", index); + _mesa_sprintf(str, "varying[%d]", index); break; case PROGRAM_UNIFORM: /* extension */ - sprintf(str, "uniform[%d]", index); + _mesa_sprintf(str, "uniform[%d]", index); break; case PROGRAM_CONSTANT: /* extension */ - sprintf(str, "constant[%d]", index); + _mesa_sprintf(str, "constant[%d]", index); break; case PROGRAM_STATE_VAR: /* extension */ - sprintf(str, "state[%d]", index); + _mesa_sprintf(str, "state[%d]", index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); @@ -898,7 +898,7 @@ _mesa_write_shader_to_file(const struct gl_shader *shader) else type = "vert"; - snprintf(filename, strlen(filename), "shader_%u.%s", shader->Name, type); + _mesa_snprintf(filename, strlen(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "w"); if (!f) { fprintf(stderr, "Unable to open %s for writing\n", filename); -- cgit v1.2.3 From 1e81855566b8c9957b39ee4612cec24bea591785 Mon Sep 17 00:00:00 2001 From: Johannes Engel Date: Wed, 11 Feb 2009 11:31:05 +0100 Subject: Add install target for egl Signed-off-by: Johannes Engel Acked-by: Jakob Bornecrantz --- src/egl/Makefile | 7 +++++++ src/egl/drivers/Makefile | 6 ++++++ src/egl/drivers/demo/Makefile | 4 +++- src/egl/drivers/dri/Makefile | 2 ++ src/egl/drivers/glx/Makefile | 2 ++ src/egl/drivers/xdri/Makefile | 2 ++ src/egl/main/Makefile | 4 +++- 7 files changed, 25 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/egl/Makefile b/src/egl/Makefile index 024453f8bb..5b09e178c6 100644 --- a/src/egl/Makefile +++ b/src/egl/Makefile @@ -1,6 +1,7 @@ # src/egl/Makefile TOP = ../.. +include $(TOP)/configs/current SUBDIRS = main drivers @@ -15,6 +16,12 @@ subdirs: fi \ done +install: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) install) || exit 1 ; \ + fi \ + done clean: -@for dir in $(SUBDIRS) ; do \ diff --git a/src/egl/drivers/Makefile b/src/egl/drivers/Makefile index f0538f563f..dde4ee2255 100644 --- a/src/egl/drivers/Makefile +++ b/src/egl/drivers/Makefile @@ -16,6 +16,12 @@ subdirs: fi \ done +install: + @ for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir ; $(MAKE) install) || exit 1 ; \ + fi \ + done clean: @for dir in $(SUBDIRS) ; do \ diff --git a/src/egl/drivers/demo/Makefile b/src/egl/drivers/demo/Makefile index 6ca25aa5d6..d908cdb4b2 100644 --- a/src/egl/drivers/demo/Makefile +++ b/src/egl/drivers/demo/Makefile @@ -25,7 +25,9 @@ $(TOP)/$(LIB_DIR)/demodriver.so: $(OBJECTS) -ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \ $(OBJECTS) - +install: + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/demodriver.so $(DESTDIR)$(INSTALL_LIB_DIR) clean: -rm -f *.o diff --git a/src/egl/drivers/dri/Makefile b/src/egl/drivers/dri/Makefile index d7eba653b2..be2f9b6bea 100644 --- a/src/egl/drivers/dri/Makefile +++ b/src/egl/drivers/dri/Makefile @@ -48,6 +48,8 @@ $(TOP)/$(LIB_DIR)/libEGLdri.so: $(OBJECTS) -major 1 -minor 0 \ -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) $(LIBS) +install: $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libEGLdri.so $(DESTDIR)$(INSTALL_LIB_DIR) clean: -rm -f *.o diff --git a/src/egl/drivers/glx/Makefile b/src/egl/drivers/glx/Makefile index 3cd5276513..090a230ca3 100644 --- a/src/egl/drivers/glx/Makefile +++ b/src/egl/drivers/glx/Makefile @@ -56,6 +56,8 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(OBJECTS) -install $(TOP)/$(LIB_DIR) \ $(OBJECTS) $(DRM_LIB) $(MISC_LIBS) +install: $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/$(DRIVER_NAME) $(DESTDIR)$(INSTALL_LIB_DIR) clean: rm -f *.o diff --git a/src/egl/drivers/xdri/Makefile b/src/egl/drivers/xdri/Makefile index a721b997e6..db4b710002 100644 --- a/src/egl/drivers/xdri/Makefile +++ b/src/egl/drivers/xdri/Makefile @@ -52,6 +52,8 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(OBJECTS) -install $(TOP)/$(LIB_DIR) \ $(OBJECTS) $(DRM_LIB) $(MISC_LIBS) +install: $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/$(DRIVER_NAME) $(DESTDIR)$(INSTALL_LIB_DIR) clean: rm -f *.o diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile index 8ea60c0199..89b4a200bc 100644 --- a/src/egl/main/Makefile +++ b/src/egl/main/Makefile @@ -65,7 +65,9 @@ $(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS) -major 1 -minor 0 \ -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) $(LIBS) - +install: + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libEGL.so* $(DESTDIR)$(INSTALL_LIB_DIR) clean: -rm -f *.o *.so* -- cgit v1.2.3 From 369d1859d7bc4a6213f128718f8affc8e4f06006 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 08:16:14 -0700 Subject: glsl: fix incorrect size returned by glGetActiveUniform() for array elements. Fixes one of the issues in bug 20056. --- src/mesa/shader/shader_api.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index a5cf1ca1d4..44c28c4422 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -892,6 +892,7 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, { const struct gl_shader_program *shProg; const struct gl_program *prog; + const struct gl_program_parameter *param; GLint progPos; shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform"); @@ -917,14 +918,30 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, if (!prog || progPos < 0) return; /* should never happen */ - if (nameOut) - copy_string(nameOut, maxLength, length, - prog->Parameters->Parameters[progPos].Name); - if (size) - *size = prog->Parameters->Parameters[progPos].Size - / sizeof_glsl_type(prog->Parameters->Parameters[progPos].DataType); - if (type) - *type = prog->Parameters->Parameters[progPos].DataType; + ASSERT(progPos < prog->Parameters->NumParameters); + param = &prog->Parameters->Parameters[progPos]; + + if (nameOut) { + copy_string(nameOut, maxLength, length, param->Name); + } + + if (size) { + GLint typeSize = sizeof_glsl_type(param->DataType); + if (param->Size > typeSize) { + /* This is an array. + * Array elements are placed on vector[4] boundaries so they're + * a multiple of four floats. We round typeSize up to next multiple + * of four to get the right size below. + */ + typeSize = (typeSize + 3) & ~3; + } + /* Note that the returned size is in units of the , not bytes */ + *size = param->Size / typeSize; + } + + if (type) { + *type = param->DataType; + } } -- cgit v1.2.3 From 2c1ea0720deb9b1f90fc294a7a731270d4f4bad6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 08:46:21 -0700 Subject: glsl: fix glUniform() array bounds error checking If too many array elements are specified, they're to be silently ignored (don't raise a GL error). Fixes another issue in bug 20056. --- src/mesa/shader/shader_api.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 44c28c4422..8b9281a086 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1616,19 +1616,31 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, else { /* ordinary uniform variable */ GLsizei k, i; - GLint slots = (param->Size + 3) / 4; + const GLint slots = (param->Size + 3) / 4; + const GLint typeSize = sizeof_glsl_type(param->DataType); - if (count * elems > (GLint) param->Size) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count too large)"); - return; + if (param->Size > typeSize) { + /* an array */ + /* we'll ignore extra data below */ + } + else { + /* non-array: count must be one */ + if (count != 1) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glUniform(uniform is not an array)"); + return; + } } - - if (count > slots) - count = slots; for (k = 0; k < count; k++) { - GLfloat *uniformVal = - program->Parameters->ParameterValues[index + offset + k]; + GLfloat *uniformVal; + + if (offset + k > slots) { + /* Extra array data is ignored */ + break; + } + + uniformVal = program->Parameters->ParameterValues[index + offset + k]; if (is_integer_type(type)) { const GLint *iValues = ((const GLint *) values) + k * elems; for (i = 0; i < elems; i++) { -- cgit v1.2.3 From 4ef7a93296dd7d7480dfa00a2b085009ca8c4814 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 09:03:16 -0700 Subject: glsl: rework _mesa_get_uniform[fi]v() to avoid using a fixed size intermediate array --- src/mesa/shader/shader_api.c | 103 +++++++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 8b9281a086..290717ff55 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1185,24 +1185,30 @@ get_uniform_rows_cols(const struct gl_program_parameter *p, } -#define MAX_UNIFORM_ELEMENTS 16 - /** - * Helper for GetUniformfv(), GetUniformiv() - * Returns number of elements written to 'params' output. + * Helper for get_uniform[fi]v() functions. + * Given a shader program name and uniform location, return a pointer + * to the shader program and return the program parameter position. */ -static GLuint -get_uniformfv(GLcontext *ctx, GLuint program, GLint location, - GLfloat *params) +static void +lookup_uniform_parameter(GLcontext *ctx, GLuint program, GLint location, + struct gl_program **progOut, GLint *paramPosOut) { struct gl_shader_program *shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v"); - if (shProg) { - if (shProg->Uniforms && - location >= 0 && location < (GLint) shProg->Uniforms->NumUniforms) { - GLint progPos; - const struct gl_program *prog = NULL; + struct gl_program *prog = NULL; + GLint progPos = -1; + + /* if shProg is NULL, we'll have already recorded an error */ + if (shProg) { + if (!shProg->Uniforms || + location < 0 || + location >= (GLint) shProg->Uniforms->NumUniforms) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)"); + } + else { + /* OK, find the gl_program and program parameter location */ progPos = shProg->Uniforms->Uniforms[location].VertPos; if (progPos >= 0) { prog = &shProg->VertexProgram->Base; @@ -1213,33 +1219,11 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location, prog = &shProg->FragmentProgram->Base; } } - - ASSERT(prog); - if (prog) { - const struct gl_program_parameter *p = - &prog->Parameters->Parameters[progPos]; - GLint rows, cols, i, j, k; - - /* See uniformiv() below */ - assert(p->Size <= MAX_UNIFORM_ELEMENTS); - - get_uniform_rows_cols(p, &rows, &cols); - - k = 0; - for (i = 0; i < rows; i++) { - for (j = 0; j < cols; j++ ) { - params[k++] = prog->Parameters->ParameterValues[progPos+i][j]; - } - } - - return p->Size; - } - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)"); } } - return 0; + + *progOut = prog; + *paramPosOut = progPos; } @@ -1250,23 +1234,54 @@ static void _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location, GLfloat *params) { - (void) get_uniformfv(ctx, program, location, params); + struct gl_program *prog; + GLint paramPos; + + lookup_uniform_parameter(ctx, program, location, &prog, ¶mPos); + + if (prog) { + const struct gl_program_parameter *p = + &prog->Parameters->Parameters[paramPos]; + GLint rows, cols, i, j, k; + + get_uniform_rows_cols(p, &rows, &cols); + + k = 0; + for (i = 0; i < rows; i++) { + for (j = 0; j < cols; j++ ) { + params[k++] = prog->Parameters->ParameterValues[paramPos+i][j]; + } + } + } } /** * Called via ctx->Driver.GetUniformiv(). + * \sa _mesa_get_uniformfv, only difference is a cast. */ static void _mesa_get_uniformiv(GLcontext *ctx, GLuint program, GLint location, GLint *params) { - GLfloat fparams[MAX_UNIFORM_ELEMENTS]; - GLuint n = get_uniformfv(ctx, program, location, fparams); - GLuint i; - assert(n <= MAX_UNIFORM_ELEMENTS); - for (i = 0; i < n; i++) { - params[i] = (GLint) fparams[i]; + struct gl_program *prog; + GLint paramPos; + + lookup_uniform_parameter(ctx, program, location, &prog, ¶mPos); + + if (prog) { + const struct gl_program_parameter *p = + &prog->Parameters->Parameters[paramPos]; + GLint rows, cols, i, j, k; + + get_uniform_rows_cols(p, &rows, &cols); + + k = 0; + for (i = 0; i < rows; i++) { + for (j = 0; j < cols; j++ ) { + params[k++] = (GLint) prog->Parameters->ParameterValues[paramPos+i][j]; + } + } } } -- cgit v1.2.3 From 234f03e90ab718f5b16300a91bac477ccbabf36c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 09:05:08 -0700 Subject: glsl: raise GL_INVALID_OPERATION for glUniform(location < -1) location = -1 is silently ignored, but other negative values should raise an error. Another fix for bug 20056. --- src/mesa/shader/shader_api.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 290717ff55..e738cde791 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1700,6 +1700,11 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, if (location == -1) return; /* The standard specifies this as a no-op */ + if (location < -1) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location)"); + return; + } + split_location_offset(&location, &offset); if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) { @@ -1874,6 +1879,11 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows, if (location == -1) return; /* The standard specifies this as a no-op */ + if (location < -1) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(location)"); + return; + } + split_location_offset(&location, &offset); if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) { -- cgit v1.2.3 From 2b4f0216bf757f63c0e76eb3a9a59a486ce63051 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 09:12:34 -0700 Subject: glsl: allow setting arrays of samplers in set_program_uniform() Arrays of sampler vars haven't been tested much and might actually be broken. Will need to be revisited someday. Another fix for bug 20056. --- src/mesa/shader/shader_api.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index e738cde791..013e912e5d 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1603,27 +1603,36 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, if (param->Type == PROGRAM_SAMPLER) { /* This controls which texture unit which is used by a sampler */ GLuint texUnit, sampler; + GLint i; /* data type for setting samplers must be int */ - if (type != GL_INT || count != 1) { + if (type != GL_INT) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(only glUniform1i can be used " "to set sampler uniforms)"); return; } - sampler = (GLuint) program->Parameters->ParameterValues[index][0]; - texUnit = ((GLuint *) values)[0]; + /* XXX arrays of samplers haven't been tested much, but it's not a + * common thing... + */ + for (i = 0; i < count; i++) { + sampler = (GLuint) program->Parameters->ParameterValues[index + i][0]; + texUnit = ((GLuint *) values)[i]; + + /* check that the sampler (tex unit index) is legal */ + if (texUnit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glUniform1(invalid sampler/tex unit index)"); + return; + } - /* check that the sampler (tex unit index) is legal */ - if (texUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glUniform1(invalid sampler/tex unit index)"); - return; + /* This maps a sampler to a texture unit: */ + if (sampler < MAX_SAMPLERS) { + program->SamplerUnits[sampler] = texUnit; + } } - /* This maps a sampler to a texture unit: */ - program->SamplerUnits[sampler] = texUnit; _mesa_update_shader_textures_used(program); FLUSH_VERTICES(ctx, _NEW_TEXTURE); -- cgit v1.2.3 From 874f364e9ea3a03d29ae4b6e1c7e2843ef8b9e79 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 11 Feb 2009 16:35:12 +0000 Subject: draw: Cap max vertices instead of failing assert. --- src/gallium/auxiliary/draw/draw_pipe_vbuf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c index 5ead25efff..9153bc2f86 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c +++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c @@ -394,13 +394,14 @@ vbuf_alloc_vertices( struct vbuf_stage *vbuf ) /* even number */ vbuf->max_vertices = vbuf->max_vertices & ~1; + if(vbuf->max_vertices >= UNDEFINED_VERTEX_ID) + vbuf->max_vertices = UNDEFINED_VERTEX_ID - 1; + /* Must always succeed -- driver gives us a * 'max_vertex_buffer_bytes' which it guarantees it can allocate, * and it will flush itself if necessary to do so. If this does * fail, we are basically without usable hardware. */ - assert(vbuf->max_vertices < UNDEFINED_VERTEX_ID); - vbuf->vertices = (uint *) vbuf->render->allocate_vertices(vbuf->render, (ushort) vbuf->vertex_size, (ushort) vbuf->max_vertices); -- cgit v1.2.3 From 36b83f519864e20a8ddd69b7ced55e89624a390a Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Wed, 11 Feb 2009 11:52:32 -0500 Subject: nouveau: 1xN, Nx1 levels of a swizzled mip tree shouldn't be aligned. --- src/gallium/drivers/nv30/nv30_miptree.c | 3 ++- src/gallium/drivers/nv40/nv40_miptree.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index fe13f50ebb..510c94d4e6 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -50,7 +50,8 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt) for (l = 0; l < pt->last_level; l++) { nv30mt->level[l].image_offset[f] = offset; - if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) + if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR) && + pt->width[l + 1] > 1 && pt->height[l + 1] > 1) offset += align(nv30mt->level[l].pitch * pt->height[l], 64); else offset += nv30mt->level[l].pitch * pt->height[l]; diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index e4f8df910a..e38b1e7f5c 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -50,7 +50,8 @@ nv40_miptree_layout(struct nv40_miptree *mt) for (l = 0; l < pt->last_level; l++) { mt->level[l].image_offset[f] = offset; - if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) + if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR) && + pt->width[l + 1] > 1 && pt->height[l + 1] > 1) offset += align(mt->level[l].pitch * pt->height[l], 64); else offset += mt->level[l].pitch * pt->height[l]; -- cgit v1.2.3 From 277bf235f169c5ab885028360a5dfdf6a970616a Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 11 Feb 2009 09:55:20 -0800 Subject: Add external pixman CFLAGS after all internal include paths With the pixman CFLAGS at the beginning of the command line, my build was picking up the glcore.h from glproto, which doesn't have any of the TFP fields in __GLcontextmodes. Signed-off-by: Dan Nicholson --- src/gallium/state_trackers/egl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile index 17d1a7a8e4..c9124b1c90 100644 --- a/src/gallium/state_trackers/egl/Makefile +++ b/src/gallium/state_trackers/egl/Makefile @@ -7,13 +7,13 @@ TOP = ../../../.. include ${TOP}/configs/current CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \ - $(shell pkg-config --cflags pixman-1 xorg-server) \ -I${GALLIUMDIR}/include \ -I${GALLIUMDIR}/auxiliary \ -I${TOP}/src/mesa/drivers/dri/common \ -I${TOP}/src/mesa \ -I$(TOP)/include \ -I$(TOP)/src/egl/main \ + $(shell pkg-config --cflags pixman-1 xorg-server) \ ${LIBDRM_CFLAGS} ############################################# -- cgit v1.2.3 From 2218592d47b963791105f5b8fa1a0b3f3a07f674 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 13:52:17 -0700 Subject: mesa: get rid of _math_init() Only VBO uses the evaluator code so call _math_init_eval() there. Only TNL uses the transform/translate code so call _math_init_transformation() and _math_init_translate9) there. This is a step toward resolving some symbol collisions between Mesa's and gallium's x86 codegen. Have VBO and TNL modules call _math_init_transformation() --- src/mesa/main/context.c | 7 ------- src/mesa/math/m_xform.c | 8 -------- src/mesa/math/mathmod.h | 2 -- src/mesa/tnl/t_context.c | 5 +++++ src/mesa/vbo/vbo_context.c | 3 +++ 5 files changed, 8 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 39c7fa037e..c5b90d9cda 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -151,10 +151,7 @@ #include "shader/atifragshader.h" #endif #if _HAVE_FULL_GL -#include "math/m_translate.h" #include "math/m_matrix.h" -#include "math/m_xform.h" -#include "math/mathmod.h" #endif #ifdef USE_SPARC_ASM @@ -387,13 +384,9 @@ one_time_init( GLcontext *ctx ) _mesa_init_sqrt_table(); -#if _HAVE_FULL_GL - _math_init(); - for (i = 0; i < 256; i++) { _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F; } -#endif #ifdef USE_SPARC_ASM _mesa_init_sparc_glapi_relocs(); diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index 901ae5b416..fdc8abd434 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -220,11 +220,3 @@ _math_init_transformation( void ) _mesa_init_all_x86_64_transform_asm(); #endif } - -void -_math_init( void ) -{ - _math_init_transformation(); - _math_init_translate(); - _math_init_eval(); -} diff --git a/src/mesa/math/mathmod.h b/src/mesa/math/mathmod.h index 6fbaaea94b..fb0862b5b1 100644 --- a/src/mesa/math/mathmod.h +++ b/src/mesa/math/mathmod.h @@ -36,6 +36,4 @@ #ifndef _MESA_MATH_H_ #define _MESA_MATH_H_ -extern void _math_init( void ); - #endif diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 7bfc7b0061..f0d31fdac3 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -32,6 +32,8 @@ #include "main/macros.h" #include "main/mtypes.h" #include "main/light.h" +#include "math/m_translate.h" +#include "math/m_xform.h" #include "tnl.h" #include "t_context.h" @@ -81,6 +83,9 @@ _tnl_CreateContext( GLcontext *ctx ) /* plug in the VBO drawing function */ vbo_set_draw_func(ctx, _tnl_draw_prims); + _math_init_transformation(); + _math_init_translate(); + return GL_TRUE; } diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 467ab4e3e5..ca8190fd05 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -28,6 +28,7 @@ #include "main/imports.h" #include "main/mtypes.h" #include "main/api_arrayelt.h" +#include "math/m_eval.h" #include "vbo.h" #include "vbo_context.h" @@ -230,6 +231,8 @@ GLboolean _vbo_CreateContext( GLcontext *ctx ) vbo_save_init( ctx ); #endif + _math_init_eval(); + return GL_TRUE; } -- cgit v1.2.3 From da4f933eb2544b62daf0b3c3bd8e16277dd64117 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 13:59:54 -0700 Subject: mesa: refactor MATH_SOURCES, remove Mesa x86 codegen from gallium build Omit math/m_xform.c from gallium builds since it's not used and it's the one place we were pulling in the Mesa x86 codegen which collides with gallium's x86 codegen. Can now omit ASM_C_SOURCES from gallium build too. --- src/mesa/sources.mak | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index dfafbc982b..1bd81506e0 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -88,7 +88,10 @@ MATH_SOURCES = \ math/m_eval.c \ math/m_matrix.c \ math/m_translate.c \ - math/m_vector.c \ + math/m_vector.c + +MATH_XFORM_SOURCES = \ + $(MATH_SOURCES) \ math/m_xform.c SWRAST_SOURCES = \ @@ -309,7 +312,7 @@ COMMON_DRIVER_SOURCES = \ MESA_SOURCES = \ $(MAIN_SOURCES) \ - $(MATH_SOURCES) \ + $(MATH_XFORM_SOURCES) \ $(VBO_SOURCES) \ $(TNL_SOURCES) \ $(SHADER_SOURCES) \ @@ -330,7 +333,6 @@ MESA_GALLIUM_SOURCES = \ $(VBO_SOURCES) \ $(STATETRACKER_SOURCES) \ $(SHADER_SOURCES) \ - $(ASM_C_SOURCES) \ $(SLANG_SOURCES) -- cgit v1.2.3 From 81374d1ebed16aa3eed336295e80be0dfebfad75 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 14:09:22 -0700 Subject: gallium: silence warnings about void ptr arithmetic --- src/gallium/auxiliary/util/u_linear.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_linear.c b/src/gallium/auxiliary/util/u_linear.c index a76704ffc7..ba6204d6f7 100644 --- a/src/gallium/auxiliary/util/u_linear.c +++ b/src/gallium/auxiliary/util/u_linear.c @@ -9,7 +9,7 @@ pipe_linear_to_tile(size_t src_stride, void *src_ptr, int x, y, z; char *ptr; size_t bytes = t->cols * t->block.size; - + char *dst_ptr2 = (char *) dst_ptr; assert(pipe_linear_check_tile(t)); @@ -19,8 +19,8 @@ pipe_linear_to_tile(size_t src_stride, void *src_ptr, /* this inner loop could be replace with SSE magic */ ptr = (char*)src_ptr + src_stride * t->rows * y + bytes * x; for (z = 0; z < t->rows; z++) { - memcpy(dst_ptr, ptr, bytes); - dst_ptr += bytes; + memcpy(dst_ptr2, ptr, bytes); + dst_ptr2 += bytes; ptr += src_stride; } } @@ -33,6 +33,7 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, int x, y, z; char *ptr; size_t bytes = t->cols * t->block.size; + const char *src_ptr2 = (const char *) src_ptr; /* lets read lineary from the tiled buffer */ for (y = 0; y < t->tiles_y; y++) { @@ -40,8 +41,8 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, /* this inner loop could be replace with SSE magic */ ptr = (char*)dst_ptr + dst_stride * t->rows * y + bytes * x; for (z = 0; z < t->rows; z++) { - memcpy(ptr, src_ptr, bytes); - src_ptr += bytes; + memcpy(ptr, src_ptr2, bytes); + src_ptr2 += bytes; ptr += dst_stride; } } -- cgit v1.2.3 From 6b06a6b929aa742f92653728254255f1867d6210 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 14:11:48 -0700 Subject: gallium: const-correctness for u_linear.c functions --- src/gallium/auxiliary/util/u_linear.c | 6 +++--- src/gallium/auxiliary/util/u_linear.h | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_linear.c b/src/gallium/auxiliary/util/u_linear.c index ba6204d6f7..e999cefe74 100644 --- a/src/gallium/auxiliary/util/u_linear.c +++ b/src/gallium/auxiliary/util/u_linear.c @@ -3,7 +3,7 @@ #include "u_linear.h" void -pipe_linear_to_tile(size_t src_stride, void *src_ptr, +pipe_linear_to_tile(size_t src_stride, const void *src_ptr, struct pipe_tile_info *t, void *dst_ptr) { int x, y, z; @@ -27,7 +27,7 @@ pipe_linear_to_tile(size_t src_stride, void *src_ptr, } } -void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, +void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr, size_t dst_stride, void *dst_ptr) { int x, y, z; @@ -51,7 +51,7 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, void pipe_linear_fill_info(struct pipe_tile_info *t, - struct pipe_format_block *block, + const struct pipe_format_block *block, unsigned tile_width, unsigned tile_height, unsigned tiles_x, unsigned tiles_y) { diff --git a/src/gallium/auxiliary/util/u_linear.h b/src/gallium/auxiliary/util/u_linear.h index e337cfd770..1589f029bc 100644 --- a/src/gallium/auxiliary/util/u_linear.h +++ b/src/gallium/auxiliary/util/u_linear.h @@ -3,6 +3,7 @@ #define U_LINEAR_H #include "pipe/p_format.h" + struct pipe_tile_info { unsigned size; @@ -23,10 +24,10 @@ struct pipe_tile_info struct pipe_format_block block; }; -void pipe_linear_to_tile(size_t src_stride, void *src_ptr, +void pipe_linear_to_tile(size_t src_stride, const void *src_ptr, struct pipe_tile_info *t, void *dst_ptr); -void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, +void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr, size_t dst_stride, void *dst_ptr); /** @@ -39,11 +40,11 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, * @tiles_y number of tiles in y axis */ void pipe_linear_fill_info(struct pipe_tile_info *t, - struct pipe_format_block *block, + const struct pipe_format_block *block, unsigned tile_width, unsigned tile_height, unsigned tiles_x, unsigned tiles_y); -static INLINE boolean pipe_linear_check_tile(struct pipe_tile_info *t) +static INLINE boolean pipe_linear_check_tile(const struct pipe_tile_info *t) { if (t->tile.size != t->block.size * t->cols * t->rows) return FALSE; -- cgit v1.2.3 From 0ccbc3c905f0594a35d72887a1f115e148aaa596 Mon Sep 17 00:00:00 2001 From: Robert Ellison Date: Wed, 11 Feb 2009 18:01:34 -0700 Subject: Fix an i965 assertion failure on glClear() While running conform with render-to-texture: conform -d 33 -v 2 -t -direct the i965 driver failed this assertion: intel_clear.c:77: intel_clear_tris: Assertion `(mask & ~((1 << BUFFER_BACK_LEFT) | (1 << BUFFER_FRONT_LEFT) | (1 << BUFFER_DEPTH) | (1 << BUFFER_STENCIL))) == 0' failed. The problem is that intel_clear_tris() is called by intelClear() to clear any and all of the available color buffers, but intel_clear_tris() actually only handles the back left and front left color buffers; so the assertion fails as soon as you try to clear a non-standard color buffer. The fix is to have intelClear() only call intel_clear_tris() with buffers that intel_clear_tris() can support. intelClear() already backs down to _swrast_Clear() for all buffers that aren't handled explicitly. --- src/mesa/drivers/dri/intel/intel_clear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index a47c4d4050..b229136316 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -275,7 +275,7 @@ intelClear(GLcontext *ctx, GLbitfield mask) } else { /* glColorMask in effect */ - tri_mask |= (mask & BUFFER_BITS_COLOR); + tri_mask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)); } /* HW stencil */ -- cgit v1.2.3 From ed6f41e2f467f5b9338320a96202c7dfd181422f Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Feb 2009 21:25:10 -0700 Subject: softpipe: rename sp_quad.[ch] -> sp_quad_pipe.[ch] Be more consistant with 'draw' module. --- src/gallium/drivers/softpipe/Makefile | 2 +- src/gallium/drivers/softpipe/SConscript | 2 +- src/gallium/drivers/softpipe/sp_context.h | 2 +- src/gallium/drivers/softpipe/sp_quad.c | 118 ---------------------- src/gallium/drivers/softpipe/sp_quad.h | 69 ------------- src/gallium/drivers/softpipe/sp_quad_alpha_test.c | 2 +- src/gallium/drivers/softpipe/sp_quad_blend.c | 2 +- src/gallium/drivers/softpipe/sp_quad_bufloop.c | 2 +- src/gallium/drivers/softpipe/sp_quad_colormask.c | 2 +- src/gallium/drivers/softpipe/sp_quad_coverage.c | 2 +- src/gallium/drivers/softpipe/sp_quad_depth_test.c | 2 +- src/gallium/drivers/softpipe/sp_quad_earlyz.c | 2 +- src/gallium/drivers/softpipe/sp_quad_fs.c | 2 +- src/gallium/drivers/softpipe/sp_quad_occlusion.c | 2 +- src/gallium/drivers/softpipe/sp_quad_output.c | 2 +- src/gallium/drivers/softpipe/sp_quad_pipe.c | 118 ++++++++++++++++++++++ src/gallium/drivers/softpipe/sp_quad_pipe.h | 69 +++++++++++++ src/gallium/drivers/softpipe/sp_quad_stencil.c | 2 +- src/gallium/drivers/softpipe/sp_quad_stipple.c | 2 +- src/gallium/drivers/softpipe/sp_setup.c | 2 +- 20 files changed, 203 insertions(+), 203 deletions(-) delete mode 100644 src/gallium/drivers/softpipe/sp_quad.c delete mode 100644 src/gallium/drivers/softpipe/sp_quad.h create mode 100644 src/gallium/drivers/softpipe/sp_quad_pipe.c create mode 100644 src/gallium/drivers/softpipe/sp_quad_pipe.h (limited to 'src') diff --git a/src/gallium/drivers/softpipe/Makefile b/src/gallium/drivers/softpipe/Makefile index 120bdfd9dd..f186f6df1d 100644 --- a/src/gallium/drivers/softpipe/Makefile +++ b/src/gallium/drivers/softpipe/Makefile @@ -14,7 +14,7 @@ C_SOURCES = \ sp_draw_arrays.c \ sp_prim_setup.c \ sp_prim_vbuf.c \ - sp_quad.c \ + sp_quad_pipe.c \ sp_quad_alpha_test.c \ sp_quad_blend.c \ sp_quad_colormask.c \ diff --git a/src/gallium/drivers/softpipe/SConscript b/src/gallium/drivers/softpipe/SConscript index c1f7daa8ab..f8720638a7 100644 --- a/src/gallium/drivers/softpipe/SConscript +++ b/src/gallium/drivers/softpipe/SConscript @@ -17,7 +17,7 @@ softpipe = env.ConvenienceLibrary( 'sp_setup.c', 'sp_quad_alpha_test.c', 'sp_quad_blend.c', - 'sp_quad.c', + 'sp_quad_pipe.c', 'sp_quad_colormask.c', 'sp_quad_coverage.c', 'sp_quad_depth_test.c', diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index e2451c6ecb..4437cd48f6 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -36,7 +36,7 @@ #include "draw/draw_vertex.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "sp_tex_sample.h" diff --git a/src/gallium/drivers/softpipe/sp_quad.c b/src/gallium/drivers/softpipe/sp_quad.c deleted file mode 100644 index 892ef87ee9..0000000000 --- a/src/gallium/drivers/softpipe/sp_quad.c +++ /dev/null @@ -1,118 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 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. - * - **************************************************************************/ - - -#include "sp_context.h" -#include "sp_state.h" -#include "pipe/p_shader_tokens.h" - -static void -sp_push_quad_first( - struct softpipe_context *sp, - struct quad_stage *quad, - uint i ) -{ - quad->next = sp->quad[i].first; - sp->quad[i].first = quad; -} - -static void -sp_build_depth_stencil( - struct softpipe_context *sp, - uint i ) -{ - if (sp->depth_stencil->stencil[0].enabled || - sp->depth_stencil->stencil[1].enabled) { - sp_push_quad_first( sp, sp->quad[i].stencil_test, i ); - } - else if (sp->depth_stencil->depth.enabled && - sp->framebuffer.zsbuf) { - sp_push_quad_first( sp, sp->quad[i].depth_test, i ); - } -} - -void -sp_build_quad_pipeline(struct softpipe_context *sp) -{ - uint i; - - boolean early_depth_test = - sp->depth_stencil->depth.enabled && - sp->framebuffer.zsbuf && - !sp->depth_stencil->alpha.enabled && - !sp->fs->info.uses_kill && - !sp->fs->info.writes_z; - - /* build up the pipeline in reverse order... */ - for (i = 0; i < SP_NUM_QUAD_THREADS; i++) { - sp->quad[i].first = sp->quad[i].output; - - if (sp->blend->colormask != 0xf) { - sp_push_quad_first( sp, sp->quad[i].colormask, i ); - } - - if (sp->blend->blend_enable || - sp->blend->logicop_enable) { - sp_push_quad_first( sp, sp->quad[i].blend, i ); - } - - if (sp->depth_stencil->depth.occlusion_count) { - sp_push_quad_first( sp, sp->quad[i].occlusion, i ); - } - - if (sp->rasterizer->poly_smooth || - sp->rasterizer->line_smooth || - sp->rasterizer->point_smooth) { - sp_push_quad_first( sp, sp->quad[i].coverage, i ); - } - - if (!early_depth_test) { - sp_build_depth_stencil( sp, i ); - } - - if (sp->depth_stencil->alpha.enabled) { - sp_push_quad_first( sp, sp->quad[i].alpha_test, i ); - } - - /* XXX always enable shader? */ - if (1) { - sp_push_quad_first( sp, sp->quad[i].shade, i ); - } - - if (early_depth_test) { - sp_build_depth_stencil( sp, i ); - sp_push_quad_first( sp, sp->quad[i].earlyz, i ); - } - -#if !USE_DRAW_STAGE_PSTIPPLE - if (sp->rasterizer->poly_stipple_enable) { - sp_push_quad_first( sp, sp->quad[i].polygon_stipple, i ); - } -#endif - } -} - diff --git a/src/gallium/drivers/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h deleted file mode 100644 index 08513cb95f..0000000000 --- a/src/gallium/drivers/softpipe/sp_quad.h +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 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. - * - **************************************************************************/ - -/* Authors: Keith Whitwell - */ - -#ifndef SP_QUAD_H -#define SP_QUAD_H - - -struct softpipe_context; -struct quad_header; - - -struct quad_stage { - struct softpipe_context *softpipe; - - struct quad_stage *next; - - void (*begin)(struct quad_stage *qs); - - /** the stage action */ - void (*run)(struct quad_stage *qs, struct quad_header *quad); - - void (*destroy)(struct quad_stage *qs); -}; - - -struct quad_stage *sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_earlyz_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_alpha_test_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe ); -struct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe ); - -void sp_build_quad_pipeline(struct softpipe_context *sp); - -void sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad); - -#endif /* SP_QUAD_H */ diff --git a/src/gallium/drivers/softpipe/sp_quad_alpha_test.c b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c index 85c9f037a3..41560be528 100644 --- a/src/gallium/drivers/softpipe/sp_quad_alpha_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c @@ -5,7 +5,7 @@ #include "sp_context.h" #include "sp_headers.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "pipe/p_defines.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c index fb1d430a4f..9186895ace 100644 --- a/src/gallium/drivers/softpipe/sp_quad_blend.c +++ b/src/gallium/drivers/softpipe/sp_quad_blend.c @@ -37,7 +37,7 @@ #include "sp_headers.h" #include "sp_surface.h" #include "sp_tile_cache.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #define VEC4_COPY(DST, SRC) \ diff --git a/src/gallium/drivers/softpipe/sp_quad_bufloop.c b/src/gallium/drivers/softpipe/sp_quad_bufloop.c index d7d6a6974d..47ae7c9d6c 100644 --- a/src/gallium/drivers/softpipe/sp_quad_bufloop.c +++ b/src/gallium/drivers/softpipe/sp_quad_bufloop.c @@ -3,7 +3,7 @@ #include "sp_context.h" #include "sp_headers.h" #include "sp_surface.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" /** diff --git a/src/gallium/drivers/softpipe/sp_quad_colormask.c b/src/gallium/drivers/softpipe/sp_quad_colormask.c index 563c2fc739..ff922d7704 100644 --- a/src/gallium/drivers/softpipe/sp_quad_colormask.c +++ b/src/gallium/drivers/softpipe/sp_quad_colormask.c @@ -36,7 +36,7 @@ #include "sp_context.h" #include "sp_headers.h" #include "sp_surface.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "sp_tile_cache.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_coverage.c b/src/gallium/drivers/softpipe/sp_quad_coverage.c index c27fd1482d..44e22680e0 100644 --- a/src/gallium/drivers/softpipe/sp_quad_coverage.c +++ b/src/gallium/drivers/softpipe/sp_quad_coverage.c @@ -36,7 +36,7 @@ #include "util/u_memory.h" #include "sp_context.h" #include "sp_headers.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" /** diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index 523bd3e080..df444998e6 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -34,7 +34,7 @@ #include "sp_context.h" #include "sp_headers.h" #include "sp_surface.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "sp_tile_cache.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_earlyz.c b/src/gallium/drivers/softpipe/sp_quad_earlyz.c index 6e2dde304e..f15d989662 100644 --- a/src/gallium/drivers/softpipe/sp_quad_earlyz.c +++ b/src/gallium/drivers/softpipe/sp_quad_earlyz.c @@ -32,7 +32,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" #include "sp_headers.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" /** diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c index 5dacbbe55f..7298e9a127 100644 --- a/src/gallium/drivers/softpipe/sp_quad_fs.c +++ b/src/gallium/drivers/softpipe/sp_quad_fs.c @@ -44,7 +44,7 @@ #include "sp_context.h" #include "sp_state.h" #include "sp_headers.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "sp_texture.h" #include "sp_tex_sample.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_occlusion.c b/src/gallium/drivers/softpipe/sp_quad_occlusion.c index 169bd82876..be3df917fa 100644 --- a/src/gallium/drivers/softpipe/sp_quad_occlusion.c +++ b/src/gallium/drivers/softpipe/sp_quad_occlusion.c @@ -37,7 +37,7 @@ #include "sp_context.h" #include "sp_headers.h" #include "sp_surface.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" static unsigned count_bits( unsigned val ) { diff --git a/src/gallium/drivers/softpipe/sp_quad_output.c b/src/gallium/drivers/softpipe/sp_quad_output.c index a37c8b4c39..d6c406e418 100644 --- a/src/gallium/drivers/softpipe/sp_quad_output.c +++ b/src/gallium/drivers/softpipe/sp_quad_output.c @@ -29,7 +29,7 @@ #include "sp_context.h" #include "sp_headers.h" #include "sp_surface.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "sp_tile_cache.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.c b/src/gallium/drivers/softpipe/sp_quad_pipe.c new file mode 100644 index 0000000000..892ef87ee9 --- /dev/null +++ b/src/gallium/drivers/softpipe/sp_quad_pipe.c @@ -0,0 +1,118 @@ +/************************************************************************** + * + * Copyright 2007 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. + * + **************************************************************************/ + + +#include "sp_context.h" +#include "sp_state.h" +#include "pipe/p_shader_tokens.h" + +static void +sp_push_quad_first( + struct softpipe_context *sp, + struct quad_stage *quad, + uint i ) +{ + quad->next = sp->quad[i].first; + sp->quad[i].first = quad; +} + +static void +sp_build_depth_stencil( + struct softpipe_context *sp, + uint i ) +{ + if (sp->depth_stencil->stencil[0].enabled || + sp->depth_stencil->stencil[1].enabled) { + sp_push_quad_first( sp, sp->quad[i].stencil_test, i ); + } + else if (sp->depth_stencil->depth.enabled && + sp->framebuffer.zsbuf) { + sp_push_quad_first( sp, sp->quad[i].depth_test, i ); + } +} + +void +sp_build_quad_pipeline(struct softpipe_context *sp) +{ + uint i; + + boolean early_depth_test = + sp->depth_stencil->depth.enabled && + sp->framebuffer.zsbuf && + !sp->depth_stencil->alpha.enabled && + !sp->fs->info.uses_kill && + !sp->fs->info.writes_z; + + /* build up the pipeline in reverse order... */ + for (i = 0; i < SP_NUM_QUAD_THREADS; i++) { + sp->quad[i].first = sp->quad[i].output; + + if (sp->blend->colormask != 0xf) { + sp_push_quad_first( sp, sp->quad[i].colormask, i ); + } + + if (sp->blend->blend_enable || + sp->blend->logicop_enable) { + sp_push_quad_first( sp, sp->quad[i].blend, i ); + } + + if (sp->depth_stencil->depth.occlusion_count) { + sp_push_quad_first( sp, sp->quad[i].occlusion, i ); + } + + if (sp->rasterizer->poly_smooth || + sp->rasterizer->line_smooth || + sp->rasterizer->point_smooth) { + sp_push_quad_first( sp, sp->quad[i].coverage, i ); + } + + if (!early_depth_test) { + sp_build_depth_stencil( sp, i ); + } + + if (sp->depth_stencil->alpha.enabled) { + sp_push_quad_first( sp, sp->quad[i].alpha_test, i ); + } + + /* XXX always enable shader? */ + if (1) { + sp_push_quad_first( sp, sp->quad[i].shade, i ); + } + + if (early_depth_test) { + sp_build_depth_stencil( sp, i ); + sp_push_quad_first( sp, sp->quad[i].earlyz, i ); + } + +#if !USE_DRAW_STAGE_PSTIPPLE + if (sp->rasterizer->poly_stipple_enable) { + sp_push_quad_first( sp, sp->quad[i].polygon_stipple, i ); + } +#endif + } +} + diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.h b/src/gallium/drivers/softpipe/sp_quad_pipe.h new file mode 100644 index 0000000000..08513cb95f --- /dev/null +++ b/src/gallium/drivers/softpipe/sp_quad_pipe.h @@ -0,0 +1,69 @@ +/************************************************************************** + * + * Copyright 2007 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. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ + +#ifndef SP_QUAD_H +#define SP_QUAD_H + + +struct softpipe_context; +struct quad_header; + + +struct quad_stage { + struct softpipe_context *softpipe; + + struct quad_stage *next; + + void (*begin)(struct quad_stage *qs); + + /** the stage action */ + void (*run)(struct quad_stage *qs, struct quad_header *quad); + + void (*destroy)(struct quad_stage *qs); +}; + + +struct quad_stage *sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_earlyz_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_alpha_test_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe ); +struct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe ); + +void sp_build_quad_pipeline(struct softpipe_context *sp); + +void sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad); + +#endif /* SP_QUAD_H */ diff --git a/src/gallium/drivers/softpipe/sp_quad_stencil.c b/src/gallium/drivers/softpipe/sp_quad_stencil.c index 7495515764..914b9340e4 100644 --- a/src/gallium/drivers/softpipe/sp_quad_stencil.c +++ b/src/gallium/drivers/softpipe/sp_quad_stencil.c @@ -8,7 +8,7 @@ #include "sp_headers.h" #include "sp_surface.h" #include "sp_tile_cache.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "pipe/p_defines.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_stipple.c b/src/gallium/drivers/softpipe/sp_quad_stipple.c index ccf37f6be5..90b0905ea5 100644 --- a/src/gallium/drivers/softpipe/sp_quad_stipple.c +++ b/src/gallium/drivers/softpipe/sp_quad_stipple.c @@ -5,7 +5,7 @@ #include "sp_context.h" #include "sp_headers.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "pipe/p_defines.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index b1adb9cb7a..752e9d31e2 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -36,7 +36,7 @@ #include "sp_context.h" #include "sp_headers.h" -#include "sp_quad.h" +#include "sp_quad_pipe.h" #include "sp_state.h" #include "sp_prim_setup.h" #include "draw/draw_context.h" -- cgit v1.2.3 From b865f84c8d94959bd91ec1ab49dd919ea8cc8b8d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Feb 2009 21:30:21 -0700 Subject: softpipe: rename single-include preprocessor symbol, add comments --- src/gallium/drivers/softpipe/sp_quad_pipe.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.h b/src/gallium/drivers/softpipe/sp_quad_pipe.h index 08513cb95f..0e40586ffc 100644 --- a/src/gallium/drivers/softpipe/sp_quad_pipe.h +++ b/src/gallium/drivers/softpipe/sp_quad_pipe.h @@ -28,14 +28,19 @@ /* Authors: Keith Whitwell */ -#ifndef SP_QUAD_H -#define SP_QUAD_H +#ifndef SP_QUAD_PIPE_H +#define SP_QUAD_PIPE_H struct softpipe_context; struct quad_header; +/** + * Fragment processing is performed on 2x2 blocks of pixels called "quads". + * Quad processing is performed with a pipeline of stages represented by + * this type. + */ struct quad_stage { struct softpipe_context *softpipe; @@ -66,4 +71,4 @@ void sp_build_quad_pipeline(struct softpipe_context *sp); void sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad); -#endif /* SP_QUAD_H */ +#endif /* SP_QUAD_PIPE_H */ -- cgit v1.2.3 From 7925274da323d5a896b557181d4016e0391f026f Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Feb 2009 21:33:59 -0700 Subject: softpipe: rename sp_headers.h to sp_quad.h This header describes the quad-related datatypes afterall. --- src/gallium/drivers/softpipe/sp_fs_exec.c | 2 +- src/gallium/drivers/softpipe/sp_fs_sse.c | 2 +- src/gallium/drivers/softpipe/sp_headers.h | 95 ----------------------- src/gallium/drivers/softpipe/sp_quad.h | 94 ++++++++++++++++++++++ src/gallium/drivers/softpipe/sp_quad_alpha_test.c | 2 +- src/gallium/drivers/softpipe/sp_quad_blend.c | 2 +- src/gallium/drivers/softpipe/sp_quad_bufloop.c | 2 +- src/gallium/drivers/softpipe/sp_quad_colormask.c | 2 +- src/gallium/drivers/softpipe/sp_quad_coverage.c | 2 +- src/gallium/drivers/softpipe/sp_quad_depth_test.c | 2 +- src/gallium/drivers/softpipe/sp_quad_earlyz.c | 2 +- src/gallium/drivers/softpipe/sp_quad_fs.c | 2 +- src/gallium/drivers/softpipe/sp_quad_occlusion.c | 2 +- src/gallium/drivers/softpipe/sp_quad_output.c | 2 +- src/gallium/drivers/softpipe/sp_quad_stencil.c | 2 +- src/gallium/drivers/softpipe/sp_quad_stipple.c | 2 +- src/gallium/drivers/softpipe/sp_setup.c | 2 +- src/gallium/drivers/softpipe/sp_tex_sample.c | 2 +- 18 files changed, 110 insertions(+), 111 deletions(-) delete mode 100644 src/gallium/drivers/softpipe/sp_headers.h create mode 100644 src/gallium/drivers/softpipe/sp_quad.h (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c index 453b0373f0..3c7ba565d6 100644 --- a/src/gallium/drivers/softpipe/sp_fs_exec.c +++ b/src/gallium/drivers/softpipe/sp_fs_exec.c @@ -29,7 +29,7 @@ #include "sp_context.h" #include "sp_state.h" #include "sp_fs.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "pipe/p_state.h" diff --git a/src/gallium/drivers/softpipe/sp_fs_sse.c b/src/gallium/drivers/softpipe/sp_fs_sse.c index 9a273c8764..7e22081132 100644 --- a/src/gallium/drivers/softpipe/sp_fs_sse.c +++ b/src/gallium/drivers/softpipe/sp_fs_sse.c @@ -29,7 +29,7 @@ #include "sp_context.h" #include "sp_state.h" #include "sp_fs.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "pipe/p_state.h" diff --git a/src/gallium/drivers/softpipe/sp_headers.h b/src/gallium/drivers/softpipe/sp_headers.h deleted file mode 100644 index 4a42cb3c19..0000000000 --- a/src/gallium/drivers/softpipe/sp_headers.h +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 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. - * - **************************************************************************/ - -/* Authors: Keith Whitwell - */ - -#ifndef SP_HEADERS_H -#define SP_HEADERS_H - -#include "pipe/p_state.h" -#include "tgsi/tgsi_exec.h" - -#define PRIM_POINT 1 -#define PRIM_LINE 2 -#define PRIM_TRI 3 - - -/* The rasterizer generates 2x2 quads of fragment and feeds them to - * the current fp_machine (see below). - * Remember that Y=0=top with Y increasing down the window. - */ -#define QUAD_TOP_LEFT 0 -#define QUAD_TOP_RIGHT 1 -#define QUAD_BOTTOM_LEFT 2 -#define QUAD_BOTTOM_RIGHT 3 - -#define MASK_TOP_LEFT (1 << QUAD_TOP_LEFT) -#define MASK_TOP_RIGHT (1 << QUAD_TOP_RIGHT) -#define MASK_BOTTOM_LEFT (1 << QUAD_BOTTOM_LEFT) -#define MASK_BOTTOM_RIGHT (1 << QUAD_BOTTOM_RIGHT) -#define MASK_ALL 0xf - - -/** - * Encodes everything we need to know about a 2x2 pixel block. Uses - * "Channel-Serial" or "SoA" layout. - */ -struct quad_header_input -{ - int x0; - int y0; - float coverage[QUAD_SIZE]; /** fragment coverage for antialiasing */ - unsigned facing:1; /**< Front (0) or back (1) facing? */ - unsigned prim:2; /**< PRIM_POINT, LINE, TRI */ -}; - -struct quad_header_inout -{ - unsigned mask:4; -}; - -struct quad_header_output -{ - /** colors in SOA format (rrrr, gggg, bbbb, aaaa) */ - float color[PIPE_MAX_COLOR_BUFS][NUM_CHANNELS][QUAD_SIZE]; - float depth[QUAD_SIZE]; -}; - -struct quad_header { - struct quad_header_input input; - struct quad_header_inout inout; - struct quad_header_output output; - - const struct tgsi_interp_coef *coef; - const struct tgsi_interp_coef *posCoef; - - unsigned nr_attrs; -}; - -#endif /* SP_HEADERS_H */ - diff --git a/src/gallium/drivers/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h new file mode 100644 index 0000000000..37c03bfc09 --- /dev/null +++ b/src/gallium/drivers/softpipe/sp_quad.h @@ -0,0 +1,94 @@ +/************************************************************************** + * + * Copyright 2007 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. + * + **************************************************************************/ + +/* Authors: Keith Whitwell + */ + +#ifndef SP_QUAD_H +#define SP_QUAD_H + +#include "pipe/p_state.h" +#include "tgsi/tgsi_exec.h" + +#define PRIM_POINT 1 +#define PRIM_LINE 2 +#define PRIM_TRI 3 + + +/* The rasterizer generates 2x2 quads of fragment and feeds them to + * the current fp_machine (see below). + * Remember that Y=0=top with Y increasing down the window. + */ +#define QUAD_TOP_LEFT 0 +#define QUAD_TOP_RIGHT 1 +#define QUAD_BOTTOM_LEFT 2 +#define QUAD_BOTTOM_RIGHT 3 + +#define MASK_TOP_LEFT (1 << QUAD_TOP_LEFT) +#define MASK_TOP_RIGHT (1 << QUAD_TOP_RIGHT) +#define MASK_BOTTOM_LEFT (1 << QUAD_BOTTOM_LEFT) +#define MASK_BOTTOM_RIGHT (1 << QUAD_BOTTOM_RIGHT) +#define MASK_ALL 0xf + + +/** + * Encodes everything we need to know about a 2x2 pixel block. Uses + * "Channel-Serial" or "SoA" layout. + */ +struct quad_header_input +{ + int x0; + int y0; + float coverage[QUAD_SIZE]; /** fragment coverage for antialiasing */ + unsigned facing:1; /**< Front (0) or back (1) facing? */ + unsigned prim:2; /**< PRIM_POINT, LINE, TRI */ +}; + +struct quad_header_inout +{ + unsigned mask:4; +}; + +struct quad_header_output +{ + /** colors in SOA format (rrrr, gggg, bbbb, aaaa) */ + float color[PIPE_MAX_COLOR_BUFS][NUM_CHANNELS][QUAD_SIZE]; + float depth[QUAD_SIZE]; +}; + +struct quad_header { + struct quad_header_input input; + struct quad_header_inout inout; + struct quad_header_output output; + + const struct tgsi_interp_coef *coef; + const struct tgsi_interp_coef *posCoef; + + unsigned nr_attrs; +}; + +#endif /* SP_QUAD_H */ diff --git a/src/gallium/drivers/softpipe/sp_quad_alpha_test.c b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c index 41560be528..0845bae0e6 100644 --- a/src/gallium/drivers/softpipe/sp_quad_alpha_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c @@ -4,7 +4,7 @@ */ #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_quad_pipe.h" #include "pipe/p_defines.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c index 9186895ace..e134e44337 100644 --- a/src/gallium/drivers/softpipe/sp_quad_blend.c +++ b/src/gallium/drivers/softpipe/sp_quad_blend.c @@ -34,7 +34,7 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_tile_cache.h" #include "sp_quad_pipe.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_bufloop.c b/src/gallium/drivers/softpipe/sp_quad_bufloop.c index 47ae7c9d6c..953d8516b9 100644 --- a/src/gallium/drivers/softpipe/sp_quad_bufloop.c +++ b/src/gallium/drivers/softpipe/sp_quad_bufloop.c @@ -1,7 +1,7 @@ #include "util/u_memory.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_quad_pipe.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_colormask.c b/src/gallium/drivers/softpipe/sp_quad_colormask.c index ff922d7704..dc90e5d5e9 100644 --- a/src/gallium/drivers/softpipe/sp_quad_colormask.c +++ b/src/gallium/drivers/softpipe/sp_quad_colormask.c @@ -34,7 +34,7 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_quad_pipe.h" #include "sp_tile_cache.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_coverage.c b/src/gallium/drivers/softpipe/sp_quad_coverage.c index 44e22680e0..4814c610ee 100644 --- a/src/gallium/drivers/softpipe/sp_quad_coverage.c +++ b/src/gallium/drivers/softpipe/sp_quad_coverage.c @@ -35,7 +35,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_quad_pipe.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index df444998e6..d463930bae 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -32,7 +32,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_quad_pipe.h" #include "sp_tile_cache.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_earlyz.c b/src/gallium/drivers/softpipe/sp_quad_earlyz.c index f15d989662..496fd39ed1 100644 --- a/src/gallium/drivers/softpipe/sp_quad_earlyz.c +++ b/src/gallium/drivers/softpipe/sp_quad_earlyz.c @@ -31,7 +31,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_quad_pipe.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c index 7298e9a127..adca5df73d 100644 --- a/src/gallium/drivers/softpipe/sp_quad_fs.c +++ b/src/gallium/drivers/softpipe/sp_quad_fs.c @@ -43,7 +43,7 @@ #include "sp_context.h" #include "sp_state.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_quad_pipe.h" #include "sp_texture.h" #include "sp_tex_sample.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_occlusion.c b/src/gallium/drivers/softpipe/sp_quad_occlusion.c index be3df917fa..dfa7ff3b1d 100644 --- a/src/gallium/drivers/softpipe/sp_quad_occlusion.c +++ b/src/gallium/drivers/softpipe/sp_quad_occlusion.c @@ -35,7 +35,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_quad_pipe.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_output.c b/src/gallium/drivers/softpipe/sp_quad_output.c index d6c406e418..92d5f9f3c1 100644 --- a/src/gallium/drivers/softpipe/sp_quad_output.c +++ b/src/gallium/drivers/softpipe/sp_quad_output.c @@ -27,7 +27,7 @@ #include "util/u_memory.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_quad_pipe.h" #include "sp_tile_cache.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_stencil.c b/src/gallium/drivers/softpipe/sp_quad_stencil.c index 914b9340e4..5e9d447737 100644 --- a/src/gallium/drivers/softpipe/sp_quad_stencil.c +++ b/src/gallium/drivers/softpipe/sp_quad_stencil.c @@ -5,7 +5,7 @@ #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_tile_cache.h" #include "sp_quad_pipe.h" diff --git a/src/gallium/drivers/softpipe/sp_quad_stipple.c b/src/gallium/drivers/softpipe/sp_quad_stipple.c index 90b0905ea5..0ad101fbf9 100644 --- a/src/gallium/drivers/softpipe/sp_quad_stipple.c +++ b/src/gallium/drivers/softpipe/sp_quad_stipple.c @@ -4,7 +4,7 @@ */ #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_quad_pipe.h" #include "pipe/p_defines.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index 752e9d31e2..a106b05fc9 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -35,7 +35,7 @@ #include "sp_setup.h" #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_quad_pipe.h" #include "sp_state.h" #include "sp_prim_setup.h" diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index 32aa5025e4..adbd0cb7f0 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -34,7 +34,7 @@ */ #include "sp_context.h" -#include "sp_headers.h" +#include "sp_quad.h" #include "sp_surface.h" #include "sp_texture.h" #include "sp_tex_sample.h" -- cgit v1.2.3 From 253d2d1676e07ddfc566f3761e409f9cabde1937 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Feb 2009 21:38:20 -0700 Subject: softpipe: rename PRIM_x to QUAD_PRIM_x --- src/gallium/drivers/softpipe/sp_quad.h | 8 ++++---- src/gallium/drivers/softpipe/sp_quad_coverage.c | 7 ++++--- src/gallium/drivers/softpipe/sp_quad_stipple.c | 2 +- src/gallium/drivers/softpipe/sp_setup.c | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h index 37c03bfc09..0ef425a310 100644 --- a/src/gallium/drivers/softpipe/sp_quad.h +++ b/src/gallium/drivers/softpipe/sp_quad.h @@ -34,9 +34,9 @@ #include "pipe/p_state.h" #include "tgsi/tgsi_exec.h" -#define PRIM_POINT 1 -#define PRIM_LINE 2 -#define PRIM_TRI 3 +#define QUAD_PRIM_POINT 1 +#define QUAD_PRIM_LINE 2 +#define QUAD_PRIM_TRI 3 /* The rasterizer generates 2x2 quads of fragment and feeds them to @@ -65,7 +65,7 @@ struct quad_header_input int y0; float coverage[QUAD_SIZE]; /** fragment coverage for antialiasing */ unsigned facing:1; /**< Front (0) or back (1) facing? */ - unsigned prim:2; /**< PRIM_POINT, LINE, TRI */ + unsigned prim:2; /**< QUAD_PRIM_POINT, LINE, TRI */ }; struct quad_header_inout diff --git a/src/gallium/drivers/softpipe/sp_quad_coverage.c b/src/gallium/drivers/softpipe/sp_quad_coverage.c index 4814c610ee..4aeee85870 100644 --- a/src/gallium/drivers/softpipe/sp_quad_coverage.c +++ b/src/gallium/drivers/softpipe/sp_quad_coverage.c @@ -46,10 +46,11 @@ static void coverage_quad(struct quad_stage *qs, struct quad_header *quad) { struct softpipe_context *softpipe = qs->softpipe; + const uint prim = quad->input.prim; - if ((softpipe->rasterizer->poly_smooth && quad->input.prim == PRIM_TRI) || - (softpipe->rasterizer->line_smooth && quad->input.prim == PRIM_LINE) || - (softpipe->rasterizer->point_smooth && quad->input.prim == PRIM_POINT)) { + if ((softpipe->rasterizer->poly_smooth && prim == QUAD_PRIM_TRI) || + (softpipe->rasterizer->line_smooth && prim == QUAD_PRIM_LINE) || + (softpipe->rasterizer->point_smooth && prim == QUAD_PRIM_POINT)) { uint cbuf; /* loop over colorbuffer outputs */ diff --git a/src/gallium/drivers/softpipe/sp_quad_stipple.c b/src/gallium/drivers/softpipe/sp_quad_stipple.c index 0ad101fbf9..ec7bb3c95e 100644 --- a/src/gallium/drivers/softpipe/sp_quad_stipple.c +++ b/src/gallium/drivers/softpipe/sp_quad_stipple.c @@ -19,7 +19,7 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad) static const uint bit31 = 1 << 31; static const uint bit30 = 1 << 30; - if (quad->input.prim == PRIM_TRI) { + if (quad->input.prim == QUAD_PRIM_TRI) { struct softpipe_context *softpipe = qs->softpipe; /* need to invert Y to index into OpenGL's stipple pattern */ int y0, y1; diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index a106b05fc9..97aa1ac60a 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -968,7 +968,7 @@ void setup_tri( struct setup_context *setup, setup_tri_coefficients( setup ); setup_tri_edges( setup ); - setup->quad.input.prim = PRIM_TRI; + setup->quad.input.prim = QUAD_PRIM_TRI; setup->span.y = 0; setup->span.y_flags = 0; @@ -1206,7 +1206,7 @@ setup_line(struct setup_context *setup, setup->quad.input.x0 = setup->quad.input.y0 = -1; setup->quad.inout.mask = 0x0; - setup->quad.input.prim = PRIM_LINE; + setup->quad.input.prim = QUAD_PRIM_LINE; /* XXX temporary: set coverage to 1.0 so the line appears * if AA mode happens to be enabled. */ @@ -1361,7 +1361,7 @@ setup_point( struct setup_context *setup, } } - setup->quad.input.prim = PRIM_POINT; + setup->quad.input.prim = QUAD_PRIM_POINT; if (halfSize <= 0.5 && !round) { /* special case for 1-pixel points */ -- cgit v1.2.3 From 460b62336d83379a98948168a4bbe177fc6df835 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Feb 2009 21:44:38 -0700 Subject: softpipe: updated comments --- src/gallium/drivers/softpipe/sp_quad.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h index 0ef425a310..bd6c6cb912 100644 --- a/src/gallium/drivers/softpipe/sp_quad.h +++ b/src/gallium/drivers/softpipe/sp_quad.h @@ -34,6 +34,7 @@ #include "pipe/p_state.h" #include "tgsi/tgsi_exec.h" + #define QUAD_PRIM_POINT 1 #define QUAD_PRIM_LINE 2 #define QUAD_PRIM_TRI 3 @@ -56,23 +57,29 @@ /** - * Encodes everything we need to know about a 2x2 pixel block. Uses - * "Channel-Serial" or "SoA" layout. + * Quad stage inputs (pos, coverage, front/back face, etc) */ struct quad_header_input { - int x0; - int y0; - float coverage[QUAD_SIZE]; /** fragment coverage for antialiasing */ - unsigned facing:1; /**< Front (0) or back (1) facing? */ - unsigned prim:2; /**< QUAD_PRIM_POINT, LINE, TRI */ + int x0, y0; /**< quad window pos, always even */ + float coverage[QUAD_SIZE]; /**< fragment coverage for antialiasing */ + unsigned facing:1; /**< Front (0) or back (1) facing? */ + unsigned prim:2; /**< QUAD_PRIM_POINT, LINE, TRI */ }; + +/** + * Quad stage inputs/outputs. + */ struct quad_header_inout { unsigned mask:4; }; + +/** + * Quad stage outputs (color & depth). + */ struct quad_header_output { /** colors in SOA format (rrrr, gggg, bbbb, aaaa) */ @@ -80,6 +87,11 @@ struct quad_header_output float depth[QUAD_SIZE]; }; + +/** + * Encodes everything we need to know about a 2x2 pixel block. Uses + * "Channel-Serial" or "SoA" layout. + */ struct quad_header { struct quad_header_input input; struct quad_header_inout inout; -- cgit v1.2.3 From f908421e64886a7cbc1365fef45412b97b993220 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 21:51:00 -0700 Subject: softpipe: remove some old polygon stipple stuff and do some clean-ups --- src/gallium/drivers/softpipe/sp_context.h | 6 ------ src/gallium/drivers/softpipe/sp_quad_stipple.c | 23 ++++++++--------------- 2 files changed, 8 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index 4437cd48f6..af121157d4 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -112,12 +112,6 @@ struct softpipe_context { unsigned reduced_api_prim; /**< PIPE_PRIM_POINTS, _LINES or _TRIANGLES */ -#if 0 - /* Stipple derived state: - */ - ubyte stipple_masks[16][16]; -#endif - /** Derived from scissor and surface bounds: */ struct pipe_scissor_state cliprect; diff --git a/src/gallium/drivers/softpipe/sp_quad_stipple.c b/src/gallium/drivers/softpipe/sp_quad_stipple.c index ec7bb3c95e..05e862f097 100644 --- a/src/gallium/drivers/softpipe/sp_quad_stipple.c +++ b/src/gallium/drivers/softpipe/sp_quad_stipple.c @@ -24,6 +24,8 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad) /* need to invert Y to index into OpenGL's stipple pattern */ int y0, y1; uint stipple0, stipple1; + const int col0 = quad->input.x0 % 32; + if (softpipe->rasterizer->origin_lower_left) { y0 = softpipe->framebuffer.height - 1 - quad->input.y0; y1 = y0 - 1; @@ -32,12 +34,11 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad) y0 = quad->input.y0; y1 = y0 + 1; } + stipple0 = softpipe->poly_stipple.stipple[y0 % 32]; stipple1 = softpipe->poly_stipple.stipple[y1 % 32]; -#if 1 - { - const int col0 = quad->input.x0 % 32; + /* turn off quad mask bits that fail the stipple test */ if ((stipple0 & (bit31 >> col0)) == 0) quad->inout.mask &= ~MASK_TOP_LEFT; @@ -49,19 +50,11 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad) if ((stipple1 & (bit30 >> col0)) == 0) quad->inout.mask &= ~MASK_BOTTOM_RIGHT; - } -#else - /* We'd like to use this code, but we'd need to redefine - * MASK_TOP_LEFT to be (1 << 1) and MASK_TOP_RIGHT to be (1 << 0), - * and similarly for the BOTTOM bits. But that may have undesirable - * side effects elsewhere. - */ - const int col0 = 30 - (quad->input.x0 % 32); - quad->inout.mask &= (((stipple0 >> col0) & 0x3) | - (((stipple1 >> col0) & 0x3) << 2)); -#endif - if (!quad->inout.mask) + + if (!quad->inout.mask) { + /* all fragments failed stipple test, end of quad pipeline */ return; + } } qs->next->run(qs->next, quad); -- cgit v1.2.3 From 0aaa3ef2faf5c71c53abd5314ed7d55dcb929e21 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 22:01:43 -0700 Subject: softpipe: asst comments, clean-ups --- src/gallium/drivers/softpipe/sp_context.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index af121157d4..3e99884842 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -51,7 +51,6 @@ */ #define SP_NUM_QUAD_THREADS 1 -struct softpipe_winsys; struct softpipe_vbuf_render; struct draw_context; struct draw_stage; @@ -63,15 +62,15 @@ struct sp_vertex_shader; struct softpipe_context { struct pipe_context pipe; /**< base class */ - /* The most recent drawing state as set by the driver: - */ - const struct pipe_blend_state *blend; + /** Constant state objects */ + const struct pipe_blend_state *blend; const struct pipe_sampler_state *sampler[PIPE_MAX_SAMPLERS]; - const struct pipe_depth_stencil_alpha_state *depth_stencil; + const struct pipe_depth_stencil_alpha_state *depth_stencil; const struct pipe_rasterizer_state *rasterizer; const struct sp_fragment_shader *fs; const struct sp_vertex_shader *vs; + /** Other rendering state */ struct pipe_blend_color blend_color; struct pipe_clip_state clip; struct pipe_constant_buffer constants[PIPE_SHADER_TYPES]; @@ -82,23 +81,20 @@ struct softpipe_context { struct pipe_viewport_state viewport; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; - unsigned dirty; unsigned num_samplers; unsigned num_textures; unsigned num_vertex_elements; unsigned num_vertex_buffers; - boolean no_rast; + unsigned dirty; /**< Mask of SP_NEW_x flags */ /* Counter for occlusion queries. Note this supports overlapping * queries. */ uint64_t occlusion_count; - /* - * Mapped vertex buffers - */ + /** Mapped vertex buffers */ ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS]; /** Mapped constant buffers */ @@ -108,6 +104,7 @@ struct softpipe_context { struct vertex_info vertex_info; struct vertex_info vertex_info_vbuf; + /** Which vertex shader output slot contains point size */ int psize_slot; unsigned reduced_api_prim; /**< PIPE_PRIM_POINTS, _LINES or _TRIANGLES */ @@ -153,8 +150,9 @@ struct softpipe_context { struct softpipe_tile_cache *tex_cache[PIPE_MAX_SAMPLERS]; - int use_sse : 1; - int dump_fs : 1; + unsigned use_sse : 1; + unsigned dump_fs : 1; + unsigned no_rast : 1; }; -- cgit v1.2.3 From f164101b24141207789f5bbac0a0d451325d067d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 22:03:34 -0700 Subject: softpipe: remove unneeded #include --- src/gallium/drivers/softpipe/sp_context.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index 3e99884842..59d6df8f2d 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -32,7 +32,6 @@ #define SP_CONTEXT_H #include "pipe/p_context.h" -#include "pipe/p_defines.h" #include "draw/draw_vertex.h" -- cgit v1.2.3 From 492e61d94f68c3a4a515cab3cf227eed5b426bdf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Feb 2009 22:13:17 -0700 Subject: softpipe: asst clean-ups, const correctness, comments --- src/gallium/drivers/softpipe/sp_setup.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index 97aa1ac60a..0925653b5d 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -32,13 +32,12 @@ * \author Brian Paul */ -#include "sp_setup.h" - #include "sp_context.h" +#include "sp_prim_setup.h" #include "sp_quad.h" #include "sp_quad_pipe.h" +#include "sp_setup.h" #include "sp_state.h" -#include "sp_prim_setup.h" #include "draw/draw_context.h" #include "draw/draw_private.h" #include "draw/draw_vertex.h" @@ -265,17 +264,20 @@ is_inf_or_nan(float x) } -static boolean cull_tri( struct setup_context *setup, - float det ) +/** + * Do triangle cull test using tri determinant (sign indicates orientation) + * \return true if triangle is to be culled. + */ +static INLINE boolean +cull_tri(const struct setup_context *setup, float det) { - if (det != 0) - { + if (det != 0) { /* if (det < 0 then Z points toward camera and triangle is * counter-clockwise winding. */ unsigned winding = (det < 0) ? PIPE_WINDING_CCW : PIPE_WINDING_CW; - - if ((winding & setup->winding) == 0) + + if ((winding & setup->winding) == 0) return FALSE; } @@ -1009,7 +1011,7 @@ void setup_tri( struct setup_context *setup, * for a line. */ static void -line_linear_coeff(struct setup_context *setup, +line_linear_coeff(const struct setup_context *setup, struct tgsi_interp_coef *coef, uint vertSlot, uint i) { @@ -1029,9 +1031,9 @@ line_linear_coeff(struct setup_context *setup, * for a line. */ static void -line_persp_coeff(struct setup_context *setup, - struct tgsi_interp_coef *coef, - uint vertSlot, uint i) +line_persp_coeff(const struct setup_context *setup, + struct tgsi_interp_coef *coef, + uint vertSlot, uint i) { /* XXX double-check/verify this arithmetic */ const float a0 = setup->vmin[vertSlot][i] * setup->vmin[0][3]; @@ -1266,7 +1268,7 @@ setup_line(struct setup_context *setup, static void -point_persp_coeff(struct setup_context *setup, +point_persp_coeff(const struct setup_context *setup, const float (*vert)[4], struct tgsi_interp_coef *coef, uint vertSlot, uint i) -- cgit v1.2.3 From b93d3057257c5ecbcd3861726d8d9bb5040529aa Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 12 Feb 2009 11:58:04 +0000 Subject: scons: Build xlib state tracker regardless of DRI settings. --- src/gallium/state_trackers/glx/xlib/SConscript | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/SConscript b/src/gallium/state_trackers/glx/xlib/SConscript index 14cdad69cb..01641e90e4 100644 --- a/src/gallium/state_trackers/glx/xlib/SConscript +++ b/src/gallium/state_trackers/glx/xlib/SConscript @@ -5,8 +5,7 @@ Import('*') if env['platform'] == 'linux' \ and 'mesa' in env['statetrackers'] \ - and ('softpipe' or 'i915simple' or 'trace') in env['drivers'] \ - and not env['dri']: + and ('softpipe' or 'i915simple' or 'trace') in env['drivers']: env = env.Clone() -- cgit v1.2.3 From f5cca127b0ddcfe36b8dc98a5f405979e8afe673 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 12 Feb 2009 13:30:01 +0000 Subject: tgsi: keep immediate file info uptodate Make sure the stats for TGSI_FILE_IMMEDIATE are uptodate. Previously we just had immediate_count, but file_*[TGSI_FILE_IMMEDIATE] were bogus. --- src/gallium/auxiliary/tgsi/tgsi_scan.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index d02205a63e..c535788819 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -151,7 +151,14 @@ tgsi_scan_shader(const struct tgsi_token *tokens, break; case TGSI_TOKEN_TYPE_IMMEDIATE: - info->immediate_count++; + { + uint reg = info->immediate_count++; + uint file = TGSI_FILE_IMMEDIATE; + + info->file_mask[file] |= (1 << reg); + info->file_count[file]++; + info->file_max[file] = MAX2(info->file_max[file], (int)reg); + } break; default: -- cgit v1.2.3 From 2c8c09edda645f04c8bd34f8b53031cbb951cdfe Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 11 Feb 2009 16:53:53 +0100 Subject: egl: Use only libdrm structs for kms --- src/gallium/state_trackers/egl/egl_surface.c | 4 ++-- src/gallium/state_trackers/egl/egl_tracker.c | 2 +- src/gallium/state_trackers/egl/egl_tracker.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/egl_surface.c b/src/gallium/state_trackers/egl/egl_surface.c index 091d437d81..281dff9f8a 100644 --- a/src/gallium/state_trackers/egl/egl_surface.c +++ b/src/gallium/state_trackers/egl/egl_surface.c @@ -16,11 +16,11 @@ * Util functions */ -static struct drm_mode_modeinfo * +static drmModeModeInfoPtr drm_find_mode(drmModeConnectorPtr connector, _EGLMode *mode) { int i; - struct drm_mode_modeinfo *m = NULL; + drmModeModeInfoPtr m = NULL; for (i = 0; i < connector->count_modes; i++) { m = &connector->modes[i]; diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c index dec82c3a00..2813bf4360 100644 --- a/src/gallium/state_trackers/egl/egl_tracker.c +++ b/src/gallium/state_trackers/egl/egl_tracker.c @@ -92,7 +92,7 @@ drm_update_res(struct drm_device *dev) static void drm_add_modes_from_connector(_EGLScreen *screen, drmModeConnectorPtr connector) { - struct drm_mode_modeinfo *m; + drmModeModeInfoPtr m = NULL; int i; for (i = 0; i < connector->count_modes; i++) { diff --git a/src/gallium/state_trackers/egl/egl_tracker.h b/src/gallium/state_trackers/egl/egl_tracker.h index 0b4dd9797d..908bab5f9b 100644 --- a/src/gallium/state_trackers/egl/egl_tracker.h +++ b/src/gallium/state_trackers/egl/egl_tracker.h @@ -128,7 +128,7 @@ struct drm_screen /*drmModeCrtcPtr crtc;*/ uint32_t crtcID; - struct drm_mode_modeinfo *mode; + drmModeModeInfoPtr mode; }; -- cgit v1.2.3 From 9eff576c947bf4d1c487ec692e8b16aa198ac532 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 08:30:58 -0700 Subject: mesa: remove empty, unneeded mathmod.h header --- src/mesa/math/m_xform.c | 1 - src/mesa/math/mathmod.h | 39 --------------------------------------- 2 files changed, 40 deletions(-) delete mode 100644 src/mesa/math/mathmod.h (limited to 'src') diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index fdc8abd434..eda4edab4f 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -40,7 +40,6 @@ #include "m_matrix.h" #include "m_translate.h" #include "m_xform.h" -#include "mathmod.h" #ifdef DEBUG_MATH diff --git a/src/mesa/math/mathmod.h b/src/mesa/math/mathmod.h deleted file mode 100644 index fb0862b5b1..0000000000 --- a/src/mesa/math/mathmod.h +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - - -/** - * \mainpage Mesa Math Module - * - * This module contains math-related utility functions for transforming - * vertices, translating arrays of numbers from one data type to another, - * evaluating curved surfaces, etc. - */ - - -#ifndef _MESA_MATH_H_ -#define _MESA_MATH_H_ - -#endif -- cgit v1.2.3 From e8cd8be03b9617d75df4e09dc568b6760db1edc4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 08:58:12 -0700 Subject: mesa: restore FLUSH_VERTICES() in _mesa_notifySwapBuffers() --- src/mesa/main/context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index c5b90d9cda..19ff5e552c 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -183,6 +183,7 @@ GLfloat _mesa_ubyte_to_float_color_tab[256]; void _mesa_notifySwapBuffers(__GLcontext *ctx) { + FLUSH_VERTICES( ctx, 0 ); if (ctx->Driver.Flush) { ctx->Driver.Flush(ctx); } -- cgit v1.2.3 From f45fa843199e86593126cb9e3b94621b31dd7589 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 09:15:38 -0700 Subject: mesa: remove unused functions in m_xform.[ch] The functions are: _mesa_project_points() _mesa_transform_bounds3() _mesa_transform_bounds2() _mesa_transform_point_sz() --- src/mesa/math/m_xform.c | 72 ------------------------------------------------- src/mesa/math/m_xform.h | 15 ----------- 2 files changed, 87 deletions(-) (limited to 'src') diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index eda4edab4f..4789a855d4 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -96,37 +96,6 @@ transform_func *_mesa_transform_tab[5]; #undef ARGS - - -GLvector4f *_mesa_project_points( GLvector4f *proj_vec, - const GLvector4f *clip_vec ) -{ - const GLuint stride = clip_vec->stride; - const GLfloat *from = (GLfloat *)clip_vec->start; - const GLuint count = clip_vec->count; - GLfloat (*vProj)[4] = (GLfloat (*)[4])proj_vec->start; - GLuint i; - - for (i = 0 ; i < count ; i++, STRIDE_F(from, stride)) - { - GLfloat oow = 1.0F / from[3]; - vProj[i][3] = oow; - vProj[i][0] = from[0] * oow; - vProj[i][1] = from[1] * oow; - vProj[i][2] = from[2] * oow; - } - - proj_vec->flags |= VEC_SIZE_4; - proj_vec->size = 3; - proj_vec->count = clip_vec->count; - return proj_vec; -} - - - - - - /* * Transform a 4-element row vector (1x4 matrix) by a 4x4 matrix. This * function is used for transforming clipping plane equations and spotlight @@ -148,47 +117,6 @@ void _mesa_transform_vector( GLfloat u[4], const GLfloat v[4], const GLfloat m[1 } -/* Useful for one-off point transformations, as in clipping. - * Note that because the matrix isn't analysed we do too many - * multiplies, and that the result is always 4-clean. - */ -void _mesa_transform_point_sz( GLfloat Q[4], const GLfloat M[16], - const GLfloat P[4], GLuint sz ) -{ - if (Q == P) - return; - - if (sz == 4) - { - Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; - Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; - Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; - Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3]; - } - else if (sz == 3) - { - Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; - Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; - Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; - Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15]; - } - else if (sz == 2) - { - Q[0] = M[0] * P[0] + M[4] * P[1] + M[12]; - Q[1] = M[1] * P[0] + M[5] * P[1] + M[13]; - Q[2] = M[2] * P[0] + M[6] * P[1] + M[14]; - Q[3] = M[3] * P[0] + M[7] * P[1] + M[15]; - } - else if (sz == 1) - { - Q[0] = M[0] * P[0] + M[12]; - Q[1] = M[1] * P[0] + M[13]; - Q[2] = M[2] * P[0] + M[14]; - Q[3] = M[3] * P[0] + M[15]; - } -} - - /* * This is called only once. It initializes several tables with pointers * to optimized transformation functions. This is where we can test for diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index 24e8ddbd57..c8144c00ae 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -148,18 +148,6 @@ typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec, CONST GLvector4f *from_vec ); -extern GLvector4f *_mesa_project_points( GLvector4f *to, - CONST GLvector4f *from ); - -extern void _mesa_transform_bounds3( GLubyte *orMask, GLubyte *andMask, - CONST GLfloat m[16], - CONST GLfloat src[][3] ); - -extern void _mesa_transform_bounds2( GLubyte *orMask, GLubyte *andMask, - CONST GLfloat m[16], - CONST GLfloat src[][3] ); - - extern dotprod_func _mesa_dotprod_tab[5]; extern vec_copy_func _mesa_copy_tab[0x10]; extern vec_copy_func _mesa_copy_clean_tab[5]; @@ -173,9 +161,6 @@ extern normal_func _mesa_normal_tab[0xf]; extern transform_func *_mesa_transform_tab[5]; -extern void _mesa_transform_point_sz( GLfloat Q[4], CONST GLfloat M[16], - CONST GLfloat P[4], GLuint sz ); - #define TransformRaw( to, mat, from ) \ ( _mesa_transform_tab[(from)->size][(mat)->type]( to, (mat)->m, from ), \ -- cgit v1.2.3 From 987aedd7dc75c095a96cb20b21bbad2f71857776 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 09:17:18 -0700 Subject: mesa: move _mesa_transform_vector() from m_xform.c to m_matrix.c m_xform.c is omitted from gallium builds but _mesa_transform_vector() is still needed. --- src/mesa/main/texgen.c | 2 +- src/mesa/math/m_matrix.c | 21 +++++++++++++++++++++ src/mesa/math/m_matrix.h | 3 +++ src/mesa/math/m_xform.c | 21 --------------------- src/mesa/math/m_xform.h | 4 ---- 5 files changed, 25 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 244c7aaafc..d2baecb92a 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -34,7 +34,7 @@ #include "main/enums.h" #include "main/macros.h" #include "main/texgen.h" -#include "math/m_xform.h" +#include "math/m_matrix.h" diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 84b4cae4ad..58cae88b08 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1620,3 +1620,24 @@ _math_transposefd( GLfloat to[16], const GLdouble from[16] ) /*@}*/ + +/** + * Transform a 4-element row vector (1x4 matrix) by a 4x4 matrix. This + * function is used for transforming clipping plane equations and spotlight + * directions. + * Mathematically, u = v * m. + * Input: v - input vector + * m - transformation matrix + * Output: u - transformed vector + */ +void +_mesa_transform_vector( GLfloat u[4], const GLfloat v[4], const GLfloat m[16] ) +{ + const GLfloat v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3]; +#define M(row,col) m[row + col*4] + u[0] = v0 * M(0,0) + v1 * M(1,0) + v2 * M(2,0) + v3 * M(3,0); + u[1] = v0 * M(0,1) + v1 * M(1,1) + v2 * M(2,1) + v3 * M(3,1); + u[2] = v0 * M(0,2) + v1 * M(1,2) + v2 * M(2,2) + v3 * M(3,2); + u[3] = v0 * M(0,3) + v1 * M(1,3) + v2 * M(2,3) + v3 * M(3,3); +#undef M +} diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h index a8d9000e89..3bc5de6cd4 100644 --- a/src/mesa/math/m_matrix.h +++ b/src/mesa/math/m_matrix.h @@ -200,6 +200,9 @@ do { \ } while (0) +extern void +_mesa_transform_vector(GLfloat u[4], const GLfloat v[4], const GLfloat m[16]); + /*@}*/ diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index 4789a855d4..369f2c6e95 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -96,27 +96,6 @@ transform_func *_mesa_transform_tab[5]; #undef ARGS -/* - * Transform a 4-element row vector (1x4 matrix) by a 4x4 matrix. This - * function is used for transforming clipping plane equations and spotlight - * directions. - * Mathematically, u = v * m. - * Input: v - input vector - * m - transformation matrix - * Output: u - transformed vector - */ -void _mesa_transform_vector( GLfloat u[4], const GLfloat v[4], const GLfloat m[16] ) -{ - GLfloat v0=v[0], v1=v[1], v2=v[2], v3=v[3]; -#define M(row,col) m[row + col*4] - u[0] = v0 * M(0,0) + v1 * M(1,0) + v2 * M(2,0) + v3 * M(3,0); - u[1] = v0 * M(0,1) + v1 * M(1,1) + v2 * M(2,1) + v3 * M(3,1); - u[2] = v0 * M(0,2) + v1 * M(1,2) + v2 * M(2,2) + v3 * M(3,2); - u[3] = v0 * M(0,3) + v1 * M(1,3) + v2 * M(2,3) + v3 * M(3,3); -#undef M -} - - /* * This is called only once. It initializes several tables with pointers * to optimized transformation functions. This is where we can test for diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index c8144c00ae..7ef76e0b92 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -41,10 +41,6 @@ #endif -extern void -_mesa_transform_vector(GLfloat u[4], CONST GLfloat v[4], CONST GLfloat m[16]); - - extern void _math_init_transformation(void); -- cgit v1.2.3 From 19dff5efc1e348d037b1b3cdfb9ac91020ecde4d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 09:21:50 -0700 Subject: mesa: don't include m_xform.h where not needed --- src/mesa/main/attrib.c | 2 +- src/mesa/main/clip.c | 1 - src/mesa/main/dlist.c | 1 - src/mesa/main/enable.c | 1 - src/mesa/main/matrix.c | 1 - src/mesa/main/texenv.c | 1 - src/mesa/main/texstate.c | 1 - 7 files changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 218e0aeb6b..add0045959 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -56,7 +56,7 @@ #include "texstate.h" #include "varray.h" #include "mtypes.h" -#include "math/m_xform.h" + /** * Special struct for saving/restoring texture state (GL_TEXTURE_BIT) diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index 43ef55ee3b..96c80e6ef8 100644 --- a/src/mesa/main/clip.c +++ b/src/mesa/main/clip.c @@ -29,7 +29,6 @@ #include "macros.h" #include "mtypes.h" -#include "math/m_xform.h" #include "math/m_matrix.h" diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index db1415bc06..76b3315034 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -85,7 +85,6 @@ #endif #include "math/m_matrix.h" -#include "math/m_xform.h" #include "glapi/dispatch.h" diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 2b54fac694..7ff3b15c84 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -37,7 +37,6 @@ #include "mtypes.h" #include "enums.h" #include "math/m_matrix.h" -#include "math/m_xform.h" #include "api_arrayelt.h" diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 0f96f94909..90d142278d 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -42,7 +42,6 @@ #include "matrix.h" #include "mtypes.h" #include "math/m_matrix.h" -#include "math/m_xform.h" /** diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index 097923182a..95547a500e 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -35,7 +35,6 @@ #include "main/enums.h" #include "main/macros.h" #include "main/texenv.h" -#include "math/m_xform.h" #define TE_ERROR(errCode, msg, value) \ diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 7761af7589..6586a48646 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -42,7 +42,6 @@ #include "texstate.h" #include "texenvprogram.h" #include "mtypes.h" -#include "math/m_xform.h" -- cgit v1.2.3 From 1a2f4dd8768703fbc1b2a0d5be342345644805b4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 10:08:25 -0700 Subject: mesa: consistantly use mesa memory-functions in gallium state tracker Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc. Still using CALLOC_STRUCT() at this point. --- src/mesa/state_tracker/st_atom.c | 4 ++-- src/mesa/state_tracker/st_atom_shader.c | 4 ++-- src/mesa/state_tracker/st_cb_accum.c | 20 ++++++++++---------- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/state_tracker/st_cb_clear.c | 4 ++-- src/mesa/state_tracker/st_cb_drawpixels.c | 12 ++++++------ src/mesa/state_tracker/st_cb_fbo.c | 2 +- src/mesa/state_tracker/st_cb_program.c | 8 ++++---- src/mesa/state_tracker/st_cb_queryobj.c | 2 +- src/mesa/state_tracker/st_cb_rasterpos.c | 2 +- src/mesa/state_tracker/st_context.c | 4 ++-- src/mesa/state_tracker/st_draw.c | 2 +- src/mesa/state_tracker/st_program.c | 6 +++--- 14 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index fc8587f459..f79092291b 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -69,7 +69,7 @@ void st_init_atoms( struct st_context *st ) { GLuint i; - st->atoms = malloc(sizeof(atoms)); + st->atoms = _mesa_malloc(sizeof(atoms)); st->nr_atoms = sizeof(atoms)/sizeof(*atoms); memcpy(st->atoms, atoms, sizeof(atoms)); @@ -92,7 +92,7 @@ void st_init_atoms( struct st_context *st ) void st_destroy_atoms( struct st_context *st ) { if (st->atoms) { - free(st->atoms); + _mesa_free(st->atoms); st->atoms = NULL; } } diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index cbd414e2d3..5653933e12 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -298,7 +298,7 @@ st_free_translated_vertex_programs(struct st_context *st, while (xvp) { next = xvp->next; - free(xvp); + _mesa_free(xvp); xvp = next; } } @@ -313,7 +313,7 @@ get_passthrough_fs(struct st_context *st) st->passthrough_fs = util_make_fragment_passthrough_shader(st->pipe, &shader); #if 0 /* We actually need to keep the tokens around at this time */ - free((void *) shader.tokens); + _mesa_free((void *) shader.tokens); #endif } diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index a4e72b48ed..2fc37343bd 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -206,8 +206,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value, color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); - colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + colorBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + accBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, colorBuf); acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf); @@ -218,8 +218,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value, acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf); - free(colorBuf); - free(accBuf); + _mesa_free(colorBuf); + _mesa_free(accBuf); pipe_surface_reference(&acc_surf, NULL); pipe_surface_reference(&color_surf, NULL); } @@ -242,7 +242,7 @@ accum_load(struct pipe_context *pipe, GLfloat value, color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); - buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, buf); @@ -252,7 +252,7 @@ accum_load(struct pipe_context *pipe, GLfloat value, acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, buf); - free(buf); + _mesa_free(buf); pipe_surface_reference(&acc_surf, NULL); pipe_surface_reference(&color_surf, NULL); } @@ -271,7 +271,7 @@ accum_return(GLcontext *ctx, GLfloat value, GLfloat *abuf, *cbuf = NULL; GLint i, ch; - abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + abuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); acc_surf = screen->get_tex_surface(screen, acc_strb->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); @@ -283,7 +283,7 @@ accum_return(GLcontext *ctx, GLfloat value, acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, abuf); if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) { - cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + cbuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, cbuf); } @@ -301,9 +301,9 @@ accum_return(GLcontext *ctx, GLfloat value, pipe_put_tile_rgba(color_surf, xpos, ypos, width, height, abuf); - free(abuf); + _mesa_free(abuf); if (cbuf) - free(cbuf); + _mesa_free(cbuf); pipe_surface_reference(&acc_surf, NULL); pipe_surface_reference(&color_surf, NULL); } diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index f14e562400..fff348de59 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -827,7 +827,7 @@ st_destroy_bitmap(struct st_context *st) if (st->bitmap.cache) { pipe_texture_release(&st->bitmap.cache->texture); - FREE(st->bitmap.cache); + _mesa_free(st->bitmap.cache); st->bitmap.cache = NULL; } } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 07fa2afce0..e601ec46f8 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -80,7 +80,7 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj) if (st_obj->buffer) pipe_buffer_reference(pipe->screen, &st_obj->buffer, NULL); - free(st_obj); + _mesa_free(st_obj); } diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 668c3f9ebf..0eddda23a7 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -98,12 +98,12 @@ st_destroy_clear(struct st_context *st) struct pipe_context *pipe = st->pipe; if (st->clear.vert_shader.tokens) { - FREE((void *) st->clear.vert_shader.tokens); + _mesa_free((void *) st->clear.vert_shader.tokens); st->clear.vert_shader.tokens = NULL; } if (st->clear.frag_shader.tokens) { - FREE((void *) st->clear.frag_shader.tokens); + _mesa_free((void *) st->clear.frag_shader.tokens); st->clear.frag_shader.tokens = NULL; } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 32bf21411d..cb4a01c22b 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -896,7 +896,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, ubyte *buffer; int i; - buffer = malloc(width * height * sizeof(ubyte)); + buffer = _mesa_malloc(width * height * sizeof(ubyte)); if (!buffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)"); return; @@ -950,7 +950,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } } - free(buffer); + _mesa_free(buffer); /* unmap the stencil buffer */ screen->surface_unmap(screen, psDraw); @@ -1056,19 +1056,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (type == GL_COLOR) { /* alternate path using get/put_tile() */ - GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(psRead, srcx, srcy, width, height, buf); pipe_put_tile_rgba(psTex, 0, 0, width, height, buf); - free(buf); + _mesa_free(buf); } else { /* GL_DEPTH */ - GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); + GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); pipe_get_tile_z(psRead, srcx, srcy, width, height, buf); pipe_put_tile_z(psTex, 0, 0, width, height, buf); - free(buf); + _mesa_free(buf); } pipe_surface_reference(&psRead, NULL); } diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 9af648b8d0..fd85a7a305 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -194,7 +194,7 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb) ASSERT(strb); pipe_surface_reference(&strb->surface, NULL); pipe_texture_reference(&strb->texture, NULL); - free(strb); + _mesa_free(strb); } diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index ea0fa20012..44f47865f8 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -152,7 +152,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stvp->state.tokens) { - FREE((void *) stvp->state.tokens); + _mesa_free((void *) stvp->state.tokens); stvp->state.tokens = NULL; } } @@ -167,7 +167,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stfp->state.tokens) { - FREE((void *) stfp->state.tokens); + _mesa_free((void *) stfp->state.tokens); stfp->state.tokens = NULL; } @@ -214,7 +214,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stfp->state.tokens) { - FREE((void *) stfp->state.tokens); + _mesa_free((void *) stfp->state.tokens); stfp->state.tokens = NULL; } @@ -242,7 +242,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stvp->state.tokens) { - FREE((void *) stvp->state.tokens); + _mesa_free((void *) stvp->state.tokens); stvp->state.tokens = NULL; } diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index 21c2c7dd9f..bd2716a45f 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -87,7 +87,7 @@ st_DeleteQuery(GLcontext *ctx, struct gl_query_object *q) stq->pq = NULL; } - FREE(stq); + _mesa_free(stq); } diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 8867ca5652..f4057778bd 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -102,7 +102,7 @@ rastpos_line( struct draw_stage *stage, struct prim_header *prim ) static void rastpos_destroy(struct draw_stage *stage) { - free(stage); + _mesa_free(stage); } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index e584a6ceea..34f76d4462 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -217,7 +217,7 @@ static void st_destroy_context_priv( struct st_context *st ) st->default_texture = NULL; } - free( st ); + _mesa_free( st ); } @@ -245,7 +245,7 @@ void st_destroy_context( struct st_context *st ) pipe->destroy( pipe ); - free(ctx); + _mesa_free(ctx); } diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index ae71d586c2..b52e488612 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -223,7 +223,7 @@ setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count, if (!stobj) return NULL; - vec = (unsigned *) calloc(sizeof(unsigned), (count + 31) / 32); + vec = (unsigned *) _mesa_calloc(sizeof(unsigned) * ((count + 31) / 32)); if (!vec) return NULL; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 442eeed147..d2535b6a2f 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -61,9 +61,9 @@ static INLINE void * mem_dup(const void *src, uint size) { - void *dup = MALLOC(size); + void *dup = _mesa_malloc(size); if (dup) - memcpy(dup, src, size); + _mesa_memcpy(dup, src, size); return dup; } @@ -307,7 +307,7 @@ st_translate_vertex_program(struct st_context *st, /* free old shader state, if any */ if (stvp->state.tokens) { - FREE((void *) stvp->state.tokens); + _mesa_free((void *) stvp->state.tokens); stvp->state.tokens = NULL; } if (stvp->driver_shader) { -- cgit v1.2.3 From f1a59a6dd7b7b0523db191d82b3af1a841c6475d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 10:14:36 -0700 Subject: mesa: use new ST_CALLOC_STRUCT() macro in gallium state tracker --- src/mesa/state_tracker/st_atom_shader.c | 2 +- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/state_tracker/st_cb_fbo.c | 4 ++-- src/mesa/state_tracker/st_cb_feedback.c | 4 ++-- src/mesa/state_tracker/st_cb_program.c | 4 ++-- src/mesa/state_tracker/st_cb_queryobj.c | 2 +- src/mesa/state_tracker/st_cb_rasterpos.c | 2 +- src/mesa/state_tracker/st_cb_texture.c | 4 ++-- src/mesa/state_tracker/st_context.c | 2 +- src/mesa/state_tracker/st_context.h | 4 ++++ src/mesa/state_tracker/st_framebuffer.c | 2 +- 12 files changed, 19 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 5653933e12..bed3ff4ae5 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -165,7 +165,7 @@ find_translated_vp(struct st_context *st, /* No? Allocate translated vp object now */ if (!xvp) { - xvp = CALLOC_STRUCT(translated_vertex_program); + xvp = ST_CALLOC_STRUCT(translated_vertex_program); xvp->frag_inputs = fragInputsRead; xvp->master = stvp; diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index fff348de59..da0ea64558 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -798,7 +798,7 @@ st_init_bitmap(struct st_context *st) } /* alloc bitmap cache object */ - st->bitmap.cache = CALLOC_STRUCT(bitmap_cache); + st->bitmap.cache = ST_CALLOC_STRUCT(bitmap_cache); reset_cache(st); } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index e601ec46f8..aba1cda932 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -55,7 +55,7 @@ static struct gl_buffer_object * st_bufferobj_alloc(GLcontext *ctx, GLuint name, GLenum target) { - struct st_buffer_object *st_obj = CALLOC_STRUCT(st_buffer_object); + struct st_buffer_object *st_obj = ST_CALLOC_STRUCT(st_buffer_object); if (!st_obj) return NULL; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index fd85a7a305..611d78df0c 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -232,7 +232,7 @@ st_new_framebuffer(GLcontext *ctx, GLuint name) static struct gl_renderbuffer * st_new_renderbuffer(GLcontext *ctx, GLuint name) { - struct st_renderbuffer *strb = CALLOC_STRUCT(st_renderbuffer); + struct st_renderbuffer *strb = ST_CALLOC_STRUCT(st_renderbuffer); if (strb) { _mesa_init_renderbuffer(&strb->Base, name); strb->Base.Delete = st_renderbuffer_delete; @@ -254,7 +254,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples) { struct st_renderbuffer *strb; - strb = CALLOC_STRUCT(st_renderbuffer); + strb = ST_CALLOC_STRUCT(st_renderbuffer); if (!strb) { _mesa_error(NULL, GL_OUT_OF_MEMORY, "creating renderbuffer"); return NULL; diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index c7e8aa7cc5..86d3542262 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -184,7 +184,7 @@ feedback_destroy( struct draw_stage *stage ) static struct draw_stage * draw_glfeedback_stage(GLcontext *ctx, struct draw_context *draw) { - struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage); + struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage); fs->stage.draw = draw; fs->stage.next = NULL; @@ -257,7 +257,7 @@ select_destroy( struct draw_stage *stage ) static struct draw_stage * draw_glselect_stage(GLcontext *ctx, struct draw_context *draw) { - struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage); + struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage); fs->stage.draw = draw; fs->stage.next = NULL; diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 44f47865f8..4398ab2839 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -99,7 +99,7 @@ static struct gl_program *st_new_program( GLcontext *ctx, { switch (target) { case GL_VERTEX_PROGRAM_ARB: { - struct st_vertex_program *prog = CALLOC_STRUCT(st_vertex_program); + struct st_vertex_program *prog = ST_CALLOC_STRUCT(st_vertex_program); prog->serialNo = SerialNo++; @@ -111,7 +111,7 @@ static struct gl_program *st_new_program( GLcontext *ctx, case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: { - struct st_fragment_program *prog = CALLOC_STRUCT(st_fragment_program); + struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program); prog->serialNo = SerialNo++; diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index bd2716a45f..dcf4c38eb6 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -64,7 +64,7 @@ st_query_object(struct gl_query_object *q) static struct gl_query_object * st_NewQueryObject(GLcontext *ctx, GLuint id) { - struct st_query_object *stq = CALLOC_STRUCT(st_query_object); + struct st_query_object *stq = ST_CALLOC_STRUCT(st_query_object); if (stq) { stq->base.Id = id; stq->base.Ready = GL_TRUE; diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index f4057778bd..7dd2352739 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -180,7 +180,7 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim) static struct rastpos_stage * new_draw_rastpos_stage(GLcontext *ctx, struct draw_context *draw) { - struct rastpos_stage *rs = CALLOC_STRUCT(rastpos_stage); + struct rastpos_stage *rs = ST_CALLOC_STRUCT(rastpos_stage); GLuint i; rs->stage.draw = draw; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 9279a768c8..3dd1f1d737 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -114,7 +114,7 @@ st_NewTextureImage(GLcontext * ctx) { DBG("%s\n", __FUNCTION__); (void) ctx; - return (struct gl_texture_image *) CALLOC_STRUCT(st_texture_image); + return (struct gl_texture_image *) ST_CALLOC_STRUCT(st_texture_image); } @@ -122,7 +122,7 @@ st_NewTextureImage(GLcontext * ctx) static struct gl_texture_object * st_NewTextureObject(GLcontext * ctx, GLuint name, GLenum target) { - struct st_texture_object *obj = CALLOC_STRUCT(st_texture_object); + struct st_texture_object *obj = ST_CALLOC_STRUCT(st_texture_object); DBG("%s\n", __FUNCTION__); _mesa_initialize_texture_object(&obj->base, name, target); diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 34f76d4462..6d6c9f4332 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -105,7 +105,7 @@ static struct st_context * st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe ) { uint i; - struct st_context *st = CALLOC_STRUCT( st_context ); + struct st_context *st = ST_CALLOC_STRUCT( st_context ); ctx->st = st; diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 695ac4a96f..3547925ad7 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -242,6 +242,10 @@ st_fb_orientation(const struct gl_framebuffer *fb) } +/** clear-alloc a struct-sized object, with casting */ +#define ST_CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T)) + + extern int st_get_msaa(void); diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 0d9c7b97e3..0d4474a8b3 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -49,7 +49,7 @@ st_create_framebuffer( const __GLcontextModes *visual, uint width, uint height, void *private) { - struct st_framebuffer *stfb = CALLOC_STRUCT(st_framebuffer); + struct st_framebuffer *stfb = ST_CALLOC_STRUCT(st_framebuffer); if (stfb) { int samples = st_get_msaa(); -- cgit v1.2.3 From 5de5ab428cf5516d91daa3f193a76b0d87853f55 Mon Sep 17 00:00:00 2001 From: Robert Ellison Date: Thu, 12 Feb 2009 13:47:36 -0700 Subject: glDrawBuffers(n==0) is valid According to the GL spec, calling glDrawBuffers() with n == 0 is a valid operation (and essentially prevents drawing to any buffers). But _msa_DrawBuffersARB() was producing a GL_INVALID_VALUE error in this case. This fix adjusts the error check, and makes a small change to the ctx->Driver.DrawBuffer() call below to ensure that, if n == 0, Driver.DrawBuffer() is called with GL_NONE and that buffers[0] is *not* referenced in this case (since we don't know whether it is valid). Internal identifier: 365833 --- src/mesa/main/buffers.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 818d068a12..85db3868c4 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -290,7 +290,10 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) { + /* Turns out n==0 is a valid input that should not produce an error. + * The remaining code below correctly handles the n==0 case. + */ + if (n < 0 || n > (GLsizei) ctx->Const.MaxDrawBuffers) { _mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)"); return; } @@ -332,12 +335,14 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) _mesa_drawbuffers(ctx, n, buffers, destMask); /* - * Call device driver function. + * Call device driver function. Note that n can be equal to 0, + * in which case we don't want to reference buffers[0], which + * may not be valid. */ if (ctx->Driver.DrawBuffers) ctx->Driver.DrawBuffers(ctx, n, buffers); else if (ctx->Driver.DrawBuffer) - ctx->Driver.DrawBuffer(ctx, buffers[0]); + ctx->Driver.DrawBuffer(ctx, n>0? buffers[0]:GL_NONE); } -- cgit v1.2.3 From 56d88aece94d1f9972b6887e98a638a314af8732 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 2 Feb 2009 01:32:11 +0100 Subject: intel: Remove the ttm backend RIP ttm, its been fun knowing you. --- src/gallium/winsys/drm/intel/common/Makefile | 23 - .../winsys/drm/intel/common/Makefile.template | 64 -- .../winsys/drm/intel/common/intel_be_batchbuffer.c | 429 --------- .../winsys/drm/intel/common/intel_be_batchbuffer.h | 69 -- .../winsys/drm/intel/common/intel_be_context.c | 107 --- .../winsys/drm/intel/common/intel_be_context.h | 40 - .../winsys/drm/intel/common/intel_be_device.c | 296 ------- .../winsys/drm/intel/common/intel_be_device.h | 72 -- .../winsys/drm/intel/common/ws_dri_bufmgr.c | 949 -------------------- .../winsys/drm/intel/common/ws_dri_bufmgr.h | 138 --- .../winsys/drm/intel/common/ws_dri_bufpool.h | 102 --- .../winsys/drm/intel/common/ws_dri_drmpool.c | 268 ------ .../winsys/drm/intel/common/ws_dri_fencemgr.c | 377 -------- .../winsys/drm/intel/common/ws_dri_fencemgr.h | 115 --- .../winsys/drm/intel/common/ws_dri_mallocpool.c | 161 ---- .../winsys/drm/intel/common/ws_dri_slabpool.c | 968 --------------------- 16 files changed, 4178 deletions(-) delete mode 100644 src/gallium/winsys/drm/intel/common/Makefile delete mode 100644 src/gallium/winsys/drm/intel/common/Makefile.template delete mode 100644 src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c delete mode 100644 src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h delete mode 100644 src/gallium/winsys/drm/intel/common/intel_be_context.c delete mode 100644 src/gallium/winsys/drm/intel/common/intel_be_context.h delete mode 100644 src/gallium/winsys/drm/intel/common/intel_be_device.c delete mode 100644 src/gallium/winsys/drm/intel/common/intel_be_device.h delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c delete mode 100644 src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c (limited to 'src') diff --git a/src/gallium/winsys/drm/intel/common/Makefile b/src/gallium/winsys/drm/intel/common/Makefile deleted file mode 100644 index bf1a7d691f..0000000000 --- a/src/gallium/winsys/drm/intel/common/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -TOP = ../../../../../.. -include $(TOP)/configs/current - -LIBNAME = inteldrm - -C_SOURCES = \ - intel_be_batchbuffer.c \ - intel_be_context.c \ - intel_be_device.c \ - ws_dri_bufmgr.c \ - ws_dri_drmpool.c \ - ws_dri_fencemgr.c \ - ws_dri_mallocpool.c \ - ws_dri_slabpool.c - - -include ./Makefile.template - -DRIVER_DEFINES = $(shell pkg-config libdrm --cflags \ - && pkg-config libdrm --atleast-version=2.3.1 \ - && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP") -symlinks: - diff --git a/src/gallium/winsys/drm/intel/common/Makefile.template b/src/gallium/winsys/drm/intel/common/Makefile.template deleted file mode 100644 index 02ed363a43..0000000000 --- a/src/gallium/winsys/drm/intel/common/Makefile.template +++ /dev/null @@ -1,64 +0,0 @@ -# -*-makefile-*- - - -# We still have a dependency on the "dri" buffer manager. Most likely -# the interface can be reused in non-dri environments, and also as a -# frontend to simpler memory managers. -# -COMMON_SOURCES = - -OBJECTS = $(C_SOURCES:.c=.o) \ - $(CPP_SOURCES:.cpp=.o) \ - $(ASM_SOURCES:.S=.o) - - -### Include directories -INCLUDES = \ - -I. \ - -I$(TOP)/src/gallium/include \ - -I$(TOP)/src/gallium/auxiliary \ - -I$(TOP)/src/gallium/drivers \ - -I$(TOP)/include \ - $(DRIVER_INCLUDES) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ - -.cpp.o: - $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend symlinks $(LIBNAME) - - -$(LIBNAME): $(OBJECTS) Makefile Makefile.template - $(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS) - - -depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) \ - $(ASM_SOURCES) 2> /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -# Remove .o and backup files -clean:: - -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS) - -rm -f depend depend.bak - - -include depend diff --git a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c b/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c deleted file mode 100644 index bc13a5761e..0000000000 --- a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c +++ /dev/null @@ -1,429 +0,0 @@ - -#include "intel_be_batchbuffer.h" -#include "intel_be_context.h" -#include "intel_be_device.h" -#include - -#include "xf86drm.h" - -static void -intel_realloc_relocs(struct intel_be_batchbuffer *batch, int num_relocs) -{ - unsigned long size = num_relocs * I915_RELOC0_STRIDE + I915_RELOC_HEADER; - - size *= sizeof(uint32_t); - batch->reloc = realloc(batch->reloc, size); - batch->reloc_size = num_relocs; -} - - -void -intel_be_batchbuffer_reset(struct intel_be_batchbuffer *batch) -{ - /* - * Get a new, free batchbuffer. - */ - drmBO *bo; - struct drm_bo_info_req *req; - - driBOUnrefUserList(batch->list); - driBOResetList(batch->list); - - /* base.size is the size available to the i915simple driver */ - batch->base.size = batch->device->max_batch_size - BATCH_RESERVED; - batch->base.actual_size = batch->device->max_batch_size; - driBOData(batch->buffer, batch->base.actual_size, NULL, NULL, 0); - - /* - * Add the batchbuffer to the validate list. - */ - - driBOAddListItem(batch->list, batch->buffer, - DRM_BO_FLAG_EXE | DRM_BO_FLAG_MEM_TT, - DRM_BO_FLAG_EXE | DRM_BO_MASK_MEM, - &batch->dest_location, &batch->node); - - req = &batch->node->bo_arg.d.req.bo_req; - - /* - * Set up information needed for us to make relocations - * relative to the underlying drm buffer objects. - */ - - driReadLockKernelBO(); - bo = driBOKernel(batch->buffer); - req->presumed_offset = (uint64_t) bo->offset; - req->hint = DRM_BO_HINT_PRESUMED_OFFSET; - batch->drmBOVirtual = (uint8_t *) bo->virtual; - driReadUnlockKernelBO(); - - /* - * Adjust the relocation buffer size. - */ - - if (batch->reloc_size > INTEL_MAX_RELOCS || - batch->reloc == NULL) - intel_realloc_relocs(batch, INTEL_DEFAULT_RELOCS); - - assert(batch->reloc != NULL); - batch->reloc[0] = 0; /* No relocs yet. */ - batch->reloc[1] = 1; /* Reloc type 1 */ - batch->reloc[2] = 0; /* Only a single relocation list. */ - batch->reloc[3] = 0; /* Only a single relocation list. */ - - batch->base.map = driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, 0); - batch->poolOffset = driBOPoolOffset(batch->buffer); - batch->base.ptr = batch->base.map; - batch->dirty_state = ~0; - batch->nr_relocs = 0; - batch->flags = 0; - batch->id = 0;//batch->intel->intelScreen->batch_id++; -} - -/*====================================================================== - * Public functions - */ -struct intel_be_batchbuffer * -intel_be_batchbuffer_alloc(struct intel_be_context *intel) -{ - struct intel_be_batchbuffer *batch = calloc(sizeof(*batch), 1); - - batch->intel = intel; - batch->device = intel->device; - - driGenBuffers(intel->device->batchPool, "batchbuffer", 1, - &batch->buffer, 4096, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE, 0); - batch->last_fence = NULL; - batch->list = driBOCreateList(20); - batch->reloc = NULL; - intel_be_batchbuffer_reset(batch); - return batch; -} - -void -intel_be_batchbuffer_free(struct intel_be_batchbuffer *batch) -{ - if (batch->last_fence) { - driFenceFinish(batch->last_fence, - DRM_FENCE_TYPE_EXE, FALSE); - driFenceUnReference(&batch->last_fence); - } - if (batch->base.map) { - driBOUnmap(batch->buffer); - batch->base.map = NULL; - } - driBOUnReference(batch->buffer); - driBOFreeList(batch->list); - if (batch->reloc) - free(batch->reloc); - batch->buffer = NULL; - free(batch); -} - -void -intel_be_offset_relocation(struct intel_be_batchbuffer *batch, - unsigned pre_add, - struct _DriBufferObject *driBO, - uint64_t val_flags, - uint64_t val_mask) -{ - int itemLoc; - struct _drmBONode *node; - uint32_t *reloc; - struct drm_bo_info_req *req; - - driBOAddListItem(batch->list, driBO, val_flags, val_mask, - &itemLoc, &node); - req = &node->bo_arg.d.req.bo_req; - - if (!(req->hint & DRM_BO_HINT_PRESUMED_OFFSET)) { - - /* - * Stop other threads from tampering with the underlying - * drmBO while we're reading its offset. - */ - - driReadLockKernelBO(); - req->presumed_offset = (uint64_t) driBOKernel(driBO)->offset; - driReadUnlockKernelBO(); - req->hint = DRM_BO_HINT_PRESUMED_OFFSET; - } - - pre_add += driBOPoolOffset(driBO); - - if (batch->nr_relocs == batch->reloc_size) - intel_realloc_relocs(batch, batch->reloc_size * 2); - - reloc = batch->reloc + - (I915_RELOC_HEADER + batch->nr_relocs * I915_RELOC0_STRIDE); - - reloc[0] = ((uint8_t *)batch->base.ptr - batch->drmBOVirtual); - i915_batchbuffer_dword(&batch->base, req->presumed_offset + pre_add); - reloc[1] = pre_add; - reloc[2] = itemLoc; - reloc[3] = batch->dest_location; - batch->nr_relocs++; -} - -static void -i915_drm_copy_reply(const struct drm_bo_info_rep * rep, drmBO * buf) -{ - buf->handle = rep->handle; - buf->flags = rep->flags; - buf->size = rep->size; - buf->offset = rep->offset; - buf->mapHandle = rep->arg_handle; - buf->proposedFlags = rep->proposed_flags; - buf->start = rep->buffer_start; - buf->fenceFlags = rep->fence_flags; - buf->replyFlags = rep->rep_flags; - buf->pageAlignment = rep->page_alignment; -} - -static int -i915_execbuf(struct intel_be_batchbuffer *batch, - unsigned int used, - boolean ignore_cliprects, - drmBOList *list, - struct drm_i915_execbuffer *ea) -{ -// struct intel_be_context *intel = batch->intel; - drmBONode *node; - drmMMListHead *l; - struct drm_i915_op_arg *arg, *first; - struct drm_bo_op_req *req; - struct drm_bo_info_rep *rep; - uint64_t *prevNext = NULL; - drmBO *buf; - int ret = 0; - uint32_t count = 0; - - first = NULL; - for (l = list->list.next; l != &list->list; l = l->next) { - node = DRMLISTENTRY(drmBONode, l, head); - - arg = &node->bo_arg; - req = &arg->d.req; - - if (!first) - first = arg; - - if (prevNext) - *prevNext = (unsigned long)arg; - - prevNext = &arg->next; - req->bo_req.handle = node->buf->handle; - req->op = drm_bo_validate; - req->bo_req.flags = node->arg0; - req->bo_req.mask = node->arg1; - req->bo_req.hint |= 0; - count++; - } - - memset(ea, 0, sizeof(*ea)); - ea->num_buffers = count; - ea->batch.start = batch->poolOffset; - ea->batch.used = used; -#if 0 /* ZZZ JB: no cliprects used */ - ea->batch.cliprects = intel->pClipRects; - ea->batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects; - ea->batch.DR1 = 0; - ea->batch.DR4 = 0;((((GLuint) intel->drawX) & 0xffff) | - (((GLuint) intel->drawY) << 16)); -#else - ea->batch.cliprects = NULL; - ea->batch.num_cliprects = 0; - ea->batch.DR1 = 0; - ea->batch.DR4 = 0; -#endif - ea->fence_arg.flags = DRM_I915_FENCE_FLAG_FLUSHED; - ea->ops_list = (unsigned long) first; - first->reloc_ptr = (unsigned long) batch->reloc; - batch->reloc[0] = batch->nr_relocs; - - //return -EFAULT; - do { - ret = drmCommandWriteRead(batch->device->fd, DRM_I915_EXECBUFFER, ea, - sizeof(*ea)); - } while (ret == -EAGAIN); - - if (ret != 0) - return ret; - - for (l = list->list.next; l != &list->list; l = l->next) { - node = DRMLISTENTRY(drmBONode, l, head); - arg = &node->bo_arg; - rep = &arg->d.rep.bo_info; - - if (!arg->handled) { - return -EFAULT; - } - if (arg->d.rep.ret) - return arg->d.rep.ret; - - buf = node->buf; - i915_drm_copy_reply(rep, buf); - } - return 0; -} - -/* TODO: Push this whole function into bufmgr. - */ -static struct _DriFenceObject * -do_flush_locked(struct intel_be_batchbuffer *batch, - unsigned int used, - boolean ignore_cliprects, boolean allow_unlock) -{ - struct intel_be_context *intel = batch->intel; - struct _DriFenceObject *fo; - drmFence fence; - drmBOList *boList; - struct drm_i915_execbuffer ea; - int ret = 0; - - driBOValidateUserList(batch->list); - boList = driGetdrmBOList(batch->list); - -#if 0 /* ZZZ JB Allways run */ - if (!(intel->numClipRects == 0 && !ignore_cliprects)) { -#else - if (1) { -#endif - ret = i915_execbuf(batch, used, ignore_cliprects, boList, &ea); - } else { - driPutdrmBOList(batch->list); - fo = NULL; - goto out; - } - driPutdrmBOList(batch->list); - if (ret) - abort(); - - if (ea.fence_arg.error != 0) { - - /* - * The hardware has been idled by the kernel. - * Don't fence the driBOs. - */ - - if (batch->last_fence) - driFenceUnReference(&batch->last_fence); -#if 0 /* ZZZ JB: no _mesa_* funcs in gallium */ - _mesa_printf("fence error\n"); -#endif - batch->last_fence = NULL; - fo = NULL; - goto out; - } - - fence.handle = ea.fence_arg.handle; - fence.fence_class = ea.fence_arg.fence_class; - fence.type = ea.fence_arg.type; - fence.flags = ea.fence_arg.flags; - fence.signaled = ea.fence_arg.signaled; - - fo = driBOFenceUserList(batch->device->fenceMgr, batch->list, - "SuperFence", &fence); - - if (driFenceType(fo) & DRM_I915_FENCE_TYPE_RW) { - if (batch->last_fence) - driFenceUnReference(&batch->last_fence); - /* - * FIXME: Context last fence?? - */ - batch->last_fence = fo; - driFenceReference(fo); - } - out: -#if 0 /* ZZZ JB: fix this */ - intel->vtbl.lost_hardware(intel); -#else - (void)intel; -#endif - return fo; -} - - -struct _DriFenceObject * -intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch) -{ - struct intel_be_context *intel = batch->intel; - unsigned int used = batch->base.ptr - batch->base.map; - boolean was_locked = batch->intel->hardware_locked(intel); - struct _DriFenceObject *fence; - - if (used == 0) { - driFenceReference(batch->last_fence); - return batch->last_fence; - } - - /* Add the MI_BATCH_BUFFER_END. Always add an MI_FLUSH - this is a - * performance drain that we would like to avoid. - */ -#if 0 /* ZZZ JB: what should we do here? */ - if (used & 4) { - ((int *) batch->base.ptr)[0] = intel->vtbl.flush_cmd(); - ((int *) batch->base.ptr)[1] = 0; - ((int *) batch->base.ptr)[2] = MI_BATCH_BUFFER_END; - used += 12; - } - else { - ((int *) batch->base.ptr)[0] = intel->vtbl.flush_cmd(); - ((int *) batch->base.ptr)[1] = MI_BATCH_BUFFER_END; - used += 8; - } -#else - if (used & 4) { - ((int *) batch->base.ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH; - ((int *) batch->base.ptr)[1] = 0; - ((int *) batch->base.ptr)[2] = (0xA<<23); // MI_BATCH_BUFFER_END; - used += 12; - } - else { - ((int *) batch->base.ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH; - ((int *) batch->base.ptr)[1] = (0xA<<23); // MI_BATCH_BUFFER_END; - used += 8; - } -#endif - driBOUnmap(batch->buffer); - batch->base.ptr = NULL; - batch->base.map = NULL; - - /* TODO: Just pass the relocation list and dma buffer up to the - * kernel. - */ - if (!was_locked) - intel->hardware_lock(intel); - - fence = do_flush_locked(batch, used, !(batch->flags & INTEL_BATCH_CLIPRECTS), - FALSE); - - if (!was_locked) - intel->hardware_unlock(intel); - - /* Reset the buffer: - */ - intel_be_batchbuffer_reset(batch); - return fence; -} - -void -intel_be_batchbuffer_finish(struct intel_be_batchbuffer *batch) -{ - struct _DriFenceObject *fence = intel_be_batchbuffer_flush(batch); - driFenceFinish(fence, driFenceType(fence), FALSE); - driFenceUnReference(&fence); -} - -#if 0 -void -intel_be_batchbuffer_data(struct intel_be_batchbuffer *batch, - const void *data, unsigned int bytes, unsigned int flags) -{ - assert((bytes & 3) == 0); - intel_batchbuffer_require_space(batch, bytes, flags); - memcpy(batch->base.ptr, data, bytes); - batch->base.ptr += bytes; -} -#endif diff --git a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h b/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h deleted file mode 100644 index f150e3a674..0000000000 --- a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h +++ /dev/null @@ -1,69 +0,0 @@ - -#ifndef INTEL_BE_BATCHBUFFER_H -#define INTEL_BE_BATCHBUFFER_H - -#include "i915simple/i915_batch.h" - -#include "ws_dri_bufmgr.h" - -#define BATCH_RESERVED 16 - -#define INTEL_DEFAULT_RELOCS 100 -#define INTEL_MAX_RELOCS 400 - -#define INTEL_BATCH_NO_CLIPRECTS 0x1 -#define INTEL_BATCH_CLIPRECTS 0x2 - -struct intel_be_context; -struct intel_be_device; - -struct intel_be_batchbuffer -{ - struct i915_batchbuffer base; - - struct intel_be_context *intel; - struct intel_be_device *device; - - struct _DriBufferObject *buffer; - struct _DriFenceObject *last_fence; - uint32_t flags; - - struct _DriBufferList *list; - size_t list_count; - - uint32_t *reloc; - size_t reloc_size; - size_t nr_relocs; - - uint32_t dirty_state; - uint32_t id; - - uint32_t poolOffset; - uint8_t *drmBOVirtual; - struct _drmBONode *node; /* Validation list node for this buffer */ - int dest_location; /* Validation list sequence for this buffer */ -}; - -struct intel_be_batchbuffer * -intel_be_batchbuffer_alloc(struct intel_be_context *intel); - -void -intel_be_batchbuffer_free(struct intel_be_batchbuffer *batch); - -void -intel_be_batchbuffer_finish(struct intel_be_batchbuffer *batch); - -struct _DriFenceObject * -intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch); - -void -intel_be_batchbuffer_reset(struct intel_be_batchbuffer *batch); - -void -intel_be_offset_relocation(struct intel_be_batchbuffer *batch, - unsigned pre_add, - struct _DriBufferObject *driBO, - uint64_t val_flags, - uint64_t val_mask); - -#endif diff --git a/src/gallium/winsys/drm/intel/common/intel_be_context.c b/src/gallium/winsys/drm/intel/common/intel_be_context.c deleted file mode 100644 index 1af39674f4..0000000000 --- a/src/gallium/winsys/drm/intel/common/intel_be_context.c +++ /dev/null @@ -1,107 +0,0 @@ - -/* - * Authors: Jakob Bornecrantz - */ - -#include "ws_dri_fencemgr.h" -#include "intel_be_device.h" -#include "intel_be_context.h" -#include "intel_be_batchbuffer.h" - -static INLINE struct intel_be_context * -intel_be_context(struct i915_winsys *sws) -{ - return (struct intel_be_context *)sws; -} - -/* Simple batchbuffer interface: - */ - -static struct i915_batchbuffer* -intel_i915_batch_get(struct i915_winsys *sws) -{ - struct intel_be_context *intel = intel_be_context(sws); - return &intel->batch->base; -} - -static void intel_i915_batch_reloc(struct i915_winsys *sws, - struct pipe_buffer *buf, - unsigned access_flags, - unsigned delta) -{ - struct intel_be_context *intel = intel_be_context(sws); - - unsigned flags = DRM_BO_FLAG_MEM_TT; - unsigned mask = DRM_BO_MASK_MEM; - - if (access_flags & I915_BUFFER_ACCESS_WRITE) { - flags |= DRM_BO_FLAG_WRITE; - mask |= DRM_BO_FLAG_WRITE; - } - - if (access_flags & I915_BUFFER_ACCESS_READ) { - flags |= DRM_BO_FLAG_READ; - mask |= DRM_BO_FLAG_READ; - } - - intel_be_offset_relocation(intel->batch, - delta, - dri_bo(buf), - flags, - mask); -} - -static void intel_i915_batch_flush(struct i915_winsys *sws, - struct pipe_fence_handle **fence) -{ - struct intel_be_context *intel = intel_be_context(sws); - - union { - struct _DriFenceObject *dri; - struct pipe_fence_handle *pipe; - } fu; - - if (fence) - assert(!*fence); - - fu.dri = intel_be_batchbuffer_flush(intel->batch); - - if (!fu.dri) { - assert(0); - *fence = NULL; - return; - } - - if (fu.dri) { - if (fence) - *fence = fu.pipe; - else - driFenceUnReference(&fu.dri); - } - -} - -boolean -intel_be_init_context(struct intel_be_context *intel, struct intel_be_device *device) -{ - assert(intel); - assert(device); - - intel->device = device; - - /* TODO move framebuffer createion to the driver */ - - intel->base.batch_get = intel_i915_batch_get; - intel->base.batch_reloc = intel_i915_batch_reloc; - intel->base.batch_flush = intel_i915_batch_flush; - - intel->batch = intel_be_batchbuffer_alloc(intel); - - return true; -} - -void -intel_be_destroy_context(struct intel_be_context *intel) -{ - intel_be_batchbuffer_free(intel->batch); -} diff --git a/src/gallium/winsys/drm/intel/common/intel_be_context.h b/src/gallium/winsys/drm/intel/common/intel_be_context.h deleted file mode 100644 index d5cbc93594..0000000000 --- a/src/gallium/winsys/drm/intel/common/intel_be_context.h +++ /dev/null @@ -1,40 +0,0 @@ -/* These need to be diffrent from the intel winsys */ -#ifndef INTEL_BE_CONTEXT_H -#define INTEL_BE_CONTEXT_H - -#include "i915simple/i915_winsys.h" - -struct intel_be_context -{ - /** Interface to i915simple driver */ - struct i915_winsys base; - - struct intel_be_device *device; - struct intel_be_batchbuffer *batch; - - /* - * Hardware lock functions. - * - * Needs to be filled in by the winsys. - */ - void (*hardware_lock)(struct intel_be_context *context); - void (*hardware_unlock)(struct intel_be_context *context); - boolean (*hardware_locked)(struct intel_be_context *context); -}; - -/** - * Intialize a allocated intel_be_context struct. - * - * Remember to set the hardware_* functions. - */ -boolean -intel_be_init_context(struct intel_be_context *intel, - struct intel_be_device *device); - -/** - * Destroy a intel_be_context. - * Does not free the struct that is up to the winsys. - */ -void -intel_be_destroy_context(struct intel_be_context *intel); -#endif diff --git a/src/gallium/winsys/drm/intel/common/intel_be_device.c b/src/gallium/winsys/drm/intel/common/intel_be_device.c deleted file mode 100644 index 85ab1a2684..0000000000 --- a/src/gallium/winsys/drm/intel/common/intel_be_device.c +++ /dev/null @@ -1,296 +0,0 @@ - - -/* - * Authors: Keith Whitwell - * Jakob Bornecrantz - */ - -#include "intel_be_device.h" -#include "ws_dri_bufmgr.h" -#include "ws_dri_bufpool.h" -#include "ws_dri_fencemgr.h" - -#include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_defines.h" -#include "pipe/p_state.h" -#include "pipe/p_inlines.h" -#include "util/u_memory.h" - -#include "i915simple/i915_screen.h" - -/* Turn a pipe winsys into an intel/pipe winsys: - */ -static INLINE struct intel_be_device * -intel_be_device( struct pipe_winsys *winsys ) -{ - return (struct intel_be_device *)winsys; -} - - -/* - * Buffer functions. - * - * Most callbacks map direcly onto dri_bufmgr operations: - */ - -static void *intel_be_buffer_map(struct pipe_winsys *winsys, - struct pipe_buffer *buf, - unsigned flags ) -{ - unsigned drm_flags = 0; - - if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) - drm_flags |= DRM_BO_FLAG_WRITE; - - if (flags & PIPE_BUFFER_USAGE_CPU_READ) - drm_flags |= DRM_BO_FLAG_READ; - - return driBOMap( dri_bo(buf), drm_flags, 0 ); -} - -static void intel_be_buffer_unmap(struct pipe_winsys *winsys, - struct pipe_buffer *buf) -{ - driBOUnmap( dri_bo(buf) ); -} - -static void -intel_be_buffer_destroy(struct pipe_winsys *winsys, - struct pipe_buffer *buf) -{ - driBOUnReference( dri_bo(buf) ); - FREE(buf); -} - -static struct pipe_buffer * -intel_be_buffer_create(struct pipe_winsys *winsys, - unsigned alignment, - unsigned usage, - unsigned size ) -{ - struct intel_be_buffer *buffer = CALLOC_STRUCT( intel_be_buffer ); - struct intel_be_device *iws = intel_be_device(winsys); - unsigned flags = 0; - struct _DriBufferPool *pool; - - buffer->base.refcount = 1; - buffer->base.alignment = alignment; - buffer->base.usage = usage; - buffer->base.size = size; - - if (usage & (PIPE_BUFFER_USAGE_VERTEX | PIPE_BUFFER_USAGE_CONSTANT)) { - flags |= DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED; - pool = iws->mallocPool; - } else if (usage & PIPE_BUFFER_USAGE_CUSTOM) { - /* For vertex buffers */ - flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT; - pool = iws->vertexPool; - } else { - flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT; - pool = iws->regionPool; - } - - if (usage & PIPE_BUFFER_USAGE_GPU_READ) - flags |= DRM_BO_FLAG_READ; - - if (usage & PIPE_BUFFER_USAGE_GPU_WRITE) - flags |= DRM_BO_FLAG_WRITE; - - /* drm complains if we don't set any read/write flags. - */ - if ((flags & (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE)) == 0) - flags |= DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE; - - buffer->pool = pool; - driGenBuffers( buffer->pool, - "pipe buffer", 1, &buffer->driBO, alignment, flags, 0 ); - - driBOData( buffer->driBO, size, NULL, buffer->pool, 0 ); - - return &buffer->base; -} - - -static struct pipe_buffer * -intel_be_user_buffer_create(struct pipe_winsys *winsys, void *ptr, unsigned bytes) -{ - struct intel_be_buffer *buffer = CALLOC_STRUCT( intel_be_buffer ); - struct intel_be_device *iws = intel_be_device(winsys); - - driGenUserBuffer( iws->regionPool, - "pipe user buffer", &buffer->driBO, ptr, bytes ); - - buffer->base.refcount = 1; - - return &buffer->base; -} - -struct pipe_buffer * -intel_be_buffer_from_handle(struct intel_be_device *device, - const char* name, unsigned handle) -{ - struct intel_be_buffer *be_buf = malloc(sizeof(*be_buf)); - struct pipe_buffer *buffer; - - if (!be_buf) - goto err; - - memset(be_buf, 0, sizeof(*be_buf)); - - driGenBuffers(device->staticPool, name, 1, &be_buf->driBO, 0, 0, 0); - driBOSetReferenced(be_buf->driBO, handle); - - if (0) /** XXX TODO check error */ - goto err_bo; - - buffer = &be_buf->base; - buffer->refcount = 1; - buffer->alignment = 0; - buffer->usage = 0; - buffer->size = driBOSize(be_buf->driBO); - - return buffer; -err_bo: - free(be_buf); -err: - return NULL; -} - - -static struct pipe_buffer * -intel_i915_surface_buffer_create(struct pipe_winsys *winsys, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned *stride) -{ - const unsigned alignment = 64; - struct pipe_format_block block; - unsigned nblocksx, nblocksy; - - pf_get_block(format, &block); - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - *stride = round_up(nblocksx * block.size, alignment); - - return winsys->buffer_create(winsys, alignment, - usage, - *stride * nblocksy); -} - - -/* - * Fence functions - */ - -static void -intel_be_fence_reference( struct pipe_winsys *sws, - struct pipe_fence_handle **ptr, - struct pipe_fence_handle *fence ) -{ - if (*ptr) - driFenceUnReference((struct _DriFenceObject **)ptr); - - if (fence) - *ptr = (struct pipe_fence_handle *)driFenceReference((struct _DriFenceObject *)fence); -} - -static int -intel_be_fence_signalled( struct pipe_winsys *sws, - struct pipe_fence_handle *fence, - unsigned flag ) -{ - return driFenceSignaled((struct _DriFenceObject *)fence, flag); -} - -static int -intel_be_fence_finish( struct pipe_winsys *sws, - struct pipe_fence_handle *fence, - unsigned flag ) -{ - return driFenceFinish((struct _DriFenceObject *)fence, flag, 0); -} - - -/* - * Misc functions - */ - -boolean -intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id) -{ - dev->fd = fd; - dev->max_batch_size = 16 * 4096; - dev->max_vertex_size = 128 * 4096; - - dev->base.buffer_create = intel_be_buffer_create; - dev->base.user_buffer_create = intel_be_user_buffer_create; - dev->base.buffer_map = intel_be_buffer_map; - dev->base.buffer_unmap = intel_be_buffer_unmap; - dev->base.buffer_destroy = intel_be_buffer_destroy; - dev->base.surface_buffer_create = intel_i915_surface_buffer_create; - dev->base.fence_reference = intel_be_fence_reference; - dev->base.fence_signalled = intel_be_fence_signalled; - dev->base.fence_finish = intel_be_fence_finish; - -#if 0 /* Set by the winsys */ - dev->base.flush_frontbuffer = intel_flush_frontbuffer; - dev->base.get_name = intel_get_name; -#endif - - dev->fMan = driInitFreeSlabManager(10, 10); - dev->fenceMgr = driFenceMgrTTMInit(dev->fd); - - dev->mallocPool = driMallocPoolInit(); - dev->staticPool = driDRMPoolInit(dev->fd); - /* Sizes: 64 128 256 512 1024 2048 4096 8192 16384 32768 */ - dev->regionPool = driSlabPoolInit(dev->fd, - DRM_BO_FLAG_READ | - DRM_BO_FLAG_WRITE | - DRM_BO_FLAG_MEM_TT, - DRM_BO_FLAG_READ | - DRM_BO_FLAG_WRITE | - DRM_BO_FLAG_MEM_TT, - 64, - 10, 120, 4096 * 64, 0, - dev->fMan); - - dev->vertexPool = driSlabPoolInit(dev->fd, - DRM_BO_FLAG_READ | - DRM_BO_FLAG_WRITE | - DRM_BO_FLAG_MEM_TT, - DRM_BO_FLAG_READ | - DRM_BO_FLAG_WRITE | - DRM_BO_FLAG_MEM_TT, - dev->max_vertex_size, - 1, 120, dev->max_vertex_size * 4, 0, - dev->fMan); - - dev->batchPool = driSlabPoolInit(dev->fd, - DRM_BO_FLAG_EXE | - DRM_BO_FLAG_MEM_TT, - DRM_BO_FLAG_EXE | - DRM_BO_FLAG_MEM_TT, - dev->max_batch_size, - 1, 40, dev->max_batch_size * 16, 0, - dev->fMan); - - /* Fill in this struct with callbacks that i915simple will need to - * communicate with the window system, buffer manager, etc. - */ - dev->screen = i915_create_screen(&dev->base, id); - - return true; -} - -void -intel_be_destroy_device(struct intel_be_device *dev) -{ - driPoolTakeDown(dev->mallocPool); - driPoolTakeDown(dev->staticPool); - driPoolTakeDown(dev->regionPool); - driPoolTakeDown(dev->vertexPool); - driPoolTakeDown(dev->batchPool); - - /** TODO takedown fenceMgr and fMan */ -} diff --git a/src/gallium/winsys/drm/intel/common/intel_be_device.h b/src/gallium/winsys/drm/intel/common/intel_be_device.h deleted file mode 100644 index 534d638b6a..0000000000 --- a/src/gallium/winsys/drm/intel/common/intel_be_device.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef INTEL_DRM_DEVICE_H -#define INTEL_DRM_DEVICE_H - -#include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_context.h" - -/* - * Device - */ - -struct intel_be_device -{ - struct pipe_winsys base; - - /** - * Hw level screen - */ - struct pipe_screen *screen; - - int fd; /**< Drm file discriptor */ - - size_t max_batch_size; - size_t max_vertex_size; - - struct _DriFenceMgr *fenceMgr; - - struct _DriBufferPool *batchPool; - struct _DriBufferPool *regionPool; - struct _DriBufferPool *mallocPool; - struct _DriBufferPool *vertexPool; - struct _DriBufferPool *staticPool; - struct _DriFreeSlabManager *fMan; -}; - -boolean -intel_be_init_device(struct intel_be_device *device, int fd, unsigned id); - -void -intel_be_destroy_device(struct intel_be_device *dev); - -/* - * Buffer - */ - -struct intel_be_buffer { - struct pipe_buffer base; - struct _DriBufferPool *pool; - struct _DriBufferObject *driBO; -}; - -/** - * Create a be buffer from a drm bo handle - * - * Takes a reference - */ -struct pipe_buffer * -intel_be_buffer_from_handle(struct intel_be_device *device, - const char* name, unsigned handle); - -static INLINE struct intel_be_buffer * -intel_be_buffer(struct pipe_buffer *buf) -{ - return (struct intel_be_buffer *)buf; -} - -static INLINE struct _DriBufferObject * -dri_bo(struct pipe_buffer *buf) -{ - return intel_be_buffer(buf)->driBO; -} - -#endif diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c b/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c deleted file mode 100644 index 517a97b3ee..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c +++ /dev/null @@ -1,949 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Thomas Hellström - * Keith Whitwell - */ - -#include -#include -#include -#include "pipe/p_thread.h" -#include "errno.h" -#include "ws_dri_bufmgr.h" -#include "string.h" -#include "pipe/p_debug.h" -#include "ws_dri_bufpool.h" -#include "ws_dri_fencemgr.h" - - -/* - * This lock is here to protect drmBO structs changing underneath us during a - * validate list call, since validatelist cannot take individiual locks for - * each drmBO. Validatelist takes this lock in write mode. Any access to an - * individual drmBO should take this lock in read mode, since in that case, the - * driBufferObject mutex will protect the access. Locking order is - * driBufferObject mutex - > this rw lock. - */ - -pipe_static_mutex(bmMutex); -pipe_static_condvar(bmCond); - -static int kernelReaders = 0; -static int num_buffers = 0; -static int num_user_buffers = 0; - -static drmBO *drmBOListBuf(void *iterator) -{ - drmBONode *node; - drmMMListHead *l = (drmMMListHead *) iterator; - node = DRMLISTENTRY(drmBONode, l, head); - return node->buf; -} - -static void *drmBOListIterator(drmBOList *list) -{ - void *ret = list->list.next; - - if (ret == &list->list) - return NULL; - return ret; -} - -static void *drmBOListNext(drmBOList *list, void *iterator) -{ - void *ret; - - drmMMListHead *l = (drmMMListHead *) iterator; - ret = l->next; - if (ret == &list->list) - return NULL; - return ret; -} - -static drmBONode *drmAddListItem(drmBOList *list, drmBO *item, - uint64_t arg0, - uint64_t arg1) -{ - drmBONode *node; - drmMMListHead *l; - - l = list->free.next; - if (l == &list->free) { - node = (drmBONode *) malloc(sizeof(*node)); - if (!node) { - return NULL; - } - list->numCurrent++; - } - else { - DRMLISTDEL(l); - node = DRMLISTENTRY(drmBONode, l, head); - } - node->buf = item; - node->arg0 = arg0; - node->arg1 = arg1; - DRMLISTADD(&node->head, &list->list); - list->numOnList++; - return node; -} - -static int drmAddValidateItem(drmBOList *list, drmBO *buf, uint64_t flags, - uint64_t mask, int *newItem) -{ - drmBONode *node, *cur; - drmMMListHead *l; - - *newItem = 0; - cur = NULL; - - for (l = list->list.next; l != &list->list; l = l->next) { - node = DRMLISTENTRY(drmBONode, l, head); - if (node->buf == buf) { - cur = node; - break; - } - } - if (!cur) { - cur = drmAddListItem(list, buf, flags, mask); - if (!cur) { - return -ENOMEM; - } - *newItem = 1; - cur->arg0 = flags; - cur->arg1 = mask; - } - else { - uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM; - uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM; - - if (mask & cur->arg1 & ~DRM_BO_MASK_MEM & (cur->arg0 ^ flags)) { - return -EINVAL; - } - - cur->arg1 |= mask; - cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask); - - if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) && - (cur->arg0 & DRM_BO_MASK_MEM) == 0) { - return -EINVAL; - } - } - return 0; -} - -static void drmBOFreeList(drmBOList *list) -{ - drmBONode *node; - drmMMListHead *l; - - l = list->list.next; - while(l != &list->list) { - DRMLISTDEL(l); - node = DRMLISTENTRY(drmBONode, l, head); - free(node); - l = list->list.next; - list->numCurrent--; - list->numOnList--; - } - - l = list->free.next; - while(l != &list->free) { - DRMLISTDEL(l); - node = DRMLISTENTRY(drmBONode, l, head); - free(node); - l = list->free.next; - list->numCurrent--; - } -} - -static int drmAdjustListNodes(drmBOList *list) -{ - drmBONode *node; - drmMMListHead *l; - int ret = 0; - - while(list->numCurrent < list->numTarget) { - node = (drmBONode *) malloc(sizeof(*node)); - if (!node) { - ret = -ENOMEM; - break; - } - list->numCurrent++; - DRMLISTADD(&node->head, &list->free); - } - - while(list->numCurrent > list->numTarget) { - l = list->free.next; - if (l == &list->free) - break; - DRMLISTDEL(l); - node = DRMLISTENTRY(drmBONode, l, head); - free(node); - list->numCurrent--; - } - return ret; -} - -static int drmBOCreateList(int numTarget, drmBOList *list) -{ - DRMINITLISTHEAD(&list->list); - DRMINITLISTHEAD(&list->free); - list->numTarget = numTarget; - list->numCurrent = 0; - list->numOnList = 0; - return drmAdjustListNodes(list); -} - -static int drmBOResetList(drmBOList *list) -{ - drmMMListHead *l; - int ret; - - ret = drmAdjustListNodes(list); - if (ret) - return ret; - - l = list->list.next; - while (l != &list->list) { - DRMLISTDEL(l); - DRMLISTADD(l, &list->free); - list->numOnList--; - l = list->list.next; - } - return drmAdjustListNodes(list); -} - -void driWriteLockKernelBO(void) -{ - pipe_mutex_lock(bmMutex); - while(kernelReaders != 0) - pipe_condvar_wait(bmCond, bmMutex); -} - -void driWriteUnlockKernelBO(void) -{ - pipe_mutex_unlock(bmMutex); -} - -void driReadLockKernelBO(void) -{ - pipe_mutex_lock(bmMutex); - kernelReaders++; - pipe_mutex_unlock(bmMutex); -} - -void driReadUnlockKernelBO(void) -{ - pipe_mutex_lock(bmMutex); - if (--kernelReaders == 0) - pipe_condvar_broadcast(bmCond); - pipe_mutex_unlock(bmMutex); -} - - - - -/* - * TODO: Introduce fence pools in the same way as - * buffer object pools. - */ - -typedef struct _DriBufferObject -{ - DriBufferPool *pool; - pipe_mutex mutex; - int refCount; - const char *name; - uint64_t flags; - unsigned hint; - unsigned alignment; - unsigned createdByReference; - void *private; - /* user-space buffer: */ - unsigned userBuffer; - void *userData; - unsigned userSize; -} DriBufferObject; - -typedef struct _DriBufferList { - drmBOList drmBuffers; /* List of kernel buffers needing validation */ - drmBOList driBuffers; /* List of user-space buffers needing validation */ -} DriBufferList; - - -void -bmError(int val, const char *file, const char *function, int line) -{ - printf("Fatal video memory manager error \"%s\".\n" - "Check kernel logs or set the LIBGL_DEBUG\n" - "environment variable to \"verbose\" for more info.\n" - "Detected in file %s, line %d, function %s.\n", - strerror(-val), file, line, function); -#ifndef NDEBUG - abort(); -#else - abort(); -#endif -} - -extern drmBO * -driBOKernel(struct _DriBufferObject *buf) -{ - drmBO *ret; - - driReadLockKernelBO(); - pipe_mutex_lock(buf->mutex); - assert(buf->private != NULL); - ret = buf->pool->kernel(buf->pool, buf->private); - if (!ret) - BM_CKFATAL(-EINVAL); - pipe_mutex_unlock(buf->mutex); - driReadUnlockKernelBO(); - - return ret; -} - -void -driBOWaitIdle(struct _DriBufferObject *buf, int lazy) -{ - - /* - * This function may block. Is it sane to keep the mutex held during - * that time?? - */ - - pipe_mutex_lock(buf->mutex); - BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, &buf->mutex, lazy)); - pipe_mutex_unlock(buf->mutex); -} - -void * -driBOMap(struct _DriBufferObject *buf, unsigned flags, unsigned hint) -{ - void *virtual; - int retval; - - if (buf->userBuffer) { - return buf->userData; - } - - pipe_mutex_lock(buf->mutex); - assert(buf->private != NULL); - retval = buf->pool->map(buf->pool, buf->private, flags, hint, - &buf->mutex, &virtual); - pipe_mutex_unlock(buf->mutex); - - return retval == 0 ? virtual : NULL; -} - -void -driBOUnmap(struct _DriBufferObject *buf) -{ - if (buf->userBuffer) - return; - - assert(buf->private != NULL); - pipe_mutex_lock(buf->mutex); - BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private)); - pipe_mutex_unlock(buf->mutex); -} - -unsigned long -driBOOffset(struct _DriBufferObject *buf) -{ - unsigned long ret; - - assert(buf->private != NULL); - - pipe_mutex_lock(buf->mutex); - ret = buf->pool->offset(buf->pool, buf->private); - pipe_mutex_unlock(buf->mutex); - return ret; -} - -unsigned long -driBOPoolOffset(struct _DriBufferObject *buf) -{ - unsigned long ret; - - assert(buf->private != NULL); - - pipe_mutex_lock(buf->mutex); - ret = buf->pool->poolOffset(buf->pool, buf->private); - pipe_mutex_unlock(buf->mutex); - return ret; -} - -uint64_t -driBOFlags(struct _DriBufferObject *buf) -{ - uint64_t ret; - - assert(buf->private != NULL); - - driReadLockKernelBO(); - pipe_mutex_lock(buf->mutex); - ret = buf->pool->flags(buf->pool, buf->private); - pipe_mutex_unlock(buf->mutex); - driReadUnlockKernelBO(); - return ret; -} - -struct _DriBufferObject * -driBOReference(struct _DriBufferObject *buf) -{ - pipe_mutex_lock(buf->mutex); - if (++buf->refCount == 1) { - pipe_mutex_unlock(buf->mutex); - BM_CKFATAL(-EINVAL); - } - pipe_mutex_unlock(buf->mutex); - return buf; -} - -void -driBOUnReference(struct _DriBufferObject *buf) -{ - int tmp; - - if (!buf) - return; - - pipe_mutex_lock(buf->mutex); - tmp = --buf->refCount; - if (!tmp) { - pipe_mutex_unlock(buf->mutex); - if (buf->private) { - if (buf->createdByReference) - buf->pool->unreference(buf->pool, buf->private); - else - buf->pool->destroy(buf->pool, buf->private); - } - if (buf->userBuffer) - num_user_buffers--; - else - num_buffers--; - free(buf); - } else - pipe_mutex_unlock(buf->mutex); - -} - - -int -driBOData(struct _DriBufferObject *buf, - unsigned size, const void *data, - DriBufferPool *newPool, - uint64_t flags) -{ - void *virtual = NULL; - int newBuffer; - int retval = 0; - struct _DriBufferPool *pool; - - assert(!buf->userBuffer); /* XXX just do a memcpy? */ - - pipe_mutex_lock(buf->mutex); - pool = buf->pool; - - if (pool == NULL && newPool != NULL) { - buf->pool = newPool; - pool = newPool; - } - if (newPool == NULL) - newPool = pool; - - if (!pool->create) { - assert((size_t)"driBOData called on invalid buffer\n" & 0); - BM_CKFATAL(-EINVAL); - } - - newBuffer = (!buf->private || pool != newPool || - pool->size(pool, buf->private) < size); - - if (!flags) - flags = buf->flags; - - if (newBuffer) { - - if (buf->createdByReference) { - assert((size_t)"driBOData requiring resizing called on shared buffer.\n" & 0); - BM_CKFATAL(-EINVAL); - } - - if (buf->private) - buf->pool->destroy(buf->pool, buf->private); - - pool = newPool; - buf->pool = newPool; - buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE, - buf->alignment); - if (!buf->private) - retval = -ENOMEM; - - if (retval == 0) - retval = pool->map(pool, buf->private, - DRM_BO_FLAG_WRITE, - DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual); - } else if (pool->map(pool, buf->private, DRM_BO_FLAG_WRITE, - DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual)) { - /* - * Buffer is busy. need to create a new one. - */ - - void *newBuf; - - newBuf = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE, - buf->alignment); - if (newBuf) { - buf->pool->destroy(buf->pool, buf->private); - buf->private = newBuf; - } - - retval = pool->map(pool, buf->private, - DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual); - } else { - uint64_t flag_diff = flags ^ buf->flags; - - /* - * We might need to change buffer flags. - */ - - if (flag_diff){ - assert(pool->setStatus != NULL); - BM_CKFATAL(pool->unmap(pool, buf->private)); - BM_CKFATAL(pool->setStatus(pool, buf->private, flag_diff, - buf->flags)); - if (!data) - goto out; - - retval = pool->map(pool, buf->private, - DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual); - } - } - - if (retval == 0) { - if (data) - memcpy(virtual, data, size); - - BM_CKFATAL(pool->unmap(pool, buf->private)); - } - - out: - pipe_mutex_unlock(buf->mutex); - - return retval; -} - -void -driBOSubData(struct _DriBufferObject *buf, - unsigned long offset, unsigned long size, const void *data) -{ - void *virtual; - - assert(!buf->userBuffer); /* XXX just do a memcpy? */ - - pipe_mutex_lock(buf->mutex); - if (size && data) { - BM_CKFATAL(buf->pool->map(buf->pool, buf->private, - DRM_BO_FLAG_WRITE, 0, &buf->mutex, - &virtual)); - memcpy((unsigned char *) virtual + offset, data, size); - BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private)); - } - pipe_mutex_unlock(buf->mutex); -} - -void -driBOGetSubData(struct _DriBufferObject *buf, - unsigned long offset, unsigned long size, void *data) -{ - void *virtual; - - assert(!buf->userBuffer); /* XXX just do a memcpy? */ - - pipe_mutex_lock(buf->mutex); - if (size && data) { - BM_CKFATAL(buf->pool->map(buf->pool, buf->private, - DRM_BO_FLAG_READ, 0, &buf->mutex, &virtual)); - memcpy(data, (unsigned char *) virtual + offset, size); - BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private)); - } - pipe_mutex_unlock(buf->mutex); -} - -void -driBOSetReferenced(struct _DriBufferObject *buf, - unsigned long handle) -{ - pipe_mutex_lock(buf->mutex); - if (buf->private != NULL) { - assert((size_t)"Invalid buffer for setReferenced\n" & 0); - BM_CKFATAL(-EINVAL); - - } - if (buf->pool->reference == NULL) { - assert((size_t)"Invalid buffer pool for setReferenced\n" & 0); - BM_CKFATAL(-EINVAL); - } - buf->private = buf->pool->reference(buf->pool, handle); - if (!buf->private) { - assert((size_t)"Invalid buffer pool for setStatic\n" & 0); - BM_CKFATAL(-ENOMEM); - } - buf->createdByReference = TRUE; - buf->flags = buf->pool->kernel(buf->pool, buf->private)->flags; - pipe_mutex_unlock(buf->mutex); -} - -int -driGenBuffers(struct _DriBufferPool *pool, - const char *name, - unsigned n, - struct _DriBufferObject *buffers[], - unsigned alignment, uint64_t flags, unsigned hint) -{ - struct _DriBufferObject *buf; - int i; - - flags = (flags) ? flags : DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_MEM_VRAM | - DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE; - - ++num_buffers; - - assert(pool); - - for (i = 0; i < n; ++i) { - buf = (struct _DriBufferObject *) calloc(1, sizeof(*buf)); - if (!buf) - return -ENOMEM; - - pipe_mutex_init(buf->mutex); - pipe_mutex_lock(buf->mutex); - buf->refCount = 1; - buf->flags = flags; - buf->hint = hint; - buf->name = name; - buf->alignment = alignment; - buf->pool = pool; - buf->createdByReference = 0; - pipe_mutex_unlock(buf->mutex); - buffers[i] = buf; - } - return 0; -} - -void -driGenUserBuffer(struct _DriBufferPool *pool, - const char *name, - struct _DriBufferObject **buffers, - void *ptr, unsigned bytes) -{ - const unsigned alignment = 1, flags = 0, hint = 0; - - --num_buffers; /* JB: is inced in GenBuffes */ - driGenBuffers(pool, name, 1, buffers, alignment, flags, hint); - ++num_user_buffers; - - (*buffers)->userBuffer = 1; - (*buffers)->userData = ptr; - (*buffers)->userSize = bytes; -} - -void -driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]) -{ - int i; - - for (i = 0; i < n; ++i) { - driBOUnReference(buffers[i]); - } -} - - -void -driInitBufMgr(int fd) -{ - ; -} - -/* - * Note that lists are per-context and don't need mutex protection. - */ - -struct _DriBufferList * -driBOCreateList(int target) -{ - struct _DriBufferList *list = calloc(sizeof(*list), 1); - - BM_CKFATAL(drmBOCreateList(target, &list->drmBuffers)); - BM_CKFATAL(drmBOCreateList(target, &list->driBuffers)); - return list; -} - -int -driBOResetList(struct _DriBufferList * list) -{ - int ret; - ret = drmBOResetList(&list->drmBuffers); - if (ret) - return ret; - ret = drmBOResetList(&list->driBuffers); - return ret; -} - -void -driBOFreeList(struct _DriBufferList * list) -{ - drmBOFreeList(&list->drmBuffers); - drmBOFreeList(&list->driBuffers); - free(list); -} - - -/* - * Copied from libdrm, because it is needed by driAddValidateItem. - */ - -static drmBONode * -driAddListItem(drmBOList * list, drmBO * item, - uint64_t arg0, uint64_t arg1) -{ - drmBONode *node; - drmMMListHead *l; - - l = list->free.next; - if (l == &list->free) { - node = (drmBONode *) malloc(sizeof(*node)); - if (!node) { - return NULL; - } - list->numCurrent++; - } else { - DRMLISTDEL(l); - node = DRMLISTENTRY(drmBONode, l, head); - } - memset(&node->bo_arg, 0, sizeof(node->bo_arg)); - node->buf = item; - node->arg0 = arg0; - node->arg1 = arg1; - DRMLISTADDTAIL(&node->head, &list->list); - list->numOnList++; - return node; -} - -/* - * Slightly modified version compared to the libdrm version. - * This one returns the list index of the buffer put on the list. - */ - -static int -driAddValidateItem(drmBOList * list, drmBO * buf, uint64_t flags, - uint64_t mask, int *itemLoc, - struct _drmBONode **pnode) -{ - drmBONode *node, *cur; - drmMMListHead *l; - int count = 0; - - cur = NULL; - - for (l = list->list.next; l != &list->list; l = l->next) { - node = DRMLISTENTRY(drmBONode, l, head); - if (node->buf == buf) { - cur = node; - break; - } - count++; - } - if (!cur) { - cur = driAddListItem(list, buf, flags, mask); - if (!cur) - return -ENOMEM; - - cur->arg0 = flags; - cur->arg1 = mask; - } else { - uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM; - uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM; - - if (mask & cur->arg1 & ~DRM_BO_MASK_MEM & (cur->arg0 ^ flags)) { - return -EINVAL; - } - - cur->arg1 |= mask; - cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask); - - if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) && - (cur->arg0 & DRM_BO_MASK_MEM) == 0) { - return -EINVAL; - } - } - *itemLoc = count; - *pnode = cur; - return 0; -} - - -void -driBOAddListItem(struct _DriBufferList * list, struct _DriBufferObject *buf, - uint64_t flags, uint64_t mask, int *itemLoc, - struct _drmBONode **node) -{ - int newItem; - - pipe_mutex_lock(buf->mutex); - BM_CKFATAL(driAddValidateItem(&list->drmBuffers, - buf->pool->kernel(buf->pool, buf->private), - flags, mask, itemLoc, node)); - BM_CKFATAL(drmAddValidateItem(&list->driBuffers, (drmBO *) buf, - flags, mask, &newItem)); - if (newItem) - buf->refCount++; - - pipe_mutex_unlock(buf->mutex); -} - -drmBOList *driGetdrmBOList(struct _DriBufferList *list) -{ - driWriteLockKernelBO(); - return &list->drmBuffers; -} - -void driPutdrmBOList(struct _DriBufferList *list) -{ - driWriteUnlockKernelBO(); -} - - -void -driBOFence(struct _DriBufferObject *buf, struct _DriFenceObject *fence) -{ - pipe_mutex_lock(buf->mutex); - if (buf->pool->fence) - BM_CKFATAL(buf->pool->fence(buf->pool, buf->private, fence)); - pipe_mutex_unlock(buf->mutex); - -} - -void -driBOUnrefUserList(struct _DriBufferList *list) -{ - struct _DriBufferObject *buf; - void *curBuf; - - curBuf = drmBOListIterator(&list->driBuffers); - while (curBuf) { - buf = (struct _DriBufferObject *)drmBOListBuf(curBuf); - driBOUnReference(buf); - curBuf = drmBOListNext(&list->driBuffers, curBuf); - } -} - -struct _DriFenceObject * -driBOFenceUserList(struct _DriFenceMgr *mgr, - struct _DriBufferList *list, const char *name, - drmFence *kFence) -{ - struct _DriFenceObject *fence; - struct _DriBufferObject *buf; - void *curBuf; - - fence = driFenceCreate(mgr, kFence->fence_class, kFence->type, - kFence, sizeof(*kFence)); - curBuf = drmBOListIterator(&list->driBuffers); - - /* - * User-space fencing callbacks. - */ - - while (curBuf) { - buf = (struct _DriBufferObject *) drmBOListBuf(curBuf); - driBOFence(buf, fence); - driBOUnReference(buf); - curBuf = drmBOListNext(&list->driBuffers, curBuf); - } - - driBOResetList(list); - return fence; -} - -void -driBOValidateUserList(struct _DriBufferList * list) -{ - void *curBuf; - struct _DriBufferObject *buf; - - curBuf = drmBOListIterator(&list->driBuffers); - - /* - * User-space validation callbacks. - */ - - while (curBuf) { - buf = (struct _DriBufferObject *) drmBOListBuf(curBuf); - pipe_mutex_lock(buf->mutex); - if (buf->pool->validate) - BM_CKFATAL(buf->pool->validate(buf->pool, buf->private, &buf->mutex)); - pipe_mutex_unlock(buf->mutex); - curBuf = drmBOListNext(&list->driBuffers, curBuf); - } -} - - -void -driPoolTakeDown(struct _DriBufferPool *pool) -{ - pool->takeDown(pool); - -} - -unsigned long -driBOSize(struct _DriBufferObject *buf) -{ - unsigned long size; - - pipe_mutex_lock(buf->mutex); - size = buf->pool->size(buf->pool, buf->private); - pipe_mutex_unlock(buf->mutex); - - return size; - -} - -drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list) -{ - return &list->drmBuffers; -} - -drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list) -{ - return &list->driBuffers; -} - diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h b/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h deleted file mode 100644 index e6c0cff0a0..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h +++ /dev/null @@ -1,138 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Thomas Hellström - * Keith Whitwell - */ - -#ifndef _PSB_BUFMGR_H_ -#define _PSB_BUFMGR_H_ -#include -#include "i915_drm.h" -#include "ws_dri_fencemgr.h" - -typedef struct _drmBONode -{ - drmMMListHead head; - drmBO *buf; - struct drm_i915_op_arg bo_arg; - uint64_t arg0; - uint64_t arg1; -} drmBONode; - -typedef struct _drmBOList { - unsigned numTarget; - unsigned numCurrent; - unsigned numOnList; - drmMMListHead list; - drmMMListHead free; -} drmBOList; - - -struct _DriFenceObject; -struct _DriBufferObject; -struct _DriBufferPool; -struct _DriBufferList; - -/* - * Return a pointer to the libdrm buffer object this DriBufferObject - * uses. - */ - -extern drmBO *driBOKernel(struct _DriBufferObject *buf); -extern void *driBOMap(struct _DriBufferObject *buf, unsigned flags, - unsigned hint); -extern void driBOUnmap(struct _DriBufferObject *buf); -extern unsigned long driBOOffset(struct _DriBufferObject *buf); -extern unsigned long driBOPoolOffset(struct _DriBufferObject *buf); - -extern uint64_t driBOFlags(struct _DriBufferObject *buf); -extern struct _DriBufferObject *driBOReference(struct _DriBufferObject *buf); -extern void driBOUnReference(struct _DriBufferObject *buf); - -extern int driBOData(struct _DriBufferObject *r_buf, - unsigned size, const void *data, - struct _DriBufferPool *pool, uint64_t flags); - -extern void driBOSubData(struct _DriBufferObject *buf, - unsigned long offset, unsigned long size, - const void *data); -extern void driBOGetSubData(struct _DriBufferObject *buf, - unsigned long offset, unsigned long size, - void *data); -extern int driGenBuffers(struct _DriBufferPool *pool, - const char *name, - unsigned n, - struct _DriBufferObject *buffers[], - unsigned alignment, uint64_t flags, unsigned hint); -extern void driGenUserBuffer(struct _DriBufferPool *pool, - const char *name, - struct _DriBufferObject *buffers[], - void *ptr, unsigned bytes); -extern void driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]); -extern void driInitBufMgr(int fd); -extern struct _DriBufferList *driBOCreateList(int target); -extern int driBOResetList(struct _DriBufferList * list); -extern void driBOAddListItem(struct _DriBufferList * list, - struct _DriBufferObject *buf, - uint64_t flags, uint64_t mask, int *itemLoc, - struct _drmBONode **node); - -extern void driBOValidateList(int fd, struct _DriBufferList * list); -extern void driBOFreeList(struct _DriBufferList * list); -extern struct _DriFenceObject *driBOFenceUserList(struct _DriFenceMgr *mgr, - struct _DriBufferList *list, - const char *name, - drmFence *kFence); -extern void driBOUnrefUserList(struct _DriBufferList *list); -extern void driBOValidateUserList(struct _DriBufferList * list); -extern drmBOList *driGetdrmBOList(struct _DriBufferList *list); -extern void driPutdrmBOList(struct _DriBufferList *list); - -extern void driBOFence(struct _DriBufferObject *buf, - struct _DriFenceObject *fence); - -extern void driPoolTakeDown(struct _DriBufferPool *pool); -extern void driBOSetReferenced(struct _DriBufferObject *buf, - unsigned long handle); -unsigned long driBOSize(struct _DriBufferObject *buf); -extern void driBOWaitIdle(struct _DriBufferObject *buf, int lazy); -extern void driPoolTakeDown(struct _DriBufferPool *pool); - -extern void driReadLockKernelBO(void); -extern void driReadUnlockKernelBO(void); -extern void driWriteLockKernelBO(void); -extern void driWriteUnlockKernelBO(void); - -/* - * For debugging purposes. - */ - -extern drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list); -extern drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list); -#endif diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h b/src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h deleted file mode 100644 index ad3b6f3931..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Thomas Hellström - */ - -#ifndef _PSB_BUFPOOL_H_ -#define _PSB_BUFPOOL_H_ - -#include -#include "pipe/p_thread.h" -struct _DriFenceObject; - -typedef struct _DriBufferPool -{ - int fd; - int (*map) (struct _DriBufferPool * pool, void *private, - unsigned flags, int hint, pipe_mutex *mutex, - void **virtual); - int (*unmap) (struct _DriBufferPool * pool, void *private); - int (*destroy) (struct _DriBufferPool * pool, void *private); - unsigned long (*offset) (struct _DriBufferPool * pool, void *private); - unsigned long (*poolOffset) (struct _DriBufferPool * pool, void *private); - uint64_t (*flags) (struct _DriBufferPool * pool, void *private); - unsigned long (*size) (struct _DriBufferPool * pool, void *private); - void *(*create) (struct _DriBufferPool * pool, unsigned long size, - uint64_t flags, unsigned hint, unsigned alignment); - void *(*reference) (struct _DriBufferPool * pool, unsigned handle); - int (*unreference) (struct _DriBufferPool * pool, void *private); - int (*fence) (struct _DriBufferPool * pool, void *private, - struct _DriFenceObject * fence); - drmBO *(*kernel) (struct _DriBufferPool * pool, void *private); - int (*validate) (struct _DriBufferPool * pool, void *private, pipe_mutex *mutex); - int (*waitIdle) (struct _DriBufferPool *pool, void *private, pipe_mutex *mutex, - int lazy); - int (*setStatus) (struct _DriBufferPool *pool, void *private, - uint64_t flag_diff, uint64_t old_flags); - void (*takeDown) (struct _DriBufferPool * pool); - void *data; -} DriBufferPool; - -extern void bmError(int val, const char *file, const char *function, - int line); -#define BM_CKFATAL(val) \ - do{ \ - int tstVal = (val); \ - if (tstVal) \ - bmError(tstVal, __FILE__, __FUNCTION__, __LINE__); \ - } while(0); - - -/* - * Builtin pools. - */ - -/* - * Kernel buffer objects. Size in multiples of page size. Page size aligned. - */ - -extern struct _DriBufferPool *driDRMPoolInit(int fd); -extern struct _DriBufferPool *driMallocPoolInit(void); - -struct _DriFreeSlabManager; -extern struct _DriBufferPool * driSlabPoolInit(int fd, uint64_t flags, - uint64_t validMask, - uint32_t smallestSize, - uint32_t numSizes, - uint32_t desiredNumBuffers, - uint32_t maxSlabSize, - uint32_t pageAlignment, - struct _DriFreeSlabManager *fMan); -extern void driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan); -extern struct _DriFreeSlabManager * -driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec); - - -#endif diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c b/src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c deleted file mode 100644 index 54618b1c82..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c +++ /dev/null @@ -1,268 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Thomas Hellström - */ - -#include -#include -#include -#include "ws_dri_bufpool.h" -#include "ws_dri_bufmgr.h" -#include "assert.h" - -/* - * Buffer pool implementation using DRM buffer objects as DRI buffer objects. - */ - -static void * -pool_create(struct _DriBufferPool *pool, - unsigned long size, uint64_t flags, unsigned hint, - unsigned alignment) -{ - drmBO *buf = (drmBO *) malloc(sizeof(*buf)); - int ret; - unsigned pageSize = getpagesize(); - - if (!buf) - return NULL; - - if ((alignment > pageSize) && (alignment % pageSize)) { - free(buf); - return NULL; - } - - ret = drmBOCreate(pool->fd, size, alignment / pageSize, - NULL, - flags, hint, buf); - if (ret) { - free(buf); - return NULL; - } - - return (void *) buf; -} - -static void * -pool_reference(struct _DriBufferPool *pool, unsigned handle) -{ - drmBO *buf = (drmBO *) malloc(sizeof(*buf)); - int ret; - - if (!buf) - return NULL; - - ret = drmBOReference(pool->fd, handle, buf); - - if (ret) { - free(buf); - return NULL; - } - - return (void *) buf; -} - -static int -pool_destroy(struct _DriBufferPool *pool, void *private) -{ - int ret; - drmBO *buf = (drmBO *) private; - driReadLockKernelBO(); - ret = drmBOUnreference(pool->fd, buf); - free(buf); - driReadUnlockKernelBO(); - return ret; -} - -static int -pool_unreference(struct _DriBufferPool *pool, void *private) -{ - int ret; - drmBO *buf = (drmBO *) private; - driReadLockKernelBO(); - ret = drmBOUnreference(pool->fd, buf); - free(buf); - driReadUnlockKernelBO(); - return ret; -} - -static int -pool_map(struct _DriBufferPool *pool, void *private, unsigned flags, - int hint, pipe_mutex *mutex, void **virtual) -{ - drmBO *buf = (drmBO *) private; - int ret; - - driReadLockKernelBO(); - ret = drmBOMap(pool->fd, buf, flags, hint, virtual); - driReadUnlockKernelBO(); - return ret; -} - -static int -pool_unmap(struct _DriBufferPool *pool, void *private) -{ - drmBO *buf = (drmBO *) private; - int ret; - - driReadLockKernelBO(); - ret = drmBOUnmap(pool->fd, buf); - driReadUnlockKernelBO(); - - return ret; -} - -static unsigned long -pool_offset(struct _DriBufferPool *pool, void *private) -{ - drmBO *buf = (drmBO *) private; - unsigned long offset; - - driReadLockKernelBO(); - assert(buf->flags & DRM_BO_FLAG_NO_MOVE); - offset = buf->offset; - driReadUnlockKernelBO(); - - return buf->offset; -} - -static unsigned long -pool_poolOffset(struct _DriBufferPool *pool, void *private) -{ - return 0; -} - -static uint64_t -pool_flags(struct _DriBufferPool *pool, void *private) -{ - drmBO *buf = (drmBO *) private; - uint64_t flags; - - driReadLockKernelBO(); - flags = buf->flags; - driReadUnlockKernelBO(); - - return flags; -} - - -static unsigned long -pool_size(struct _DriBufferPool *pool, void *private) -{ - drmBO *buf = (drmBO *) private; - unsigned long size; - - driReadLockKernelBO(); - size = buf->size; - driReadUnlockKernelBO(); - - return buf->size; -} - -static int -pool_fence(struct _DriBufferPool *pool, void *private, - struct _DriFenceObject *fence) -{ - /* - * Noop. The kernel handles all fencing. - */ - - return 0; -} - -static drmBO * -pool_kernel(struct _DriBufferPool *pool, void *private) -{ - return (drmBO *) private; -} - -static int -pool_waitIdle(struct _DriBufferPool *pool, void *private, pipe_mutex *mutex, - int lazy) -{ - drmBO *buf = (drmBO *) private; - int ret; - - driReadLockKernelBO(); - ret = drmBOWaitIdle(pool->fd, buf, (lazy) ? DRM_BO_HINT_WAIT_LAZY:0); - driReadUnlockKernelBO(); - - return ret; -} - - -static void -pool_takedown(struct _DriBufferPool *pool) -{ - free(pool); -} - -/*static int -pool_setStatus(struct _DriBufferPool *pool, void *private, - uint64_t flag_diff, uint64_t old_flags) -{ - drmBO *buf = (drmBO *) private; - uint64_t new_flags = old_flags ^ flag_diff; - int ret; - - driReadLockKernelBO(); - ret = drmBOSetStatus(pool->fd, buf, new_flags, flag_diff, - 0, 0, 0); - driReadUnlockKernelBO(); - return ret; -}*/ - -struct _DriBufferPool * -driDRMPoolInit(int fd) -{ - struct _DriBufferPool *pool; - - pool = (struct _DriBufferPool *) malloc(sizeof(*pool)); - - if (!pool) - return NULL; - - pool->fd = fd; - pool->map = &pool_map; - pool->unmap = &pool_unmap; - pool->destroy = &pool_destroy; - pool->offset = &pool_offset; - pool->poolOffset = &pool_poolOffset; - pool->flags = &pool_flags; - pool->size = &pool_size; - pool->create = &pool_create; - pool->fence = &pool_fence; - pool->kernel = &pool_kernel; - pool->validate = NULL; - pool->waitIdle = &pool_waitIdle; - pool->takeDown = &pool_takedown; - pool->reference = &pool_reference; - pool->unreference = &pool_unreference; - pool->data = NULL; - return pool; -} diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c b/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c deleted file mode 100644 index 831c75d30c..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c +++ /dev/null @@ -1,377 +0,0 @@ -#include "ws_dri_fencemgr.h" -#include "pipe/p_thread.h" -#include -#include -#include - -/* - * Note: Locking order is - * _DriFenceObject::mutex - * _DriFenceMgr::mutex - */ - -struct _DriFenceMgr { - /* - * Constant members. Need no mutex protection. - */ - struct _DriFenceMgrCreateInfo info; - void *private; - - /* - * These members are protected by this->mutex - */ - pipe_mutex mutex; - int refCount; - drmMMListHead *heads; - int num_fences; -}; - -struct _DriFenceObject { - - /* - * These members are constant and need no mutex protection. - */ - struct _DriFenceMgr *mgr; - uint32_t fence_class; - uint32_t fence_type; - - /* - * These members are protected by mgr->mutex. - */ - drmMMListHead head; - int refCount; - - /* - * These members are protected by this->mutex. - */ - pipe_mutex mutex; - uint32_t signaled_type; - void *private; -}; - -uint32_t -driFenceType(struct _DriFenceObject *fence) -{ - return fence->fence_type; -} - -struct _DriFenceMgr * -driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info) -{ - struct _DriFenceMgr *tmp; - uint32_t i; - - tmp = calloc(1, sizeof(*tmp)); - if (!tmp) - return NULL; - - pipe_mutex_init(tmp->mutex); - pipe_mutex_lock(tmp->mutex); - tmp->refCount = 1; - tmp->info = *info; - tmp->num_fences = 0; - tmp->heads = calloc(tmp->info.num_classes, sizeof(*tmp->heads)); - if (!tmp->heads) - goto out_err; - - for (i=0; iinfo.num_classes; ++i) { - DRMINITLISTHEAD(&tmp->heads[i]); - } - pipe_mutex_unlock(tmp->mutex); - return tmp; - - out_err: - if (tmp) - free(tmp); - return NULL; -} - -static void -driFenceMgrUnrefUnlock(struct _DriFenceMgr **pMgr) -{ - struct _DriFenceMgr *mgr = *pMgr; - - *pMgr = NULL; - if (--mgr->refCount == 0) - free(mgr); - else - pipe_mutex_unlock(mgr->mutex); -} - -void -driFenceMgrUnReference(struct _DriFenceMgr **pMgr) -{ - pipe_mutex_lock((*pMgr)->mutex); - driFenceMgrUnrefUnlock(pMgr); -} - -static void -driFenceUnReferenceLocked(struct _DriFenceObject **pFence) -{ - struct _DriFenceObject *fence = *pFence; - struct _DriFenceMgr *mgr = fence->mgr; - - *pFence = NULL; - if (--fence->refCount == 0) { - DRMLISTDELINIT(&fence->head); - if (fence->private) - mgr->info.unreference(mgr, &fence->private); - --mgr->num_fences; - fence->mgr = NULL; - --mgr->refCount; - free(fence); - - } -} - - -static void -driSignalPreviousFencesLocked(struct _DriFenceMgr *mgr, - drmMMListHead *list, - uint32_t fence_class, - uint32_t fence_type) -{ - struct _DriFenceObject *entry; - drmMMListHead *prev; - - while(list != &mgr->heads[fence_class]) { - entry = DRMLISTENTRY(struct _DriFenceObject, list, head); - - /* - * Up refcount so that entry doesn't disappear from under us - * when we unlock-relock mgr to get the correct locking order. - */ - - ++entry->refCount; - pipe_mutex_unlock(mgr->mutex); - pipe_mutex_lock(entry->mutex); - pipe_mutex_lock(mgr->mutex); - - prev = list->prev; - - - - if (list->prev == list) { - - /* - * Somebody else removed the entry from the list. - */ - - pipe_mutex_unlock(entry->mutex); - driFenceUnReferenceLocked(&entry); - return; - } - - entry->signaled_type |= (fence_type & entry->fence_type); - if (entry->signaled_type == entry->fence_type) { - DRMLISTDELINIT(list); - mgr->info.unreference(mgr, &entry->private); - } - pipe_mutex_unlock(entry->mutex); - driFenceUnReferenceLocked(&entry); - list = prev; - } -} - - -int -driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type, - int lazy_hint) -{ - struct _DriFenceMgr *mgr = fence->mgr; - int ret = 0; - - pipe_mutex_lock(fence->mutex); - - if ((fence->signaled_type & fence_type) == fence_type) - goto out0; - - ret = mgr->info.finish(mgr, fence->private, fence_type, lazy_hint); - if (ret) - goto out0; - - pipe_mutex_lock(mgr->mutex); - pipe_mutex_unlock(fence->mutex); - - driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class, - fence_type); - pipe_mutex_unlock(mgr->mutex); - return 0; - - out0: - pipe_mutex_unlock(fence->mutex); - return ret; -} - -uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence) -{ - uint32_t ret; - - pipe_mutex_lock(fence->mutex); - ret = fence->signaled_type; - pipe_mutex_unlock(fence->mutex); - - return ret; -} - -int -driFenceSignaledType(struct _DriFenceObject *fence, uint32_t flush_type, - uint32_t *signaled) -{ - int ret = 0; - struct _DriFenceMgr *mgr; - - pipe_mutex_lock(fence->mutex); - mgr = fence->mgr; - *signaled = fence->signaled_type; - if ((fence->signaled_type & flush_type) == flush_type) - goto out0; - - ret = mgr->info.signaled(mgr, fence->private, flush_type, signaled); - if (ret) { - *signaled = fence->signaled_type; - goto out0; - } - - if ((fence->signaled_type | *signaled) == fence->signaled_type) - goto out0; - - pipe_mutex_lock(mgr->mutex); - pipe_mutex_unlock(fence->mutex); - - driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class, - *signaled); - - pipe_mutex_unlock(mgr->mutex); - return 0; - out0: - pipe_mutex_unlock(fence->mutex); - return ret; -} - -struct _DriFenceObject * -driFenceReference(struct _DriFenceObject *fence) -{ - pipe_mutex_lock(fence->mgr->mutex); - ++fence->refCount; - pipe_mutex_unlock(fence->mgr->mutex); - return fence; -} - -void -driFenceUnReference(struct _DriFenceObject **pFence) -{ - struct _DriFenceMgr *mgr; - - if (*pFence == NULL) - return; - - mgr = (*pFence)->mgr; - pipe_mutex_lock(mgr->mutex); - ++mgr->refCount; - driFenceUnReferenceLocked(pFence); - driFenceMgrUnrefUnlock(&mgr); -} - -struct _DriFenceObject -*driFenceCreate(struct _DriFenceMgr *mgr, uint32_t fence_class, - uint32_t fence_type, void *private, size_t private_size) -{ - struct _DriFenceObject *fence; - size_t fence_size = sizeof(*fence); - - if (private_size) - fence_size = ((fence_size + 15) & ~15); - - fence = calloc(1, fence_size + private_size); - - if (!fence) { - int ret = mgr->info.finish(mgr, private, fence_type, 0); - - if (ret) - usleep(10000000); - - return NULL; - } - - pipe_mutex_init(fence->mutex); - pipe_mutex_lock(fence->mutex); - pipe_mutex_lock(mgr->mutex); - fence->refCount = 1; - DRMLISTADDTAIL(&fence->head, &mgr->heads[fence_class]); - fence->mgr = mgr; - ++mgr->refCount; - ++mgr->num_fences; - pipe_mutex_unlock(mgr->mutex); - fence->fence_class = fence_class; - fence->fence_type = fence_type; - fence->signaled_type = 0; - fence->private = private; - if (private_size) { - fence->private = (void *)(((uint8_t *) fence) + fence_size); - memcpy(fence->private, private, private_size); - } - - pipe_mutex_unlock(fence->mutex); - return fence; -} - - -static int -tSignaled(struct _DriFenceMgr *mgr, void *private, uint32_t flush_type, - uint32_t *signaled_type) -{ - long fd = (long) mgr->private; - int dummy; - drmFence *fence = (drmFence *) private; - int ret; - - *signaled_type = 0; - ret = drmFenceSignaled((int) fd, fence, flush_type, &dummy); - if (ret) - return ret; - - *signaled_type = fence->signaled; - - return 0; -} - -static int -tFinish(struct _DriFenceMgr *mgr, void *private, uint32_t fence_type, - int lazy_hint) -{ - long fd = (long) mgr->private; - unsigned flags = lazy_hint ? DRM_FENCE_FLAG_WAIT_LAZY : 0; - - return drmFenceWait((int)fd, flags, (drmFence *) private, fence_type); -} - -static int -tUnref(struct _DriFenceMgr *mgr, void **private) -{ - long fd = (long) mgr->private; - drmFence *fence = (drmFence *) *private; - *private = NULL; - - return drmFenceUnreference(fd, fence); -} - -struct _DriFenceMgr *driFenceMgrTTMInit(int fd) -{ - struct _DriFenceMgrCreateInfo info; - struct _DriFenceMgr *mgr; - - info.flags = DRI_FENCE_CLASS_ORDERED; - info.num_classes = 4; - info.signaled = tSignaled; - info.finish = tFinish; - info.unreference = tUnref; - - mgr = driFenceMgrCreate(&info); - if (mgr == NULL) - return NULL; - - mgr->private = (void *) (long) fd; - return mgr; -} - diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h b/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h deleted file mode 100644 index 4ea58dfe18..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef DRI_FENCEMGR_H -#define DRI_FENCEMGR_H - -#include -#include - -struct _DriFenceObject; -struct _DriFenceMgr; - -/* - * Do a quick check to see if the fence manager has registered the fence - * object as signaled. Note that this function may return a false negative - * answer. - */ -extern uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence); - -/* - * Check if the fence object is signaled. This function can be substantially - * more expensive to call than the above function, but will not return a false - * negative answer. The argument "flush_type" sets the types that the - * underlying mechanism must make sure will eventually signal. - */ -extern int driFenceSignaledType(struct _DriFenceObject *fence, - uint32_t flush_type, uint32_t *signaled); - -/* - * Convenience functions. - */ - -static inline int driFenceSignaled(struct _DriFenceObject *fence, - uint32_t flush_type) -{ - uint32_t signaled_types; - int ret = driFenceSignaledType(fence, flush_type, &signaled_types); - if (ret) - return 0; - return ((signaled_types & flush_type) == flush_type); -} - -static inline int driFenceSignaledCached(struct _DriFenceObject *fence, - uint32_t flush_type) -{ - uint32_t signaled_types = - driFenceSignaledTypeCached(fence); - - return ((signaled_types & flush_type) == flush_type); -} - -/* - * Reference a fence object. - */ -extern struct _DriFenceObject *driFenceReference(struct _DriFenceObject *fence); - -/* - * Unreference a fence object. The fence object pointer will be reset to NULL. - */ - -extern void driFenceUnReference(struct _DriFenceObject **pFence); - - -/* - * Wait for a fence to signal the indicated fence_type. - * If "lazy_hint" is true, it indicates that the wait may sleep to avoid - * busy-wait polling. - */ -extern int driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type, - int lazy_hint); - -/* - * Create a DriFenceObject for manager "mgr". - * - * "private" is a pointer that should be used for the callbacks in - * struct _DriFenceMgrCreateInfo. - * - * if private_size is nonzero, then the info stored at *private, with size - * private size will be copied and the fence manager will instead use a - * pointer to the copied data for the callbacks in - * struct _DriFenceMgrCreateInfo. In that case, the object pointed to by - * "private" may be destroyed after the call to driFenceCreate. - */ -extern struct _DriFenceObject *driFenceCreate(struct _DriFenceMgr *mgr, - uint32_t fence_class, - uint32_t fence_type, - void *private, - size_t private_size); - -extern uint32_t driFenceType(struct _DriFenceObject *fence); - -/* - * Fence creations are ordered. If a fence signals a fence_type, - * it is safe to assume that all fences of the same class that was - * created before that fence has signaled the same type. - */ - -#define DRI_FENCE_CLASS_ORDERED (1 << 0) - -struct _DriFenceMgrCreateInfo { - uint32_t flags; - uint32_t num_classes; - int (*signaled) (struct _DriFenceMgr *mgr, void *private, uint32_t flush_type, - uint32_t *signaled_type); - int (*finish) (struct _DriFenceMgr *mgr, void *private, uint32_t fence_type, int lazy_hint); - int (*unreference) (struct _DriFenceMgr *mgr, void **private); -}; - -extern struct _DriFenceMgr * -driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info); - -void -driFenceMgrUnReference(struct _DriFenceMgr **pMgr); - -extern struct _DriFenceMgr * -driFenceMgrTTMInit(int fd); - -#endif diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c b/src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c deleted file mode 100644 index 60924eac9e..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c +++ /dev/null @@ -1,161 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, TX., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Thomas Hellström - */ - -#include -#include -#include -#include "pipe/p_debug.h" -#include "pipe/p_thread.h" -#include "ws_dri_bufpool.h" -#include "ws_dri_bufmgr.h" - -static void * -pool_create(struct _DriBufferPool *pool, - unsigned long size, uint64_t flags, unsigned hint, - unsigned alignment) -{ - unsigned long *private = malloc(size + 2*sizeof(unsigned long)); - if ((flags & DRM_BO_MASK_MEM) != DRM_BO_FLAG_MEM_LOCAL) - abort(); - - *private = size; - return (void *)private; -} - - -static int -pool_destroy(struct _DriBufferPool *pool, void *private) -{ - free(private); - return 0; -} - -static int -pool_waitIdle(struct _DriBufferPool *pool, void *private, - pipe_mutex *mutex, int lazy) -{ - return 0; -} - -static int -pool_map(struct _DriBufferPool *pool, void *private, unsigned flags, - int hint, pipe_mutex *mutex, void **virtual) -{ - *virtual = (void *)((unsigned long *)private + 2); - return 0; -} - -static int -pool_unmap(struct _DriBufferPool *pool, void *private) -{ - return 0; -} - -static unsigned long -pool_offset(struct _DriBufferPool *pool, void *private) -{ - /* - * BUG - */ - abort(); - return 0UL; -} - -static unsigned long -pool_poolOffset(struct _DriBufferPool *pool, void *private) -{ - /* - * BUG - */ - abort(); -} - -static uint64_t -pool_flags(struct _DriBufferPool *pool, void *private) -{ - return DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED; -} - -static unsigned long -pool_size(struct _DriBufferPool *pool, void *private) -{ - return *(unsigned long *) private; -} - - -static int -pool_fence(struct _DriBufferPool *pool, void *private, - struct _DriFenceObject *fence) -{ - abort(); - return 0UL; -} - -static drmBO * -pool_kernel(struct _DriBufferPool *pool, void *private) -{ - abort(); - return NULL; -} - -static void -pool_takedown(struct _DriBufferPool *pool) -{ - free(pool); -} - - -struct _DriBufferPool * -driMallocPoolInit(void) -{ - struct _DriBufferPool *pool; - - pool = (struct _DriBufferPool *) malloc(sizeof(*pool)); - if (!pool) - return NULL; - - pool->data = NULL; - pool->fd = -1; - pool->map = &pool_map; - pool->unmap = &pool_unmap; - pool->destroy = &pool_destroy; - pool->offset = &pool_offset; - pool->poolOffset = &pool_poolOffset; - pool->flags = &pool_flags; - pool->size = &pool_size; - pool->create = &pool_create; - pool->fence = &pool_fence; - pool->kernel = &pool_kernel; - pool->validate = NULL; - pool->waitIdle = &pool_waitIdle; - pool->takeDown = &pool_takedown; - return pool; -} diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c b/src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c deleted file mode 100644 index 391cea50a7..0000000000 --- a/src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c +++ /dev/null @@ -1,968 +0,0 @@ -/************************************************************************** - * - * Copyright 2006-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Thomas Hellstrom - */ - -#include -#include -#include -#include -#include -#include "ws_dri_bufpool.h" -#include "ws_dri_fencemgr.h" -#include "ws_dri_bufmgr.h" -#include "pipe/p_thread.h" - -#define DRI_SLABPOOL_ALLOC_RETRIES 100 - -struct _DriSlab; - -struct _DriSlabBuffer { - int isSlabBuffer; - drmBO *bo; - struct _DriFenceObject *fence; - struct _DriSlab *parent; - drmMMListHead head; - uint32_t mapCount; - uint32_t start; - uint32_t fenceType; - int unFenced; - pipe_condvar event; -}; - -struct _DriKernelBO { - int fd; - drmBO bo; - drmMMListHead timeoutHead; - drmMMListHead head; - struct timeval timeFreed; - uint32_t pageAlignment; - void *virtual; -}; - -struct _DriSlab{ - drmMMListHead head; - drmMMListHead freeBuffers; - uint32_t numBuffers; - uint32_t numFree; - struct _DriSlabBuffer *buffers; - struct _DriSlabSizeHeader *header; - struct _DriKernelBO *kbo; -}; - - -struct _DriSlabSizeHeader { - drmMMListHead slabs; - drmMMListHead freeSlabs; - drmMMListHead delayedBuffers; - uint32_t numDelayed; - struct _DriSlabPool *slabPool; - uint32_t bufSize; - pipe_mutex mutex; -}; - -struct _DriFreeSlabManager { - struct timeval slabTimeout; - struct timeval checkInterval; - struct timeval nextCheck; - drmMMListHead timeoutList; - drmMMListHead unCached; - drmMMListHead cached; - pipe_mutex mutex; -}; - - -struct _DriSlabPool { - - /* - * The data of this structure remains constant after - * initialization and thus needs no mutex protection. - */ - - struct _DriFreeSlabManager *fMan; - uint64_t proposedFlags; - uint64_t validMask; - uint32_t *bucketSizes; - uint32_t numBuckets; - uint32_t pageSize; - int fd; - int pageAlignment; - int maxSlabSize; - int desiredNumBuffers; - struct _DriSlabSizeHeader *headers; -}; - -/* - * FIXME: Perhaps arrange timeout slabs in size buckets for fast - * retreival?? - */ - - -static inline int -driTimeAfterEq(struct timeval *arg1, struct timeval *arg2) -{ - return ((arg1->tv_sec > arg2->tv_sec) || - ((arg1->tv_sec == arg2->tv_sec) && - (arg1->tv_usec > arg2->tv_usec))); -} - -static inline void -driTimeAdd(struct timeval *arg, struct timeval *add) -{ - unsigned int sec; - - arg->tv_sec += add->tv_sec; - arg->tv_usec += add->tv_usec; - sec = arg->tv_usec / 1000000; - arg->tv_sec += sec; - arg->tv_usec -= sec*1000000; -} - -static void -driFreeKernelBO(struct _DriKernelBO *kbo) -{ - if (!kbo) - return; - - (void) drmBOUnreference(kbo->fd, &kbo->bo); - free(kbo); -} - - -static void -driFreeTimeoutKBOsLocked(struct _DriFreeSlabManager *fMan, - struct timeval *time) -{ - drmMMListHead *list, *next; - struct _DriKernelBO *kbo; - - if (!driTimeAfterEq(time, &fMan->nextCheck)) - return; - - for (list = fMan->timeoutList.next, next = list->next; - list != &fMan->timeoutList; - list = next, next = list->next) { - - kbo = DRMLISTENTRY(struct _DriKernelBO, list, timeoutHead); - - if (!driTimeAfterEq(time, &kbo->timeFreed)) - break; - - DRMLISTDELINIT(&kbo->timeoutHead); - DRMLISTDELINIT(&kbo->head); - driFreeKernelBO(kbo); - } - - fMan->nextCheck = *time; - driTimeAdd(&fMan->nextCheck, &fMan->checkInterval); -} - - -/* - * Add a _DriKernelBO to the free slab manager. - * This means that it is available for reuse, but if it's not - * reused in a while, it will be freed. - */ - -static void -driSetKernelBOFree(struct _DriFreeSlabManager *fMan, - struct _DriKernelBO *kbo) -{ - struct timeval time; - - pipe_mutex_lock(fMan->mutex); - gettimeofday(&time, NULL); - driTimeAdd(&time, &fMan->slabTimeout); - - kbo->timeFreed = time; - - if (kbo->bo.flags & DRM_BO_FLAG_CACHED) - DRMLISTADD(&kbo->head, &fMan->cached); - else - DRMLISTADD(&kbo->head, &fMan->unCached); - - DRMLISTADDTAIL(&kbo->timeoutHead, &fMan->timeoutList); - driFreeTimeoutKBOsLocked(fMan, &time); - - pipe_mutex_unlock(fMan->mutex); -} - -/* - * Get a _DriKernelBO for us to use as storage for a slab. - * - */ - -static struct _DriKernelBO * -driAllocKernelBO(struct _DriSlabSizeHeader *header) - -{ - struct _DriSlabPool *slabPool = header->slabPool; - struct _DriFreeSlabManager *fMan = slabPool->fMan; - drmMMListHead *list, *next, *head; - uint32_t size = header->bufSize * slabPool->desiredNumBuffers; - struct _DriKernelBO *kbo; - struct _DriKernelBO *kboTmp; - int ret; - - /* - * FIXME: We should perhaps allow some variation in slabsize in order - * to efficiently reuse slabs. - */ - - size = (size <= slabPool->maxSlabSize) ? size : slabPool->maxSlabSize; - size = (size + slabPool->pageSize - 1) & ~(slabPool->pageSize - 1); - pipe_mutex_lock(fMan->mutex); - - kbo = NULL; - - retry: - head = (slabPool->proposedFlags & DRM_BO_FLAG_CACHED) ? - &fMan->cached : &fMan->unCached; - - for (list = head->next, next = list->next; - list != head; - list = next, next = list->next) { - - kboTmp = DRMLISTENTRY(struct _DriKernelBO, list, head); - - if ((kboTmp->bo.size == size) && - (slabPool->pageAlignment == 0 || - (kboTmp->pageAlignment % slabPool->pageAlignment) == 0)) { - - if (!kbo) - kbo = kboTmp; - - if ((kbo->bo.proposedFlags ^ slabPool->proposedFlags) == 0) - break; - - } - } - - if (kbo) { - DRMLISTDELINIT(&kbo->head); - DRMLISTDELINIT(&kbo->timeoutHead); - } - - pipe_mutex_unlock(fMan->mutex); - - if (kbo) { - uint64_t new_mask = kbo->bo.proposedFlags ^ slabPool->proposedFlags; - - ret = 0; - if (new_mask) { - ret = drmBOSetStatus(kbo->fd, &kbo->bo, slabPool->proposedFlags, - new_mask, DRM_BO_HINT_DONT_FENCE, 0, 0); - } - if (ret == 0) - return kbo; - - driFreeKernelBO(kbo); - kbo = NULL; - goto retry; - } - - kbo = calloc(1, sizeof(struct _DriKernelBO)); - if (!kbo) - return NULL; - - kbo->fd = slabPool->fd; - DRMINITLISTHEAD(&kbo->head); - DRMINITLISTHEAD(&kbo->timeoutHead); - ret = drmBOCreate(kbo->fd, size, slabPool->pageAlignment, NULL, - slabPool->proposedFlags, - DRM_BO_HINT_DONT_FENCE, &kbo->bo); - if (ret) - goto out_err0; - - ret = drmBOMap(kbo->fd, &kbo->bo, - DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, - 0, &kbo->virtual); - - if (ret) - goto out_err1; - - ret = drmBOUnmap(kbo->fd, &kbo->bo); - if (ret) - goto out_err1; - - return kbo; - - out_err1: - drmBOUnreference(kbo->fd, &kbo->bo); - out_err0: - free(kbo); - return NULL; -} - - -static int -driAllocSlab(struct _DriSlabSizeHeader *header) -{ - struct _DriSlab *slab; - struct _DriSlabBuffer *buf; - uint32_t numBuffers; - int ret; - int i; - - slab = calloc(1, sizeof(*slab)); - if (!slab) - return -ENOMEM; - - slab->kbo = driAllocKernelBO(header); - if (!slab->kbo) { - ret = -ENOMEM; - goto out_err0; - } - - numBuffers = slab->kbo->bo.size / header->bufSize; - - slab->buffers = calloc(numBuffers, sizeof(*slab->buffers)); - if (!slab->buffers) { - ret = -ENOMEM; - goto out_err1; - } - - DRMINITLISTHEAD(&slab->head); - DRMINITLISTHEAD(&slab->freeBuffers); - slab->numBuffers = numBuffers; - slab->numFree = 0; - slab->header = header; - - buf = slab->buffers; - for (i=0; i < numBuffers; ++i) { - buf->parent = slab; - buf->start = i* header->bufSize; - buf->mapCount = 0; - buf->isSlabBuffer = 1; - pipe_condvar_init(buf->event); - DRMLISTADDTAIL(&buf->head, &slab->freeBuffers); - slab->numFree++; - buf++; - } - - DRMLISTADDTAIL(&slab->head, &header->slabs); - - return 0; - - out_err1: - driSetKernelBOFree(header->slabPool->fMan, slab->kbo); - free(slab->buffers); - out_err0: - free(slab); - return ret; -} - -/* - * Delete a buffer from the slab header delayed list and put - * it on the slab free list. - */ - -static void -driSlabFreeBufferLocked(struct _DriSlabBuffer *buf) -{ - struct _DriSlab *slab = buf->parent; - struct _DriSlabSizeHeader *header = slab->header; - drmMMListHead *list = &buf->head; - - DRMLISTDEL(list); - DRMLISTADDTAIL(list, &slab->freeBuffers); - slab->numFree++; - - if (slab->head.next == &slab->head) - DRMLISTADDTAIL(&slab->head, &header->slabs); - - if (slab->numFree == slab->numBuffers) { - list = &slab->head; - DRMLISTDEL(list); - DRMLISTADDTAIL(list, &header->freeSlabs); - } - - if (header->slabs.next == &header->slabs || - slab->numFree != slab->numBuffers) { - - drmMMListHead *next; - struct _DriFreeSlabManager *fMan = header->slabPool->fMan; - - for (list = header->freeSlabs.next, next = list->next; - list != &header->freeSlabs; - list = next, next = list->next) { - - slab = DRMLISTENTRY(struct _DriSlab, list, head); - - DRMLISTDELINIT(list); - driSetKernelBOFree(fMan, slab->kbo); - free(slab->buffers); - free(slab); - } - } -} - -static void -driSlabCheckFreeLocked(struct _DriSlabSizeHeader *header, int wait) -{ - drmMMListHead *list, *prev, *first; - struct _DriSlabBuffer *buf; - struct _DriSlab *slab; - int firstWasSignaled = 1; - int signaled; - int i; - int ret; - - /* - * Rerun the freeing test if the youngest tested buffer - * was signaled, since there might be more idle buffers - * in the delay list. - */ - - while (firstWasSignaled) { - firstWasSignaled = 0; - signaled = 0; - first = header->delayedBuffers.next; - - /* Only examine the oldest 1/3 of delayed buffers: - */ - if (header->numDelayed > 3) { - for (i = 0; i < header->numDelayed; i += 3) { - first = first->next; - } - } - - for (list = first, prev = list->prev; - list != &header->delayedBuffers; - list = prev, prev = list->prev) { - buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head); - slab = buf->parent; - - if (!signaled) { - if (wait) { - ret = driFenceFinish(buf->fence, buf->fenceType, 0); - if (ret) - break; - signaled = 1; - wait = 0; - } else { - signaled = driFenceSignaled(buf->fence, buf->fenceType); - } - if (signaled) { - if (list == first) - firstWasSignaled = 1; - driFenceUnReference(&buf->fence); - header->numDelayed--; - driSlabFreeBufferLocked(buf); - } - } else if (driFenceSignaledCached(buf->fence, buf->fenceType)) { - driFenceUnReference(&buf->fence); - header->numDelayed--; - driSlabFreeBufferLocked(buf); - } - } - } -} - - -static struct _DriSlabBuffer * -driSlabAllocBuffer(struct _DriSlabSizeHeader *header) -{ - static struct _DriSlabBuffer *buf; - struct _DriSlab *slab; - drmMMListHead *list; - int count = DRI_SLABPOOL_ALLOC_RETRIES; - - pipe_mutex_lock(header->mutex); - while(header->slabs.next == &header->slabs && count > 0) { - driSlabCheckFreeLocked(header, 0); - if (header->slabs.next != &header->slabs) - break; - - pipe_mutex_unlock(header->mutex); - if (count != DRI_SLABPOOL_ALLOC_RETRIES) - usleep(1); - pipe_mutex_lock(header->mutex); - (void) driAllocSlab(header); - count--; - } - - list = header->slabs.next; - if (list == &header->slabs) { - pipe_mutex_unlock(header->mutex); - return NULL; - } - slab = DRMLISTENTRY(struct _DriSlab, list, head); - if (--slab->numFree == 0) - DRMLISTDELINIT(list); - - list = slab->freeBuffers.next; - DRMLISTDELINIT(list); - - pipe_mutex_unlock(header->mutex); - buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head); - return buf; -} - -static void * -pool_create(struct _DriBufferPool *driPool, unsigned long size, - uint64_t flags, unsigned hint, unsigned alignment) -{ - struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data; - struct _DriSlabSizeHeader *header; - struct _DriSlabBuffer *buf; - void *dummy; - int i; - int ret; - - /* - * FIXME: Check for compatibility. - */ - - header = pool->headers; - for (i=0; inumBuckets; ++i) { - if (header->bufSize >= size) - break; - header++; - } - - if (i < pool->numBuckets) - return driSlabAllocBuffer(header); - - - /* - * Fall back to allocate a buffer object directly from DRM. - * and wrap it in a driBO structure. - */ - - - buf = calloc(1, sizeof(*buf)); - - if (!buf) - return NULL; - - buf->bo = calloc(1, sizeof(*buf->bo)); - if (!buf->bo) - goto out_err0; - - if (alignment) { - if ((alignment < pool->pageSize) && (pool->pageSize % alignment)) - goto out_err1; - if ((alignment > pool->pageSize) && (alignment % pool->pageSize)) - goto out_err1; - } - - ret = drmBOCreate(pool->fd, size, alignment / pool->pageSize, NULL, - flags, hint, buf->bo); - if (ret) - goto out_err1; - - ret = drmBOMap(pool->fd, buf->bo, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, - 0, &dummy); - if (ret) - goto out_err2; - - ret = drmBOUnmap(pool->fd, buf->bo); - if (ret) - goto out_err2; - - return buf; - out_err2: - drmBOUnreference(pool->fd, buf->bo); - out_err1: - free(buf->bo); - out_err0: - free(buf); - return NULL; -} - -static int -pool_destroy(struct _DriBufferPool *driPool, void *private) -{ - struct _DriSlabBuffer *buf = - (struct _DriSlabBuffer *) private; - struct _DriSlab *slab; - struct _DriSlabSizeHeader *header; - - if (!buf->isSlabBuffer) { - struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data; - int ret; - - ret = drmBOUnreference(pool->fd, buf->bo); - free(buf->bo); - free(buf); - return ret; - } - - slab = buf->parent; - header = slab->header; - - pipe_mutex_lock(header->mutex); - buf->unFenced = 0; - buf->mapCount = 0; - - if (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType)) { - DRMLISTADDTAIL(&buf->head, &header->delayedBuffers); - header->numDelayed++; - } else { - if (buf->fence) - driFenceUnReference(&buf->fence); - driSlabFreeBufferLocked(buf); - } - - pipe_mutex_unlock(header->mutex); - return 0; -} - -static int -pool_waitIdle(struct _DriBufferPool *driPool, void *private, - pipe_mutex *mutex, int lazy) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - - while(buf->unFenced) - pipe_condvar_wait(buf->event, *mutex); - - if (!buf->fence) - return 0; - - driFenceFinish(buf->fence, buf->fenceType, lazy); - driFenceUnReference(&buf->fence); - - return 0; -} - -static int -pool_map(struct _DriBufferPool *pool, void *private, unsigned flags, - int hint, pipe_mutex *mutex, void **virtual) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - int busy; - - if (buf->isSlabBuffer) - busy = buf->unFenced || (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType)); - else - busy = buf->fence && !driFenceSignaled(buf->fence, buf->fenceType); - - - if (busy) { - if (hint & DRM_BO_HINT_DONT_BLOCK) - return -EBUSY; - else { - (void) pool_waitIdle(pool, private, mutex, 0); - } - } - - ++buf->mapCount; - *virtual = (buf->isSlabBuffer) ? - (void *) ((uint8_t *) buf->parent->kbo->virtual + buf->start) : - (void *) buf->bo->virtual; - - return 0; -} - -static int -pool_unmap(struct _DriBufferPool *pool, void *private) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - - --buf->mapCount; - if (buf->mapCount == 0 && buf->isSlabBuffer) - pipe_condvar_broadcast(buf->event); - - return 0; -} - -static unsigned long -pool_offset(struct _DriBufferPool *pool, void *private) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - struct _DriSlab *slab; - struct _DriSlabSizeHeader *header; - - if (!buf->isSlabBuffer) { - assert(buf->bo->proposedFlags & DRM_BO_FLAG_NO_MOVE); - return buf->bo->offset; - } - - slab = buf->parent; - header = slab->header; - - (void) header; - assert(header->slabPool->proposedFlags & DRM_BO_FLAG_NO_MOVE); - return slab->kbo->bo.offset + buf->start; -} - -static unsigned long -pool_poolOffset(struct _DriBufferPool *pool, void *private) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - - return buf->start; -} - -static uint64_t -pool_flags(struct _DriBufferPool *pool, void *private) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - - if (!buf->isSlabBuffer) - return buf->bo->flags; - - return buf->parent->kbo->bo.flags; -} - -static unsigned long -pool_size(struct _DriBufferPool *pool, void *private) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - if (!buf->isSlabBuffer) - return buf->bo->size; - - return buf->parent->header->bufSize; -} - -static int -pool_fence(struct _DriBufferPool *pool, void *private, - struct _DriFenceObject *fence) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - drmBO *bo; - - if (buf->fence) - driFenceUnReference(&buf->fence); - - buf->fence = driFenceReference(fence); - bo = (buf->isSlabBuffer) ? - &buf->parent->kbo->bo: - buf->bo; - buf->fenceType = bo->fenceFlags; - - buf->unFenced = 0; - pipe_condvar_broadcast(buf->event); - - return 0; -} - -static drmBO * -pool_kernel(struct _DriBufferPool *pool, void *private) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - - return (buf->isSlabBuffer) ? &buf->parent->kbo->bo : buf->bo; -} - -static int -pool_validate(struct _DriBufferPool *pool, void *private, - pipe_mutex *mutex) -{ - struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private; - - if (!buf->isSlabBuffer) - return 0; - - while(buf->mapCount != 0) - pipe_condvar_wait(buf->event, *mutex); - - buf->unFenced = 1; - return 0; -} - - -struct _DriFreeSlabManager * -driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec) -{ - struct _DriFreeSlabManager *tmp; - - tmp = calloc(1, sizeof(*tmp)); - if (!tmp) - return NULL; - - pipe_mutex_init(tmp->mutex); - pipe_mutex_lock(tmp->mutex); - tmp->slabTimeout.tv_usec = slabTimeoutMsec*1000; - tmp->slabTimeout.tv_sec = tmp->slabTimeout.tv_usec / 1000000; - tmp->slabTimeout.tv_usec -= tmp->slabTimeout.tv_sec*1000000; - - tmp->checkInterval.tv_usec = checkIntervalMsec*1000; - tmp->checkInterval.tv_sec = tmp->checkInterval.tv_usec / 1000000; - tmp->checkInterval.tv_usec -= tmp->checkInterval.tv_sec*1000000; - - gettimeofday(&tmp->nextCheck, NULL); - driTimeAdd(&tmp->nextCheck, &tmp->checkInterval); - DRMINITLISTHEAD(&tmp->timeoutList); - DRMINITLISTHEAD(&tmp->unCached); - DRMINITLISTHEAD(&tmp->cached); - pipe_mutex_unlock(tmp->mutex); - - return tmp; -} - -void -driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan) -{ - struct timeval time; - - time = fMan->nextCheck; - driTimeAdd(&time, &fMan->checkInterval); - - pipe_mutex_lock(fMan->mutex); - driFreeTimeoutKBOsLocked(fMan, &time); - pipe_mutex_unlock(fMan->mutex); - - assert(fMan->timeoutList.next == &fMan->timeoutList); - assert(fMan->unCached.next == &fMan->unCached); - assert(fMan->cached.next == &fMan->cached); - - free(fMan); -} - -static void -driInitSizeHeader(struct _DriSlabPool *pool, uint32_t size, - struct _DriSlabSizeHeader *header) -{ - pipe_mutex_init(header->mutex); - pipe_mutex_lock(header->mutex); - - DRMINITLISTHEAD(&header->slabs); - DRMINITLISTHEAD(&header->freeSlabs); - DRMINITLISTHEAD(&header->delayedBuffers); - - header->numDelayed = 0; - header->slabPool = pool; - header->bufSize = size; - - pipe_mutex_unlock(header->mutex); -} - -static void -driFinishSizeHeader(struct _DriSlabSizeHeader *header) -{ - drmMMListHead *list, *next; - struct _DriSlabBuffer *buf; - - pipe_mutex_lock(header->mutex); - for (list = header->delayedBuffers.next, next = list->next; - list != &header->delayedBuffers; - list = next, next = list->next) { - - buf = DRMLISTENTRY(struct _DriSlabBuffer, list , head); - if (buf->fence) { - (void) driFenceFinish(buf->fence, buf->fenceType, 0); - driFenceUnReference(&buf->fence); - } - header->numDelayed--; - driSlabFreeBufferLocked(buf); - } - pipe_mutex_unlock(header->mutex); -} - -static void -pool_takedown(struct _DriBufferPool *driPool) -{ - struct _DriSlabPool *pool = driPool->data; - int i; - - for (i=0; inumBuckets; ++i) { - driFinishSizeHeader(&pool->headers[i]); - } - - free(pool->headers); - free(pool->bucketSizes); - free(pool); - free(driPool); -} - -struct _DriBufferPool * -driSlabPoolInit(int fd, uint64_t flags, - uint64_t validMask, - uint32_t smallestSize, - uint32_t numSizes, - uint32_t desiredNumBuffers, - uint32_t maxSlabSize, - uint32_t pageAlignment, - struct _DriFreeSlabManager *fMan) -{ - struct _DriBufferPool *driPool; - struct _DriSlabPool *pool; - uint32_t i; - - driPool = calloc(1, sizeof(*driPool)); - if (!driPool) - return NULL; - - pool = calloc(1, sizeof(*pool)); - if (!pool) - goto out_err0; - - pool->bucketSizes = calloc(numSizes, sizeof(*pool->bucketSizes)); - if (!pool->bucketSizes) - goto out_err1; - - pool->headers = calloc(numSizes, sizeof(*pool->headers)); - if (!pool->headers) - goto out_err2; - - pool->fMan = fMan; - pool->proposedFlags = flags; - pool->validMask = validMask; - pool->numBuckets = numSizes; - pool->pageSize = getpagesize(); - pool->fd = fd; - pool->pageAlignment = pageAlignment; - pool->maxSlabSize = maxSlabSize; - pool->desiredNumBuffers = desiredNumBuffers; - - for (i=0; inumBuckets; ++i) { - pool->bucketSizes[i] = (smallestSize << i); - driInitSizeHeader(pool, pool->bucketSizes[i], - &pool->headers[i]); - } - - driPool->data = (void *) pool; - driPool->map = &pool_map; - driPool->unmap = &pool_unmap; - driPool->destroy = &pool_destroy; - driPool->offset = &pool_offset; - driPool->poolOffset = &pool_poolOffset; - driPool->flags = &pool_flags; - driPool->size = &pool_size; - driPool->create = &pool_create; - driPool->fence = &pool_fence; - driPool->kernel = &pool_kernel; - driPool->validate = &pool_validate; - driPool->waitIdle = &pool_waitIdle; - driPool->takeDown = &pool_takedown; - - return driPool; - - out_err2: - free(pool->bucketSizes); - out_err1: - free(pool); - out_err0: - free(driPool); - - return NULL; -} -- cgit v1.2.3 From 5ac8b4e4d97886a6543718b48a64f6962009b6e0 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 2 Feb 2009 01:33:38 +0100 Subject: intel: Remove the old depricated dri1 winsys --- src/gallium/winsys/drm/intel/dri/Makefile | 33 - src/gallium/winsys/drm/intel/dri/SConscript | 41 -- .../winsys/drm/intel/dri/intel_batchbuffer.h | 24 - src/gallium/winsys/drm/intel/dri/intel_context.c | 337 ---------- src/gallium/winsys/drm/intel/dri/intel_context.h | 164 ----- src/gallium/winsys/drm/intel/dri/intel_lock.c | 102 --- src/gallium/winsys/drm/intel/dri/intel_reg.h | 53 -- src/gallium/winsys/drm/intel/dri/intel_screen.c | 703 --------------------- src/gallium/winsys/drm/intel/dri/intel_screen.h | 122 ---- .../winsys/drm/intel/dri/intel_swapbuffers.c | 260 -------- .../winsys/drm/intel/dri/intel_swapbuffers.h | 47 -- .../winsys/drm/intel/dri/intel_winsys_softpipe.c | 82 --- .../winsys/drm/intel/dri/intel_winsys_softpipe.h | 39 -- .../winsys/drm/intel/dri/server/i830_common.h | 255 -------- src/gallium/winsys/drm/intel/dri/server/i830_dri.h | 62 -- 15 files changed, 2324 deletions(-) delete mode 100644 src/gallium/winsys/drm/intel/dri/Makefile delete mode 100644 src/gallium/winsys/drm/intel/dri/SConscript delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_context.c delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_context.h delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_lock.c delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_reg.h delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_screen.c delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_screen.h delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c delete mode 100644 src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h delete mode 100644 src/gallium/winsys/drm/intel/dri/server/i830_common.h delete mode 100644 src/gallium/winsys/drm/intel/dri/server/i830_dri.h (limited to 'src') diff --git a/src/gallium/winsys/drm/intel/dri/Makefile b/src/gallium/winsys/drm/intel/dri/Makefile deleted file mode 100644 index 2046441a22..0000000000 --- a/src/gallium/winsys/drm/intel/dri/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -TOP = ../../../../../.. -include $(TOP)/configs/current - -LIBNAME = i915_dri.so -LIBNAME_EGL = egl_i915_dri.so - -PIPE_DRIVERS = \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ - ../common/libinteldrm.a \ - $(TOP)/src/gallium/drivers/i915simple/libi915simple.a - - -DRIVER_SOURCES = \ - intel_winsys_softpipe.c \ - intel_swapbuffers.c \ - intel_context.c \ - intel_lock.c \ - intel_screen.c - -C_SOURCES = \ - $(COMMON_GALLIUM_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - -DRIVER_DEFINES = -I../common $(shell pkg-config libdrm --atleast-version=2.3.1 \ - && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP") - -include ../../Makefile.template - -#intel_tex_layout.o: $(TOP)/src/mesa/drivers/dri/intel/intel_tex_layout.c - -symlinks: diff --git a/src/gallium/winsys/drm/intel/dri/SConscript b/src/gallium/winsys/drm/intel/dri/SConscript deleted file mode 100644 index 6a4f50afcc..0000000000 --- a/src/gallium/winsys/drm/intel/dri/SConscript +++ /dev/null @@ -1,41 +0,0 @@ -Import('*') - -if 'mesa' in env['statetrackers']: - - env = drienv.Clone() - - env.Append(CPPPATH = [ - '../intel', - 'server' - ]) - - #MINIGLX_SOURCES = server/intel_dri.c - - DRIVER_SOURCES = [ - 'intel_winsys_pipe.c', - 'intel_winsys_softpipe.c', - 'intel_winsys_i915.c', - 'intel_batchbuffer.c', - 'intel_swapbuffers.c', - 'intel_context.c', - 'intel_lock.c', - 'intel_screen.c', - 'intel_batchpool.c', - ] - - sources = \ - COMMON_GALLIUM_SOURCES + \ - COMMON_BM_SOURCES + \ - DRIVER_SOURCES - - drivers = [ - softpipe, - i915simple - ] - - # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions - env.SharedLibrary( - target ='i915tex_dri.so', - source = sources, - LIBS = drivers + mesa + auxiliaries + env['LIBS'], - ) diff --git a/src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h b/src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h deleted file mode 100644 index 3e95326168..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef INTEL_BATCHBUFFER_H -#define INTEL_BATCHBUFFER_H - -#include "intel_be_batchbuffer.h" - -/* - * Need to redefine the BATCH defines - */ - -#undef BEGIN_BATCH -#define BEGIN_BATCH(dwords, relocs) \ - (i915_batchbuffer_check(&intel->base.batch->base, dwords, relocs)) - -#undef OUT_BATCH -#define OUT_BATCH(d) \ - i915_batchbuffer_dword(&intel->base.batch->base, d) - -#undef OUT_RELOC -#define OUT_RELOC(buf,flags,mask,delta) do { \ - assert((delta) >= 0); \ - intel_be_offset_relocation(intel->base.batch, delta, buf, flags, mask); \ -} while (0) - -#endif diff --git a/src/gallium/winsys/drm/intel/dri/intel_context.c b/src/gallium/winsys/drm/intel/dri/intel_context.c deleted file mode 100644 index 97ef731aaa..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_context.c +++ /dev/null @@ -1,337 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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. - * - **************************************************************************/ - - -#include "i830_dri.h" - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_swapbuffers.h" -#include "intel_batchbuffer.h" -#include "intel_winsys_softpipe.h" - -#include "i915simple/i915_screen.h" - -#include "state_tracker/st_public.h" -#include "state_tracker/st_context.h" -#include "pipe/p_defines.h" -#include "pipe/p_context.h" - -#include "utils.h" - - -#ifdef DEBUG -int __intel_debug = 0; -#endif - - -#define need_GL_ARB_multisample -#define need_GL_ARB_point_parameters -#define need_GL_ARB_texture_compression -#define need_GL_ARB_vertex_buffer_object -#define need_GL_ARB_vertex_program -#define need_GL_ARB_window_pos -#define need_GL_EXT_blend_color -#define need_GL_EXT_blend_equation_separate -#define need_GL_EXT_blend_func_separate -#define need_GL_EXT_blend_minmax -#define need_GL_EXT_cull_vertex -#define need_GL_EXT_fog_coord -#define need_GL_EXT_framebuffer_object -#define need_GL_EXT_multi_draw_arrays -#define need_GL_EXT_secondary_color -#define need_GL_NV_vertex_program -#include "extension_helper.h" - - -/** - * Extension strings exported by the intel driver. - * - * \note - * It appears that ARB_texture_env_crossbar has "disappeared" compared to the - * old i830-specific driver. - */ -const struct dri_extension card_extensions[] = { - {"GL_ARB_multisample", GL_ARB_multisample_functions}, - {"GL_ARB_multitexture", NULL}, - {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, - {"GL_ARB_texture_border_clamp", NULL}, - {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions}, - {"GL_ARB_texture_cube_map", NULL}, - {"GL_ARB_texture_env_add", NULL}, - {"GL_ARB_texture_env_combine", NULL}, - {"GL_ARB_texture_env_dot3", NULL}, - {"GL_ARB_texture_mirrored_repeat", NULL}, - {"GL_ARB_texture_rectangle", NULL}, - {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, - {"GL_ARB_pixel_buffer_object", NULL}, - {"GL_ARB_vertex_program", GL_ARB_vertex_program_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}, - {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, - {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, - {"GL_EXT_blend_subtract", NULL}, - {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions}, - {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions}, - {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions}, - {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions}, - {"GL_EXT_packed_depth_stencil", NULL}, - {"GL_EXT_pixel_buffer_object", NULL}, - {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, - {"GL_EXT_stencil_wrap", NULL}, - {"GL_EXT_texture_edge_clamp", NULL}, - {"GL_EXT_texture_env_combine", NULL}, - {"GL_EXT_texture_env_dot3", NULL}, - {"GL_EXT_texture_filter_anisotropic", NULL}, - {"GL_EXT_texture_lod_bias", NULL}, - {"GL_3DFX_texture_compression_FXT1", NULL}, - {"GL_APPLE_client_storage", NULL}, - {"GL_MESA_pack_invert", NULL}, - {"GL_MESA_ycbcr_texture", NULL}, - {"GL_NV_blend_square", NULL}, - {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, - {"GL_NV_vertex_program1_1", NULL}, - {"GL_SGIS_generate_mipmap", NULL }, - {NULL, NULL} -}; - - - -#ifdef DEBUG -static const struct dri_debug_control debug_control[] = { - {"ioctl", DEBUG_IOCTL}, - {"bat", DEBUG_BATCH}, - {"lock", DEBUG_LOCK}, - {"swap", DEBUG_SWAP}, - {NULL, 0} -}; -#endif - - - -static void -intel_lock_hardware(struct intel_be_context *context) -{ - struct intel_context *intel = (struct intel_context *)context; - LOCK_HARDWARE(intel); -} - -static void -intel_unlock_hardware(struct intel_be_context *context) -{ - struct intel_context *intel = (struct intel_context *)context; - UNLOCK_HARDWARE(intel); -} - -static boolean -intel_locked_hardware(struct intel_be_context *context) -{ - struct intel_context *intel = (struct intel_context *)context; - return intel->locked ? TRUE : FALSE; -} - -GLboolean -intelCreateContext(const __GLcontextModes * visual, - __DRIcontextPrivate * driContextPriv, - void *sharedContextPrivate) -{ - struct intel_context *intel = CALLOC_STRUCT(intel_context); - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - struct intel_screen *intelScreen = intel_screen(sPriv); - drmI830Sarea *saPriv = intelScreen->sarea; - int fthrottle_mode; - GLboolean havePools; - struct pipe_context *pipe; - struct st_context *st_share = NULL; - - if (sharedContextPrivate) { - st_share = ((struct intel_context *) sharedContextPrivate)->st; - } - - driContextPriv->driverPrivate = intel; - intel->intelScreen = intelScreen; - intel->driScreen = sPriv; - intel->sarea = saPriv; - - driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache, - intel->driScreen->myNum, "i915"); - - - /* - * memory pools - */ - DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext); - // ZZZ JB should be per screen and not be done per context - havePools = intelCreatePools(sPriv); - DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext); - if (!havePools) - return GL_FALSE; - - - /* Dri stuff */ - intel->hHWContext = driContextPriv->hHWContext; - intel->driFd = sPriv->fd; - intel->driHwLock = (drmLock *) & sPriv->pSAREA->lock; - - fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode"); - intel->iw.irq_seq = -1; - intel->irqsEmitted = 0; - - intel->last_swap_fence = NULL; - intel->first_swap_fence = NULL; - -#ifdef DEBUG - __intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control); -#endif - intel->base.hardware_lock = intel_lock_hardware; - intel->base.hardware_unlock = intel_unlock_hardware; - intel->base.hardware_locked = intel_locked_hardware; - - intel_be_init_context(&intel->base, &intelScreen->base); - - /* - * Pipe-related setup - */ - if (getenv("INTEL_SP")) { - /* use softpipe driver instead of hw */ - pipe = intel_create_softpipe( intel, &intelScreen->base.base ); - } - else { - switch (intel->intelScreen->deviceID) { - case PCI_CHIP_I945_G: - case PCI_CHIP_I945_GM: - case PCI_CHIP_I945_GME: - case PCI_CHIP_G33_G: - case PCI_CHIP_Q33_G: - case PCI_CHIP_Q35_G: - case PCI_CHIP_I915_G: - case PCI_CHIP_I915_GM: - pipe = i915_create_context(intelScreen->base.screen, - &intelScreen->base.base, - &intel->base.base); - break; - default: - fprintf(stderr, "Unknown PCIID %x in %s, using software driver\n", - intel->intelScreen->deviceID, __FUNCTION__); - - pipe = intel_create_softpipe( intel, &intelScreen->base.base ); - break; - } - } - - pipe->priv = intel; - - intel->st = st_create_context(pipe, visual, st_share); - - driInitExtensions( intel->st->ctx, card_extensions, GL_TRUE ); - - return GL_TRUE; -} - - -void -intelDestroyContext(__DRIcontextPrivate * driContextPriv) -{ - struct intel_context *intel = intel_context(driContextPriv); - - assert(intel); /* should never be null */ - if (intel) { - st_finish(intel->st); - - if (intel->last_swap_fence) { - driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE); - driFenceUnReference(&intel->last_swap_fence); - intel->last_swap_fence = NULL; - } - if (intel->first_swap_fence) { - driFenceFinish(intel->first_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE); - driFenceUnReference(&intel->first_swap_fence); - intel->first_swap_fence = NULL; - } - - if (intel->intelScreen->dummyContext == intel) - intel->intelScreen->dummyContext = NULL; - - st_destroy_context(intel->st); - intel_be_destroy_context(&intel->base); - free(intel); - } -} - - -GLboolean -intelUnbindContext(__DRIcontextPrivate * driContextPriv) -{ - struct intel_context *intel = intel_context(driContextPriv); - st_flush(intel->st, PIPE_FLUSH_RENDER_CACHE, NULL); - /* XXX make_current(NULL)? */ - return GL_TRUE; -} - - -GLboolean -intelMakeCurrent(__DRIcontextPrivate * driContextPriv, - __DRIdrawablePrivate * driDrawPriv, - __DRIdrawablePrivate * driReadPriv) -{ - if (driContextPriv) { - struct intel_context *intel = intel_context(driContextPriv); - struct intel_framebuffer *draw_fb = intel_framebuffer(driDrawPriv); - struct intel_framebuffer *read_fb = intel_framebuffer(driReadPriv); - - assert(draw_fb->stfb); - assert(read_fb->stfb); - - /* This is for situations in which we need a rendering context but - * there may not be any currently bound. - */ - intel->intelScreen->dummyContext = intel; - - st_make_current(intel->st, draw_fb->stfb, read_fb->stfb); - - if ((intel->driDrawable != driDrawPriv) || - (intel->lastStamp != driDrawPriv->lastStamp)) { - intel->driDrawable = driDrawPriv; - intelUpdateWindowSize(driDrawPriv); - intel->lastStamp = driDrawPriv->lastStamp; - } - - /* The size of the draw buffer will have been updated above. - * If the readbuffer is a different window, check/update its size now. - */ - if (driReadPriv != driDrawPriv) { - intelUpdateWindowSize(driReadPriv); - } - - } - else { - st_make_current(NULL, NULL, NULL); - } - - return GL_TRUE; -} diff --git a/src/gallium/winsys/drm/intel/dri/intel_context.h b/src/gallium/winsys/drm/intel/dri/intel_context.h deleted file mode 100644 index 5d22a422af..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_context.h +++ /dev/null @@ -1,164 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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 INTEL_CONTEXT_H -#define INTEL_CONTEXT_H - -#include -#include "drm.h" - -#include "pipe/p_debug.h" - -#include "intel_screen.h" -#include "i915_drm.h" - -#include "intel_be_context.h" - - -struct pipe_context; -struct intel_context; -struct _DriBufferObject; -struct st_context; - - -#define INTEL_MAX_FIXUP 64 - -/** - * Intel rendering context, contains a state tracker and intel-specific info. - */ -struct intel_context -{ - struct intel_be_context base; - struct st_context *st; - - struct _DriFenceObject *last_swap_fence; - struct _DriFenceObject *first_swap_fence; - -// struct intel_batchbuffer *batch; - - boolean locked; - char *prevLockFile; - int prevLockLine; - - uint irqsEmitted; - drm_i915_irq_wait_t iw; - - drm_context_t hHWContext; - drmLock *driHwLock; - int driFd; - - __DRIdrawablePrivate *driDrawable; - __DRIscreenPrivate *driScreen; - struct intel_screen *intelScreen; - drmI830Sarea *sarea; - - uint lastStamp; - - /** - * Configuration cache - */ - driOptionCache optionCache; -}; - - - -/** - * Intel framebuffer. - */ -struct intel_framebuffer -{ - struct st_framebuffer *stfb; - - /* other fields TBD */ - int other; -}; - - - - -/* These are functions now: - */ -void LOCK_HARDWARE( struct intel_context *intel ); -void UNLOCK_HARDWARE( struct intel_context *intel ); - -extern char *__progname; - - - -/* ================================================================ - * Debugging: - */ -#ifdef DEBUG -extern int __intel_debug; - -#define DEBUG_SWAP 0x1 -#define DEBUG_LOCK 0x2 -#define DEBUG_IOCTL 0x4 -#define DEBUG_BATCH 0x8 - -#define DBG(flag, ...) do { \ - if (__intel_debug & (DEBUG_##flag)) \ - printf(__VA_ARGS__); \ -} while(0) - -#else -#define DBG(flag, ...) -#endif - - - -#define PCI_CHIP_845_G 0x2562 -#define PCI_CHIP_I830_M 0x3577 -#define PCI_CHIP_I855_GM 0x3582 -#define PCI_CHIP_I865_G 0x2572 -#define PCI_CHIP_I915_G 0x2582 -#define PCI_CHIP_I915_GM 0x2592 -#define PCI_CHIP_I945_G 0x2772 -#define PCI_CHIP_I945_GM 0x27A2 -#define PCI_CHIP_I945_GME 0x27AE -#define PCI_CHIP_G33_G 0x29C2 -#define PCI_CHIP_Q35_G 0x29B2 -#define PCI_CHIP_Q33_G 0x29D2 - - -/** Cast wrapper */ -static INLINE struct intel_context * -intel_context(__DRIcontextPrivate *driContextPriv) -{ - return (struct intel_context *) driContextPriv->driverPrivate; -} - - -/** Cast wrapper */ -static INLINE struct intel_framebuffer * -intel_framebuffer(__DRIdrawablePrivate * driDrawPriv) -{ - return (struct intel_framebuffer *) driDrawPriv->driverPrivate; -} - - -#endif diff --git a/src/gallium/winsys/drm/intel/dri/intel_lock.c b/src/gallium/winsys/drm/intel/dri/intel_lock.c deleted file mode 100644 index ad1c202429..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_lock.c +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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. - * - **************************************************************************/ - - -#include "main/glheader.h" -#include "pipe/p_thread.h" -#include -#include "state_tracker/st_public.h" -#include "intel_context.h" -#include "i830_dri.h" - - - -pipe_static_mutex( lockMutex ); - - -static void -intelContendedLock(struct intel_context *intel, uint flags) -{ - __DRIdrawablePrivate *dPriv = intel->driDrawable; - __DRIscreenPrivate *sPriv = intel->driScreen; - struct intel_screen *intelScreen = intel_screen(sPriv); - drmI830Sarea *sarea = intel->sarea; - - drmGetLock(intel->driFd, intel->hHWContext, flags); - - DBG(LOCK, "%s - got contended lock\n", __progname); - - /* If the window moved, may need to set a new cliprect now. - * - * NOTE: This releases and regains the hw lock, so all state - * checking must be done *after* this call: - */ - if (dPriv) - DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); - - if (sarea->width != intelScreen->front.width || - sarea->height != intelScreen->front.height) { - - intelUpdateScreenRotation(sPriv, sarea); - } -} - - -/* Lock the hardware and validate our state. - */ -void LOCK_HARDWARE( struct intel_context *intel ) -{ - char __ret = 0; - - pipe_mutex_lock(lockMutex); - assert(!intel->locked); - - DRM_CAS(intel->driHwLock, intel->hHWContext, - (DRM_LOCK_HELD|intel->hHWContext), __ret); - - if (__ret) - intelContendedLock( intel, 0 ); - - DBG(LOCK, "%s - locked\n", __progname); - - intel->locked = 1; -} - - -/* Unlock the hardware using the global current context - */ -void UNLOCK_HARDWARE( struct intel_context *intel ) -{ - assert(intel->locked); - intel->locked = 0; - - DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext); - - pipe_mutex_unlock(lockMutex); - - DBG(LOCK, "%s - unlocked\n", __progname); -} diff --git a/src/gallium/winsys/drm/intel/dri/intel_reg.h b/src/gallium/winsys/drm/intel/dri/intel_reg.h deleted file mode 100644 index 4f33bee438..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_reg.h +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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 _INTEL_REG_H_ -#define _INTEL_REG_H_ - - -#define BR00_BITBLT_CLIENT 0x40000000 -#define BR00_OP_COLOR_BLT 0x10000000 -#define BR00_OP_SRC_COPY_BLT 0x10C00000 -#define BR13_SOLID_PATTERN 0x80000000 - -#define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|0x4) -#define XY_COLOR_BLT_WRITE_ALPHA (1<<21) -#define XY_COLOR_BLT_WRITE_RGB (1<<20) - -#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) -#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) -#define XY_SRC_COPY_BLT_WRITE_RGB (1<<20) - -#define MI_WAIT_FOR_EVENT ((0x3<<23)) -#define MI_WAIT_FOR_PLANE_B_FLIP (1<<6) -#define MI_WAIT_FOR_PLANE_A_FLIP (1<<2) - -#define MI_BATCH_BUFFER_END (0xA<<23) - - -#endif diff --git a/src/gallium/winsys/drm/intel/dri/intel_screen.c b/src/gallium/winsys/drm/intel/dri/intel_screen.c deleted file mode 100644 index ed75368982..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_screen.c +++ /dev/null @@ -1,703 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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. - * - **************************************************************************/ - -#include "utils.h" -#include "vblank.h" -#include "xmlpool.h" - -#include "intel_context.h" -#include "intel_screen.h" -#include "intel_batchbuffer.h" -#include "intel_swapbuffers.h" - -#include "i830_dri.h" -#include "ws_dri_bufpool.h" - -#include "pipe/p_context.h" -#include "pipe/p_screen.h" -#include "pipe/p_inlines.h" -#include "state_tracker/st_public.h" -#include "state_tracker/st_cb_fbo.h" - -static void -intelCreateSurface(struct intel_screen *intelScreen, struct pipe_winsys *winsys, unsigned handle); - -static void -intelCreateSurface(struct intel_screen *intelScreen, struct pipe_winsys *winsys, unsigned handle) -{ - struct pipe_screen *screen = intelScreen->base.screen; - struct pipe_texture *texture; - struct pipe_texture templat; - struct pipe_surface *surface; - struct pipe_buffer *buffer; - unsigned pitch; - - assert(intelScreen->front.cpp == 4); - - buffer = intel_be_buffer_from_handle(&intelScreen->base, - "front", handle); - - if (!buffer) - return; - - intelScreen->front.buffer = dri_bo(buffer); - - memset(&templat, 0, sizeof(templat)); - templat.tex_usage |= PIPE_TEXTURE_USAGE_DISPLAY_TARGET; - templat.target = PIPE_TEXTURE_2D; - templat.last_level = 0; - templat.depth[0] = 1; - templat.format = PIPE_FORMAT_A8R8G8B8_UNORM; - templat.width[0] = intelScreen->front.width; - templat.height[0] = intelScreen->front.height; - pf_get_block(templat.format, &templat.block); - pitch = intelScreen->front.pitch; - - texture = screen->texture_blanket(screen, - &templat, - &pitch, - buffer); - - /* Unref the buffer we don't need it anyways */ - pipe_buffer_reference(screen, &buffer, NULL); - - surface = screen->get_tex_surface(screen, - texture, - 0, - 0, - 0, - PIPE_BUFFER_USAGE_GPU_WRITE); - - intelScreen->front.texture = texture; - intelScreen->front.surface = surface; -} - -PUBLIC const char __driConfigOptions[] = - DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE - DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) - DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) - DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY -// DRI_CONF_FORCE_S3TC_ENABLE(false) - DRI_CONF_ALLOW_LARGE_TEXTURES(1) - DRI_CONF_SECTION_END DRI_CONF_END; - -const uint __driNConfigOptions = 3; - -#ifdef USE_NEW_INTERFACE -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /*USE_NEW_INTERFACE */ - -extern const struct dri_extension card_extensions[]; - -static GLboolean -intel_get_param(__DRIscreenPrivate *psp, int param, int *value) -{ - int ret; - struct drm_i915_getparam gp; - - gp.param = param; - gp.value = value; - - ret = drmCommandWriteRead(psp->fd, DRM_I915_GETPARAM, &gp, sizeof(gp)); - if (ret) { - fprintf(stderr, "drm_i915_getparam: %d\n", ret); - return GL_FALSE; - } - - return GL_TRUE; -} - -static void -intelSetTexOffset(__DRIcontext *pDRICtx, int texname, - unsigned long long offset, int depth, uint pitch) -{ - abort(); -#if 0 - struct intel_context *intel = (struct intel_context*) - ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate; - struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname); - struct st_texture_object *stObj = st_texture_object(tObj); - - if (!stObj) - return; - - if (stObj->pt) - st->pipe->texture_release(intel->st->pipe, &stObj->pt); - - stObj->imageOverride = GL_TRUE; - stObj->depthOverride = depth; - stObj->pitchOverride = pitch; - - if (offset) - stObj->textureOffset = offset; -#endif -} - - -#if 0 -static void -intelHandleDrawableConfig(__DRIdrawablePrivate *dPriv, - __DRIcontextPrivate *pcp, - __DRIDrawableConfigEvent *event) -{ - (void) dPriv; - (void) pcp; - (void) event; -} -#endif - -#if 0 -static void -intelHandleBufferAttach(__DRIdrawablePrivate *dPriv, - __DRIcontextPrivate *pcp, - __DRIBufferAttachEvent *ba) -{ - struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv); - - switch (ba->buffer.attachment) { - case DRI_DRAWABLE_BUFFER_FRONT_LEFT: - intelScreen->front.width = dPriv->w; - intelScreen->front.height = dPriv->h; - intelScreen->front.cpp = ba->buffer.cpp; - intelScreen->front.pitch = ba->buffer.pitch; - driGenBuffers(intelScreen->base.staticPool, "front", 1, &intelScreen->front.buffer, 0, 0, 0); - driBOSetReferenced(intelScreen->front.buffer, ba->buffer.handle); - break; - - case DRI_DRAWABLE_BUFFER_BACK_LEFT: - case DRI_DRAWABLE_BUFFER_DEPTH: - case DRI_DRAWABLE_BUFFER_STENCIL: - case DRI_DRAWABLE_BUFFER_ACCUM: - /* anything ?? */ - break; - - default: - fprintf(stderr, "unhandled buffer attach event, attachment type %d\n", - ba->buffer.attachment); - return; - } -} -#endif - -static const __DRItexOffsetExtension intelTexOffsetExtension = { - { __DRI_TEX_OFFSET }, - intelSetTexOffset, -}; - -#if 0 -static const __DRItexBufferExtension intelTexBufferExtension = { - { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, - intelSetTexBuffer, -}; -#endif - -static const __DRIextension *intelScreenExtensions[] = { - &driReadDrawableExtension, - &driCopySubBufferExtension.base, - &driSwapControlExtension.base, - &driFrameTrackingExtension.base, - &driMediaStreamCounterExtension.base, - &intelTexOffsetExtension.base, -// &intelTexBufferExtension.base, - NULL -}; - - -static void -intelPrintDRIInfo(struct intel_screen * intelScreen, - __DRIscreenPrivate * sPriv, I830DRIPtr gDRIPriv) -{ - fprintf(stderr, "*** Front size: 0x%x offset: 0x%x pitch: %d\n", - intelScreen->front.size, intelScreen->front.offset, - intelScreen->front.pitch); - fprintf(stderr, "*** Memory : 0x%x\n", gDRIPriv->mem); -} - - -#if 0 -static void -intelPrintSAREA(const drmI830Sarea * sarea) -{ - fprintf(stderr, "SAREA: sarea width %d height %d\n", sarea->width, - sarea->height); - fprintf(stderr, "SAREA: pitch: %d\n", sarea->pitch); - fprintf(stderr, - "SAREA: front offset: 0x%08x size: 0x%x handle: 0x%x\n", - sarea->front_offset, sarea->front_size, - (unsigned) sarea->front_handle); - fprintf(stderr, - "SAREA: back offset: 0x%08x size: 0x%x handle: 0x%x\n", - sarea->back_offset, sarea->back_size, - (unsigned) sarea->back_handle); - fprintf(stderr, "SAREA: depth offset: 0x%08x size: 0x%x handle: 0x%x\n", - sarea->depth_offset, sarea->depth_size, - (unsigned) sarea->depth_handle); - fprintf(stderr, "SAREA: tex offset: 0x%08x size: 0x%x handle: 0x%x\n", - sarea->tex_offset, sarea->tex_size, (unsigned) sarea->tex_handle); - fprintf(stderr, "SAREA: rotation: %d\n", sarea->rotation); - fprintf(stderr, - "SAREA: rotated offset: 0x%08x size: 0x%x\n", - sarea->rotated_offset, sarea->rotated_size); - fprintf(stderr, "SAREA: rotated pitch: %d\n", sarea->rotated_pitch); -} -#endif - - -/** - * Use the information in the sarea to update the screen parameters - * related to screen rotation. Needs to be called locked. - */ -void -intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea) -{ - struct intel_screen *intelScreen = intel_screen(sPriv); - - if (intelScreen->front.map) { - drmUnmap(intelScreen->front.map, intelScreen->front.size); - intelScreen->front.map = NULL; - } - - if (intelScreen->front.buffer) - driDeleteBuffers(1, &intelScreen->front.buffer); - - intelScreen->front.width = sarea->width; - intelScreen->front.height = sarea->height; - intelScreen->front.offset = sarea->front_offset; - intelScreen->front.pitch = sarea->pitch * intelScreen->front.cpp; - intelScreen->front.size = sarea->front_size; - intelScreen->front.handle = sarea->front_handle; - - assert( sarea->front_size >= - intelScreen->front.pitch * intelScreen->front.height ); - -#if 0 /* JB not important */ - if (!sarea->front_handle) - return; - - if (drmMap(sPriv->fd, - sarea->front_handle, - intelScreen->front.size, - (drmAddress *) & intelScreen->front.map) != 0) { - fprintf(stderr, "drmMap(frontbuffer) failed!\n"); - return; - } -#endif - -#if 0 /* JB */ - if (intelScreen->staticPool) { - driGenBuffers(intelScreen->staticPool, "static region", 1, - &intelScreen->front.buffer, 64, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE | - DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0); - - driBOSetStatic(intelScreen->front.buffer, - intelScreen->front.offset, - intelScreen->front.pitch * intelScreen->front.height, - intelScreen->front.map, 0); - } -#else - if (intelScreen->base.staticPool) { - if (intelScreen->front.buffer) { - driBOUnReference(intelScreen->front.buffer); - pipe_surface_reference(&intelScreen->front.surface, NULL); - pipe_texture_reference(&intelScreen->front.texture, NULL); - } - intelCreateSurface(intelScreen, &intelScreen->base.base, sarea->front_bo_handle); - } -#endif -} - - -boolean -intelCreatePools(__DRIscreenPrivate * sPriv) -{ - //unsigned batchPoolSize = 1024*1024; - struct intel_screen *intelScreen = intel_screen(sPriv); - - if (intelScreen->havePools) - return GL_TRUE; - - intelScreen->havePools = GL_TRUE; - - if (intelScreen->sarea) - intelUpdateScreenRotation(sPriv, intelScreen->sarea); - - return GL_TRUE; -} - -static const char * -intel_get_name( struct pipe_winsys *winsys ) -{ - return "Intel/DRI/ttm"; -} - -/* - * The state tracker (should!) keep track of whether the fake - * frontbuffer has been touched by any rendering since the last time - * we copied its contents to the real frontbuffer. Our task is easy: - */ -static void -intel_flush_frontbuffer( struct pipe_winsys *winsys, - struct pipe_surface *surf, - void *context_private) -{ - struct intel_context *intel = (struct intel_context *) context_private; - __DRIdrawablePrivate *dPriv = intel->driDrawable; - - intelDisplaySurface(dPriv, surf, NULL); -} - -static boolean -intelInitDriver(__DRIscreenPrivate * sPriv) -{ - struct intel_screen *intelScreen; - I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv; - - if (sPriv->devPrivSize != sizeof(I830DRIRec)) { - fprintf(stderr, - "\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - - /* Allocate the private area */ - intelScreen = CALLOC_STRUCT(intel_screen); - if (!intelScreen) - return GL_FALSE; - - /* parse information in __driConfigOptions */ - driParseOptionInfo(&intelScreen->optionCache, - __driConfigOptions, __driNConfigOptions); - - sPriv->private = (void *) intelScreen; - intelScreen->sarea = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) + - gDRIPriv->sarea_priv_offset); - - intelScreen->deviceID = gDRIPriv->deviceID; - - intelScreen->front.cpp = gDRIPriv->cpp; - intelScreen->drmMinor = sPriv->drm_version.minor; - intelUpdateScreenRotation(sPriv, intelScreen->sarea); - - if (0) - intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv); - - sPriv->extensions = intelScreenExtensions; - - intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer; - intelScreen->base.base.get_name = intel_get_name; - intel_be_init_device(&intelScreen->base, sPriv->fd, intelScreen->deviceID); - - return GL_TRUE; -} - - -static void -intelDestroyScreen(__DRIscreenPrivate * sPriv) -{ - struct intel_screen *intelScreen = intel_screen(sPriv); - - intel_be_destroy_device(&intelScreen->base); - /* intelUnmapScreenRegions(intelScreen); */ - - FREE(intelScreen); - sPriv->private = NULL; -} - - -/** - * This is called when we need to set up GL rendering to a new X window. - */ -static boolean -intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, - __DRIdrawablePrivate * driDrawPriv, - const __GLcontextModes * visual, boolean isPixmap) -{ - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - enum pipe_format colorFormat, depthFormat, stencilFormat; - struct intel_framebuffer *intelfb = CALLOC_STRUCT(intel_framebuffer); - - if (!intelfb) - return GL_FALSE; - - if (visual->redBits == 5) - colorFormat = PIPE_FORMAT_R5G6B5_UNORM; - else - colorFormat = PIPE_FORMAT_A8R8G8B8_UNORM; - - if (visual->depthBits == 16) - depthFormat = PIPE_FORMAT_Z16_UNORM; - else if (visual->depthBits == 24) - depthFormat = PIPE_FORMAT_S8Z24_UNORM; - else - depthFormat = PIPE_FORMAT_NONE; - - if (visual->stencilBits == 8) - stencilFormat = PIPE_FORMAT_S8Z24_UNORM; - else - stencilFormat = PIPE_FORMAT_NONE; - - intelfb->stfb = st_create_framebuffer(visual, - colorFormat, - depthFormat, - stencilFormat, - driDrawPriv->w, - driDrawPriv->h, - (void*) intelfb); - if (!intelfb->stfb) { - free(intelfb); - return GL_FALSE; - } - - driDrawPriv->driverPrivate = (void *) intelfb; - return GL_TRUE; - } -} - -static void -intelDestroyBuffer(__DRIdrawablePrivate * driDrawPriv) -{ - struct intel_framebuffer *intelfb = intel_framebuffer(driDrawPriv); - assert(intelfb->stfb); - st_unreference_framebuffer(intelfb->stfb); - free(intelfb); -} - - -/** - * Get information about previous buffer swaps. - */ -static int -intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo) -{ - if ((dPriv == NULL) || (dPriv->driverPrivate == NULL) - || (sInfo == NULL)) { - return -1; - } - - return 0; -} - -static __DRIconfig ** -intelFillInModes(__DRIscreenPrivate *psp, - unsigned pixel_bits, unsigned depth_bits, - unsigned stencil_bits, GLboolean have_back_buffer) -{ - __DRIconfig **configs; - __GLcontextModes *m; - unsigned num_modes; - unsigned depth_buffer_factor; - unsigned back_buffer_factor; - GLenum fb_format; - GLenum fb_type; - int i; - - /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't - * support pageflipping at all. - */ - static const GLenum back_buffer_modes[] = { - GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML - }; - - uint8_t depth_bits_array[3]; - uint8_t stencil_bits_array[3]; - uint8_t msaa_samples_array[1]; - - - depth_bits_array[0] = 0; - depth_bits_array[1] = depth_bits; - depth_bits_array[2] = depth_bits; - msaa_samples_array[0] = 0; - - /* Just like with the accumulation buffer, always provide some modes - * with a stencil buffer. It will be a sw fallback, but some apps won't - * care about that. - */ - stencil_bits_array[0] = 0; - stencil_bits_array[1] = 0; - if (depth_bits == 24) - stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; - - stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits; - - depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1; - back_buffer_factor = (have_back_buffer) ? 3 : 1; - - num_modes = depth_buffer_factor * back_buffer_factor * 4; - - if (pixel_bits == 16) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; - } - else { - fb_format = GL_BGRA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } - - configs = driCreateConfigs(fb_format, fb_type, - depth_bits_array, stencil_bits_array, - depth_buffer_factor, back_buffer_modes, - back_buffer_factor, msaa_samples_array, 1); - if (configs == NULL) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, - __LINE__); - return NULL; - } - - /* Mark the visual as slow if there are "fake" stencil bits. - */ - for (i = 0; configs[i]; i++) { - m = &configs[i]->modes; - if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) { - m->visualRating = GLX_SLOW_CONFIG; - } - } - - return configs; -} - -/** - * This is the driver specific part of the createNewScreen entry point. - * - * \todo maybe fold this into intelInitDriver - * - * \return the __GLcontextModes supported by this driver - */ -static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp) -{ -#ifdef I915 - static const __DRIversion ddx_expected = { 1, 5, 0 }; -#else - static const __DRIversion ddx_expected = { 1, 6, 0 }; -#endif - static const __DRIversion dri_expected = { 4, 0, 0 }; - static const __DRIversion drm_expected = { 1, 5, 0 }; - I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; - - if (!driCheckDriDdxDrmVersions2("i915", - &psp->dri_version, &dri_expected, - &psp->ddx_version, &ddx_expected, - &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 ); - //intelInitExtensions(NULL, GL_TRUE); - - if (!intelInitDriver(psp)) - return NULL; - - psp->extensions = intelScreenExtensions; - - return (const __DRIconfig **) - intelFillInModes(psp, dri_priv->cpp * 8, - (dri_priv->cpp == 2) ? 16 : 24, - (dri_priv->cpp == 2) ? 0 : 8, 1); -} - -/** - * This is the driver specific part of the createNewScreen entry point. - * - * \return the __GLcontextModes supported by this driver - */ -static const -__DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) -{ - struct intel_screen *intelScreen; - - /* 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 = CALLOC_STRUCT(intel_screen); - if (!intelScreen) { - fprintf(stderr, "\nERROR! Allocating private area failed\n"); - return GL_FALSE; - } - /* parse information in __driConfigOptions */ - driParseOptionInfo(&intelScreen->optionCache, - __driConfigOptions, __driNConfigOptions); - - psp->private = (void *) intelScreen; - - intelScreen->drmMinor = psp->drm_version.minor; - - /* Determine chipset ID? */ - if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID, - &intelScreen->deviceID)) - return GL_FALSE; - - psp->extensions = intelScreenExtensions; - - intel_be_init_device(&intelScreen->base, psp->fd, intelScreen->deviceID); - intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer; - intelScreen->base.base.get_name = intel_get_name; - - return driConcatConfigs(intelFillInModes(psp, 16, 16, 0, 1), - intelFillInModes(psp, 32, 24, 8, 1)); -} - -const struct __DriverAPIRec driDriverAPI = { - .InitScreen = intelInitScreen, - .DestroyScreen = intelDestroyScreen, - .CreateContext = intelCreateContext, - .DestroyContext = intelDestroyContext, - .CreateBuffer = intelCreateBuffer, - .DestroyBuffer = intelDestroyBuffer, - .SwapBuffers = intelSwapBuffers, - .MakeCurrent = intelMakeCurrent, - .UnbindContext = intelUnbindContext, - .GetSwapInfo = intelGetSwapInfo, - .GetDrawableMSC = driDrawableGetMSC32, - .WaitForMSC = driWaitForMSC32, - .CopySubBuffer = intelCopySubBuffer, - - //.InitScreen2 = intelInitScreen2, - //.HandleDrawableConfig = intelHandleDrawableConfig, - //.HandleBufferAttach = intelHandleBufferAttach, -}; diff --git a/src/gallium/winsys/drm/intel/dri/intel_screen.h b/src/gallium/winsys/drm/intel/dri/intel_screen.h deleted file mode 100644 index 0bb43a915c..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_screen.h +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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 _INTEL_SCREEN_H_ -#define _INTEL_SCREEN_H_ - -#include "dri_util.h" -#include "i830_common.h" -#include "xmlconfig.h" -#include "ws_dri_bufpool.h" - -#include "pipe/p_compiler.h" - -#include "intel_be_device.h" - -struct intel_screen -{ - struct intel_be_device base; - - struct { - drm_handle_t handle; - - /* We create a static dri buffer for the frontbuffer. - */ - struct _DriBufferObject *buffer; - struct pipe_surface *surface; - struct pipe_texture *texture; - - char *map; /* memory map */ - int offset; /* from start of video mem, in bytes */ - int pitch; /* row stride, in bytes */ - int width; - int height; - int size; - int cpp; /* for front and back buffers */ - } front; - - int deviceID; - int drmMinor; - - drmI830Sarea *sarea; - - /** - * Configuration cache with default values for all contexts - */ - driOptionCache optionCache; - - boolean havePools; - - /** - * Temporary(?) context to use for SwapBuffers or other situations in - * which we need a rendering context, but none is currently bound. - */ - struct intel_context *dummyContext; - - /* - * New stuff form the i915tex integration - */ - unsigned batch_id; - - - struct pipe_winsys *winsys; -}; - - - -/** cast wrapper */ -static INLINE struct intel_screen * -intel_screen(__DRIscreenPrivate *sPriv) -{ - return (struct intel_screen *) sPriv->private; -} - - -extern void -intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea); - - -extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv); - -extern boolean intelUnbindContext(__DRIcontextPrivate * driContextPriv); - -extern boolean -intelMakeCurrent(__DRIcontextPrivate * driContextPriv, - __DRIdrawablePrivate * driDrawPriv, - __DRIdrawablePrivate * driReadPriv); - - -extern boolean -intelCreatePools(__DRIscreenPrivate *sPriv); - -extern boolean -intelCreateContext(const __GLcontextModes * visual, - __DRIcontextPrivate * driContextPriv, - void *sharedContextPrivate); - - -#endif diff --git a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c b/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c deleted file mode 100644 index 34ad7eebe1..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c +++ /dev/null @@ -1,260 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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. - * - **************************************************************************/ - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_swapbuffers.h" - -#include "intel_reg.h" - -#include "pipe/p_context.h" -#include "state_tracker/st_public.h" -#include "state_tracker/st_context.h" -#include "state_tracker/st_cb_fbo.h" - -#include "ws_dri_bufmgr.h" -#include "intel_batchbuffer.h" - -/** - * Display a colorbuffer surface in an X window. - * Used for SwapBuffers and flushing front buffer rendering. - * - * \param dPriv the window/drawable to display into - * \param surf the surface to display - * \param rect optional subrect of surface to display (may be NULL). - */ -void -intelDisplaySurface(__DRIdrawablePrivate *dPriv, - struct pipe_surface *surf, - const drm_clip_rect_t *rect) -{ - struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv); - struct intel_context *intel = intelScreen->dummyContext; - - DBG(SWAP, "%s\n", __FUNCTION__); - - if (!intel) { - /* XXX this is where some kind of extra/meta context could be useful */ - return; - } - - if (intel->last_swap_fence) { - driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, TRUE); - driFenceUnReference(&intel->last_swap_fence); - intel->last_swap_fence = NULL; - } - intel->last_swap_fence = intel->first_swap_fence; - intel->first_swap_fence = NULL; - - /* The LOCK_HARDWARE is required for the cliprects. Buffer offsets - * should work regardless. - */ - LOCK_HARDWARE(intel); - /* if this drawable isn't currently bound the LOCK_HARDWARE done on the - * current context (which is what intelScreenContext should return) might - * not get a contended lock and thus cliprects not updated (tests/manywin) - */ - if (intel_context(dPriv->driContextPriv) != intel) - DRI_VALIDATE_DRAWABLE_INFO(intel->driScreen, dPriv); - - - if (dPriv && dPriv->numClipRects) { - const int srcWidth = surf->width; - const int srcHeight = surf->height; - const int nbox = dPriv->numClipRects; - const drm_clip_rect_t *pbox = dPriv->pClipRects; - const int pitch = intelScreen->front.pitch / intelScreen->front.cpp; - const int cpp = intelScreen->front.cpp; - const int srcpitch = surf->stride / cpp; - int BR13, CMD; - int i; - - ASSERT(surf->buffer); - - DBG(SWAP, "screen pitch %d src surface pitch %d\n", - pitch, surf->stride); - - if (cpp == 2) { - BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24); - CMD = XY_SRC_COPY_BLT_CMD; - } - else { - BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24) | (1 << 25); - CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | - XY_SRC_COPY_BLT_WRITE_RGB); - } - - for (i = 0; i < nbox; i++, pbox++) { - drm_clip_rect_t box; - drm_clip_rect_t sbox; - - if (pbox->x1 > pbox->x2 || - pbox->y1 > pbox->y2 || - pbox->x2 > intelScreen->front.width || - pbox->y2 > intelScreen->front.height) { - /* invalid cliprect, skip it */ - continue; - } - - box = *pbox; - - if (rect) { - /* intersect cliprect with user-provided src rect */ - drm_clip_rect_t rrect; - - rrect.x1 = dPriv->x + rect->x1; - rrect.y1 = (dPriv->h - rect->y1 - rect->y2) + dPriv->y; - rrect.x2 = rect->x2 + rrect.x1; - rrect.y2 = rect->y2 + rrect.y1; - if (rrect.x1 > box.x1) - box.x1 = rrect.x1; - if (rrect.y1 > box.y1) - box.y1 = rrect.y1; - if (rrect.x2 < box.x2) - box.x2 = rrect.x2; - if (rrect.y2 < box.y2) - box.y2 = rrect.y2; - - if (box.x1 > box.x2 || box.y1 > box.y2) - continue; - } - - /* restrict blit to size of actually rendered area */ - if (box.x2 - box.x1 > srcWidth) - box.x2 = srcWidth + box.x1; - if (box.y2 - box.y1 > srcHeight) - box.y2 = srcHeight + box.y1; - - DBG(SWAP, "box x1 x2 y1 y2 %d %d %d %d\n", - box.x1, box.x2, box.y1, box.y2); - - sbox.x1 = box.x1 - dPriv->x; - sbox.y1 = box.y1 - dPriv->y; - - assert(box.x1 < box.x2); - assert(box.y1 < box.y2); - - /* XXX this could be done with pipe->surface_copy() */ - /* XXX should have its own batch buffer */ - if (!BEGIN_BATCH(8, 2)) { - /* - * Since we share this batch buffer with a context - * we can't flush it since that risks a GPU lockup - */ - assert(0); - continue; - } - - OUT_BATCH(CMD); - OUT_BATCH(BR13); - OUT_BATCH((box.y1 << 16) | box.x1); - OUT_BATCH((box.y2 << 16) | box.x2); - - OUT_RELOC(intelScreen->front.buffer, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, - DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0); - OUT_BATCH((sbox.y1 << 16) | sbox.x1); - OUT_BATCH((srcpitch * cpp) & 0xffff); - OUT_RELOC(dri_bo(surf->buffer), - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0); - - } - - if (intel->first_swap_fence) - driFenceUnReference(&intel->first_swap_fence); - intel->first_swap_fence = intel_be_batchbuffer_flush(intel->base.batch); - } - - UNLOCK_HARDWARE(intel); - - if (intel->lastStamp != dPriv->lastStamp) { - intelUpdateWindowSize(dPriv); - intel->lastStamp = dPriv->lastStamp; - } -} - - - -/** - * This will be called whenever the currently bound window is moved/resized. - */ -void -intelUpdateWindowSize(__DRIdrawablePrivate *dPriv) -{ - struct intel_framebuffer *intelfb = intel_framebuffer(dPriv); - assert(intelfb->stfb); - st_resize_framebuffer(intelfb->stfb, dPriv->w, dPriv->h); -} - - - -void -intelSwapBuffers(__DRIdrawablePrivate * dPriv) -{ - struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv); - struct pipe_surface *back_surf; - - assert(intel_fb); - assert(intel_fb->stfb); - - back_surf = st_get_framebuffer_surface(intel_fb->stfb, - ST_SURFACE_BACK_LEFT); - if (back_surf) { - st_notify_swapbuffers(intel_fb->stfb); - intelDisplaySurface(dPriv, back_surf, NULL); - st_notify_swapbuffers_complete(intel_fb->stfb); - } -} - - -/** - * Called via glXCopySubBufferMESA() to copy a subrect of the back - * buffer to the front buffer/screen. - */ -void -intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h) -{ - struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv); - struct pipe_surface *back_surf; - - assert(intel_fb); - assert(intel_fb->stfb); - - back_surf = st_get_framebuffer_surface(intel_fb->stfb, - ST_SURFACE_BACK_LEFT); - if (back_surf) { - drm_clip_rect_t rect; - rect.x1 = x; - rect.y1 = y; - rect.x2 = w; - rect.y2 = h; - - st_notify_swapbuffers(intel_fb->stfb); - intelDisplaySurface(dPriv, back_surf, &rect); - } -} diff --git a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h b/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h deleted file mode 100644 index 46c9bab3af..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 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 INTEL_SWAPBUFFERS_H -#define INTEL_SWAPBUFFERS_H - - -struct pipe_surface; - - -extern void intelDisplaySurface(__DRIdrawablePrivate * dPriv, - struct pipe_surface *surf, - const drm_clip_rect_t * rect); - -extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv); - -extern void intelCopySubBuffer(__DRIdrawablePrivate * dPriv, - int x, int y, int w, int h); - -extern void intelUpdateWindowSize(__DRIdrawablePrivate *dPriv); - - -#endif /* INTEL_SWAPBUFFERS_H */ diff --git a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c b/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c deleted file mode 100644 index 20920a2052..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * 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 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 COPYRIGHT HOLDERS, AUTHORS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Keith Whitwell - */ - -#include "intel_context.h" -#include "intel_winsys_softpipe.h" -#include "pipe/p_defines.h" -#include "pipe/p_format.h" -#include "util/u_memory.h" -#include "softpipe/sp_winsys.h" - - -struct intel_softpipe_winsys { - struct softpipe_winsys sws; - struct intel_context *intel; -}; - -/** - * Return list of surface formats supported by this driver. - */ -static boolean -intel_is_format_supported(struct softpipe_winsys *sws, - enum pipe_format format) -{ - switch(format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_S8Z24_UNORM: - return TRUE; - default: - return FALSE; - } -} - - -/** - * Create rendering context which uses software rendering. - */ -struct pipe_context * -intel_create_softpipe( struct intel_context *intel, - struct pipe_winsys *winsys ) -{ - struct intel_softpipe_winsys *isws = CALLOC_STRUCT( intel_softpipe_winsys ); - struct pipe_screen *screen = softpipe_create_screen(winsys); - - /* Fill in this struct with callbacks that softpipe will need to - * communicate with the window system, buffer manager, etc. - */ - isws->sws.is_format_supported = intel_is_format_supported; - isws->intel = intel; - - /* Create the softpipe context: - */ - return softpipe_create( screen, winsys, &isws->sws ); -} diff --git a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h b/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h deleted file mode 100644 index 5fa14cb749..0000000000 --- a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 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 INTEL_SOFTPIPE_H -#define INTEL_SOFTPIPE_H - -struct pipe_winsys; -struct pipe_context; -struct intel_context; - -struct pipe_context * -intel_create_softpipe( struct intel_context *intel, - struct pipe_winsys *winsys ); - -#endif diff --git a/src/gallium/winsys/drm/intel/dri/server/i830_common.h b/src/gallium/winsys/drm/intel/dri/server/i830_common.h deleted file mode 100644 index 3452ddb3c9..0000000000 --- a/src/gallium/winsys/drm/intel/dri/server/i830_common.h +++ /dev/null @@ -1,255 +0,0 @@ -/************************************************************************** - -Copyright 2001 VA Linux Systems Inc., Fremont, California. -Copyright 2002 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 -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 -ATI, VA LINUX SYSTEMS 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. - -**************************************************************************/ - - -#ifndef _I830_COMMON_H_ -#define _I830_COMMON_H_ - - -#define I830_NR_TEX_REGIONS 255 /* maximum due to use of chars for next/prev */ -#define I830_LOG_MIN_TEX_REGION_SIZE 14 - - -/* Driver specific DRM command indices - * NOTE: these are not OS specific, but they are driver specific - */ -#define DRM_I830_INIT 0x00 -#define DRM_I830_FLUSH 0x01 -#define DRM_I830_FLIP 0x02 -#define DRM_I830_BATCHBUFFER 0x03 -#define DRM_I830_IRQ_EMIT 0x04 -#define DRM_I830_IRQ_WAIT 0x05 -#define DRM_I830_GETPARAM 0x06 -#define DRM_I830_SETPARAM 0x07 -#define DRM_I830_ALLOC 0x08 -#define DRM_I830_FREE 0x09 -#define DRM_I830_INIT_HEAP 0x0a -#define DRM_I830_CMDBUFFER 0x0b -#define DRM_I830_DESTROY_HEAP 0x0c -#define DRM_I830_SET_VBLANK_PIPE 0x0d -#define DRM_I830_GET_VBLANK_PIPE 0x0e -#define DRM_I830_MMIO 0x10 - -typedef struct { - enum { - I830_INIT_DMA = 0x01, - I830_CLEANUP_DMA = 0x02, - I830_RESUME_DMA = 0x03 - } func; - unsigned int mmio_offset; - int sarea_priv_offset; - unsigned int ring_start; - unsigned int ring_end; - unsigned int ring_size; - unsigned int front_offset; - unsigned int back_offset; - unsigned int depth_offset; - unsigned int w; - unsigned int h; - unsigned int pitch; - unsigned int pitch_bits; - unsigned int back_pitch; - unsigned int depth_pitch; - unsigned int cpp; - unsigned int chipset; -} drmI830Init; - -typedef struct { - drmTextureRegion texList[I830_NR_TEX_REGIONS+1]; - int last_upload; /* 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 ctxOwner; /* last context to upload state */ - /** Last context that used the buffer manager. */ - int texAge; - int pf_enabled; /* is pageflipping allowed? */ - int pf_active; - int pf_current_page; /* which buffer is being displayed? */ - int perf_boxes; /* performance boxes to be displayed */ - int width, height; /* screen size in pixels */ - - drm_handle_t front_handle; - int front_offset; - int front_size; - - drm_handle_t back_handle; - int back_offset; - int back_size; - - drm_handle_t depth_handle; - int depth_offset; - int depth_size; - - drm_handle_t tex_handle; - int tex_offset; - int tex_size; - int log_tex_granularity; - int pitch; - int rotation; /* 0, 90, 180 or 270 */ - int rotated_offset; - int rotated_size; - int rotated_pitch; - int virtualX, virtualY; - - unsigned int front_tiled; - unsigned int back_tiled; - unsigned int depth_tiled; - unsigned int rotated_tiled; - unsigned int rotated2_tiled; - - int planeA_x; - int planeA_y; - int planeA_w; - int planeA_h; - int planeB_x; - int planeB_y; - int planeB_w; - int planeB_h; - - /* Triple buffering */ - drm_handle_t third_handle; - int third_offset; - int third_size; - unsigned int third_tiled; - - /* buffer object handles for the static buffers. May change - * over the lifetime of the client, though it doesn't in our current - * implementation. - */ - unsigned int front_bo_handle; - unsigned int back_bo_handle; - unsigned int third_bo_handle; - unsigned int depth_bo_handle; -} drmI830Sarea; - -/* Flags for perf_boxes - */ -#define I830_BOX_RING_EMPTY 0x1 /* populated by kernel */ -#define I830_BOX_FLIP 0x2 /* populated by kernel */ -#define I830_BOX_WAIT 0x4 /* populated by kernel & client */ -#define I830_BOX_TEXTURE_LOAD 0x8 /* populated by kernel */ -#define I830_BOX_LOST_CONTEXT 0x10 /* populated by client */ - - -typedef struct { - int start; /* agp offset */ - int used; /* nr bytes in use */ - int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ - int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/ - int num_cliprects; /* mulitpass with multiple cliprects? */ - drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */ -} drmI830BatchBuffer; - -typedef struct { - char *buf; /* agp offset */ - int sz; /* nr bytes in use */ - int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ - int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/ - int num_cliprects; /* mulitpass with multiple cliprects? */ - drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */ -} drmI830CmdBuffer; - -typedef struct { - int *irq_seq; -} drmI830IrqEmit; - -typedef struct { - int irq_seq; -} drmI830IrqWait; - -typedef struct { - int param; - int *value; -} drmI830GetParam; - -#define I830_PARAM_IRQ_ACTIVE 1 -#define I830_PARAM_ALLOW_BATCHBUFFER 2 - -typedef struct { - int param; - int value; -} drmI830SetParam; - -#define I830_SETPARAM_USE_MI_BATCHBUFFER_START 1 -#define I830_SETPARAM_TEX_LRU_LOG_GRANULARITY 2 -#define I830_SETPARAM_ALLOW_BATCHBUFFER 3 - - -/* A memory manager for regions of shared memory: - */ -#define I830_MEM_REGION_AGP 1 - -typedef struct { - int region; - int alignment; - int size; - int *region_offset; /* offset from start of fb or agp */ -} drmI830MemAlloc; - -typedef struct { - int region; - int region_offset; -} drmI830MemFree; - -typedef struct { - int region; - int size; - int start; -} drmI830MemInitHeap; - -typedef struct { - int region; -} drmI830MemDestroyHeap; - -#define DRM_I830_VBLANK_PIPE_A 1 -#define DRM_I830_VBLANK_PIPE_B 2 - -typedef struct { - int pipe; -} drmI830VBlankPipe; - -#define MMIO_READ 0 -#define MMIO_WRITE 1 - -#define MMIO_REGS_IA_PRIMATIVES_COUNT 0 -#define MMIO_REGS_IA_VERTICES_COUNT 1 -#define MMIO_REGS_VS_INVOCATION_COUNT 2 -#define MMIO_REGS_GS_PRIMITIVES_COUNT 3 -#define MMIO_REGS_GS_INVOCATION_COUNT 4 -#define MMIO_REGS_CL_PRIMITIVES_COUNT 5 -#define MMIO_REGS_CL_INVOCATION_COUNT 6 -#define MMIO_REGS_PS_INVOCATION_COUNT 7 -#define MMIO_REGS_PS_DEPTH_COUNT 8 - -typedef struct { - unsigned int read_write:1; - unsigned int reg:31; - void __user *data; -} drmI830MMIO; - -#endif /* _I830_DRM_H_ */ diff --git a/src/gallium/winsys/drm/intel/dri/server/i830_dri.h b/src/gallium/winsys/drm/intel/dri/server/i830_dri.h deleted file mode 100644 index 0d514b6c38..0000000000 --- a/src/gallium/winsys/drm/intel/dri/server/i830_dri.h +++ /dev/null @@ -1,62 +0,0 @@ - -#ifndef _I830_DRI_H -#define _I830_DRI_H - -#include "xf86drm.h" -#include "i830_common.h" - -#define I830_MAX_DRAWABLES 256 - -#define I830_MAJOR_VERSION 1 -#define I830_MINOR_VERSION 7 -#define I830_PATCHLEVEL 2 - -#define I830_REG_SIZE 0x80000 - -typedef struct _I830DRIRec { - drm_handle_t regs; - drmSize regsSize; - - drmSize unused1; /* backbufferSize */ - drm_handle_t unused2; /* backbuffer */ - - drmSize unused3; /* depthbufferSize */ - drm_handle_t unused4; /* depthbuffer */ - - drmSize unused5; /* rotatedSize */ - drm_handle_t unused6; /* rotatedbuffer */ - - drm_handle_t unused7; /* textures */ - int unused8; /* textureSize */ - - drm_handle_t unused9; /* agp_buffers */ - drmSize unused10; /* agp_buf_size */ - - int deviceID; - int width; - int height; - int mem; - int cpp; - int bitsPerPixel; - - int unused11[8]; /* was front/back/depth/rotated offset/pitch */ - - int unused12; /* logTextureGranularity */ - int unused13; /* textureOffset */ - - int irq; - int sarea_priv_offset; -} I830DRIRec, *I830DRIPtr; - -typedef struct { - /* Nothing here yet */ - int dummy; -} I830ConfigPrivRec, *I830ConfigPrivPtr; - -typedef struct { - /* Nothing here yet */ - int dummy; -} I830DRIContextRec, *I830DRIContextPtr; - - -#endif -- cgit v1.2.3 From 67fc3ace65419b0865253e3ef54b20abbca1dfb5 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 2 Feb 2009 01:30:05 +0100 Subject: intel: Make gem export the drm_api_hocks --- src/gallium/winsys/drm/intel/egl/Makefile | 13 ++-- src/gallium/winsys/drm/intel/egl/intel_api.c | 10 --- src/gallium/winsys/drm/intel/egl/intel_api.h | 14 ---- src/gallium/winsys/drm/intel/egl/intel_context.c | 83 ---------------------- src/gallium/winsys/drm/intel/egl/intel_device.c | 48 ------------- src/gallium/winsys/drm/intel/gem/Makefile | 3 +- src/gallium/winsys/drm/intel/gem/intel_be_api.c | 12 ++++ src/gallium/winsys/drm/intel/gem/intel_be_api.h | 14 ++++ .../winsys/drm/intel/gem/intel_be_context.c | 44 +++++++++++- .../winsys/drm/intel/gem/intel_be_context.h | 17 ----- src/gallium/winsys/drm/intel/gem/intel_be_device.c | 42 +++++++---- src/gallium/winsys/drm/intel/gem/intel_be_device.h | 11 ++- 12 files changed, 112 insertions(+), 199 deletions(-) delete mode 100644 src/gallium/winsys/drm/intel/egl/intel_api.c delete mode 100644 src/gallium/winsys/drm/intel/egl/intel_api.h delete mode 100644 src/gallium/winsys/drm/intel/egl/intel_context.c delete mode 100644 src/gallium/winsys/drm/intel/egl/intel_device.c create mode 100644 src/gallium/winsys/drm/intel/gem/intel_be_api.c create mode 100644 src/gallium/winsys/drm/intel/gem/intel_be_api.h (limited to 'src') diff --git a/src/gallium/winsys/drm/intel/egl/Makefile b/src/gallium/winsys/drm/intel/egl/Makefile index 7147d89e0d..c5217ad2d6 100644 --- a/src/gallium/winsys/drm/intel/egl/Makefile +++ b/src/gallium/winsys/drm/intel/egl/Makefile @@ -1,19 +1,16 @@ TOP = ../../../../../.. +GALLIUMDIR = ../../../.. include $(TOP)/configs/current LIBNAME = EGL_i915.so PIPE_DRIVERS = \ - ../gem/libinteldrm.a \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ - $(TOP)/src/gallium/drivers/i915simple/libi915simple.a \ $(TOP)/src/gallium/state_trackers/egl/libegldrm.a \ + $(GALLIUMDIR)/winsys/drm/intel/gem/libinteldrm.a \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ + $(TOP)/src/gallium/drivers/i915simple/libi915simple.a - -DRIVER_SOURCES = \ - intel_context.c \ - intel_device.c \ - intel_api.c +DRIVER_SOURCES = C_SOURCES = \ $(COMMON_GALLIUM_SOURCES) \ diff --git a/src/gallium/winsys/drm/intel/egl/intel_api.c b/src/gallium/winsys/drm/intel/egl/intel_api.c deleted file mode 100644 index 5dc4a7b052..0000000000 --- a/src/gallium/winsys/drm/intel/egl/intel_api.c +++ /dev/null @@ -1,10 +0,0 @@ - -#include "intel_api.h" - -struct drm_api drm_api_hocks = -{ - .create_screen = intel_create_screen, - .create_context = intel_create_context, - .buffer_from_handle = intel_be_buffer_from_handle, - .handle_from_buffer = intel_be_handle_from_buffer, -}; diff --git a/src/gallium/winsys/drm/intel/egl/intel_api.h b/src/gallium/winsys/drm/intel/egl/intel_api.h deleted file mode 100644 index 8ec165ab01..0000000000 --- a/src/gallium/winsys/drm/intel/egl/intel_api.h +++ /dev/null @@ -1,14 +0,0 @@ - -#ifndef _INTEL_API_H_ -#define _INTEL_API_H_ - -#include "pipe/p_compiler.h" - -#include "state_tracker/drm_api.h" - -#include "intel_be_device.h" - -struct pipe_screen *intel_create_screen(int drmFD, int pciID); -struct pipe_context *intel_create_context(struct pipe_screen *screen); - -#endif diff --git a/src/gallium/winsys/drm/intel/egl/intel_context.c b/src/gallium/winsys/drm/intel/egl/intel_context.c deleted file mode 100644 index 57e5ff7bc1..0000000000 --- a/src/gallium/winsys/drm/intel/egl/intel_context.c +++ /dev/null @@ -1,83 +0,0 @@ - -#include "i915simple/i915_screen.h" - -#include "intel_be_device.h" -#include "intel_be_context.h" - -#include "pipe/p_defines.h" -#include "pipe/p_context.h" - -#include "intel_api.h" - -struct intel_context -{ - struct intel_be_context base; - - /* stuff */ -}; - -/* - * Hardware lock functions. - * Doesn't do anything in EGL - */ - -static void -intel_lock_hardware(struct intel_be_context *context) -{ - (void)context; -} - -static void -intel_unlock_hardware(struct intel_be_context *context) -{ - (void)context; -} - -static boolean -intel_locked_hardware(struct intel_be_context *context) -{ - (void)context; - return FALSE; -} - - -/* - * Misc functions. - */ -static void -intel_destroy_be_context(struct i915_winsys *winsys) -{ - struct intel_context *intel = (struct intel_context *)winsys; - - intel_be_destroy_context(&intel->base); - free(intel); -} - -struct pipe_context * -intel_create_context(struct pipe_screen *screen) -{ - struct intel_context *intel; - struct pipe_context *pipe; - struct intel_be_device *device = (struct intel_be_device *)screen->winsys; - - intel = (struct intel_context *)malloc(sizeof(*intel)); - memset(intel, 0, sizeof(*intel)); - - intel->base.hardware_lock = intel_lock_hardware; - intel->base.hardware_unlock = intel_unlock_hardware; - intel->base.hardware_locked = intel_locked_hardware; - - intel_be_init_context(&intel->base, device); - - intel->base.base.destroy = intel_destroy_be_context; - -#if 0 - pipe = intel_create_softpipe(intel, screen->winsys); -#else - pipe = i915_create_context(screen, &device->base, &intel->base.base); -#endif - - pipe->priv = intel; - - return pipe; -} diff --git a/src/gallium/winsys/drm/intel/egl/intel_device.c b/src/gallium/winsys/drm/intel/egl/intel_device.c deleted file mode 100644 index 6b281402d5..0000000000 --- a/src/gallium/winsys/drm/intel/egl/intel_device.c +++ /dev/null @@ -1,48 +0,0 @@ - -#include -#include "pipe/p_defines.h" -#include "intel_be_device.h" -#include "i915simple/i915_screen.h" - -#include "intel_api.h" - -struct intel_device -{ - struct intel_be_device base; - - int deviceID; -}; - -static void -intel_destroy_winsys(struct pipe_winsys *winsys) -{ - struct intel_device *dev = (struct intel_device *)winsys; - - intel_be_destroy_device(&dev->base); - - free(dev); -} - -struct pipe_screen * -intel_create_screen(int drmFD, int deviceID) -{ - struct intel_device *dev; - struct pipe_screen *screen; - - /* Allocate the private area */ - dev = malloc(sizeof(*dev)); - if (!dev) - return NULL; - memset(dev, 0, sizeof(*dev)); - - dev->deviceID = deviceID; - - intel_be_init_device(&dev->base, drmFD, deviceID); - - /* we need to hock our own destroy function in here */ - dev->base.base.destroy = intel_destroy_winsys; - - screen = i915_create_screen(&dev->base.base, deviceID); - - return screen; -} diff --git a/src/gallium/winsys/drm/intel/gem/Makefile b/src/gallium/winsys/drm/intel/gem/Makefile index b25fc258f4..7a85a3f149 100644 --- a/src/gallium/winsys/drm/intel/gem/Makefile +++ b/src/gallium/winsys/drm/intel/gem/Makefile @@ -6,7 +6,8 @@ LIBNAME = inteldrm C_SOURCES = \ intel_be_batchbuffer.c \ intel_be_context.c \ - intel_be_device.c + intel_be_device.c \ + intel_be_api.c include ./Makefile.template diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.c b/src/gallium/winsys/drm/intel/gem/intel_be_api.c new file mode 100644 index 0000000000..6cffed5134 --- /dev/null +++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.c @@ -0,0 +1,12 @@ + +#include "intel_be_api.h" + +struct drm_api drm_api_hocks = +{ + /* intel_be_context.c */ + .create_context = intel_be_create_context, + /* intel_be_screen.c */ + .create_screen = intel_be_create_screen, + .buffer_from_handle = intel_be_buffer_from_handle, + .handle_from_buffer = intel_be_handle_from_buffer, +}; diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.h b/src/gallium/winsys/drm/intel/gem/intel_be_api.h new file mode 100644 index 0000000000..73e458d4ba --- /dev/null +++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.h @@ -0,0 +1,14 @@ + +#ifndef _INTEL_BE_API_H_ +#define _INTEL_BE_API_H_ + +#include "pipe/p_compiler.h" + +#include "state_tracker/drm_api.h" + +#include "intel_be_device.h" + +struct pipe_screen *intel_be_create_screen(int drmFD, int pciID); +struct pipe_context *intel_be_create_context(struct pipe_screen *screen); + +#endif diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_context.c b/src/gallium/winsys/drm/intel/gem/intel_be_context.c index 95e761d78d..bb6f1b916c 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_context.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.c @@ -1,10 +1,14 @@ +#include "pipe/p_screen.h" + #include "intel_be_device.h" #include "intel_be_context.h" #include "intel_be_batchbuffer.h" #include "i915_drm.h" +#include "intel_be_api.h" + static struct i915_batchbuffer * intel_be_batch_get(struct i915_winsys *sws) { @@ -57,6 +61,21 @@ intel_be_batch_flush(struct i915_winsys *sws, intel_be_batchbuffer_flush(intel->batch, f); } + +/* + * Misc functions. + */ + +static void +intel_be_destroy_context(struct i915_winsys *winsys) +{ + struct intel_be_context *intel = intel_be_context(winsys); + + intel_be_batchbuffer_free(intel->batch); + + free(intel); +} + boolean intel_be_init_context(struct intel_be_context *intel, struct intel_be_device *device) { @@ -68,13 +87,32 @@ intel_be_init_context(struct intel_be_context *intel, struct intel_be_device *de intel->base.batch_reloc = intel_be_batch_reloc; intel->base.batch_flush = intel_be_batch_flush; + intel->base.destroy = intel_be_destroy_context; + intel->batch = intel_be_batchbuffer_alloc(intel); return true; } -void -intel_be_destroy_context(struct intel_be_context *intel) +struct pipe_context * +intel_be_create_context(struct pipe_screen *screen) { - intel_be_batchbuffer_free(intel->batch); + struct intel_be_context *intel; + struct pipe_context *pipe; + struct intel_be_device *device = intel_be_device(screen->winsys); + + intel = (struct intel_be_context *)malloc(sizeof(*intel)); + memset(intel, 0, sizeof(*intel)); + + intel_be_init_context(intel, device); + +#if 0 + pipe = intel_create_softpipe(intel, screen->winsys); +#else + pipe = i915_create_context(screen, &device->base, &intel->base); +#endif + + pipe->priv = intel; + + return pipe; } diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_context.h b/src/gallium/winsys/drm/intel/gem/intel_be_context.h index 9cee1a4e52..5a369669c0 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_context.h +++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.h @@ -11,15 +11,6 @@ struct intel_be_context struct intel_be_device *device; struct intel_be_batchbuffer *batch; - - /* - * Hardware lock functions. - * - * Needs to be filled in by the winsys. - */ - void (*hardware_lock)(struct intel_be_context *context); - void (*hardware_unlock)(struct intel_be_context *context); - boolean (*hardware_locked)(struct intel_be_context *context); }; static INLINE struct intel_be_context * @@ -37,12 +28,4 @@ boolean intel_be_init_context(struct intel_be_context *intel, struct intel_be_device *device); -/** - * Destroy a intel_be_context. - * - * Does not free the struct that is up to the winsys. - */ -void -intel_be_destroy_context(struct intel_be_context *intel); - #endif diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.c b/src/gallium/winsys/drm/intel/gem/intel_be_device.c index 82c1cb2f32..a2163a1e6d 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_device.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.c @@ -11,15 +11,7 @@ #include "i915simple/i915_screen.h" - -/** - * Turn a pipe winsys into an intel/pipe winsys: - */ -static INLINE struct intel_be_device * -intel_be_device(struct pipe_winsys *winsys) -{ - return (struct intel_be_device *)winsys; -} +#include "intel_be_api.h" /* * Buffer @@ -233,10 +225,21 @@ intel_be_fence_finish(struct pipe_winsys *sws, * Misc functions */ +static void +intel_be_destroy_winsys(struct pipe_winsys *winsys) +{ + struct intel_be_device *dev = intel_be_device(winsys); + + drm_intel_bufmgr_destroy(dev->pools.gem); + + free(dev); +} + boolean intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id) { dev->fd = fd; + dev->id = id; dev->max_batch_size = 16 * 4096; dev->max_vertex_size = 128 * 4096; @@ -253,13 +256,28 @@ intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id) dev->base.fence_signalled = intel_be_fence_signalled; dev->base.fence_finish = intel_be_fence_finish; + dev->base.destroy = intel_be_destroy_winsys; + dev->pools.gem = drm_intel_bufmgr_gem_init(dev->fd, dev->max_batch_size); return true; } -void -intel_be_destroy_device(struct intel_be_device *dev) +struct pipe_screen * +intel_be_create_screen(int drmFD, int deviceID) { - drm_intel_bufmgr_destroy(dev->pools.gem); + struct intel_be_device *dev; + struct pipe_screen *screen; + + /* Allocate the private area */ + dev = malloc(sizeof(*dev)); + if (!dev) + return NULL; + memset(dev, 0, sizeof(*dev)); + + intel_be_init_device(dev, drmFD, deviceID); + + screen = i915_create_screen(&dev->base, deviceID); + + return screen; } diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.h b/src/gallium/winsys/drm/intel/gem/intel_be_device.h index f06890163c..c4837e65fa 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_device.h +++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.h @@ -18,6 +18,8 @@ struct intel_be_device int fd; /**< Drm file discriptor */ + unsigned id; + size_t max_batch_size; size_t max_vertex_size; @@ -26,12 +28,15 @@ struct intel_be_device } pools; }; +static INLINE struct intel_be_device * +intel_be_device(struct pipe_winsys *winsys) +{ + return (struct intel_be_device *)winsys; +} + boolean intel_be_init_device(struct intel_be_device *device, int fd, unsigned id); -void -intel_be_destroy_device(struct intel_be_device *dev); - /* * Buffer */ -- cgit v1.2.3 From 25ac2801d758b299dcbc6d4fb3fd62370cdb8d0a Mon Sep 17 00:00:00 2001 From: Benjamin Close Date: Fri, 13 Feb 2009 10:07:26 +1030 Subject: galium: Makefile fixes: -Werror=implicit-function-declaration -> -Werror-implicit-function-declaration Found-By: Tinderbox --- src/gallium/state_trackers/egl/Makefile | 2 +- src/gallium/state_trackers/g3dvl/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile index c9124b1c90..d2ea8d3857 100644 --- a/src/gallium/state_trackers/egl/Makefile +++ b/src/gallium/state_trackers/egl/Makefile @@ -6,7 +6,7 @@ TOP = ../../../.. include ${TOP}/configs/current -CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \ +CFLAGS += -g -Wall -Werror-implicit-function-declaration -fPIC \ -I${GALLIUMDIR}/include \ -I${GALLIUMDIR}/auxiliary \ -I${TOP}/src/mesa/drivers/dri/common \ diff --git a/src/gallium/state_trackers/g3dvl/Makefile b/src/gallium/state_trackers/g3dvl/Makefile index cddfca54fe..f9f4d6be3c 100644 --- a/src/gallium/state_trackers/g3dvl/Makefile +++ b/src/gallium/state_trackers/g3dvl/Makefile @@ -3,7 +3,7 @@ OBJECTS = vl_display.o vl_screen.o vl_context.o vl_surface.o vl_shader_build.o vl_r16snorm_mc_buf.o GALLIUMDIR = ../.. -CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \ +CFLAGS += -g -Wall -Werror-implicit-function-declaration -fPIC \ -I${GALLIUMDIR}/include \ -I${GALLIUMDIR}/auxiliary \ -I${GALLIUMDIR}/winsys/g3dvl \ -- cgit v1.2.3 From e46dca58b21ad87956b97a08d27bc212e714aa43 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 13 Feb 2009 01:17:11 +0100 Subject: intel: Only build winsys with built state trackers --- src/gallium/winsys/drm/intel/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/intel/Makefile b/src/gallium/winsys/drm/intel/Makefile index eede9fc866..78773b8d1b 100644 --- a/src/gallium/winsys/drm/intel/Makefile +++ b/src/gallium/winsys/drm/intel/Makefile @@ -2,7 +2,9 @@ TOP = ../../../../.. include $(TOP)/configs/current -SUBDIRS = gem egl +# Always build gem and then build winsys with +# enabled state trackers +SUBDIRS = gem $(GALLIUM_STATE_TRACKERS_DIRS) default: subdirs -- cgit v1.2.3 From 08e324fff3b295bfd5b176ed1242ad838c6d5f25 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 12 Feb 2009 16:52:15 -0800 Subject: r300-gallium: Fix typo in texture buffer size request. --- src/gallium/drivers/r300/r300_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index ff812c09f8..bd35e089f9 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -72,7 +72,7 @@ static struct pipe_texture* r300_setup_miptree(tex); - tex->buffer = screen->buffer_create(screen, 63, + tex->buffer = screen->buffer_create(screen, 64, PIPE_BUFFER_USAGE_PIXEL, tex->size); -- cgit v1.2.3 From affe0311fa60489e56b854c09f713fae024a0b00 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 12 Feb 2009 16:53:06 -0800 Subject: r300-gallium: Add r500 passthrough shader assembly. This allows a simple passthrough fragment shader to be provided on r500. --- src/gallium/drivers/r300/r300_context.h | 16 ++++++++++++ src/gallium/drivers/r300/r300_cs_inlines.h | 5 ++++ src/gallium/drivers/r300/r300_emit.c | 33 +++++++++++++++++++++++++ src/gallium/drivers/r300/r300_reg.h | 1 + src/gallium/drivers/r300/r300_state.c | 5 ++++ src/gallium/drivers/r300/r300_state_shader.c | 37 ++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_state_shader.h | 1 + 7 files changed, 98 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 376c57639d..a29201eaba 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -107,6 +107,12 @@ struct r3xx_fragment_shader { /* Has this shader been translated yet? */ boolean translated; + + /* Number of used instructions */ + int instruction_count; + + /* Pixel stack size */ + int stack_size; }; struct r300_fragment_shader { @@ -117,6 +123,16 @@ struct r300_fragment_shader { struct r500_fragment_shader { /* Parent class */ struct r3xx_fragment_shader shader; + + /* Machine instructions */ + struct { + uint32_t inst0; + uint32_t inst1; + uint32_t inst2; + uint32_t inst3; + uint32_t inst4; + uint32_t inst5; + } instructions[256]; /*< XXX magic number */ }; struct r300_texture { diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index 71e6623699..b7c04fde1a 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -26,6 +26,11 @@ #ifdef R300_CS_H +#define RADEON_ONE_REG_WR (1 << 15) + +#define CS_OUT_ONE_REG(register, count) \ + OUT_CS_REG_SEQ(register, (count | RADEON_ONE_REG_WR)) + #define R300_PACIFY do { \ OUT_CS_REG(R300_SC_SCREENDOOR, 0x0); \ OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 585a9e729d..4d1b10de23 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -79,6 +79,39 @@ void r300_emit_dsa_state(struct r300_context* r300, END_CS; } +void r300_emit_fragment_shader(struct r300_context* r300, + struct r300_fragment_shader* shader) +{ + CS_LOCALS(r300); +} + +void r500_emit_fragment_shader(struct r300_context* r300, + struct r500_fragment_shader* shader) +{ + CS_LOCALS(r300); + int i = 0; + + BEGIN_CS(8 + (shader->shader.instruction_count * 6) + 6); + OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); + OUT_CS_REG(R500_US_PIXSIZE, shader->shader.stack_size); + OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | + R500_US_CODE_END_ADDR(shader->shader.instruction_count)); + + OUT_CS_REG(R500_GA_US_VECTOR_INDEX, R500_GA_US_VECTOR_INDEX_TYPE_INSTR); + OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, + shader->shader.instruction_count * 6); + for (i = 0; i < shader->shader.instruction_count; i++) { + CS_OUT(shader->instructions[i].inst0); + CS_OUT(shader->instructions[i].inst1); + CS_OUT(shader->instructions[i].inst2); + CS_OUT(shader->instructions[i].inst3); + CS_OUT(shader->instructions[i].inst4); + CS_OUT(shader->instructions[i].inst5); + } + R300_PACIFY; + END_CS; +} + /* XXX add pitch, stride, z/stencil buf */ void r300_emit_fb_state(struct r300_context* r300, struct pipe_framebuffer_state* fb) diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index dbd0cc28e2..9e86423efb 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -2973,6 +2973,7 @@ enum { # define R500_INST_RGB_OMASK_R (1 << 15) # define R500_INST_RGB_OMASK_G (1 << 16) # define R500_INST_RGB_OMASK_B (1 << 17) +# define R500_INST_RGB_OMASK_RGB (7 << 15) # define R500_INST_ALPHA_OMASK (1 << 18) # define R500_INST_RGB_CLAMP (1 << 19) # define R500_INST_ALPHA_CLAMP (1 << 20) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 9392d72342..5fe2b8ea3e 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -432,6 +432,11 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) } } + if (!fs->translated) { + debug_printf("r300: Couldn't assemble fragment shader...\n"); + /* XXX exit here */ + } + r300->fs = fs; r300->dirty_state |= R300_NEW_FRAGMENT_SHADER; diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c index e87172128f..710b7ee0a6 100644 --- a/src/gallium/drivers/r300/r300_state_shader.c +++ b/src/gallium/drivers/r300/r300_state_shader.c @@ -22,12 +22,49 @@ #include "r300_state_shader.h" +void r300_make_passthrough_fragment_shader(struct r300_fragment_shader* fs) +{ +} + +void r500_make_passthrough_fragment_shader(struct r500_fragment_shader* fs) +{ + fs->shader.instruction_count = 1; + fs->shader.stack_size = 0; + + fs->instructions[0].inst0 = R500_INST_TYPE_OUT | + R500_INST_TEX_SEM_WAIT | + R500_INST_LAST | + R500_INST_RGB_OMASK_RGB | R500_INST_ALPHA_OMASK | + R500_INST_RGB_CLAMP | R500_INST_ALPHA_CLAMP; + fs->instructions[0].inst1 = + R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST | + R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST; + fs->instructions[0].inst2 = + R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | R500_ALPHA_ADDR1_CONST | + R500_ALPHA_ADDR2(0) | R500_ALPHA_ADDR2_CONST; + fs->instructions[0].inst3 = + 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; + fs->instructions[0].inst4 = + R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A; + fs->instructions[0].inst5 = + 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; + + fs->shader.translated = true; +} + void r300_translate_shader(struct r300_context* r300, struct r300_fragment_shader* fs) { + r300_make_passthrough_fragment_shader(fs); } void r500_translate_shader(struct r300_context* r300, struct r500_fragment_shader* fs) { + r500_make_passthrough_fragment_shader(fs); } diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h index a20bd4276c..030ecaa56e 100644 --- a/src/gallium/drivers/r300/r300_state_shader.h +++ b/src/gallium/drivers/r300/r300_state_shader.h @@ -24,6 +24,7 @@ #define R300_STATE_SHADER_H #include "r300_context.h" +#include "r300_reg.h" #include "r300_screen.h" void r300_translate_shader(struct r300_context* r300, -- cgit v1.2.3 From f2a36d334c6fbe3787d44c6203f54ccb184fb923 Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Fri, 13 Feb 2009 02:34:34 +0100 Subject: r300: minor fixes and clear up some surface_fill Signed-off-by: Corbin Simpson --- src/gallium/drivers/r300/r300_chipset.c | 4 +- src/gallium/drivers/r300/r300_cs_inlines.h | 2 - src/gallium/drivers/r300/r300_surface.c | 565 +++++++++++++++-------------- 3 files changed, 291 insertions(+), 280 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c index 7def62422a..794fa2b9b8 100644 --- a/src/gallium/drivers/r300/r300_chipset.c +++ b/src/gallium/drivers/r300/r300_chipset.c @@ -343,6 +343,6 @@ void r300_parse_chipset(struct r300_capabilities* caps) break; } - /* Force off TCL for now */ - caps->has_tcl = FALSE; + /* XXX SW TCL is broken so no forcing it off right now + caps->has_tcl = FALSE; */ } diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index b7c04fde1a..2ca907dd90 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -32,10 +32,8 @@ OUT_CS_REG_SEQ(register, (count | RADEON_ONE_REG_WR)) #define R300_PACIFY do { \ - OUT_CS_REG(R300_SC_SCREENDOOR, 0x0); \ OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | \ (1 << 18) | (1 << 31)); \ - OUT_CS_REG(R300_SC_SCREENDOOR, 0xffffff); \ } while (0) diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 1e1f96a7f9..4bd8a25460 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -1,5 +1,6 @@ /* * Copyright 2008 Corbin Simpson + * Joakim Sindholt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -53,295 +54,307 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } -BEGIN_CS((caps->is_r500) ? 309 : 280); -R300_PACIFY; -OUT_CS_REG(R300_TX_INVALTAGS, 0x0); -R300_PACIFY; -/* Flush PVS. */ -OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); - -OUT_CS_REG(R300_SE_VTE_CNTL, 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 | R300_VTX_W0_FMT); -/* Vertex size. */ -OUT_CS_REG(R300_VAP_VTX_SIZE, 0x8); -/* Max and min vertex index clamp. */ -OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, 0xFFFFFF); -OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0x0); -/* XXX endian */ -OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP); -OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0); -/* XXX magic number not in r300_reg */ -OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); -OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0); -OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4); -OUT_CS_32F(1.0); -OUT_CS_32F(1.0); -OUT_CS_32F(1.0); -OUT_CS_32F(1.0); -/* XXX is this too long? */ -OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xFFFF); -OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE | - R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE); -/* XXX more magic numbers */ -OUT_CS_REG(R300_GB_MSPOS0, 0x66666666); -OUT_CS_REG(R300_GB_MSPOS1, 0x66666666); -/* XXX why doesn't classic Mesa write the number of pipes, too? */ -OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | R300_GB_TILE_SIZE_16); -OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W); -OUT_CS_REG(R300_GB_AA_CONFIG, 0x0); -/* XXX point tex stuffing */ -OUT_CS_REG_SEQ(R300_GA_POINT_S0, 1); -OUT_CS_32F(0.0); -OUT_CS_REG_SEQ(R300_GA_POINT_S1, 1); -OUT_CS_32F(1.0); -OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 | - (0x5 << R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT)); -/* XXX should this be related to the actual point size? */ -OUT_CS_REG(R300_GA_POINT_MINMAX, 0x6 | - (0x1800 << R300_GA_POINT_MINMAX_MAX_SHIFT)); -/* XXX this big chunk should be refactored into rs_state */ -OUT_CS_REG(R300_GA_LINE_CNTL, 0x00030006); -OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, 0x3BAAAAAB); -OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, 0x00000000); -OUT_CS_REG(R300_GA_LINE_S0, 0x00000000); -OUT_CS_REG(R300_GA_LINE_S1, 0x3F800000); -OUT_CS_REG(R300_GA_ENHANCE, 0x00000002); -OUT_CS_REG(R300_GA_COLOR_CONTROL, 0x0003AAAA); -OUT_CS_REG(R300_GA_SOLID_RG, 0x00000000); -OUT_CS_REG(R300_GA_SOLID_BA, 0x00000000); -OUT_CS_REG(R300_GA_POLY_MODE, 0x00000000); -OUT_CS_REG(R300_GA_ROUND_MODE, 0x00000001); -OUT_CS_REG(R300_GA_OFFSET, 0x00000000); -OUT_CS_REG(R300_GA_FOG_SCALE, 0x3DBF1412); -OUT_CS_REG(R300_GA_FOG_OFFSET, 0x00000000); -OUT_CS_REG(R300_SU_TEX_WRAP, 0x00000000); -OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, 0x00000000); -OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, 0x00000000); -OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_SCALE, 0x00000000); -OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_OFFSET, 0x00000000); -OUT_CS_REG(R300_SU_POLY_OFFSET_ENABLE, 0x00000000); -OUT_CS_REG(R300_SU_CULL_MODE, 0x00000000); -OUT_CS_REG(R300_SU_DEPTH_SCALE, 0x4B7FFFFF); -OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000); -OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C); -OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525); -OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); -OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000002); -OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x00000000); -OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000); -OUT_CS_REG(R300_FG_FOG_COLOR_B, 0x00000000); -OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000); -OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000); -OUT_CS_REG(R300_RB3D_CCTL, 0x00000000); -OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); - -/* XXX: Oh the wonderful unknown */ -OUT_CS_REG_SEQ(0x4E54, 8); -for (i = 0; i < 8; i++) - OUT_CS(0x00000000); -OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000); -OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000); -OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFFFFFFFF); -OUT_CS_REG(R300_ZB_FORMAT, 0x00000002); -OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, 0x00000003); -OUT_CS_REG(R300_ZB_BW_CNTL, 0x00000000); -OUT_CS_REG(R300_ZB_DEPTHCLEARVALUE, 0x00000000); -OUT_CS_REG(0x4F30, 0x00000000); -OUT_CS_REG(0x4F34, 0x00000000); -OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); -OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); -R300_PACIFY; -if (caps->has_tcl) { - OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, - (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)); -} else { - OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, - (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)); -} -OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000000); -OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688); -OUT_CS_REG(R300_VAP_VTX_STATE_CNTL, 0x1); -OUT_CS_REG(R300_VAP_VSM_VTX_ASSM, 0x405); -OUT_CS_REG(R300_SE_VTE_CNTL, 0x0000043F); -OUT_CS_REG(R300_VAP_VTX_SIZE, 0x00000008); -OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); -OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_0, 0x00000003); -OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_1, 0x00000000); -OUT_CS_REG(R300_TX_ENABLE, 0x0); -/* XXX viewport setup */ -OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); -OUT_CS_32F(1.0); -OUT_CS_32F((float)x); -OUT_CS_32F(1.0); -OUT_CS_32F((float)y); -OUT_CS_32F(1.0); -OUT_CS_32F(0.0); - -if (caps->has_tcl) { - OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE | - R300_PS_UCP_MODE_CLIP_AS_TRIFAN); -} + BEGIN_CS((caps->is_r500 ? 222 : 213) + (caps->has_tcl ? 34 : 4)); + R300_PACIFY; + OUT_CS_REG(R300_TX_INVALTAGS, 0x0); + R300_PACIFY; + /* Flush PVS. */ + OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); -OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | - ((w * 6) << R300_POINTSIZE_X_SHIFT)); + OUT_CS_REG(R300_SE_VTE_CNTL, 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 | R300_VTX_W0_FMT); + /* Vertex size. */ + OUT_CS_REG(R300_VAP_VTX_SIZE, 0x8); + /* Max and min vertex index clamp. */ + OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, 0xFFFFFF); + OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0x0); + /* XXX endian */ + OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP); + OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0); + /* XXX magic number not in r300_reg */ + OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); + OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0); + OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4); + OUT_CS_32F(1.0); + OUT_CS_32F(1.0); + OUT_CS_32F(1.0); + OUT_CS_32F(1.0); + /* XXX is this too long? */ + OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xFFFF); + OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE | + R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE); + /* XXX more magic numbers */ + OUT_CS_REG(R300_GB_MSPOS0, 0x66666666); + OUT_CS_REG(R300_GB_MSPOS1, 0x66666666); + /* XXX why doesn't classic Mesa write the number of pipes, too? */ + OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | + R300_GB_TILE_SIZE_16); + OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W); + OUT_CS_REG(R300_GB_AA_CONFIG, 0x0); + /* XXX point tex stuffing */ + OUT_CS_REG_SEQ(R300_GA_POINT_S0, 1); + OUT_CS_32F(0.0); + OUT_CS_REG_SEQ(R300_GA_POINT_S1, 1); + OUT_CS_32F(1.0); + OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 | + (0x5 << R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT)); + /* XXX should this be related to the actual point size? */ + OUT_CS_REG(R300_GA_POINT_MINMAX, 0x6 | + (0x1800 << R300_GA_POINT_MINMAX_MAX_SHIFT)); + /* XXX this big chunk should be refactored into rs_state */ + OUT_CS_REG(R300_GA_LINE_CNTL, 0x00030006); + OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, 0x3BAAAAAB); + OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, 0x00000000); + OUT_CS_REG(R300_GA_LINE_S0, 0x00000000); + OUT_CS_REG(R300_GA_LINE_S1, 0x3F800000); + OUT_CS_REG(R300_GA_ENHANCE, 0x00000002); + OUT_CS_REG(R300_GA_COLOR_CONTROL, 0x0003AAAA); + OUT_CS_REG(R300_GA_SOLID_RG, 0x00000000); + OUT_CS_REG(R300_GA_SOLID_BA, 0x00000000); + OUT_CS_REG(R300_GA_POLY_MODE, 0x00000000); + OUT_CS_REG(R300_GA_ROUND_MODE, 0x00000001); + OUT_CS_REG(R300_GA_OFFSET, 0x00000000); + OUT_CS_REG(R300_GA_FOG_SCALE, 0x3DBF1412); + OUT_CS_REG(R300_GA_FOG_OFFSET, 0x00000000); + OUT_CS_REG(R300_SU_TEX_WRAP, 0x00000000); + OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, 0x00000000); + OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, 0x00000000); + OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_SCALE, 0x00000000); + OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_OFFSET, 0x00000000); + OUT_CS_REG(R300_SU_POLY_OFFSET_ENABLE, 0x00000000); + OUT_CS_REG(R300_SU_CULL_MODE, 0x00000000); + OUT_CS_REG(R300_SU_DEPTH_SCALE, 0x4B7FFFFF); + OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000); + OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C); + OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525); + OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); + OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000002); + OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x00000000); + OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000); + OUT_CS_REG(R300_FG_FOG_COLOR_B, 0x00000000); + OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000); + OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000); + OUT_CS_REG(R300_RB3D_CCTL, 0x00000000); + OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); -/* XXX RS block and fp setup */ -if (caps->is_r500) { - OUT_CS_REG_SEQ(R500_RS_IP_0, 8); + /* XXX: Oh the wonderful unknown. + * Not writing these 8 regs seems to make no difference at all and seeing + * as how they're not documented, we should leave them out for now. + OUT_CS_REG_SEQ(0x4E54, 8); for (i = 0; i < 8; i++) { - /* I like the operator macros more than the shift macros... */ - OUT_CS((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_CS(0x00000000); + } */ + OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000); + OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000); + OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFFFFFFFF); + OUT_CS_REG(R300_ZB_FORMAT, 0x00000002); + OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, 0x00000003); + OUT_CS_REG(R300_ZB_BW_CNTL, 0x00000000); + OUT_CS_REG(R300_ZB_DEPTHCLEARVALUE, 0x00000000); + OUT_CS_REG(0x4F30, 0x00000000); + OUT_CS_REG(0x4F34, 0x00000000); + OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); + OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); + R300_PACIFY; + if (caps->has_tcl) { + OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, + (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)); + } else { + OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, + (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)); } - /* XXX */ - OUT_CS_REG_SEQ(R300_RS_COUNT, 2); - OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_CS(0x0); - OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); + OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000000); + OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688); + OUT_CS_REG(R300_VAP_VTX_STATE_CNTL, 0x1); + OUT_CS_REG(R300_VAP_VSM_VTX_ASSM, 0x405); + OUT_CS_REG(R300_SE_VTE_CNTL, 0x0000043F); + OUT_CS_REG(R300_VAP_VTX_SIZE, 0x00000008); + OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); + OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_0, 0x00000003); + OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_1, 0x00000000); + OUT_CS_REG(R300_TX_ENABLE, 0x0); + /* XXX viewport setup */ + OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); + OUT_CS_32F(1.0); + OUT_CS_32F((float)x); + OUT_CS_32F(1.0); + OUT_CS_32F((float)y); + OUT_CS_32F(1.0); + OUT_CS_32F(0.0); - OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); - OUT_CS_REG(R500_US_PIXSIZE, 0x00000000); - OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | - R500_US_CODE_END_ADDR(1)); - OUT_CS_REG(R500_US_CODE_RANGE, R500_US_CODE_RANGE_ADDR(0) | - R500_US_CODE_RANGE_SIZE(1)); - OUT_CS_REG(R500_US_CODE_OFFSET, R500_US_CODE_OFFSET_ADDR(0)); - R300_PACIFY; - OUT_CS_REG(R500_GA_US_VECTOR_INDEX, - 0 | R500_GA_US_VECTOR_INDEX_TYPE_INSTR); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - 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); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST | - R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | R500_ALPHA_ADDR1_CONST | - R500_ALPHA_ADDR2(0) | R500_ALPHA_ADDR2_CONST); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - 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); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - 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); -} else { - OUT_CS_REG_SEQ(R300_RS_IP_0, 8); - for (i = 0; i < 8; i++) { - OUT_CS(R300_RS_SEL_T(R300_RS_SEL_K0) | - R300_RS_SEL_R(R300_RS_SEL_K0) | R300_RS_SEL_Q(R300_RS_SEL_K1)); + if (caps->has_tcl) { + OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE | + R300_PS_UCP_MODE_CLIP_AS_TRIFAN); } - /* XXX */ - OUT_CS_REG_SEQ(R300_RS_COUNT, 2); - OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_CS(1); - OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); - /* XXX magic numbers */ - OUT_CS_REG(R300_US_CONFIG, 0); - OUT_CS_REG(R300_US_PIXSIZE, 2); - OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000); - OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x50A80); - OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); - OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x40889); - OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x1000000); - OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); - OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); -} -/* XXX these magic numbers should be explained when - * this becomes a cached state object */ -if (caps->has_tcl) { - OUT_CS_REG(R300_VAP_CNTL, 0xA | - (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (0xB << R300_VF_MAX_VTX_NUM_SHIFT) | - (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); - OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000); - OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000); - OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001); + OUT_CS_REG(R300_GA_POINT_SIZE, + ((h * 6) & R300_POINTSIZE_Y_MASK) | + ((w * 6) << R300_POINTSIZE_X_SHIFT)); + + /* XXX RS block and fp setup */ + if (caps->is_r500) { + /* XXX We seem to be in disagreement about how many of these we have + * RS:RS_IP_[0-15] [R/W] 32 bits Access: 8/16/32 MMReg:0x4074-0x40b0 + * Now that's from the docs. I don't care what the mesa driver says */ + OUT_CS_REG_SEQ(R500_RS_IP_0, 16); + for (i = 0; i < 16; i++) { + OUT_CS((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_CS_REG_SEQ(R300_RS_COUNT, 2); + OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); + OUT_CS(0x00000000); + OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); + + OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); + OUT_CS_REG(R500_US_PIXSIZE, 0x00000000); + OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | + R500_US_CODE_END_ADDR(1)); + OUT_CS_REG(R500_US_CODE_RANGE, R500_US_CODE_RANGE_ADDR(0) | + R500_US_CODE_RANGE_SIZE(1)); + OUT_CS_REG(R500_US_CODE_OFFSET, R500_US_CODE_OFFSET_ADDR(0)); + R300_PACIFY; + OUT_CS_REG(R500_GA_US_VECTOR_INDEX, + 0 | R500_GA_US_VECTOR_INDEX_TYPE_INSTR); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + 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); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST | + R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | + R500_ALPHA_ADDR1_CONST | R500_ALPHA_ADDR2(0) | + R500_ALPHA_ADDR2_CONST); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + 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); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, + 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); + } else { + OUT_CS_REG_SEQ(R300_RS_IP_0, 8); + for (i = 0; i < 8; i++) { + OUT_CS(R300_RS_SEL_T(R300_RS_SEL_K0) | + R300_RS_SEL_R(R300_RS_SEL_K0) | R300_RS_SEL_Q(R300_RS_SEL_K1)); + } + OUT_CS_REG_SEQ(R300_RS_COUNT, 2); + OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); + /* XXX Shouldn't this be 0? */ + OUT_CS(1); + OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); + + /* XXX magic numbers */ + OUT_CS_REG(R300_US_CONFIG, 0); + OUT_CS_REG(R300_US_PIXSIZE, 2); + OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000); + OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x50A80); + OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); + OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x40889); + OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x1000000); + OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); + OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); + } + /* XXX these magic numbers should be explained when + * this becomes a cached state object */ + if (caps->has_tcl) { + OUT_CS_REG(R300_VAP_CNTL, 0xA | + (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | + (0xB << R300_VF_MAX_VTX_NUM_SHIFT) | + (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); + OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000); + OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000); + OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001); + R300_PACIFY; + /* XXX translate these back into normal instructions */ + OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); + OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF00203); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10001); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248001); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF02203); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); + OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); + } else { + OUT_CS_REG(R300_VAP_CNTL, 0xA | + (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | + (0x5 << R300_VF_MAX_VTX_NUM_SHIFT) | + (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); + } R300_PACIFY; - /* XXX translate these back into normal instructions */ - OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); - OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF00203); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10001); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248001); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF02203); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); -} else { - OUT_CS_REG(R300_VAP_CNTL, 0xA | - (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (0x5 << R300_VF_MAX_VTX_NUM_SHIFT) | - (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); -} -R300_PACIFY; -END_CS; + END_CS; -r300_emit_blend_state(r300, &blend_clear_state); -r300_emit_blend_color_state(r300, &blend_color_clear_state); -r300_emit_dsa_state(r300, &dsa_clear_state); + r300_emit_blend_state(r300, &blend_clear_state); + r300_emit_blend_color_state(r300, &blend_color_clear_state); + r300_emit_dsa_state(r300, &dsa_clear_state); -BEGIN_CS(36); -R300_PACIFY; -/* Flush colorbuffer and blend caches. */ -OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, - R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D | - R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_SIGNAL); -OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, - R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | - R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); + BEGIN_CS(32); + R300_PACIFY; + /* Flush colorbuffer and blend caches. */ + OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, + R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D | + R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_SIGNAL); + OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, + R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | + R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); -OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); -OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); -/* XXX this should not be so rigid and it still doesn't work right */ -OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) | R300_COLOR_FORMAT_ARGB8888); -OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); -/* XXX Packet3 */ -OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); -OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | -(1 << R300_PRIM_NUM_VERTICES_SHIFT)); -OUT_CS_32F(w / 2.0); -OUT_CS_32F(h / 2.0); -/* XXX this should be the depth value to clear to */ -OUT_CS_32F(1.0); -OUT_CS_32F(1.0); -OUT_CS_32F(r); -OUT_CS_32F(g); -OUT_CS_32F(b); -OUT_CS_32F(1.0); + OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1); + OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); + /* XXX (dest->stride >> 2) should be the buffer width in pixels however, + * this little calculation is only good as long as the buffer is 32bpp */ + OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) | + R300_COLOR_FORMAT_ARGB8888); + OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F); + /* XXX Packet3 */ + OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); + OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | + (1 << R300_PRIM_NUM_VERTICES_SHIFT)); + OUT_CS_32F(w / 2.0); + OUT_CS_32F(h / 2.0); + /* XXX this should be the depth value to clear to */ + OUT_CS_32F(1.0); + OUT_CS_32F(1.0); + OUT_CS_32F(r); + OUT_CS_32F(g); + OUT_CS_32F(b); + OUT_CS_32F(1.0); -/* XXX figure out why this is 0xA and not 0x2 */ -OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA); -/* XXX OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, - R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | - R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */ -R300_PACIFY; + /* XXX figure out why this is 0xA and not 0x2 */ + OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA); + /* XXX OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, + R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | + R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */ + OUT_CS_REG(R300_SC_SCREENDOOR, 0x00000000); + R300_PACIFY; + OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); -END_CS; -FLUSH_CS; + END_CS; + FLUSH_CS; r300->dirty_state = R300_NEW_KITCHEN_SINK; } -- cgit v1.2.3 From 637b24a5904ab78cbd3fc61ea5fe39c52be711ce Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 12 Feb 2009 20:01:09 -0800 Subject: r300-gallium: Add r300 passthrough shader. --- src/gallium/drivers/r300/r300_context.h | 29 +++++++++++-- src/gallium/drivers/r300/r300_cs_inlines.h | 2 +- src/gallium/drivers/r300/r300_emit.c | 63 +++++++++++++++++++++------- src/gallium/drivers/r300/r300_state_shader.c | 12 +++++- 4 files changed, 87 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index a29201eaba..54879f88f5 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -108,9 +108,6 @@ struct r3xx_fragment_shader { /* Has this shader been translated yet? */ boolean translated; - /* Number of used instructions */ - int instruction_count; - /* Pixel stack size */ int stack_size; }; @@ -118,12 +115,38 @@ struct r3xx_fragment_shader { struct r300_fragment_shader { /* Parent class */ struct r3xx_fragment_shader shader; + + /* Number of ALU instructions */ + int alu_instruction_count; + + /* Number of texture instructions */ + int tex_instruction_count; + + /* Number of texture indirections */ + int indirections; + + /* Indirection node offsets */ + int offset0; + int offset1; + int offset2; + int offset3; + + /* Machine instructions */ + struct { + uint32_t alu_rgb_inst; + uint32_t alu_rgb_addr; + uint32_t alu_alpha_inst; + uint32_t alu_alpha_addr; + } instructions[64]; /* XXX magic num */ }; struct r500_fragment_shader { /* Parent class */ struct r3xx_fragment_shader shader; + /* Number of used instructions */ + int instruction_count; + /* Machine instructions */ struct { uint32_t inst0; diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index 2ca907dd90..a3ea4f900b 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -28,7 +28,7 @@ #define RADEON_ONE_REG_WR (1 << 15) -#define CS_OUT_ONE_REG(register, count) \ +#define OUT_CS_ONE_REG(register, count) \ OUT_CS_REG_SEQ(register, (count | RADEON_ONE_REG_WR)) #define R300_PACIFY do { \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 4d1b10de23..634a72991c 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -80,33 +80,58 @@ void r300_emit_dsa_state(struct r300_context* r300, } void r300_emit_fragment_shader(struct r300_context* r300, - struct r300_fragment_shader* shader) + struct r300_fragment_shader* fs) { CS_LOCALS(r300); + int i; + BEGIN_CS(0); + + OUT_CS_REG(R300_US_CONFIG, MAX(fs->indirections - 1, 0)); + OUT_CS_REG(R300_US_PIXSIZE, fs->shader.stack_size); + /* XXX figure out exactly how big the sizes are on this reg */ + OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); + /* XXX figure these ones out a bit better kthnx */ + OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_3, R300_RGBA_OUT); + + for (i = 0; i < fs->alu_instruction_count; i++) { + OUT_CS_REG(R300_US_ALU_RGB_INST_0 + (4 * i), + fs->instructions[i].alu_rgb_inst); + OUT_CS_REG(R300_US_ALU_RGB_ADDR_0 + (4 * i), + fs->instructions[i].alu_rgb_addr); + OUT_CS_REG(R300_US_ALU_ALPHA_INST_0 + (4 * i), + fs->instructions[i].alu_alpha_inst); + OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0 + (4 * i), + fs->instructions[i].alu_alpha_addr); + } + + END_CS; } void r500_emit_fragment_shader(struct r300_context* r300, - struct r500_fragment_shader* shader) + struct r500_fragment_shader* fs) { CS_LOCALS(r300); - int i = 0; + int i; - BEGIN_CS(8 + (shader->shader.instruction_count * 6) + 6); + BEGIN_CS(8 + (fs->instruction_count * 6) + 6); OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); - OUT_CS_REG(R500_US_PIXSIZE, shader->shader.stack_size); + OUT_CS_REG(R500_US_PIXSIZE, fs->shader.stack_size); OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | - R500_US_CODE_END_ADDR(shader->shader.instruction_count)); + R500_US_CODE_END_ADDR(fs->instruction_count)); OUT_CS_REG(R500_GA_US_VECTOR_INDEX, R500_GA_US_VECTOR_INDEX_TYPE_INSTR); OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, - shader->shader.instruction_count * 6); - for (i = 0; i < shader->shader.instruction_count; i++) { - CS_OUT(shader->instructions[i].inst0); - CS_OUT(shader->instructions[i].inst1); - CS_OUT(shader->instructions[i].inst2); - CS_OUT(shader->instructions[i].inst3); - CS_OUT(shader->instructions[i].inst4); - CS_OUT(shader->instructions[i].inst5); + fs->instruction_count * 6); + for (i = 0; i < fs->instruction_count; i++) { + OUT_CS(fs->instructions[i].inst0); + OUT_CS(fs->instructions[i].inst1); + OUT_CS(fs->instructions[i].inst2); + OUT_CS(fs->instructions[i].inst3); + OUT_CS(fs->instructions[i].inst4); + OUT_CS(fs->instructions[i].inst5); } R300_PACIFY; END_CS; @@ -173,6 +198,16 @@ static void r300_emit_dirty_state(struct r300_context* r300) r300_emit_dsa_state(r300, r300->dsa_state); } + if (r300->dirty_state & R300_NEW_FRAGMENT_SHADER) { + if (r300screen->caps->is_r500) { + r500_emit_fragment_shader(r300, + (struct r500_fragment_shader*)r300->fs); + } else { + r300_emit_fragment_shader(r300, + (struct r300_fragment_shader*)r300->fs); + } + } + if (r300->dirty_state & R300_NEW_RASTERIZER) { r300_emit_rs_state(r300, r300->rs_state); } diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c index 710b7ee0a6..824dbeb0aa 100644 --- a/src/gallium/drivers/r300/r300_state_shader.c +++ b/src/gallium/drivers/r300/r300_state_shader.c @@ -24,11 +24,21 @@ void r300_make_passthrough_fragment_shader(struct r300_fragment_shader* fs) { + fs->alu_instruction_count = 1; + fs->tex_instruction_count = 0; + fs->indirections = 1; + fs->shader.stack_size = 2; + + /* XXX decode these */ + fs->instructions[0].alu_rgb_inst = 0x50A80; + fs->instructions[0].alu_rgb_inst = 0x1C000000; + fs->instructions[0].alu_alpha_inst = 0x40889; + fs->instructions[0].alu_alpha_inst = 0x1000000; } void r500_make_passthrough_fragment_shader(struct r500_fragment_shader* fs) { - fs->shader.instruction_count = 1; + fs->instruction_count = 1; fs->shader.stack_size = 0; fs->instructions[0].inst0 = R500_INST_TYPE_OUT | -- cgit v1.2.3 From 0d60a3f33cbc071fb5aca95b96f35908059b0435 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 12 Feb 2009 20:20:41 -0800 Subject: r300-gallium: r300 passthrough shader, static shader objects, and clear code. --- src/gallium/drivers/r300/r300_emit.c | 31 ++++++++----- src/gallium/drivers/r300/r300_state_shader.c | 51 ++-------------------- src/gallium/drivers/r300/r300_state_shader.h | 53 +++++++++++++++++++++++ src/gallium/drivers/r300/r300_surface.c | 65 +++++----------------------- src/gallium/drivers/r300/r300_surface.h | 1 + 5 files changed, 89 insertions(+), 112 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 634a72991c..8391663f7f 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -115,23 +115,32 @@ void r500_emit_fragment_shader(struct r300_context* r300, { CS_LOCALS(r300); int i; - - BEGIN_CS(8 + (fs->instruction_count * 6) + 6); + /* XXX Problem: OUT_CS_ONE_REG causes card crash */ + /* BEGIN_CS(8 + (shader->shader.instruction_count * 6) + 6); */ + BEGIN_CS(10 + (shader->shader.instruction_count * 12)); OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); OUT_CS_REG(R500_US_PIXSIZE, fs->shader.stack_size); OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(fs->instruction_count)); OUT_CS_REG(R500_GA_US_VECTOR_INDEX, R500_GA_US_VECTOR_INDEX_TYPE_INSTR); - OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, - fs->instruction_count * 6); - for (i = 0; i < fs->instruction_count; i++) { - OUT_CS(fs->instructions[i].inst0); - OUT_CS(fs->instructions[i].inst1); - OUT_CS(fs->instructions[i].inst2); - OUT_CS(fs->instructions[i].inst3); - OUT_CS(fs->instructions[i].inst4); - OUT_CS(fs->instructions[i].inst5); + /* OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, + shader->shader.instruction_count * 6); + for (i = 0; i < shader->shader.instruction_count; i++) { + OUT_CS(shader->instructions[i].inst0); + OUT_CS(shader->instructions[i].inst1); + OUT_CS(shader->instructions[i].inst2); + OUT_CS(shader->instructions[i].inst3); + OUT_CS(shader->instructions[i].inst4); + OUT_CS(shader->instructions[i].inst5); + } */ + for (i = 0; i < shader->shader.instruction_count; i++) { + OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst0); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst1); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst2); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst3); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst4); + OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst5); } R300_PACIFY; END_CS; diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c index 824dbeb0aa..352cb62df7 100644 --- a/src/gallium/drivers/r300/r300_state_shader.c +++ b/src/gallium/drivers/r300/r300_state_shader.c @@ -22,59 +22,16 @@ #include "r300_state_shader.h" -void r300_make_passthrough_fragment_shader(struct r300_fragment_shader* fs) -{ - fs->alu_instruction_count = 1; - fs->tex_instruction_count = 0; - fs->indirections = 1; - fs->shader.stack_size = 2; - - /* XXX decode these */ - fs->instructions[0].alu_rgb_inst = 0x50A80; - fs->instructions[0].alu_rgb_inst = 0x1C000000; - fs->instructions[0].alu_alpha_inst = 0x40889; - fs->instructions[0].alu_alpha_inst = 0x1000000; -} - -void r500_make_passthrough_fragment_shader(struct r500_fragment_shader* fs) -{ - fs->instruction_count = 1; - fs->shader.stack_size = 0; - - fs->instructions[0].inst0 = R500_INST_TYPE_OUT | - R500_INST_TEX_SEM_WAIT | - R500_INST_LAST | - R500_INST_RGB_OMASK_RGB | R500_INST_ALPHA_OMASK | - R500_INST_RGB_CLAMP | R500_INST_ALPHA_CLAMP; - fs->instructions[0].inst1 = - R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST | - R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST; - fs->instructions[0].inst2 = - R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | R500_ALPHA_ADDR1_CONST | - R500_ALPHA_ADDR2(0) | R500_ALPHA_ADDR2_CONST; - fs->instructions[0].inst3 = - 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; - fs->instructions[0].inst4 = - R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A; - fs->instructions[0].inst5 = - 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; - - fs->shader.translated = true; -} - void r300_translate_shader(struct r300_context* r300, struct r300_fragment_shader* fs) { - r300_make_passthrough_fragment_shader(fs); + /* XXX fix this at some point */ + *fs = r300_passthrough_fragment_shader; } void r500_translate_shader(struct r300_context* r300, struct r500_fragment_shader* fs) { - r500_make_passthrough_fragment_shader(fs); + /* XXX fix this at some point */ + *fs = r500_passthrough_fragment_shader; } diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h index 030ecaa56e..8e9ed5d59e 100644 --- a/src/gallium/drivers/r300/r300_state_shader.h +++ b/src/gallium/drivers/r300/r300_state_shader.h @@ -33,4 +33,57 @@ void r300_translate_shader(struct r300_context* r300, void r500_translate_shader(struct r300_context* r300, struct r500_fragment_shader* fs); +static const struct r300_fragment_shader r300_passthrough_fragment_shader = { + /* XXX This is the emission code. TODO: decode + OUT_CS_REG(R300_US_CONFIG, 0); + OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0); + OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000); + OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); + OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); */ + .alu_instruction_count = 1; + .tex_instruction_count = 0; + .indirections = 1; + .shader.stack_size = 2; + + /* XXX decode these */ + .instructions[0].alu_rgb_inst = 0x50A80; + .instructions[0].alu_rgb_inst = 0x1C000000; + .instructions[0].alu_alpha_inst = 0x40889; + .instructions[0].alu_alpha_inst = 0x1000000; +}; + +static const struct r500_fragment_shader r500_passthrough_fragment_shader = { + .shader.stack_size = 0, + .instruction_count = 1, + .instructions[0].inst0 = R500_INST_TYPE_OUT | + R500_INST_TEX_SEM_WAIT | R500_INST_LAST | + R500_INST_RGB_OMASK_RGB | R500_INST_ALPHA_OMASK | + R500_INST_RGB_CLAMP | R500_INST_ALPHA_CLAMP, + .instructions[0].inst1 = + R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST | + R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST, + .instructions[0].inst2 = + R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | R500_ALPHA_ADDR1_CONST | + R500_ALPHA_ADDR2(0) | R500_ALPHA_ADDR2_CONST, + .instructions[0].inst3 = + 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, + .instructions[0].inst4 = + R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A, + .instructions[0].inst5 = + 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, + .shader.translated = TRUE, +}; + #endif /* R300_STATE_SHADER_H */ diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 4bd8a25460..54ab778ce7 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -54,7 +54,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } - BEGIN_CS((caps->is_r500 ? 222 : 213) + (caps->has_tcl ? 34 : 4)); + BEGIN_CS(172 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; @@ -197,7 +197,7 @@ static void r300_surface_fill(struct pipe_context* pipe, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); - /* XXX RS block and fp setup */ + /* RS block setup */ if (caps->is_r500) { /* XXX We seem to be in disagreement about how many of these we have * RS:RS_IP_[0-15] [R/W] 32 bits Access: 8/16/32 MMReg:0x4074-0x40b0 @@ -213,40 +213,6 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); OUT_CS(0x00000000); OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); - - OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); - OUT_CS_REG(R500_US_PIXSIZE, 0x00000000); - OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | - R500_US_CODE_END_ADDR(1)); - OUT_CS_REG(R500_US_CODE_RANGE, R500_US_CODE_RANGE_ADDR(0) | - R500_US_CODE_RANGE_SIZE(1)); - OUT_CS_REG(R500_US_CODE_OFFSET, R500_US_CODE_OFFSET_ADDR(0)); - R300_PACIFY; - OUT_CS_REG(R500_GA_US_VECTOR_INDEX, - 0 | R500_GA_US_VECTOR_INDEX_TYPE_INSTR); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - 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); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST | - R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | - R500_ALPHA_ADDR1_CONST | R500_ALPHA_ADDR2(0) | - R500_ALPHA_ADDR2_CONST); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - 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); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, - 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); } else { OUT_CS_REG_SEQ(R300_RS_IP_0, 8); for (i = 0; i < 8; i++) { @@ -258,26 +224,17 @@ static void r300_surface_fill(struct pipe_context* pipe, /* XXX Shouldn't this be 0? */ OUT_CS(1); OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); + } + END_CS; - /* XXX magic numbers */ - OUT_CS_REG(R300_US_CONFIG, 0); - OUT_CS_REG(R300_US_PIXSIZE, 2); - OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0); - OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000); - OUT_CS_REG(R300_US_ALU_RGB_INST_0, 0x50A80); - OUT_CS_REG(R300_US_ALU_RGB_ADDR_0, 0x1C000000); - OUT_CS_REG(R300_US_ALU_ALPHA_INST_0, 0x40889); - OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0, 0x1000000); - OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); - OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); + /* Fragment shader setup */ + if (caps->is_r500) { + r500_emit_fragment_shader(r300, &r500_passthrough_fragment_shader); + } else { + r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader); } + + BEGIN_CS(2 + (caps->has_tcl ? 30 : 2)); /* XXX these magic numbers should be explained when * this becomes a cached state object */ if (caps->has_tcl) { diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h index e1d53116a1..17d6c62fe8 100644 --- a/src/gallium/drivers/r300/r300_surface.h +++ b/src/gallium/drivers/r300/r300_surface.h @@ -31,6 +31,7 @@ #include "r300_context.h" #include "r300_cs.h" #include "r300_emit.h" +#include "r300_state_shader.h" const struct r300_blend_state blend_clear_state = { .blend_control = 0x0, -- cgit v1.2.3 From 92661bcbad13c8750f63e3a30b6c616d2f1094d3 Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Fri, 13 Feb 2009 05:08:54 +0100 Subject: r300-gallium: fix OUT_CS_ONE_REG and use where applicable Signed-off-by: Corbin Simpson --- src/gallium/drivers/r300/r300_cs_inlines.h | 8 ++++++-- src/gallium/drivers/r300/r300_emit.c | 16 +++------------- src/gallium/drivers/r300/r300_surface.c | 26 ++++++++++++++------------ 3 files changed, 23 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index a3ea4f900b..98f9ee0451 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -28,8 +28,12 @@ #define RADEON_ONE_REG_WR (1 << 15) -#define OUT_CS_ONE_REG(register, count) \ - OUT_CS_REG_SEQ(register, (count | RADEON_ONE_REG_WR)) +#define OUT_CS_ONE_REG(register, count) do { \ + debug_printf("r300: writing data sequence of %d to 0x%04X\n", \ + count, register); \ + assert(register); \ + OUT_CS(CP_PACKET0(register, ((count) - 1)) | RADEON_ONE_REG_WR); \ +} while (0) #define R300_PACIFY do { \ OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 8391663f7f..a4d520a674 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -114,17 +114,15 @@ void r500_emit_fragment_shader(struct r300_context* r300, struct r500_fragment_shader* fs) { CS_LOCALS(r300); - int i; - /* XXX Problem: OUT_CS_ONE_REG causes card crash */ - /* BEGIN_CS(8 + (shader->shader.instruction_count * 6) + 6); */ - BEGIN_CS(10 + (shader->shader.instruction_count * 12)); + int i = 0; + BEGIN_CS(11 + (shader->shader.instruction_count * 6)); OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); OUT_CS_REG(R500_US_PIXSIZE, fs->shader.stack_size); OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(fs->instruction_count)); OUT_CS_REG(R500_GA_US_VECTOR_INDEX, R500_GA_US_VECTOR_INDEX_TYPE_INSTR); - /* OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, + OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, shader->shader.instruction_count * 6); for (i = 0; i < shader->shader.instruction_count; i++) { OUT_CS(shader->instructions[i].inst0); @@ -133,14 +131,6 @@ void r500_emit_fragment_shader(struct r300_context* r300, OUT_CS(shader->instructions[i].inst3); OUT_CS(shader->instructions[i].inst4); OUT_CS(shader->instructions[i].inst5); - } */ - for (i = 0; i < shader->shader.instruction_count; i++) { - OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst0); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst1); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst2); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst3); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst4); - OUT_CS_REG(R500_GA_US_VECTOR_DATA, shader->instructions[i].inst5); } R300_PACIFY; END_CS; diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 54ab778ce7..2c6af363f2 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -54,7 +54,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } - BEGIN_CS(172 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); + BEGIN_CS(168 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); R300_PACIFY; OUT_CS_REG(R300_TX_INVALTAGS, 0x0); R300_PACIFY; @@ -153,8 +153,9 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, 0x00000003); OUT_CS_REG(R300_ZB_BW_CNTL, 0x00000000); OUT_CS_REG(R300_ZB_DEPTHCLEARVALUE, 0x00000000); + /* XXX Moar unknown that should probably be left out. OUT_CS_REG(0x4F30, 0x00000000); - OUT_CS_REG(0x4F34, 0x00000000); + OUT_CS_REG(0x4F34, 0x00000000); */ OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); R300_PACIFY; @@ -233,8 +234,8 @@ static void r300_surface_fill(struct pipe_context* pipe, } else { r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader); } - - BEGIN_CS(2 + (caps->has_tcl ? 30 : 2)); + + BEGIN_CS(2 + (caps->has_tcl ? 23 : 2)); /* XXX these magic numbers should be explained when * this becomes a cached state object */ if (caps->has_tcl) { @@ -249,14 +250,15 @@ static void r300_surface_fill(struct pipe_context* pipe, /* XXX translate these back into normal instructions */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF00203); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10001); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248001); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xF02203); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0xD10021); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x1248021); - OUT_CS_REG(R300_VAP_PVS_UPLOAD_DATA, 0x0); + OUT_CS_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, 8); + OUT_CS(0x00F00203); + OUT_CS(0x00D10001); + OUT_CS(0x01248001); + OUT_CS(0x00000000); + OUT_CS(0x00F02203); + OUT_CS(0x00D10021); + OUT_CS(0x01248021); + OUT_CS(0x00000000); } else { OUT_CS_REG(R300_VAP_CNTL, 0xA | (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) | -- cgit v1.2.3 From 1d2c31df41d2a52b306fd65bbb6c800e993a2798 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 12 Feb 2009 20:35:17 -0800 Subject: r300-gallium: Fix build errors. --- src/gallium/drivers/r300/r300_emit.c | 18 +++++++++--------- src/gallium/drivers/r300/r300_state_shader.h | 16 ++++++++-------- src/gallium/drivers/r300/r300_surface.c | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index a4d520a674..a3b2772e15 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -115,7 +115,7 @@ void r500_emit_fragment_shader(struct r300_context* r300, { CS_LOCALS(r300); int i = 0; - BEGIN_CS(11 + (shader->shader.instruction_count * 6)); + BEGIN_CS(11 + (fs->instruction_count * 6)); OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); OUT_CS_REG(R500_US_PIXSIZE, fs->shader.stack_size); OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | @@ -123,14 +123,14 @@ void r500_emit_fragment_shader(struct r300_context* r300, OUT_CS_REG(R500_GA_US_VECTOR_INDEX, R500_GA_US_VECTOR_INDEX_TYPE_INSTR); OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA, - shader->shader.instruction_count * 6); - for (i = 0; i < shader->shader.instruction_count; i++) { - OUT_CS(shader->instructions[i].inst0); - OUT_CS(shader->instructions[i].inst1); - OUT_CS(shader->instructions[i].inst2); - OUT_CS(shader->instructions[i].inst3); - OUT_CS(shader->instructions[i].inst4); - OUT_CS(shader->instructions[i].inst5); + fs->instruction_count * 6); + for (i = 0; i < fs->instruction_count; i++) { + OUT_CS(fs->instructions[i].inst0); + OUT_CS(fs->instructions[i].inst1); + OUT_CS(fs->instructions[i].inst2); + OUT_CS(fs->instructions[i].inst3); + OUT_CS(fs->instructions[i].inst4); + OUT_CS(fs->instructions[i].inst5); } R300_PACIFY; END_CS; diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h index 8e9ed5d59e..a5f03b967b 100644 --- a/src/gallium/drivers/r300/r300_state_shader.h +++ b/src/gallium/drivers/r300/r300_state_shader.h @@ -47,16 +47,16 @@ static const struct r300_fragment_shader r300_passthrough_fragment_shader = { OUT_CS(R300_US_OUT_FMT_UNUSED); OUT_CS(R300_US_OUT_FMT_UNUSED); OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); */ - .alu_instruction_count = 1; - .tex_instruction_count = 0; - .indirections = 1; - .shader.stack_size = 2; + .alu_instruction_count = 1, + .tex_instruction_count = 0, + .indirections = 1, + .shader.stack_size = 2, /* XXX decode these */ - .instructions[0].alu_rgb_inst = 0x50A80; - .instructions[0].alu_rgb_inst = 0x1C000000; - .instructions[0].alu_alpha_inst = 0x40889; - .instructions[0].alu_alpha_inst = 0x1000000; + .instructions[0].alu_rgb_inst = 0x50A80, + .instructions[0].alu_rgb_inst = 0x1C000000, + .instructions[0].alu_alpha_inst = 0x40889, + .instructions[0].alu_alpha_inst = 0x1000000, }; static const struct r500_fragment_shader r500_passthrough_fragment_shader = { diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 2c6af363f2..7a4114554b 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -234,7 +234,7 @@ static void r300_surface_fill(struct pipe_context* pipe, } else { r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader); } - + BEGIN_CS(2 + (caps->has_tcl ? 23 : 2)); /* XXX these magic numbers should be explained when * this becomes a cached state object */ -- cgit v1.2.3 From fe7863f3f82cda290334cecfde816e21a0e9f5d3 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 12 Feb 2009 20:47:15 -0800 Subject: r300-gallium: Fix linker error a few linker warnings. A few prototypes, a missing header, a misspelled macro. --- src/gallium/drivers/r300/r300_emit.c | 2 +- src/gallium/drivers/r300/r300_emit.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index a3b2772e15..c0990cabd9 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -86,7 +86,7 @@ void r300_emit_fragment_shader(struct r300_context* r300, int i; BEGIN_CS(0); - OUT_CS_REG(R300_US_CONFIG, MAX(fs->indirections - 1, 0)); + OUT_CS_REG(R300_US_CONFIG, MAX2(fs->indirections - 1, 0)); OUT_CS_REG(R300_US_PIXSIZE, fs->shader.stack_size); /* XXX figure out exactly how big the sizes are on this reg */ OUT_CS_REG(R300_US_CODE_OFFSET, 0x0); diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index b6e69386f9..4c5a6d292e 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -20,6 +20,8 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "util/u_math.h" + #include "r300_context.h" #include "r300_cs.h" #include "r300_screen.h" @@ -33,4 +35,13 @@ void r300_emit_blend_color_state(struct r300_context* r300, void r300_emit_dsa_state(struct r300_context* r300, struct r300_dsa_state* dsa); +void r300_emit_fragment_shader(struct r300_context* r300, + struct r300_fragment_shader* fs); + +void r500_emit_fragment_shader(struct r300_context* r300, + struct r500_fragment_shader* fs); + +void r300_emit_fb_state(struct r300_context* r300, + struct pipe_framebuffer_state* fb); + void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs); -- cgit v1.2.3 From 8a2d0005af34cfaf88b2d70168fdfb2c91e79045 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 12 Feb 2009 23:36:21 -0800 Subject: r300-gallium: Take care of various bad dereferences in shader setup. Unbreaks glxinfo. --- src/gallium/drivers/r300/r300_state.c | 11 +++++------ src/gallium/drivers/r300/r300_state_shader.c | 24 ++++++++++++++++++++---- src/gallium/drivers/r300/r300_state_shader.h | 1 - 3 files changed, 25 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 5fe2b8ea3e..2c0906aad8 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -424,7 +424,10 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) struct r300_context* r300 = r300_context(pipe); struct r3xx_fragment_shader* fs = (struct r3xx_fragment_shader*)shader; - if (!fs->translated) { + if (fs == NULL) { + r300->fs = NULL; + return; + } else if (!fs->translated) { if (r300_screen(r300->context.screen)->caps->is_r500) { r500_translate_shader(r300, fs); } else { @@ -432,11 +435,7 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) } } - if (!fs->translated) { - debug_printf("r300: Couldn't assemble fragment shader...\n"); - /* XXX exit here */ - } - + fs->translated = true; r300->fs = fs; r300->dirty_state |= R300_NEW_FRAGMENT_SHADER; diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c index 352cb62df7..cb606c409a 100644 --- a/src/gallium/drivers/r300/r300_state_shader.c +++ b/src/gallium/drivers/r300/r300_state_shader.c @@ -22,16 +22,32 @@ #include "r300_state_shader.h" +static void r300_copy_passthrough_shader(struct r300_fragment_shader* fs) +{ + struct r300_fragment_shader* pt = &r300_passthrough_fragment_shader; + fs->shader.stack_size = pt->shader.stack_size; + fs->alu_instruction_count = pt->alu_instruction_count; + fs->tex_instruction_count = pt->tex_instruction_count; + fs->indirections = pt->indirections; + fs->instructions[0] = pt->instructions[0]; +} + +static void r500_copy_passthrough_shader(struct r500_fragment_shader* fs) +{ + struct r500_fragment_shader* pt = &r500_passthrough_fragment_shader; + fs->shader.stack_size = pt->shader.stack_size; + fs->instruction_count = pt->instruction_count; + fs->instructions[0] = pt->instructions[0]; +} + void r300_translate_shader(struct r300_context* r300, struct r300_fragment_shader* fs) { - /* XXX fix this at some point */ - *fs = r300_passthrough_fragment_shader; + r300_copy_passthrough_shader(fs); } void r500_translate_shader(struct r300_context* r300, struct r500_fragment_shader* fs) { - /* XXX fix this at some point */ - *fs = r500_passthrough_fragment_shader; + r500_copy_passthrough_shader(fs); } diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h index a5f03b967b..108f5ec085 100644 --- a/src/gallium/drivers/r300/r300_state_shader.h +++ b/src/gallium/drivers/r300/r300_state_shader.h @@ -83,7 +83,6 @@ static const struct r500_fragment_shader r500_passthrough_fragment_shader = { 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, - .shader.translated = TRUE, }; #endif /* R300_STATE_SHADER_H */ -- cgit v1.2.3 From afe24b94b3dee11ccda238ed82ed58ae46fb918b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 12 Feb 2009 03:59:07 +0100 Subject: egl: Doesn't depend on xorg or pixman --- src/gallium/state_trackers/egl/Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile index d2ea8d3857..ea4cec0bb8 100644 --- a/src/gallium/state_trackers/egl/Makefile +++ b/src/gallium/state_trackers/egl/Makefile @@ -13,7 +13,6 @@ CFLAGS += -g -Wall -Werror-implicit-function-declaration -fPIC \ -I${TOP}/src/mesa \ -I$(TOP)/include \ -I$(TOP)/src/egl/main \ - $(shell pkg-config --cflags pixman-1 xorg-server) \ ${LIBDRM_CFLAGS} ############################################# -- cgit v1.2.3 From 6559107c7ae67ae6a94f53728cad85137aaf6312 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Feb 2009 07:44:02 -0700 Subject: mesa: add additional texture size/limit assertions --- src/mesa/main/context.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 19ff5e552c..9705fd8a98 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -864,6 +864,9 @@ _mesa_init_constants(GLcontext *ctx) assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS); assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS); + /* Max texture size should be <= max viewport size (render to texture) */ + assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH); + /* Constants, may be overriden (usually only reduced) by device drivers */ ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS; ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS; @@ -960,13 +963,18 @@ check_context_limits(GLcontext *ctx) /* number of coord units cannot be greater than number of image units */ assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits); - assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH); - assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH); + assert(ctx->Const.MaxTextureLevels <= MAX_TEXTURE_LEVELS); + assert(ctx->Const.Max3DTextureLevels <= MAX_3D_TEXTURE_LEVELS); + assert(ctx->Const.MaxCubeTextureLevels <= MAX_CUBE_TEXTURE_LEVELS); + assert(ctx->Const.MaxTextureRectSize <= MAX_TEXTURE_RECT_SIZE); /* make sure largest texture image is <= MAX_WIDTH in size */ - assert((1 << (ctx->Const.MaxTextureLevels -1 )) <= MAX_WIDTH); - assert((1 << (ctx->Const.MaxCubeTextureLevels -1 )) <= MAX_WIDTH); - assert((1 << (ctx->Const.Max3DTextureLevels -1 )) <= MAX_WIDTH); + assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH); + assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= MAX_WIDTH); + assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH); + + assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH); + assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH); assert(ctx->Const.MaxDrawBuffers <= MAX_DRAW_BUFFERS); -- cgit v1.2.3 From ac53b1b0345f10f988c412af528bfd38052acab5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Feb 2009 08:11:01 -0700 Subject: mesa: check if TNL state is null in _tnl_free_vertices() to avoid potential segfault _tnl_free_vertices() is called from several places during context tear-down. Depending on the order in which the swrast, swrast_setup and tnl context is destroyed we could hit a null pointer here. This doesn't seem to be an actual issue with any Mesa drivers, but let's be safe. --- src/mesa/tnl/t_vertex.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index 10b78f820e..fe4209ae57 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -535,27 +535,30 @@ void _tnl_init_vertices( GLcontext *ctx, void _tnl_free_vertices( GLcontext *ctx ) { - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct tnl_clipspace_fastpath *fp, *tmp; + TNLcontext *tnl = TNL_CONTEXT(ctx); + if (tnl) { + struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); + struct tnl_clipspace_fastpath *fp, *tmp; - if (vtx->vertex_buf) { - ALIGN_FREE(vtx->vertex_buf); - vtx->vertex_buf = NULL; - } - - for (fp = vtx->fastpath ; fp ; fp = tmp) { - tmp = fp->next; - FREE(fp->attr); - - /* KW: At the moment, fp->func is constrained to be allocated by - * _mesa_exec_alloc(), as the hardwired fastpaths in - * t_vertex_generic.c are handled specially. It would be nice - * to unify them, but this probably won't change until this - * module gets another overhaul. - */ - _mesa_exec_free((void *) fp->func); - FREE(fp); + if (vtx->vertex_buf) { + ALIGN_FREE(vtx->vertex_buf); + vtx->vertex_buf = NULL; + } + + for (fp = vtx->fastpath ; fp ; fp = tmp) { + tmp = fp->next; + FREE(fp->attr); + + /* KW: At the moment, fp->func is constrained to be allocated by + * _mesa_exec_alloc(), as the hardwired fastpaths in + * t_vertex_generic.c are handled specially. It would be nice + * to unify them, but this probably won't change until this + * module gets another overhaul. + */ + _mesa_exec_free((void *) fp->func); + FREE(fp); + } + + vtx->fastpath = NULL; } - - vtx->fastpath = NULL; } -- cgit v1.2.3 From c273dfe6a28d4bb64ce167685b4053d22db5a727 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Fri, 13 Feb 2009 07:31:24 -0800 Subject: Add dummy install target for glew to fix 'make install' Signed-off-by: Dan Nicholson --- src/glew/Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/glew/Makefile b/src/glew/Makefile index 49ee8b6594..8e6ccb4f7c 100644 --- a/src/glew/Makefile +++ b/src/glew/Makefile @@ -37,6 +37,9 @@ $(TOP)/$(LIB_DIR)/$(GLEW_LIB_NAME): depend $(OBJECTS) $(MKLIB) -o $(GLEW_LIB) -static -install $(TOP)/$(LIB_DIR) $(OBJECTS) +install: + + clean: -rm -f *.o *~ -rm -f depend depend.bak -- cgit v1.2.3 From 073a73e4c7344db46ab89862e2fbc267da34969c Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 13 Feb 2009 08:14:42 -0800 Subject: r300-gallium: Various thingies. Add formats to framebuffer emit, fix up shader function names, make sure fragment format is emitted for r500. --- src/gallium/drivers/r300/r300_emit.c | 18 ++++++++++++ src/gallium/drivers/r300/r300_reg.h | 43 +--------------------------- src/gallium/drivers/r300/r300_state.c | 5 ++-- src/gallium/drivers/r300/r300_state_shader.c | 4 +-- src/gallium/drivers/r300/r300_state_shader.h | 11 ++----- src/gallium/drivers/r300/r300_surface.c | 8 +++++- 6 files changed, 34 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index c0990cabd9..8108b99f94 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -136,6 +136,21 @@ void r500_emit_fragment_shader(struct r300_context* r300, END_CS; } +/* Translate pipe_format into US_OUT_FMT. Note that formats are stored from + * C3 to C0. */ +uint32_t translate_out_fmt(enum pipe_format format) +{ + switch (format) { + case PIPE_FORMAT_A8R8G8B8_UNORM: + return R300_US_OUT_FMT_C4_8 | + R300_C0_SEL_B | R300_C1_SEL_G | + R300_C2_SEL_R | R300_C3_SEL_A; + default: + return R300_US_OUT_FMT_UNUSED; + } + return 0; +} + /* XXX add pitch, stride, z/stencil buf */ void r300_emit_fb_state(struct r300_context* r300, struct pipe_framebuffer_state* fb) @@ -149,6 +164,9 @@ void r300_emit_fb_state(struct r300_context* r300, tex = (struct r300_texture*)fb->cbufs[i]->texture; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); + + OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), + translate_out_fmt(fb->cbufs[i]->format)); } R300_PACIFY; END_CS; diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index 9e86423efb..468e0a2e44 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -1709,6 +1709,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_C3_SEL_G (2 << 14) # define R300_C3_SEL_B (3 << 14) # define R300_OUT_SIGN(x) (x << 16) +# define R500_ROUND_ADJ (1 << 20) /* ALU * The ALU instructions register blocks are enumerated according to the order @@ -3048,48 +3049,6 @@ enum { # define R500_FORMAT_TXWIDTH(x) (x << 0) # define R500_FORMAT_TXHEIGHT(x) (x << 11) # define R500_FORMAT_TXDEPTH(x) (x << 22) -/* _0 through _3 */ -#define R500_US_OUT_FMT_0 0x46A4 -# define R500_OUT_FMT_C4_8 (0 << 0) -# define R500_OUT_FMT_C4_10 (1 << 0) -# define R500_OUT_FMT_C4_10_GAMMA (2 << 0) -# define R500_OUT_FMT_C_16 (3 << 0) -# define R500_OUT_FMT_C2_16 (4 << 0) -# define R500_OUT_FMT_C4_16 (5 << 0) -# define R500_OUT_FMT_C_16_MPEG (6 << 0) -# define R500_OUT_FMT_C2_16_MPEG (7 << 0) -# define R500_OUT_FMT_C2_4 (8 << 0) -# define R500_OUT_FMT_C_3_3_2 (9 << 0) -# define R500_OUT_FMT_C_6_5_6 (10 << 0) -# define R500_OUT_FMT_C_11_11_10 (11 << 0) -# define R500_OUT_FMT_C_10_11_11 (12 << 0) -# define R500_OUT_FMT_C_2_10_10_10 (13 << 0) -/* #define R500_OUT_FMT_RESERVED (14 << 0) */ -# define R500_OUT_FMT_UNUSED (15 << 0) -# define R500_OUT_FMT_C_16_FP (16 << 0) -# define R500_OUT_FMT_C2_16_FP (17 << 0) -# define R500_OUT_FMT_C4_16_FP (18 << 0) -# define R500_OUT_FMT_C_32_FP (19 << 0) -# define R500_OUT_FMT_C2_32_FP (20 << 0) -# define R500_OUT_FMT_C4_32_FP (21 << 0) -# define R500_C0_SEL_A (0 << 8) -# define R500_C0_SEL_R (1 << 8) -# define R500_C0_SEL_G (2 << 8) -# define R500_C0_SEL_B (3 << 8) -# define R500_C1_SEL_A (0 << 10) -# define R500_C1_SEL_R (1 << 10) -# define R500_C1_SEL_G (2 << 10) -# define R500_C1_SEL_B (3 << 10) -# define R500_C2_SEL_A (0 << 12) -# define R500_C2_SEL_R (1 << 12) -# define R500_C2_SEL_G (2 << 12) -# define R500_C2_SEL_B (3 << 12) -# define R500_C3_SEL_A (0 << 14) -# define R500_C3_SEL_R (1 << 14) -# define R500_C3_SEL_G (2 << 14) -# define R500_C3_SEL_B (3 << 14) -# define R500_OUT_SIGN(x) (x << 16) -# define R500_ROUND_ADJ (1 << 20) #define R500_US_PIXSIZE 0x4604 # define R500_PIX_SIZE(x) (x) #define R500_US_TEX_ADDR_0 0x9800 diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 2c0906aad8..d02679c7c5 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -26,6 +26,7 @@ #include "r300_context.h" #include "r300_reg.h" +#include "r300_state_shader.h" /* r300_state: Functions used to intialize state context by translating * Gallium state objects into semi-native r300 state objects. @@ -429,9 +430,9 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) return; } else if (!fs->translated) { if (r300_screen(r300->context.screen)->caps->is_r500) { - r500_translate_shader(r300, fs); + r500_translate_fragment_shader(r300, (struct r500_fragment_shader*)fs); } else { - r300_translate_shader(r300, fs); + r300_translate_fragment_shader(r300, (struct r300_fragment_shader*)fs); } } diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c index cb606c409a..d10ac55580 100644 --- a/src/gallium/drivers/r300/r300_state_shader.c +++ b/src/gallium/drivers/r300/r300_state_shader.c @@ -40,13 +40,13 @@ static void r500_copy_passthrough_shader(struct r500_fragment_shader* fs) fs->instructions[0] = pt->instructions[0]; } -void r300_translate_shader(struct r300_context* r300, +void r300_translate_fragment_shader(struct r300_context* r300, struct r300_fragment_shader* fs) { r300_copy_passthrough_shader(fs); } -void r500_translate_shader(struct r300_context* r300, +void r500_translate_fragment_shader(struct r300_context* r300, struct r500_fragment_shader* fs) { r500_copy_passthrough_shader(fs); diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h index 108f5ec085..1d5d9ee943 100644 --- a/src/gallium/drivers/r300/r300_state_shader.h +++ b/src/gallium/drivers/r300/r300_state_shader.h @@ -27,10 +27,10 @@ #include "r300_reg.h" #include "r300_screen.h" -void r300_translate_shader(struct r300_context* r300, +void r300_translate_fragment_shader(struct r300_context* r300, struct r300_fragment_shader* fs); -void r500_translate_shader(struct r300_context* r300, +void r500_translate_fragment_shader(struct r300_context* r300, struct r500_fragment_shader* fs); static const struct r300_fragment_shader r300_passthrough_fragment_shader = { @@ -41,12 +41,7 @@ static const struct r300_fragment_shader r300_passthrough_fragment_shader = { OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0); OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0); OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000); - OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); - OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS(R300_US_OUT_FMT_UNUSED); - OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); */ +*/ .alu_instruction_count = 1, .tex_instruction_count = 0, .indirections = 1, diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 7a4114554b..07837cb823 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -235,7 +235,13 @@ static void r300_surface_fill(struct pipe_context* pipe, r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader); } - BEGIN_CS(2 + (caps->has_tcl ? 23 : 2)); + BEGIN_CS(10 + (caps->has_tcl ? 23 : 2)); + OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); + OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS(R300_US_OUT_FMT_UNUSED); + OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0); /* XXX these magic numbers should be explained when * this becomes a cached state object */ if (caps->has_tcl) { -- cgit v1.2.3 From 88b702e8c47c8930940c396132b2a191d4a3e7ca Mon Sep 17 00:00:00 2001 From: Robert Ellison Date: Fri, 13 Feb 2009 15:19:04 -0700 Subject: i965: Eric Anholt's patch for bumping up texture sizes I'm committing this because it fixes a conform failure; the failure occurs on the TextureProxy test, where the test attempts to create proxy textures at every level, but fails at the last level (border == 1, width == 1, height == 1) because it's beyond MAX_TEXTURE_LEVELS. Eric's original comment was: idr said that in his review swrast was ready for it, and the 965 driver is advertising it already though it has been resulting in many crashes due to arrays using these defines not being big enough. --- src/mesa/main/config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index c3feffda98..9d0cd18e05 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -101,16 +101,16 @@ #define MAX_COLOR_TABLE_SIZE 256 /** Number of 1D/2D texture mipmap levels */ -#define MAX_TEXTURE_LEVELS 12 +#define MAX_TEXTURE_LEVELS 13 /** Number of 3D texture mipmap levels */ #define MAX_3D_TEXTURE_LEVELS 9 /** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */ -#define MAX_CUBE_TEXTURE_LEVELS 12 +#define MAX_CUBE_TEXTURE_LEVELS 13 /** Maximum rectangular texture size - GL_NV_texture_rectangle */ -#define MAX_TEXTURE_RECT_SIZE 2048 +#define MAX_TEXTURE_RECT_SIZE 4096 /** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */ #define MAX_ARRAY_TEXTURE_LAYERS 64 @@ -166,7 +166,7 @@ #define MAX_TEXTURE_MAX_ANISOTROPY 16.0 /** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */ -#define MAX_TEXTURE_LOD_BIAS 11.0 +#define MAX_TEXTURE_LOD_BIAS 12.0 /** For GL_ARB_vertex_program */ /*@{*/ -- cgit v1.2.3 From 14dc4937336061c4c8d51c75d96fa216d9edcf2a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 14:47:56 -0700 Subject: i965: fix inconsistant indentation in brw_wm.c --- src/mesa/drivers/dri/i965/brw_wm.c | 76 +++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index ea708a0681..fb1e6839ba 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -90,51 +90,53 @@ static void do_wm_prog( struct brw_context *brw, c = brw->wm.compile_data; if (c == NULL) { - brw->wm.compile_data = calloc(1, sizeof(*brw->wm.compile_data)); - c = brw->wm.compile_data; + brw->wm.compile_data = calloc(1, sizeof(*brw->wm.compile_data)); + c = brw->wm.compile_data; } else { - memset(c, 0, sizeof(*brw->wm.compile_data)); + memset(c, 0, sizeof(*brw->wm.compile_data)); } memcpy(&c->key, key, sizeof(*key)); c->fp = fp; c->env_param = brw->intel.ctx.FragmentProgram.Parameters; - brw_init_compile(brw, &c->func); + brw_init_compile(brw, &c->func); + if (brw_wm_is_glsl(&c->fp->program)) { - brw_wm_glsl_emit(brw, c); - } else { - /* Augment fragment program. Add instructions for pre- and - * post-fragment-program tasks such as interpolation and fogging. - */ - brw_wm_pass_fp(c); - - /* Translate to intermediate representation. Build register usage - * chains. - */ - brw_wm_pass0(c); - - /* Dead code removal. - */ - brw_wm_pass1(c); - - /* Register allocation. - */ - c->grf_limit = BRW_WM_MAX_GRF/2; - - brw_wm_pass2(c); - - c->prog_data.total_grf = c->max_wm_grf; - if (c->last_scratch) { - c->prog_data.total_scratch = - c->last_scratch + 0x40; - } else { - c->prog_data.total_scratch = 0; - } - - /* Emit GEN4 code. - */ - brw_wm_emit(c); + brw_wm_glsl_emit(brw, c); + } + else { + /* Augment fragment program. Add instructions for pre- and + * post-fragment-program tasks such as interpolation and fogging. + */ + brw_wm_pass_fp(c); + + /* Translate to intermediate representation. Build register usage + * chains. + */ + brw_wm_pass0(c); + + /* Dead code removal. + */ + brw_wm_pass1(c); + + /* Register allocation. + */ + c->grf_limit = BRW_WM_MAX_GRF/2; + + brw_wm_pass2(c); + + c->prog_data.total_grf = c->max_wm_grf; + if (c->last_scratch) { + c->prog_data.total_scratch = + c->last_scratch + 0x40; + } else { + c->prog_data.total_scratch = 0; + } + + /* Emit GEN4 code. + */ + brw_wm_emit(c); } if (INTEL_DEBUG & DEBUG_WM) fprintf(stderr, "\n"); -- cgit v1.2.3 From 984c9636ed21f7d390b4b50c0b1d664506ede0e1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 14:53:30 -0700 Subject: i965: formatting and indentation fixes --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 8fd776ac39..dcf2f3d956 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -323,7 +323,7 @@ static void emit_pixel_xy(struct brw_wm_compile *c, } static void emit_delta_xy(struct brw_wm_compile *c, - struct prog_instruction *inst) + struct prog_instruction *inst) { struct brw_reg r1 = brw_vec1_grf(1, 0); struct brw_reg dst0, dst1, src0, src1; @@ -351,10 +351,8 @@ static void emit_delta_xy(struct brw_wm_compile *c, negate(suboffset(r1,1))); } - } - static void fire_fb_write( struct brw_wm_compile *c, GLuint base_reg, GLuint nr, @@ -410,18 +408,19 @@ static void emit_fb_write(struct brw_wm_compile *c, brw_pop_insn_state(p); } - if (c->key.source_depth_to_render_target) - { - if (c->key.computes_depth) { - src0 = get_src_reg(c, &inst->SrcReg[2], 2, 1); - brw_MOV(p, brw_message_reg(nr), src0); - } else { - src0 = get_src_reg(c, &inst->SrcReg[1], 1, 1); - brw_MOV(p, brw_message_reg(nr), src0); - } - - nr += 2; - } + if (c->key.source_depth_to_render_target) { + if (c->key.computes_depth) { + src0 = get_src_reg(c, &inst->SrcReg[2], 2, 1); + brw_MOV(p, brw_message_reg(nr), src0); + } + else { + src0 = get_src_reg(c, &inst->SrcReg[1], 1, 1); + brw_MOV(p, brw_message_reg(nr), src0); + } + + nr += 2; + } + target = inst->Sampler >> 1; eot = inst->Sampler & 1; fire_fb_write(c, 0, nr, target, eot); @@ -1675,8 +1674,8 @@ static void emit_noise3( struct brw_wm_compile *c, now causes. Instead, we loop twice around performing a similar operation to noise3, once for the w=0 cube and once for the w=1, with a bit more code to glue it all together. */ -static void noise4_sub( struct brw_wm_compile *c ) { - +static void noise4_sub( struct brw_wm_compile *c ) +{ struct brw_compile *p = &c->func; struct brw_reg param[ 4 ], x0y0, x0y1, x1y0, x1y1, /* gradients at four of the corners */ -- cgit v1.2.3 From 1a693e90b5594651a3b17f47c7f5f094088c502f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 14:54:13 -0700 Subject: i965: s/__inline/INLINE/ --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index dcf2f3d956..93e5481662 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1044,23 +1044,23 @@ static void emit_ddy(struct brw_wm_compile *c, brw_set_saturate(p, 0); } -static __inline struct brw_reg high_words( struct brw_reg reg ) +static INLINE struct brw_reg high_words( struct brw_reg reg ) { return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_W ), 1 ), 0, 8, 2 ); } -static __inline struct brw_reg low_words( struct brw_reg reg ) +static INLINE struct brw_reg low_words( struct brw_reg reg ) { return stride( retype( reg, BRW_REGISTER_TYPE_W ), 0, 8, 2 ); } -static __inline struct brw_reg even_bytes( struct brw_reg reg ) +static INLINE struct brw_reg even_bytes( struct brw_reg reg ) { return stride( retype( reg, BRW_REGISTER_TYPE_B ), 0, 16, 2 ); } -static __inline struct brw_reg odd_bytes( struct brw_reg reg ) +static INLINE struct brw_reg odd_bytes( struct brw_reg reg ) { return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_B ), 1 ), 0, 16, 2 ); -- cgit v1.2.3 From 11b75eafc7533c152e6306e4d8f85d7268f3cc16 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 14:58:19 -0700 Subject: i965: more reformatting/clean-up --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 93e5481662..66c80f1291 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -319,7 +319,6 @@ static void emit_pixel_xy(struct brw_wm_compile *c, stride(suboffset(r1_uw, 5), 2, 4, 0), brw_imm_v(0x11001100)); } - } static void emit_delta_xy(struct brw_wm_compile *c, @@ -395,18 +394,17 @@ static void emit_fb_write(struct brw_wm_compile *c, */ 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->SrcReg[0], channel, 1); - /* 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); + + brw_push_insn_state(p); + for (channel = 0; channel < 4; channel++) { + src0 = get_src_reg(c, &inst->SrcReg[0], channel, 1); + /* 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) { -- cgit v1.2.3 From 643d9401388be0c16ca0df8ea20dead6d31850de Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 15:04:21 -0700 Subject: intel: turn on GL_ARB_shading_language_120 It's done in the Mesa GLSL compiler. The only part of it that might matter in drivers is the centroid sampling option for MSAA. --- src/mesa/drivers/dri/intel/intel_extensions.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 28223ca141..9058e48bc5 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -129,11 +129,7 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_point_sprite", NULL }, { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, -#if 0 - /* Support for GLSL 1.20 is currently broken in core Mesa. - */ { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, -#endif { "GL_ARB_shadow", NULL }, { "GL_ARB_texture_non_power_of_two", NULL }, { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions }, -- cgit v1.2.3 From 7cffcaaba1a5960c0b890b2b4bc835c3020a5ab0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 15:35:02 -0700 Subject: i965: updated comments --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 54 ++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 66c80f1291..0d3e2eb770 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -8,12 +8,17 @@ enum _subroutine { SUB_NOISE1, SUB_NOISE2, SUB_NOISE3, SUB_NOISE4 }; -/* Only guess, need a flag in gl_fragment_program later */ + +/** + * Determine if the given fragment program uses GLSL features such + * as flow conditionals, loops, subroutines. + * Some GLSL shaders may use these features, others might not. + */ GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp) { int i; for (i = 0; i < fp->Base.NumInstructions; i++) { - struct prog_instruction *inst = &fp->Base.Instructions[i]; + const struct prog_instruction *inst = &fp->Base.Instructions[i]; switch (inst->Opcode) { case OPCODE_IF: case OPCODE_TRUNC: @@ -176,13 +181,15 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c, src->NegateBase, src->Abs); } -/* Subroutines are minimal support for resusable instruction sequences. - They are implemented as simply as possible to minimise overhead: there - is no explicit support for communication between the caller and callee - other than saving the return address in a temporary register, nor is - there any automatic local storage. This implies that great care is - required before attempting reentrancy or any kind of nested - subroutine invocations. */ +/** + * Subroutines are minimal support for resusable instruction sequences. + * They are implemented as simply as possible to minimise overhead: there + * is no explicit support for communication between the caller and callee + * other than saving the return address in a temporary register, nor is + * there any automatic local storage. This implies that great care is + * required before attempting reentrancy or any kind of nested + * subroutine invocations. + */ static void invoke_subroutine( struct brw_wm_compile *c, enum _subroutine subroutine, void (*emit)( struct brw_wm_compile * ) ) @@ -1363,9 +1370,11 @@ static void emit_noise2( struct brw_wm_compile *c, release_tmps( c, mark ); } -/* The three-dimensional case is much like the one- and two- versions above, - but since the number of corners is rapidly growing we now pack 16 16-bit - hashes into each register to extract more parallelism from the EUs. */ +/** + * The three-dimensional case is much like the one- and two- versions above, + * but since the number of corners is rapidly growing we now pack 16 16-bit + * hashes into each register to extract more parallelism from the EUs. + */ static void noise3_sub( struct brw_wm_compile *c ) { struct brw_compile *p = &c->func; @@ -1667,11 +1676,13 @@ static void emit_noise3( struct brw_wm_compile *c, release_tmps( c, mark ); } -/* For the four-dimensional case, the little micro-optimisation benefits - we obtain by unrolling all the loops aren't worth the massive bloat it - now causes. Instead, we loop twice around performing a similar operation - to noise3, once for the w=0 cube and once for the w=1, with a bit more - code to glue it all together. */ +/** + * For the four-dimensional case, the little micro-optimisation benefits + * we obtain by unrolling all the loops aren't worth the massive bloat it + * now causes. Instead, we loop twice around performing a similar operation + * to noise3, once for the w=0 cube and once for the w=1, with a bit more + * code to glue it all together. + */ static void noise4_sub( struct brw_wm_compile *c ) { struct brw_compile *p = &c->func; @@ -2511,10 +2522,19 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) c->fp->program.Base.Instructions[i].Data = NULL; } + +/** + * Do GPU code generation for shaders that use GLSL features such as + * flow control. Other shaders will be compiled with the + */ void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) { + /* initial instruction translation/simplification */ brw_wm_pass_fp(c); + + /* actual code generation */ brw_wm_emit_glsl(brw, c); + c->prog_data.total_grf = c->reg_index; c->prog_data.total_scratch = 0; } -- cgit v1.2.3 From 2f78d4a2cd009d8d6a5f470d5738586b7f89f3d9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 15:35:41 -0700 Subject: i965: code clean-ups, comments, and minor refactoring --- src/mesa/drivers/dri/i965/brw_wm.c | 86 +++++++++++++++++++++-------------- src/mesa/drivers/dri/i965/brw_wm_fp.c | 16 +++++-- 2 files changed, 65 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index fb1e6839ba..4501e0472f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -80,6 +80,53 @@ GLuint brw_wm_is_scalar_result( GLuint opcode ) } +/** + * Do GPU code generation for non-GLSL shader. non-GLSL shaders have + * no flow control instructions so we can more readily do SSA-style + * optimizations. + */ +static void +brw_wm_non_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) +{ + /* Augment fragment program. Add instructions for pre- and + * post-fragment-program tasks such as interpolation and fogging. + */ + brw_wm_pass_fp(c); + + /* Translate to intermediate representation. Build register usage + * chains. + */ + brw_wm_pass0(c); + + /* Dead code removal. + */ + brw_wm_pass1(c); + + /* Register allocation. + */ + c->grf_limit = BRW_WM_MAX_GRF / 2; + + brw_wm_pass2(c); + + c->prog_data.total_grf = c->max_wm_grf; + if (c->last_scratch) { + c->prog_data.total_scratch = c->last_scratch + 0x40; + } + else { + c->prog_data.total_scratch = 0; + } + + /* Emit GEN4 code. + */ + brw_wm_emit(c); +} + + +/** + * All Mesa program -> GPU code generation goes through this function. + * Depending on the instructions used (i.e. flow control instructions) + * we'll use one of two code generators. + */ static void do_wm_prog( struct brw_context *brw, struct brw_fragment_program *fp, struct brw_wm_prog_key *key) @@ -102,42 +149,17 @@ static void do_wm_prog( struct brw_context *brw, brw_init_compile(brw, &c->func); + /* + * Shader which use GLSL features such as flow control are handled + * differently from "simple" shaders. + */ if (brw_wm_is_glsl(&c->fp->program)) { brw_wm_glsl_emit(brw, c); } else { - /* Augment fragment program. Add instructions for pre- and - * post-fragment-program tasks such as interpolation and fogging. - */ - brw_wm_pass_fp(c); - - /* Translate to intermediate representation. Build register usage - * chains. - */ - brw_wm_pass0(c); - - /* Dead code removal. - */ - brw_wm_pass1(c); - - /* Register allocation. - */ - c->grf_limit = BRW_WM_MAX_GRF/2; - - brw_wm_pass2(c); - - c->prog_data.total_grf = c->max_wm_grf; - if (c->last_scratch) { - c->prog_data.total_scratch = - c->last_scratch + 0x40; - } else { - c->prog_data.total_scratch = 0; - } - - /* Emit GEN4 code. - */ - brw_wm_emit(c); + brw_wm_non_glsl_emit(brw, c); } + if (INTEL_DEBUG & DEBUG_WM) fprintf(stderr, "\n"); @@ -307,8 +329,6 @@ static void brw_prepare_wm_prog(struct brw_context *brw) } -/* See brw_wm.c: - */ const struct brw_tracked_state brw_wm_prog = { .dirty = { .mesa = (_NEW_COLOR | diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index ea3f3fc678..0a44f8bcca 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -942,6 +942,11 @@ static void print_insns( const struct prog_instruction *insn, } } + +/** + * Initial pass for fragment program code generation. + * This function is used by both the GLSL and non-GLSL paths. + */ void brw_wm_pass_fp( struct brw_wm_compile *c ) { struct brw_fragment_program *fp = c->fp; @@ -958,15 +963,19 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) c->pixel_w = src_undef(); c->nr_fp_insns = 0; - /* Emit preamble instructions: + /* Emit preamble instructions. This is where special instructions such as + * WM_CINTERP, WM_LINTERP, WM_PINTERP and WM_WPOSXY are emitted to + * compute shader inputs from varying vars. */ - - for (insn = 0; insn < fp->program.Base.NumInstructions; insn++) { const struct prog_instruction *inst = &fp->program.Base.Instructions[insn]; validate_src_regs(c, inst); validate_dst_regs(c, inst); } + + /* Loop over all instructions doing assorted simplifications and + * transformations. + */ for (insn = 0; insn < fp->program.Base.NumInstructions; insn++) { const struct prog_instruction *inst = &fp->program.Base.Instructions[insn]; struct prog_instruction *out; @@ -975,7 +984,6 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) * necessary: */ - switch (inst->Opcode) { case OPCODE_SWZ: out = emit_insn(c, inst); -- cgit v1.2.3 From 2f2082bf16ca86b8ebea9e04b77011f74d09c3db Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 15:40:04 -0700 Subject: i965: minor clean-ups --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 53 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 4e099b5945..bac7135bab 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -96,7 +96,7 @@ static void brw_set_dest( struct brw_instruction *insn, } static void brw_set_src0( struct brw_instruction *insn, - struct brw_reg reg ) + struct brw_reg reg ) { assert(reg.file != BRW_MESSAGE_REGISTER_FILE); @@ -169,7 +169,7 @@ static void brw_set_src0( struct brw_instruction *insn, void brw_set_src1( struct brw_instruction *insn, - struct brw_reg reg ) + struct brw_reg reg ) { assert(reg.file != BRW_MESSAGE_REGISTER_FILE); @@ -323,13 +323,13 @@ static void brw_set_dp_read_message( struct brw_instruction *insn, } static void brw_set_sampler_message(struct brw_context *brw, - struct brw_instruction *insn, - GLuint binding_table_index, - GLuint sampler, - GLuint msg_type, - GLuint response_length, - GLuint msg_length, - GLboolean eot) + struct brw_instruction *insn, + GLuint binding_table_index, + GLuint sampler, + GLuint msg_type, + GLuint response_length, + GLuint msg_length, + GLboolean eot) { brw_set_src1(insn, brw_imm_d(0)); @@ -407,7 +407,7 @@ static struct brw_instruction *brw_alu2(struct brw_compile *p, * Convenience routines. */ #define ALU1(OP) \ -struct brw_instruction *brw_##OP(struct brw_compile *p, \ +struct brw_instruction *brw_##OP(struct brw_compile *p, \ struct brw_reg dest, \ struct brw_reg src0) \ { \ @@ -415,7 +415,7 @@ struct brw_instruction *brw_##OP(struct brw_compile *p, \ } #define ALU2(OP) \ -struct brw_instruction *brw_##OP(struct brw_compile *p, \ +struct brw_instruction *brw_##OP(struct brw_compile *p, \ struct brw_reg dest, \ struct brw_reg src0, \ struct brw_reg src1) \ @@ -469,9 +469,9 @@ void brw_NOP(struct brw_compile *p) */ struct brw_instruction *brw_JMPI(struct brw_compile *p, - struct brw_reg dest, - struct brw_reg src0, - struct brw_reg src1) + struct brw_reg dest, + struct brw_reg src0, + struct brw_reg src1) { struct brw_instruction *insn = brw_alu2(p, BRW_OPCODE_JMPI, dest, src0, src1); @@ -674,7 +674,7 @@ struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size) struct brw_instruction *brw_WHILE(struct brw_compile *p, - struct brw_instruction *do_insn) + struct brw_instruction *do_insn) { struct brw_instruction *insn; @@ -931,13 +931,13 @@ void brw_dp_READ_16( struct brw_compile *p, void brw_fb_WRITE(struct brw_compile *p, - struct brw_reg dest, - GLuint msg_reg_nr, - struct brw_reg src0, - GLuint binding_table_index, - GLuint msg_length, - GLuint response_length, - GLboolean eot) + struct brw_reg dest, + GLuint msg_reg_nr, + struct brw_reg src0, + GLuint binding_table_index, + GLuint msg_length, + GLuint response_length, + GLboolean eot) { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); @@ -973,8 +973,8 @@ void brw_SAMPLE(struct brw_compile *p, { GLboolean need_stall = 0; - if(writemask == 0) { -/* _mesa_printf("%s: zero writemask??\n", __FUNCTION__); */ + if (writemask == 0) { + /*_mesa_printf("%s: zero writemask??\n", __FUNCTION__); */ return; } @@ -1006,7 +1006,7 @@ void brw_SAMPLE(struct brw_compile *p, if (newmask != writemask) { need_stall = 1; -/* _mesa_printf("need stall %x %x\n", newmask , writemask); */ + /* _mesa_printf("need stall %x %x\n", newmask , writemask); */ } else { struct brw_reg m1 = brw_message_reg(msg_reg_nr); @@ -1047,8 +1047,7 @@ void brw_SAMPLE(struct brw_compile *p, eot); } - if (need_stall) - { + if (need_stall) { struct brw_reg reg = vec8(offset(dest, response_length-1)); /* mov (8) r9.0<1>:f r9.0<8;8,1>:f { Align1 } -- cgit v1.2.3 From 97937e0ac8d5f46722af98ca40fba3f7a989d97d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Feb 2009 16:03:39 -0700 Subject: i965: the return value of translate_insn() is never used. Make it void. --- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index 590cd946ec..3ade6aa6c3 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -334,8 +334,9 @@ static struct brw_wm_ref *get_new_ref( struct brw_wm_compile *c, } -static struct brw_wm_instruction *translate_insn( struct brw_wm_compile *c, - const struct prog_instruction *inst ) +static void +translate_insn(struct brw_wm_compile *c, + const struct prog_instruction *inst) { struct brw_wm_instruction *out = get_instruction(c); GLuint writemask = inst->DstReg.WriteMask; @@ -365,8 +366,6 @@ static struct brw_wm_instruction *translate_insn( struct brw_wm_compile *c, pass0_set_dst_scalar(c, out, inst, writemask); else pass0_set_dst(c, out, inst, writemask); - - return out; } -- cgit v1.2.3 From 74b6d55864b9264323a09856781f655e453b182b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Feb 2009 16:56:25 -0700 Subject: i965: add missing break for OPCODE_RET case This doesn't effect correctness, but we were emitting an extraneous ADD. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 24b7dc30fe..a1328f6967 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -1212,6 +1212,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) brw_set_access_mode(p, BRW_ALIGN_1); brw_MOV(p, brw_ip_reg(), deref_1d(stack_index, 0)); brw_set_access_mode(p, BRW_ALIGN_16); + break; case OPCODE_END: brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); break; -- cgit v1.2.3 From c51c822ee02cb47ddba46da668577d51b7c02831 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Feb 2009 17:17:52 -0700 Subject: i965: rewrite the code for handling shader subroutine calls Previously, the prog_instruction::Data field was used to map original Mesa instructions to brw instructions in order to resolve subroutine calls. This was a rather tangled mess. Plus it's an obstacle to implementing dynamic allocation/growing of the instruction buffer (it's still a fixed size). Mesa's GLSL compiler emits a label for each subroutine and CAL instruction. Now we use those labels to patch the subroutine calls after code generation has been done. We just keep a list of all CAL instructions that needs patching and a list of all subroutine labels. It's a simple matter to resolve them. This also consolidates some redundant post-emit code between brw_vs_emit.c and brw_wm_glsl.c and removes some loops that cleared the prog_instruction::Data fields at the end. Plus, a bunch of new comments. --- src/mesa/drivers/dri/i965/brw_eu.c | 123 ++++++++++++++++++++++++++++++++ src/mesa/drivers/dri/i965/brw_eu.h | 18 +++++ src/mesa/drivers/dri/i965/brw_vs_emit.c | 71 +++++++++--------- src/mesa/drivers/dri/i965/brw_wm.h | 2 + src/mesa/drivers/dri/i965/brw_wm_fp.c | 1 - src/mesa/drivers/dri/i965/brw_wm_glsl.c | 36 +++------- 6 files changed, 187 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c index b3ae4eef33..c53efba599 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.c +++ b/src/mesa/drivers/dri/i965/brw_eu.c @@ -129,3 +129,126 @@ const GLuint *brw_get_program( struct brw_compile *p, return (const GLuint *)p->store; } + + +/** + * Subroutine calls require special attention. + * Mesa instructions may be expanded into multiple hardware instructions + * so the prog_instruction::BranchTarget field can't be used as an index + * into the hardware instructions. + * + * The BranchTarget field isn't needed, however. Mesa's GLSL compiler + * emits CAL and BGNSUB instructions with labels that can be used to map + * subroutine calls to actual subroutine code blocks. + * + * The structures and function here implement patching of CAL instructions + * so they jump to the right subroutine code... + */ + + +/** + * For each OPCODE_BGNSUB we create one of these. + */ +struct brw_glsl_label +{ + const char *name; /**< the label string */ + GLuint position; /**< the position of the brw instruction for this label */ + struct brw_glsl_label *next; /**< next in linked list */ +}; + + +/** + * For each OPCODE_CAL we create one of these. + */ +struct brw_glsl_call +{ + GLuint call_inst_pos; /**< location of the CAL instruction */ + const char *sub_name; /**< name of subroutine to call */ + struct brw_glsl_call *next; /**< next in linked list */ +}; + + +/** + * Called for each OPCODE_BGNSUB. + */ +void +brw_save_label(struct brw_compile *c, const char *name, GLuint position) +{ + struct brw_glsl_label *label = CALLOC_STRUCT(brw_glsl_label); + label->name = name; + label->position = position; + label->next = c->first_label; + c->first_label = label; +} + + +/** + * Called for each OPCODE_CAL. + */ +void +brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos) +{ + struct brw_glsl_call *call = CALLOC_STRUCT(brw_glsl_call); + call->call_inst_pos = call_pos; + call->sub_name = name; + call->next = c->first_call; + c->first_call = call; +} + + +/** + * Lookup a label, return label's position/offset. + */ +static GLuint +brw_lookup_label(struct brw_compile *c, const char *name) +{ + const struct brw_glsl_label *label; + for (label = c->first_label; label; label = label->next) { + if (strcmp(name, label->name) == 0) { + return label->position; + } + } + abort(); /* should never happen */ + return ~0; +} + + +/** + * When we're done generating code, this function is called to resolve + * subroutine calls. + */ +void +brw_resolve_cals(struct brw_compile *c) +{ + const struct brw_glsl_call *call; + + for (call = c->first_call; call; call = call->next) { + const GLuint sub_loc = brw_lookup_label(c, call->sub_name); + struct brw_instruction *brw_call_inst = &c->store[call->call_inst_pos]; + struct brw_instruction *brw_sub_inst = &c->store[sub_loc]; + GLint offset = brw_sub_inst - brw_call_inst; + + /* patch brw_inst1 to point to brw_inst2 */ + brw_set_src1(brw_call_inst, brw_imm_d(offset * 16)); + } + + /* free linked list of calls */ + { + struct brw_glsl_call *call, *next; + for (call = c->first_call; call; call = next) { + next = call->next; + _mesa_free(call); + } + c->first_call = NULL; + } + + /* free linked list of labels */ + { + struct brw_glsl_label *label, *next; + for (label = c->first_label; label; label = next) { + next = label->next; + _mesa_free(label); + } + c->first_label = NULL; + } +} diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index 9e2b39af9b..b36a1976ef 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -91,6 +91,11 @@ struct brw_indirect { }; +struct brw_glsl_label; +struct brw_glsl_call; + + + #define BRW_EU_MAX_INSN_STACK 5 #define BRW_EU_MAX_INSN 1200 @@ -106,9 +111,22 @@ struct brw_compile { GLuint flag_value; GLboolean single_program_flow; struct brw_context *brw; + + struct brw_glsl_label *first_label; /**< linked list of labels */ + struct brw_glsl_call *first_call; /**< linked list of CALs */ }; +void +brw_save_label(struct brw_compile *c, const char *name, GLuint position); + +void +brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos); + +void +brw_resolve_cals(struct brw_compile *c); + + static INLINE int type_sz( GLuint type ) { diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index a1328f6967..235f826812 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -954,36 +954,27 @@ static void emit_vertex_write( struct brw_vs_compile *c) } +/** + * Called after code generation to resolve subroutine calls and the + * END instruction. + * \param end_inst points to brw code for END instruction + * \param last_inst points to last instruction emitted before vertex write + */ static void -post_vs_emit( struct brw_vs_compile *c, struct brw_instruction *end_inst ) +post_vs_emit( struct brw_vs_compile *c, + struct brw_instruction *end_inst, + struct brw_instruction *last_inst ) { - GLuint nr_insns = c->vp->program.Base.NumInstructions; - GLuint insn, target_insn; - struct prog_instruction *inst1, *inst2; - struct brw_instruction *brw_inst1, *brw_inst2; - int offset; - for (insn = 0; insn < nr_insns; insn++) { - inst1 = &c->vp->program.Base.Instructions[insn]; - brw_inst1 = inst1->Data; - switch (inst1->Opcode) { - case OPCODE_CAL: - case OPCODE_BRA: - target_insn = inst1->BranchTarget; - inst2 = &c->vp->program.Base.Instructions[target_insn]; - brw_inst2 = inst2->Data; - offset = brw_inst2 - brw_inst1; - brw_set_src1(brw_inst1, brw_imm_d(offset*16)); - break; - case OPCODE_END: - offset = end_inst - brw_inst1; - brw_set_src1(brw_inst1, brw_imm_d(offset*16)); - break; - default: - break; - } - } + GLint offset; + + brw_resolve_cals(&c->func); + + /* patch up the END code to jump past subroutines, etc */ + offset = last_inst - end_inst; + brw_set_src1(end_inst, brw_imm_d(offset * 16)); } + /* Emit the fragment program instructions here. */ void brw_vs_emit(struct brw_vs_compile *c ) @@ -992,7 +983,8 @@ void brw_vs_emit(struct brw_vs_compile *c ) struct brw_compile *p = &c->func; GLuint nr_insns = c->vp->program.Base.NumInstructions; GLuint insn, if_insn = 0; - struct brw_instruction *end_inst; + GLuint end_offset = 0; + struct brw_instruction *end_inst, *last_inst; struct brw_instruction *if_inst[MAX_IFSN]; struct brw_indirect stack_index = brw_indirect(0, 0); @@ -1035,7 +1027,6 @@ void brw_vs_emit(struct brw_vs_compile *c ) /* Get argument regs. SWZ is special and does this itself. */ - inst->Data = &p->store[p->nr_insn]; if (inst->Opcode != OPCODE_SWZ) for (i = 0; i < 3; i++) { struct prog_src_register *src = &inst->SrcReg[i]; @@ -1203,7 +1194,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) brw_set_access_mode(p, BRW_ALIGN_16); brw_ADD(p, get_addr_reg(stack_index), get_addr_reg(stack_index), brw_imm_d(4)); - inst->Data = &p->store[p->nr_insn]; + brw_save_call(p, inst->Comment, p->nr_insn); brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); break; case OPCODE_RET: @@ -1214,13 +1205,21 @@ void brw_vs_emit(struct brw_vs_compile *c ) brw_set_access_mode(p, BRW_ALIGN_16); break; case OPCODE_END: + end_offset = p->nr_insn; + /* this instruction will get patched later to jump past subroutine + * code, etc. + */ brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); break; case OPCODE_PRINT: + /* no-op */ + break; case OPCODE_BGNSUB: + brw_save_label(p, inst->Comment, p->nr_insn); + break; case OPCODE_ENDSUB: - /* no-op instructions */ - break; + /* no-op */ + break; default: _mesa_problem(NULL, "Unsupported opcode %i (%s) in vertex shader", inst->Opcode, inst->Opcode < MAX_OPCODE ? @@ -1258,9 +1257,11 @@ void brw_vs_emit(struct brw_vs_compile *c ) release_tmps(c); } - end_inst = &p->store[p->nr_insn]; + end_inst = &p->store[end_offset]; + last_inst = &p->store[p->nr_insn]; + + /* The END instruction will be patched to jump to this code */ emit_vertex_write(c); - post_vs_emit(c, end_inst); - for (insn = 0; insn < nr_insns; insn++) - c->vp->program.Base.Instructions[insn].Data = NULL; + + post_vs_emit(c, end_inst, last_inst); } diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 0f46a25b1a..582031f5f6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -281,4 +281,6 @@ 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); + + #endif diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 0a44f8bcca..8b5ccdba93 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -183,7 +183,6 @@ static struct prog_instruction *emit_insn(struct brw_wm_compile *c, { struct prog_instruction *inst = get_fp_inst(c); *inst = *inst0; - inst->Data = (void *)inst0; return inst; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 0d3e2eb770..d99aa372a9 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -2252,28 +2252,12 @@ static void emit_tex(struct brw_wm_compile *c, brw_MOV(p, dst[3], brw_imm_f(1.0)); } +/** + * Resolve subroutine calls after code emit is done. + */ static void post_wm_emit( struct brw_wm_compile *c ) { - GLuint nr_insns = c->fp->program.Base.NumInstructions; - GLuint insn, target_insn; - struct prog_instruction *inst1, *inst2; - struct brw_instruction *brw_inst1, *brw_inst2; - int offset; - for (insn = 0; insn < nr_insns; insn++) { - inst1 = &c->fp->program.Base.Instructions[insn]; - brw_inst1 = inst1->Data; - switch (inst1->Opcode) { - case OPCODE_CAL: - target_insn = inst1->BranchTarget; - inst2 = &c->fp->program.Base.Instructions[target_insn]; - brw_inst2 = inst2->Data; - offset = brw_inst2 - brw_inst1; - brw_set_src1(brw_inst1, brw_imm_d(offset*16)); - break; - default: - break; - } - } + brw_resolve_cals(&c->func); } static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) @@ -2293,10 +2277,6 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) for (i = 0; i < c->nr_fp_insns; i++) { struct prog_instruction *inst = &c->prog_instructions[i]; - struct prog_instruction *orig_inst; - - if ((orig_inst = inst->Data) != 0) - orig_inst->Data = current_insn(p); if (inst->CondUpdate) brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); @@ -2454,7 +2434,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) brw_ENDIF(p, if_inst[--if_insn]); break; case OPCODE_BGNSUB: + brw_save_label(p, inst->Comment, p->nr_insn); + break; case OPCODE_ENDSUB: + /* no-op */ break; case OPCODE_CAL: brw_push_insn_state(p); @@ -2464,8 +2447,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) brw_set_access_mode(p, BRW_ALIGN_16); brw_ADD(p, get_addr_reg(stack_index), get_addr_reg(stack_index), brw_imm_d(4)); - orig_inst = inst->Data; - orig_inst->Data = &p->store[p->nr_insn]; + brw_save_call(&c->func, inst->Comment, p->nr_insn); brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); brw_pop_insn_state(p); break; @@ -2518,8 +2500,6 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) brw_set_predicate_control(p, BRW_PREDICATE_NONE); } post_wm_emit(c); - for (i = 0; i < c->fp->program.Base.NumInstructions; i++) - c->fp->program.Base.Instructions[i].Data = NULL; } -- cgit v1.2.3 From e511110b71a7ea19c531d707080813d9d432341c Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 13 Feb 2009 23:20:43 -0800 Subject: r300-gallium: Add derived state for vertex formats. Next up: The evil RS block. --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_context.h | 26 +++--- src/gallium/drivers/r300/r300_state_derived.c | 114 ++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_state_derived.h | 31 +++++++ 4 files changed, 161 insertions(+), 11 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_state_derived.c create mode 100644 src/gallium/drivers/r300/r300_state_derived.h (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index e83d943cd8..85b3f15ac5 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -11,6 +11,7 @@ C_SOURCES = \ r300_flush.c \ r300_screen.c \ r300_state.c \ + r300_state_derived.c \ r300_state_shader.c \ r300_surface.c \ r300_swtcl_emit.c \ diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 54879f88f5..caedbb8448 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -24,6 +24,7 @@ #define R300_CONTEXT_H #include "draw/draw_context.h" +#include "draw/draw_vertex.h" #include "pipe/p_context.h" #include "tgsi/tgsi_scan.h" #include "util/u_memory.h" @@ -85,17 +86,18 @@ struct r300_scissor_state { struct r300_texture_state { }; -#define R300_NEW_BLEND 0x000001 -#define R300_NEW_BLEND_COLOR 0x000002 -#define R300_NEW_DSA 0x000004 -#define R300_NEW_FRAMEBUFFERS 0x000008 -#define R300_NEW_FRAGMENT_SHADER 0x000010 -#define R300_NEW_RASTERIZER 0x000020 -#define R300_NEW_SAMPLER 0x000040 -#define R300_NEW_SCISSOR 0x004000 -#define R300_NEW_TEXTURE 0x008000 -#define R300_NEW_VERTEX_SHADER 0x800000 -#define R300_NEW_KITCHEN_SINK 0xffffff +#define R300_NEW_BLEND 0x0000001 +#define R300_NEW_BLEND_COLOR 0x0000002 +#define R300_NEW_DSA 0x0000004 +#define R300_NEW_FRAMEBUFFERS 0x0000008 +#define R300_NEW_FRAGMENT_SHADER 0x0000010 +#define R300_NEW_RASTERIZER 0x0000020 +#define R300_NEW_SAMPLER 0x0000040 +#define R300_NEW_SCISSOR 0x0004000 +#define R300_NEW_TEXTURE 0x0008000 +#define R300_NEW_VERTEX_FORMAT 0x0800000 +#define R300_NEW_VERTEX_SHADER 0x1000000 +#define R300_NEW_KITCHEN_SINK 0x1ffffff /* The next several objects are not pure Radeon state; they inherit from * various Gallium classes. */ @@ -203,6 +205,8 @@ struct r300_context { struct r300_texture* textures[8]; struct r300_texture_state* texture_states[8]; int texture_count; + /* Vertex information. */ + struct vertex_info vertex_info; /* Bitmask of dirty state objects. */ uint32_t dirty_state; /* Flag indicating whether or not the HW is dirty. */ diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c new file mode 100644 index 0000000000..fc2730d4c6 --- /dev/null +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -0,0 +1,114 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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 "r300_state_derived.h" + +/* r300_state_derived: Various bits of state which are dependent upon + * currently bound CSO data. */ + +/* Update the vertex_info struct in our r300_context. + * + * The vertex_info struct describes the post-TCL format of vertices. It is + * required for Draw when doing SW TCL, and also for describing the + * dreaded RS block on R300 chipsets. */ +/* XXX this function should be able to handle vert shaders as well as draw */ +static void r300_update_vertex_layout(struct r300_context* r300) +{ + struct vertex_info vinfo; + boolean pos = false, psize = false, fog = false; + int i, texs = 0, cols = 0; + + struct tgsi_shader_info* info = &r300->fs->info; + memset(&vinfo, 0, sizeof(vinfo)); + + /* This is rather lame. Since draw_find_vs_output doesn't return an error + * when it can't find an output, we have to pre-iterate and count each + * output ourselves. */ + for (i = 0; i < info->num_inputs; i++) { + switch (info->input_semantic_name[i]) { + case TGSI_SEMANTIC_POSITION: + pos = true; + break; + case TGSI_SEMANTIC_COLOR: + cols++; + break; + case TGSI_SEMANTIC_FOG: + fog = true; + break; + case TGSI_SEMANTIC_PSIZE: + psize = true; + break; + case TGSI_SEMANTIC_GENERIC: + texs++; + break; + default: + debug_printf("r300: Unknown vertex input %d\n", + info->input_semantic_name[i]); + break; + } + } + + /* Do the actual vertex_info setup. + * + * vertex_info has four uints of hardware-specific data in it. + * vinfo.hwfmt[0] is VAP_OUT_VTX_FMT_0 + * vinfo.hwfmt[1] is VAP_OUT_VTX_FMT_1 */ + + if (pos) { + draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_POS, + draw_find_vs_output(r300->draw, TGSI_SEMANTIC_POSITION, 0)); + vinfo.hwfmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; + } else { + debug_printf("r300: No vertex input for position in SW TCL;\n" + " this will probably end poorly.\n"); + } + + if (psize) { + draw_emit_vertex_attr(&vinfo, EMIT_1F, INTERP_LINEAR, + draw_find_vs_output(r300->draw, TGSI_SEMANTIC_PSIZE, 0)); + vinfo.hwfmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; + } + + for (i = 0; i < cols; i++) { + draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_LINEAR, + draw_find_vs_output(r300->draw, TGSI_SEMANTIC_COLOR, i)); + vinfo.hwfmt[0] |= (R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << i); + } + + if (fog) { + draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE, + draw_find_vs_output(r300->draw, TGSI_SEMANTIC_FOG, 0)); + vinfo.hwfmt[0] |= + (R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << cols); + } + + for (i = 0; i < texs; i++) { + draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_LINEAR, + draw_find_vs_output(r300->draw, TGSI_SEMANTIC_GENERIC, i)); + vinfo.hwfmt[1] |= (4 << (3 * i)); + } + + if (memcmp(&r300->vertex_info, &vinfo, sizeof(struct vertex_info))) { + memcpy(&r300->vertex_info, &vinfo, sizeof(struct vertex_info)); + r300->dirty_state |= R300_NEW_VERTEX_FORMAT; + } +} diff --git a/src/gallium/drivers/r300/r300_state_derived.h b/src/gallium/drivers/r300/r300_state_derived.h new file mode 100644 index 0000000000..11d0787d12 --- /dev/null +++ b/src/gallium/drivers/r300/r300_state_derived.h @@ -0,0 +1,31 @@ +/* + * Copyright 2008 Corbin Simpson + * + * 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. */ + +#ifndef R300_STATE_DERIVED_H +#define R300_STATE_DERIVED_H + +#include "draw/draw_vertex.h" + +#include "r300_context.h" +#include "r300_reg.h" + +#endif /* R300_STATE_DERIVED_H */ -- cgit v1.2.3 From b45e5e2a12e91cecec8922e58b2fc3960ab7ae14 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 01:55:38 -0800 Subject: r300-gallium: Emit Z/stencil buffer offset. --- src/gallium/drivers/r300/r300_emit.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 8108b99f94..21803443fe 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -168,6 +168,19 @@ void r300_emit_fb_state(struct r300_context* r300, OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), translate_out_fmt(fb->cbufs[i]->format)); } + + if (fb->zsbuf) { + tex = (struct r300_texture*)fb->zsbuf->texture; + OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1); + OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); + } + + OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, + R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS | + R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D); + OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, + R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | + R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); R300_PACIFY; END_CS; } -- cgit v1.2.3 From 1c533bdeb6e2932120874754bb357790d4c923a8 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 02:06:17 -0800 Subject: r300-gallium: Add Z/stencil buffer format emit. Also set BEGIN_CS correctly. --- src/gallium/drivers/r300/r300_emit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 21803443fe..75864c0ef6 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -151,7 +151,7 @@ uint32_t translate_out_fmt(enum pipe_format format) return 0; } -/* XXX add pitch, stride, z/stencil buf */ +/* XXX add pitch, stride */ void r300_emit_fb_state(struct r300_context* r300, struct pipe_framebuffer_state* fb) { @@ -159,7 +159,7 @@ void r300_emit_fb_state(struct r300_context* r300, struct r300_texture* tex; int i; - BEGIN_CS((3 * fb->nr_cbufs) + 6); + BEGIN_CS((5 * fb->nr_cbufs) + (fb->zsbuf ? 5 : 0) + 6); for (i = 0; i < fb->nr_cbufs; i++) { tex = (struct r300_texture*)fb->cbufs[i]->texture; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); @@ -173,6 +173,12 @@ void r300_emit_fb_state(struct r300_context* r300, tex = (struct r300_texture*)fb->zsbuf->texture; OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1); OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); + if (fb->zsbuf->format == PIPE_FORMAT_Z24S8_UNORM) { + OUT_CS_REG(R300_ZB_FORMAT, + R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL); + } else { + OUT_CS_REG(R300_ZB_FORMAT, 0x0); + } } OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, -- cgit v1.2.3 From 9a20ef0a52f8c4efd7431ccd59e32efecdc33893 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 02:07:29 -0800 Subject: r300-gallium: Enable all four colorbuffer render targets. As far as I can tell all the state emission necessary has been set up. Well, except for the fragment shader, but c'mon, gimme a break. :3 --- src/gallium/drivers/r300/r300_screen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 8ed66a1660..5088c13039 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -100,8 +100,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) /* IN THEORY */ return 0; case PIPE_CAP_MAX_RENDER_TARGETS: - /* XXX 4 eventually */ - return 1; + return 4; case PIPE_CAP_OCCLUSION_QUERY: /* IN THEORY */ return 0; -- cgit v1.2.3 From 5352ec3b870706467b538595d90bfacbef0f98d5 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 02:24:30 -0800 Subject: r300-gallium: Update r300_screen comments and add a few formats. --- src/gallium/drivers/r300/r300_screen.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 5088c13039..d7354ad893 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -120,7 +120,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) * shows why this is silly. Assuming RGBA, 4cpp, we can see that * 4096*4096*4096 = 64.0 GiB exactly, so it's not exactly * practical. However, if at some point a game really wants this, - * then we can remove this limit. */ + * then we can remove or raise this limit. */ if (r300screen->caps->is_r500) { /* 9 == 256x256x256 */ return 9; @@ -141,7 +141,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int param) case PIPE_CAP_TEXTURE_MIRROR_REPEAT: return 1; case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: - /* XXX guessing */ + /* XXX guessing (what a terrible guess) */ return 2; default: debug_printf("r300: Implementation error: Bad param %d\n", @@ -174,13 +174,25 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) } } -/* XXX moar formats */ +/* XXX even moar formats */ static boolean check_tex_2d_format(enum pipe_format format) { switch (format) { + /* Colorbuffer */ case PIPE_FORMAT_A8R8G8B8_UNORM: + /* Texture */ case PIPE_FORMAT_I8_UNORM: + /* Z buffer */ + case PIPE_FORMAT_Z16_UNORM: + /* Z buffer with stencil */ + case PIPE_FORMAT_Z24S8_UNORM: return TRUE; + + /* These formats are explicitly not supported, in order to keep + * people from wasting their time trying to implement them... */ + case PIPE_FORMAT_S8Z24_UNORM: + return FALSE; + default: debug_printf("r300: Warning: Got unknown format: %s, in %s\n", pf_name(format), __FUNCTION__); -- cgit v1.2.3 From 76142d2b8bdb0d5b32ad4e71264f7e0341d312b4 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 02:40:33 -0800 Subject: radeon-gallium: Clean out extensions explicitly enabled by Mesa. This cleans up some of the cruft from the old DRI setup, and it turns out that only the GLSL extensions are still off if we let st_extensions.c handle the setup instead. --- src/gallium/winsys/drm/radeon/radeon_context.c | 38 ++------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/radeon/radeon_context.c b/src/gallium/winsys/drm/radeon/radeon_context.c index a9d1577634..13a7035fec 100644 --- a/src/gallium/winsys/drm/radeon/radeon_context.c +++ b/src/gallium/winsys/drm/radeon/radeon_context.c @@ -38,57 +38,23 @@ #include "radeon_buffer.h" #include "radeon_winsys_softpipe.h" -#define need_GL_ARB_fragment_program -#define need_GL_ARB_multisample #define need_GL_ARB_point_parameters -#define need_GL_ARB_shader_objects -#define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object -#define need_GL_ARB_vertex_program -#define need_GL_ARB_vertex_shader -#define need_GL_EXT_blend_color -#define need_GL_EXT_blend_equation_separate -#define need_GL_EXT_blend_func_separate -#define need_GL_EXT_blend_minmax #define need_GL_EXT_cull_vertex #define need_GL_EXT_compiled_vertex_array -#define need_GL_EXT_fog_coord -#define need_GL_EXT_framebuffer_object -#define need_GL_EXT_multi_draw_arrays -#define need_GL_EXT_secondary_color -#define need_GL_VERSION_2_0 -#define need_GL_VERSION_2_1 #include "extension_helper.h" /** * Extension strings exported by the radeon driver. */ const struct dri_extension radeon_card_extensions[] = { - {"GL_ARB_multitexture", NULL}, - {"GL_ARB_texture_border_clamp", NULL}, +/* XXX these are technically not supported {"GL_ARB_texture_rectangle", NULL}, - {"GL_ARB_pixel_buffer_object", NULL}, + {"GL_ARB_pixel_buffer_object", NULL}, */ {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, - {"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_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, - {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions}, - {"GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions}, - {"GL_EXT_blend_color", GL_EXT_blend_color_functions}, - {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions}, - {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, - {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, - {"GL_EXT_blend_subtract", NULL}, {"GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions}, {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions}, - {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions}, - {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions}, - {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions}, - {"GL_EXT_packed_depth_stencil", NULL}, - {"GL_EXT_pixel_buffer_object", NULL}, - {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, - {"GL_EXT_stencil_wrap", NULL}, {NULL, NULL} }; -- cgit v1.2.3 From 8520b15018ca10e2bc47c1db4f7378df6d3c2e99 Mon Sep 17 00:00:00 2001 From: Nicolai Haehnle Date: Sat, 14 Feb 2009 17:06:06 +0100 Subject: r300: Redirect constant TEX coordinates R3xx/R5xx fragment program texture constants must come from a hardware register instead of the constant file, so we redirect if necessary during the native rewrite phase. The symptoms of this bug started appearing when the Mesa fixed function texenvprogram code started using STATE_CURRENT_ATTRIB constants for texture coordinates when the corresponding attributes were constant across all vertices. Signed-off-by: Nicolai Haehnle --- src/mesa/drivers/dri/r300/r300_fragprog.c | 13 +++++++++++++ src/mesa/drivers/dri/r300/r500_fragprog.c | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 4ef7f2bd78..8d030c63fb 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -163,6 +163,19 @@ static GLboolean transform_TEX( } } + if (inst.SrcReg[0].File != PROGRAM_TEMPORARY && inst.SrcReg[0].File != PROGRAM_INPUT) { + int tmpreg = radeonFindFreeTemporary(t); + tgt = radeonAppendInstructions(t->Program, 1); + tgt->Opcode = OPCODE_MOV; + tgt->DstReg.File = PROGRAM_TEMPORARY; + tgt->DstReg.Index = tmpreg; + tgt->SrcReg[0] = inst.SrcReg[0]; + + reset_srcreg(&inst.SrcReg[0]); + inst.SrcReg[0].File = PROGRAM_TEMPORARY; + inst.SrcReg[0].Index = tmpreg; + } + tgt = radeonAppendInstructions(t->Program, 1); _mesa_copy_instructions(tgt, &inst, 1); diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c index 75dae86fa8..926ddd5964 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog.c @@ -31,6 +31,12 @@ #include "radeon_program_alu.h" +static void reset_srcreg(struct prog_src_register* reg) +{ + _mesa_bzero(reg, sizeof(*reg)); + reg->Swizzle = SWIZZLE_NOOP; +} + static struct prog_src_register shadow_ambient(struct gl_program *program, int tmu) { gl_state_index fail_value_tokens[STATE_LENGTH] = { @@ -99,6 +105,19 @@ static GLboolean transform_TEX( destredirect = GL_TRUE; } + if (inst.SrcReg[0].File != PROGRAM_TEMPORARY && inst.SrcReg[0].File != PROGRAM_INPUT) { + int tmpreg = radeonFindFreeTemporary(t); + tgt = radeonAppendInstructions(t->Program, 1); + tgt->Opcode = OPCODE_MOV; + tgt->DstReg.File = PROGRAM_TEMPORARY; + tgt->DstReg.Index = tmpreg; + tgt->SrcReg[0] = inst.SrcReg[0]; + + reset_srcreg(&inst.SrcReg[0]); + inst.SrcReg[0].File = PROGRAM_TEMPORARY; + inst.SrcReg[0].Index = tmpreg; + } + tgt = radeonAppendInstructions(t->Program, 1); _mesa_copy_instructions(tgt, &inst, 1); -- cgit v1.2.3 From f176c94e49a50b05b3af9f748a67e2ebd2e1b8fd Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 03:23:50 -0800 Subject: r300-gallium: Use fui instead of a roll-my-own. Man, util/u_math just gets better by the day. --- src/gallium/drivers/r300/r300_cs.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 385b61a096..3049702a94 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -23,21 +23,11 @@ #ifndef R300_CS_H #define R300_CS_H +#include "util/u_math.h" + #include "r300_reg.h" #include "r300_winsys.h" -/* Pack a 32-bit float into a dword. */ -static uint32_t pack_float_32(float f) -{ - union { - float f; - uint32_t u; - } u; - - u.f = f; - return u.u; -} - /* Yes, I know macros are ugly. However, they are much prettier than the code * that they neatly hide away, and don't have the cost of function setup,so * we're going to use them. */ @@ -80,7 +70,7 @@ static uint32_t pack_float_32(float f) } while (0) #define OUT_CS_32F(value) do { \ - cs_winsys->write_cs_dword(cs, pack_float_32(value)); \ + cs_winsys->write_cs_dword(cs, fui(value)); \ cs_count--; \ } while (0) -- cgit v1.2.3 From 39d0ac4826dd71ca7db224a14110017fdadea6fb Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 04:11:27 -0800 Subject: r300-gallium: Clean up some clear registers. --- src/gallium/drivers/r300/r300_surface.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 07837cb823..30a0d06199 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -54,9 +54,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } - BEGIN_CS(168 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); - R300_PACIFY; - OUT_CS_REG(R300_TX_INVALTAGS, 0x0); + BEGIN_CS(164 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); R300_PACIFY; /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); @@ -235,7 +233,7 @@ static void r300_surface_fill(struct pipe_context* pipe, r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader); } - BEGIN_CS(10 + (caps->has_tcl ? 23 : 2)); + BEGIN_CS(8 + (caps->has_tcl ? 23 : 2)); OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); OUT_CS(R300_US_OUT_FMT_UNUSED); @@ -314,9 +312,7 @@ static void r300_surface_fill(struct pipe_context* pipe, /* XXX OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */ - OUT_CS_REG(R300_SC_SCREENDOOR, 0x00000000); - R300_PACIFY; - OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); + R300_SCREENDOOR; END_CS; FLUSH_CS; -- cgit v1.2.3 From 4e309b5d64e9b0b6da4bd34772af5d949bd4d62f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 04:41:29 -0800 Subject: r300-gallium: Grab bag of goodies. Some fixes from glisse, moar swtcl emit setup, cleanup a bunch of regs, properly do clear flush, and BEGIN_CS count fixes. --- src/gallium/drivers/r300/r300_cs_inlines.h | 5 +++ src/gallium/drivers/r300/r300_emit.c | 6 ++-- src/gallium/drivers/r300/r300_surface.c | 16 +++------- src/gallium/drivers/r300/r300_swtcl_emit.c | 50 ++++++++++++++++++++++++++---- 4 files changed, 55 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index 98f9ee0451..16e412f586 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -40,5 +40,10 @@ (1 << 18) | (1 << 31)); \ } while (0) +#define R300_SCREENDOOR do { \ + OUT_CS_REG(R300_SC_SCREENDOOR, 0x0); \ + R300_PACIFY; \ + OUT_CS_REG(R300_SC_SCREENDOOR, 0xffffff); \ +} while (0) #endif /* R300_CS_H */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 75864c0ef6..c6464e3eb6 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -115,7 +115,7 @@ void r500_emit_fragment_shader(struct r300_context* r300, { CS_LOCALS(r300); int i = 0; - BEGIN_CS(11 + (fs->instruction_count * 6)); + BEGIN_CS(9 + (fs->instruction_count * 6)); OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); OUT_CS_REG(R500_US_PIXSIZE, fs->shader.stack_size); OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) | @@ -132,7 +132,6 @@ void r500_emit_fragment_shader(struct r300_context* r300, OUT_CS(fs->instructions[i].inst4); OUT_CS(fs->instructions[i].inst5); } - R300_PACIFY; END_CS; } @@ -159,7 +158,7 @@ void r300_emit_fb_state(struct r300_context* r300, struct r300_texture* tex; int i; - BEGIN_CS((5 * fb->nr_cbufs) + (fb->zsbuf ? 5 : 0) + 6); + BEGIN_CS((5 * fb->nr_cbufs) + (fb->zsbuf ? 5 : 0) + 4); for (i = 0; i < fb->nr_cbufs; i++) { tex = (struct r300_texture*)fb->cbufs[i]->texture; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); @@ -187,7 +186,6 @@ void r300_emit_fb_state(struct r300_context* r300, OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); - R300_PACIFY; END_CS; } diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 30a0d06199..392c7d318d 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -54,8 +54,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } - BEGIN_CS(164 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); - R300_PACIFY; + BEGIN_CS(158 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); @@ -127,7 +126,6 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000); OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C); OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525); - OUT_CS_REG(R300_SC_SCREENDOOR, 0x00FFFFFF); OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000002); OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x00000000); OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000); @@ -156,7 +154,6 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(0x4F34, 0x00000000); */ OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); - R300_PACIFY; if (caps->has_tcl) { OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, (R300_DATA_TYPE_FLOAT_4 << R300_DATA_TYPE_0_SHIFT) | @@ -233,7 +230,7 @@ static void r300_surface_fill(struct pipe_context* pipe, r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader); } - BEGIN_CS(8 + (caps->has_tcl ? 23 : 2)); + BEGIN_CS(8 + (caps->has_tcl ? 20 : 2)); OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4); OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A); OUT_CS(R300_US_OUT_FMT_UNUSED); @@ -250,7 +247,6 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000); OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000); OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001); - R300_PACIFY; /* XXX translate these back into normal instructions */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1); OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0); @@ -269,15 +265,13 @@ static void r300_surface_fill(struct pipe_context* pipe, (0x5 << R300_VF_MAX_VTX_NUM_SHIFT) | (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT)); } - R300_PACIFY; END_CS; r300_emit_blend_state(r300, &blend_clear_state); r300_emit_blend_color_state(r300, &blend_color_clear_state); r300_emit_dsa_state(r300, &dsa_clear_state); - BEGIN_CS(32); - R300_PACIFY; + BEGIN_CS(24); /* Flush colorbuffer and blend caches. */ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D | @@ -312,12 +306,10 @@ static void r300_surface_fill(struct pipe_context* pipe, /* XXX OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */ - R300_SCREENDOOR; END_CS; - FLUSH_CS; - r300->dirty_state = R300_NEW_KITCHEN_SINK; + r300->dirty_hw++; } void r300_init_surface_functions(struct r300_context* r300) diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c index f6e98d23e9..e51ac2c28d 100644 --- a/src/gallium/drivers/r300/r300_swtcl_emit.c +++ b/src/gallium/drivers/r300/r300_swtcl_emit.c @@ -41,10 +41,44 @@ static INLINE struct swtcl_stage* swtcl_stage(struct draw_stage* draw) { return (struct swtcl_stage*)draw; } -static void r300_emit_vertex(struct r300_context* r300, - const struct vertex_header* vertex) +static INLINE void r300_emit_vertex(struct r300_context* r300, + const struct vertex_header* vertex) { - /* XXX */ + struct vertex_info* vinfo = &r300->vertex_info; + CS_LOCALS(r300); + uint i, j; + + BEGIN_CS(vinfo->size); + + for (i = 0; i < vinfo->num_attribs; i++) { + j = vinfo->attrib[i].src_index; + switch (vinfo->attrib[i].emit) { + case EMIT_1F: + CS_OUT_32F(vertex->data[j][0]); + break; + case EMIT_2F: + CS_OUT_32F(vertex->data[j][0]); + CS_OUT_32F(vertex->data[j][1]); + break; + case EMIT_3F: + CS_OUT_32F(vertex->data[j][0]); + CS_OUT_32F(vertex->data[j][1]); + CS_OUT_32F(vertex->data[j][2]); + break; + case EMIT_4F: + CS_OUT_32F(vertex->data[j][0]); + CS_OUT_32F(vertex->data[j][1]); + CS_OUT_32F(vertex->data[j][2]); + CS_OUT_32F(vertex->data[j][3]); + break; + default: + debug_printf("r300: Unknown emit value %d\n", + vinfo->attrib[i].emit); + break; + } + } + + END_CS; } static INLINE void r300_emit_prim(struct draw_stage* draw, @@ -58,8 +92,12 @@ static INLINE void r300_emit_prim(struct draw_stage* draw, r300_emit_dirty_state(r300); - /* XXX should be count * vtx size */ - BEGIN_CS(2 + count + 6); + BEGIN_CS(3); + OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); + OUT_CS(r300->vertex_info.hwfmt[0]); + OUT_CS(r300->vertex_info.hwfmt[1]); + + BEGIN_CS(2 + (count * r300->vertex_info.size) + 2); OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, count)); OUT_CS(hwprim | R300_PRIM_WALK_RING | (count << R300_PRIM_NUM_VERTICES_SHIFT)); @@ -67,7 +105,7 @@ static INLINE void r300_emit_prim(struct draw_stage* draw, for (i = 0; i < count; i++) { r300_emit_vertex(r300, prim->v[i]); } - R300_PACIFY; + END_CS; } -- cgit v1.2.3 From 484858ae48fef039034cf43391883a432ac40c78 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 14 Feb 2009 15:24:44 -0800 Subject: r300-gallium: Fix scissors. Don't use SCISSORS_OFFSET since we're DRI2, and don't forget to set scissors in clear. --- src/gallium/drivers/r300/r300_cs_inlines.h | 4 ++-- src/gallium/drivers/r300/r300_emit.c | 16 ++++++++++++---- src/gallium/drivers/r300/r300_emit.h | 3 +++ src/gallium/drivers/r300/r300_state.c | 18 +++++------------- src/gallium/drivers/r300/r300_surface.c | 8 +++++++- 5 files changed, 29 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index 16e412f586..db931fd485 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -36,8 +36,8 @@ } while (0) #define R300_PACIFY do { \ - OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | \ - (1 << 18) | (1 << 31)); \ + OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) | \ + (1 << 18)); \ } while (0) #define R300_SCREENDOOR do { \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index c6464e3eb6..cfc70362cc 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -208,6 +208,17 @@ void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs) END_CS; } +void r300_emit_scissor_state(struct r300_context* r300, + struct r300_scissor_state* scissor) +{ + CS_LOCALS(r300); + BEGIN_CS(3); + OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); + OUT_CS(scissor->scissor_top_left); + OUT_CS(scissor->scissor_bottom_right); +} + +/* Emit all dirty state. */ static void r300_emit_dirty_state(struct r300_context* r300) { struct r300_screen* r300screen = @@ -247,10 +258,7 @@ static void r300_emit_dirty_state(struct r300_context* r300) } if (r300->dirty_state & R300_NEW_SCISSOR) { - struct r300_scissor_state* scissor = r300->scissor_state; - /* XXX next two are contiguous regs */ - OUT_CS_REG(R300_SC_SCISSORS_TL, scissor->scissor_top_left); - OUT_CS_REG(R300_SC_SCISSORS_BR, scissor->scissor_bottom_right); + r300_emit_scissor_state(r300, r300->scissor_state); } r300->dirty_state = 0; diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 4c5a6d292e..7642cfb39e 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -45,3 +45,6 @@ void r300_emit_fb_state(struct r300_context* r300, struct pipe_framebuffer_state* fb); void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs); + +void r300_emit_scissor_state(struct r300_context* r300, + struct r300_scissor_state* scissor); diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index d02679c7c5..6ecd61e3a2 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -715,20 +715,12 @@ static void r300_set_scissor_state(struct pipe_context* pipe, struct r300_context* r300 = r300_context(pipe); draw_flush(r300->draw); - uint32_t left, top, right, bottom; - - /* So, a bit of info. The scissors are offset by R300_SCISSORS_OFFSET in - * both directions for all values, and can only be 13 bits wide. Why? - * We may never know. */ - left = (state->minx + R300_SCISSORS_OFFSET) & 0x1fff; - top = (state->miny + R300_SCISSORS_OFFSET) & 0x1fff; - right = (state->maxx + R300_SCISSORS_OFFSET) & 0x1fff; - bottom = (state->maxy + R300_SCISSORS_OFFSET) & 0x1fff; - - r300->scissor_state->scissor_top_left = (left << R300_SCISSORS_X_SHIFT) | - (top << R300_SCISSORS_Y_SHIFT); + r300->scissor_state->scissor_top_left = + (state->minx << R300_SCISSORS_X_SHIFT) | + (state->miny << R300_SCISSORS_Y_SHIFT); r300->scissor_state->scissor_bottom_right = - (right << R300_SCISSORS_X_SHIFT) | (bottom << R300_SCISSORS_Y_SHIFT); + (state->maxx << R300_SCISSORS_X_SHIFT) | + (state->maxy << R300_SCISSORS_Y_SHIFT); r300->dirty_state |= R300_NEW_SCISSOR; } diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 392c7d318d..8c6b336aac 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -54,7 +54,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } - BEGIN_CS(158 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); + BEGIN_CS(161 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); @@ -189,10 +189,16 @@ static void r300_surface_fill(struct pipe_context* pipe, R300_PS_UCP_MODE_CLIP_AS_TRIFAN); } + /* The size of the point we're about to draw, in sixths of pixels */ OUT_CS_REG(R300_GA_POINT_SIZE, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); + /* Pixel scissors */ + OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); + OUT_CS((x << R300_SCISSORS_X_SHIFT) | (y << R300_SCISSORS_Y_SHIFT)); + OUT_CS((w << R300_SCISSORS_X_SHIFT) | (h << R300_SCISSORS_Y_SHIFT)); + /* RS block setup */ if (caps->is_r500) { /* XXX We seem to be in disagreement about how many of these we have -- cgit v1.2.3 From 96b19195ecf25d2fd54031befba431515075494a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 15 Feb 2009 09:25:22 -0700 Subject: cell: combine eval_z(), eval_w() functions --- src/gallium/drivers/cell/spu/spu_tri.c | 47 +++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c index 0d9fcb9997..9ccae2269a 100644 --- a/src/gallium/drivers/cell/spu/spu_tri.c +++ b/src/gallium/drivers/cell/spu/spu_tri.c @@ -212,31 +212,37 @@ eval_coeff_soa(uint slot, float x, float y, vector float w, vector float result[ } -/** Evalute coefficients to get Z for four pixels in a quad */ static INLINE vector float -eval_z(float x, float y) +splatz(vector float v) { - const uint slot = 0; - const float dzdx = spu_extract(setup.coef[slot].dadx, 2); - const float dzdy = spu_extract(setup.coef[slot].dady, 2); - const float topLeft = spu_extract(setup.coef[slot].a0, 2) + x * dzdx + y * dzdy; - const vector float topLeftv = spu_splats(topLeft); - const vector float derivs = (vector float) { 0.0, dzdx, dzdy, dzdx + dzdy }; - return spu_add(topLeftv, derivs); + return spu_splats(spu_extract(v, 2)); } -/** Evalute coefficients to get W for four pixels in a quad */ static INLINE vector float -eval_w(float x, float y) +splatw(vector float v) { - const uint slot = 0; - const float dwdx = spu_extract(setup.coef[slot].dadx, 3); - const float dwdy = spu_extract(setup.coef[slot].dady, 3); - const float topLeft = spu_extract(setup.coef[slot].a0, 3) + x * dwdx + y * dwdy; - const vector float topLeftv = spu_splats(topLeft); - const vector float derivs = (vector float) { 0.0, dwdx, dwdy, dwdx + dwdy }; - return spu_add(topLeftv, derivs); + return spu_splats(spu_extract(v, 3)); +} + + +/** + * Compute quad's Z and W vectors for the quad at (x,y). + */ +static INLINE void +eval_zw(float x, float y, vector float *zOut, vector float *wOut) +{ + static const vector float fragX = (const vector float) { 0.0, 1.0, 0.0, 1.0 }; + static const vector float fragY = (const vector float) { 0.0, 0.0, 1.0, 1.0 }; + const uint slot = 0; /* vertex position attribute */ + const vector float pos = setup.coef[slot].a0; + const vector float dposdx = setup.coef[slot].dadx; + const vector float dposdy = setup.coef[slot].dady; + const vector float xVec = spu_splats(x) + fragX; + const vector float yVec = spu_splats(y) + fragY; + + *zOut = splatz(pos) + xVec * splatz(dposdx) + yVec * splatz(dposdy); + *wOut = splatw(pos) + xVec * splatw(dposdx) + yVec * splatw(dposdy); } @@ -262,10 +268,11 @@ emit_quad( int x, int y, mask_t mask) * Run fragment shader, execute per-fragment ops, update fb/tile. */ vector float inputs[4*4], outputs[2*4]; - vector float fragZ = eval_z((float) x, (float) y); - vector float fragW = eval_w((float) x, (float) y); + vector float fragZ, fragW; vector unsigned int kill_mask; + eval_zw((float) x, (float) y, &fragZ, &fragW); + /* setup inputs */ #if 0 eval_coeff_soa(1, (float) x, (float) y, fragW, inputs); -- cgit v1.2.3 From 37c4f7eed2e8e31fbc847c486be4095635745a9c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 15 Feb 2009 12:08:02 -0700 Subject: cell: new/tighter code for computing fragment program inputs --- src/gallium/drivers/cell/spu/spu_tri.c | 167 +++++++++++++++------------------ 1 file changed, 76 insertions(+), 91 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c index 9ccae2269a..04e4584b25 100644 --- a/src/gallium/drivers/cell/spu/spu_tri.c +++ b/src/gallium/drivers/cell/spu/spu_tri.c @@ -29,7 +29,6 @@ * Triangle rendering within a tile. */ -#include #include "pipe/p_compiler.h" #include "pipe/p_format.h" #include "util/u_math.h" @@ -71,6 +70,12 @@ struct vertex_header { #define MASK_ALL 0xf +#define CHAN0 0 +#define CHAN1 1 +#define CHAN2 2 +#define CHAN3 3 + + #define DEBUG_VERTS 0 /** @@ -144,105 +149,94 @@ struct setup_stage { static struct setup_stage setup; -/** - * Evaluate attribute coefficients (plane equations) to compute - * attribute values for the four fragments in a quad. - * Eg: four colors will be computed (in AoS format). - */ -static INLINE void -eval_coeff(uint slot, float x, float y, vector float w, vector float result[4]) +static INLINE vector float +splatx(vector float v) { - switch (spu.vertex_info.attrib[slot].interp_mode) { - case INTERP_CONSTANT: - result[QUAD_TOP_LEFT] = - result[QUAD_TOP_RIGHT] = - result[QUAD_BOTTOM_LEFT] = - result[QUAD_BOTTOM_RIGHT] = setup.coef[slot].a0; - break; - case INTERP_LINEAR: - { - vector float dadx = setup.coef[slot].dadx; - vector float dady = setup.coef[slot].dady; - vector float topLeft = - spu_add(setup.coef[slot].a0, - spu_add(spu_mul(spu_splats(x), dadx), - spu_mul(spu_splats(y), dady))); - - result[QUAD_TOP_LEFT] = topLeft; - result[QUAD_TOP_RIGHT] = spu_add(topLeft, dadx); - result[QUAD_BOTTOM_LEFT] = spu_add(topLeft, dady); - result[QUAD_BOTTOM_RIGHT] = spu_add(spu_add(topLeft, dadx), dady); - } - break; - case INTERP_PERSPECTIVE: - { - vector float dadx = setup.coef[slot].dadx; - vector float dady = setup.coef[slot].dady; - vector float topLeft = - spu_add(setup.coef[slot].a0, - spu_add(spu_mul(spu_splats(x), dadx), - spu_mul(spu_splats(y), dady))); - - vector float wInv = spu_re(w); /* 1.0 / w */ - - result[QUAD_TOP_LEFT] = spu_mul(topLeft, wInv); - result[QUAD_TOP_RIGHT] = spu_mul(spu_add(topLeft, dadx), wInv); - result[QUAD_BOTTOM_LEFT] = spu_mul(spu_add(topLeft, dady), wInv); - result[QUAD_BOTTOM_RIGHT] = spu_mul(spu_add(spu_add(topLeft, dadx), dady), wInv); - } - break; - case INTERP_POS: - case INTERP_NONE: - break; - default: - ASSERT(0); - } + return spu_splats(spu_extract(v, CHAN0)); } - -/** - * As above, but return 4 vectors in SOA format. - * XXX this will all be re-written someday. - */ -static INLINE void -eval_coeff_soa(uint slot, float x, float y, vector float w, vector float result[4]) +static INLINE vector float +splaty(vector float v) { - eval_coeff(slot, x, y, w, result); - _transpose_matrix4x4(result, result); + return spu_splats(spu_extract(v, CHAN1)); } - static INLINE vector float splatz(vector float v) { - return spu_splats(spu_extract(v, 2)); + return spu_splats(spu_extract(v, CHAN2)); } - static INLINE vector float splatw(vector float v) { - return spu_splats(spu_extract(v, 3)); + return spu_splats(spu_extract(v, CHAN3)); } /** - * Compute quad's Z and W vectors for the quad at (x,y). + * Setup fragment shader inputs by evaluating triangle's vertex + * attribute coefficient info. + * \param x quad x pos + * \param y quad y pos + * \param fragZ returns quad Z values + * \param fragInputs returns fragment program inputs + * Note: this code could be incorporated into the fragment program + * itself to avoid the loop and switch. */ -static INLINE void -eval_zw(float x, float y, vector float *zOut, vector float *wOut) +static void +eval_inputs(float x, float y, vector float *fragZ, vector float fragInputs[]) { - static const vector float fragX = (const vector float) { 0.0, 1.0, 0.0, 1.0 }; - static const vector float fragY = (const vector float) { 0.0, 0.0, 1.0, 1.0 }; - const uint slot = 0; /* vertex position attribute */ - const vector float pos = setup.coef[slot].a0; - const vector float dposdx = setup.coef[slot].dadx; - const vector float dposdy = setup.coef[slot].dady; - const vector float xVec = spu_splats(x) + fragX; - const vector float yVec = spu_splats(y) + fragY; - - *zOut = splatz(pos) + xVec * splatz(dposdx) + yVec * splatz(dposdy); - *wOut = splatw(pos) + xVec * splatw(dposdx) + yVec * splatw(dposdy); + static const vector float deltaX = (const vector float) {0, 1, 0, 1}; + static const vector float deltaY = (const vector float) {0, 0, 1, 1}; + + const uint posSlot = 0; + const vector float pos = setup.coef[posSlot].a0; + const vector float dposdx = setup.coef[posSlot].dadx; + const vector float dposdy = setup.coef[posSlot].dady; + const vector float fragX = spu_splats(x) + deltaX; + const vector float fragY = spu_splats(y) + deltaY; + vector float fragW, wInv; + uint i; + + *fragZ = splatz(pos) + fragX * splatz(dposdx) + fragY * splatz(dposdy); + fragW = splatw(pos) + fragX * splatw(dposdx) + fragY * splatw(dposdy); + wInv = spu_re(fragW); /* 1 / w */ + + /* loop over fragment program inputs */ + for (i = 0; i < spu.vertex_info.num_attribs; i++) { + uint attr = i + 1; + enum interp_mode interp = spu.vertex_info.attrib[attr].interp_mode; + + /* constant term */ + vector float a0 = setup.coef[attr].a0; + vector float r0 = splatx(a0); + vector float r1 = splaty(a0); + vector float r2 = splatz(a0); + vector float r3 = splatw(a0); + + if (interp == INTERP_LINEAR || interp == INTERP_PERSPECTIVE) { + /* linear term */ + vector float dadx = setup.coef[attr].dadx; + vector float dady = setup.coef[attr].dady; + r0 += fragX * splatx(dadx) + fragY * splatx(dady); + r1 += fragX * splaty(dadx) + fragY * splaty(dady); + r2 += fragX * splatz(dadx) + fragY * splatz(dady); + r3 += fragX * splatw(dadx) + fragY * splatw(dady); + if (interp == INTERP_PERSPECTIVE) { + /* perspective term */ + r0 *= wInv; + r1 *= wInv; + r2 *= wInv; + r3 *= wInv; + } + } + fragInputs[CHAN0] = r0; + fragInputs[CHAN1] = r1; + fragInputs[CHAN2] = r2; + fragInputs[CHAN3] = r3; + fragInputs += 4; + } } @@ -268,20 +262,11 @@ emit_quad( int x, int y, mask_t mask) * Run fragment shader, execute per-fragment ops, update fb/tile. */ vector float inputs[4*4], outputs[2*4]; - vector float fragZ, fragW; vector unsigned int kill_mask; + vector float fragZ; - eval_zw((float) x, (float) y, &fragZ, &fragW); + eval_inputs((float) x, (float) y, &fragZ, inputs); - /* setup inputs */ -#if 0 - eval_coeff_soa(1, (float) x, (float) y, fragW, inputs); -#else - uint i; - for (i = 0; i < spu.vertex_info.num_attribs; i++) { - eval_coeff_soa(i+1, (float) x, (float) y, fragW, inputs + i * 4); - } -#endif ASSERT(spu.fragment_program); ASSERT(spu.fragment_ops); -- cgit v1.2.3 From 9576ddd97d463273978cdc530accc04c5d701966 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 15 Feb 2009 12:08:47 -0700 Subject: cell: minor Makefile clean-up --- src/gallium/drivers/cell/spu/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/spu/Makefile b/src/gallium/drivers/cell/spu/Makefile index 116453b79c..3cc52301da 100644 --- a/src/gallium/drivers/cell/spu/Makefile +++ b/src/gallium/drivers/cell/spu/Makefile @@ -33,9 +33,10 @@ OLD_SOURCES = \ spu_vertex_shader.c -SPU_OBJECTS = $(SOURCES:.c=.o) \ +SPU_OBJECTS = $(SOURCES:.c=.o) + +SPU_ASM_OUT = $(SOURCES:.c=.s) -SPU_ASM_OUT = $(SOURCES:.c=.s) \ INCLUDE_DIRS = \ -I$(TOP)/src/mesa \ -- cgit v1.2.3 From 82722a75c5d55bb8a553b525b4a1e481a7044718 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Feb 2009 02:52:47 -0800 Subject: r300-gallium: Add SC_CLIP_RULE to clear. This is a register that is in r300_demo but not r300_surface, so adding it in to see if it helps. --- src/gallium/drivers/r300/r300_surface.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 8c6b336aac..0a4710151a 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -194,6 +194,9 @@ static void r300_surface_fill(struct pipe_context* pipe, ((h * 6) & R300_POINTSIZE_Y_MASK) | ((w * 6) << R300_POINTSIZE_X_SHIFT)); + /* XXX */ + OUT_CS_REG(R300_SC_CLIP_RULE, 0xaaaa); + /* Pixel scissors */ OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); OUT_CS((x << R300_SCISSORS_X_SHIFT) | (y << R300_SCISSORS_Y_SHIFT)); -- cgit v1.2.3 From 1b77138a1effe2e18a9ce9e16c43852ff855a7be Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Feb 2009 02:53:34 -0800 Subject: r300-gallium: Add draw_arrays and friends. This is the last bit of Gallium-side plumbing for drawing things. From this point on, the only missing parts should be in r3xx-specific code areas... --- src/gallium/drivers/r300/r300_context.c | 76 +++++++++++++++++++++++++++++- src/gallium/drivers/r300/r300_context.h | 36 ++++++++++---- src/gallium/drivers/r300/r300_emit.c | 2 +- src/gallium/drivers/r300/r300_state.c | 28 ++++++++++- src/gallium/drivers/r300/r300_swtcl_emit.c | 20 ++++---- 5 files changed, 138 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 7b605ae87a..37dc9e86d6 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -22,6 +22,76 @@ #include "r300_context.h" +static boolean r300_draw_range_elements(struct pipe_context* pipe, + struct pipe_buffer* indexBuffer, + unsigned indexSize, + unsigned minIndex, + unsigned maxIndex, + unsigned mode, + unsigned start, + unsigned count) +{ + struct r300_context* r300 = r300_context(pipe); + int i; + + if (r300->dirty_state) { + r300_update_derived_state(r300); + r300_emit_dirty_state(r300); + } + + for (i = 0; i < r300->vertex_buffer_count; i++) { + void* buf = pipe_buffer_map(pipe->screen, + r300->vertex_buffers[i].buffer, + PIPE_BUFFER_USAGE_CPU_READ); + draw_set_mapped_vertex_buffer(r300->draw, i, buf); + } + + if (indexBuffer) { + void* indices = pipe_buffer_map(pipe->screen, indexBuffer, + PIPE_BUFFER_USAGE_CPU_READ); + draw_set_mapped_element_buffer_range(r300->draw, indexSize, + minIndex, maxIndex, indices); + } else { + draw_set_mapped_element_buffer(r300->draw, 0, NULL); + } + + draw_set_mapped_constant_buffer(r300->draw, + r300->shader_constants[PIPE_SHADER_VERTEX].constants, + r300->shader_constants[PIPE_SHADER_VERTEX].user_count * + (sizeof(float) * 4)); + + /* Abandon all hope, ye who enter here. */ + draw_arrays(r300->draw, mode, start, count); + + for (i = 0; i < r300->vertex_buffer_count; i++) { + pipe_buffer_unmap(pipe->screen, r300->vertex_buffers[i].buffer); + draw_set_mapped_vertex_buffer(r300->draw, i, NULL); + } + + if (indexBuffer) { + pipe_buffer_unmap(pipe->screen, indexBuffer); + draw_set_mapped_element_buffer_range(r300->draw, 0, start, + start + count - 1, NULL); + } + + return true; +} + +static boolean r300_draw_elements(struct pipe_context* pipe, + struct pipe_buffer* indexBuffer, + unsigned indexSize, unsigned mode, + unsigned start, unsigned count) +{ + return r300_draw_range_elements(pipe, indexBuffer, indexSize, 0, ~0, + mode, start, count); +} + +static boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode, + unsigned start, unsigned count) +{ + return r300_draw_elements(pipe, NULL, 0, mode, start, count); +} + static void r300_destroy_context(struct pipe_context* context) { struct r300_context* r300 = r300_context(context); @@ -49,8 +119,12 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.clear = r300_clear; + r300->context.draw_arrays = r300_draw_arrays; + r300->context.draw_elements = r300_draw_elements; + r300->context.draw_range_elements = r300_draw_range_elements; + r300->draw = draw_create(); - /*XXX draw_set_rasterize_stage(r300->draw, r300_draw_swtcl_stage(r300));*/ + draw_set_rasterize_stage(r300->draw, r300_draw_swtcl_stage(r300)); r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state); r300->scissor_state = CALLOC_STRUCT(r300_scissor_state); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index caedbb8448..53e41bf76d 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -88,20 +88,31 @@ struct r300_texture_state { #define R300_NEW_BLEND 0x0000001 #define R300_NEW_BLEND_COLOR 0x0000002 -#define R300_NEW_DSA 0x0000004 -#define R300_NEW_FRAMEBUFFERS 0x0000008 -#define R300_NEW_FRAGMENT_SHADER 0x0000010 -#define R300_NEW_RASTERIZER 0x0000020 -#define R300_NEW_SAMPLER 0x0000040 -#define R300_NEW_SCISSOR 0x0004000 -#define R300_NEW_TEXTURE 0x0008000 -#define R300_NEW_VERTEX_FORMAT 0x0800000 -#define R300_NEW_VERTEX_SHADER 0x1000000 -#define R300_NEW_KITCHEN_SINK 0x1ffffff +#define R300_NEW_CONSTANTS 0x0000004 +#define R300_NEW_DSA 0x0000008 +#define R300_NEW_FRAMEBUFFERS 0x0000010 +#define R300_NEW_FRAGMENT_SHADER 0x0000020 +#define R300_NEW_RASTERIZER 0x0000040 +#define R300_NEW_SAMPLER 0x0000080 +#define R300_NEW_SCISSOR 0x0008000 +#define R300_NEW_TEXTURE 0x0010000 +#define R300_NEW_VERTEX_FORMAT 0x1000000 +#define R300_NEW_VERTEX_SHADER 0x2000000 +#define R300_NEW_KITCHEN_SINK 0x3ffffff /* The next several objects are not pure Radeon state; they inherit from * various Gallium classes. */ +struct r300_constant_buffer { + /* Buffer of constants */ + /* XXX first number should be raised */ + float constants[8][4]; + /* Number of user-defined constants */ + int user_count; + /* Total number of constants */ + int count; +}; + struct r3xx_fragment_shader { /* Parent class */ struct pipe_shader_state state; @@ -188,6 +199,8 @@ struct r300_context { struct r300_blend_state* blend_state; /* Blend color state. */ struct r300_blend_color_state* blend_color_state; + /* Shader constants. */ + struct r300_constant_buffer shader_constants[PIPE_SHADER_TYPES]; /* Depth, stencil, and alpha state. */ struct r300_dsa_state* dsa_state; /* Fragment shader. */ @@ -205,6 +218,9 @@ struct r300_context { struct r300_texture* textures[8]; struct r300_texture_state* texture_states[8]; int texture_count; + /* Vertex buffers. */ + struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS]; + int vertex_buffer_count; /* Vertex information. */ struct vertex_info vertex_info; /* Bitmask of dirty state objects. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index cfc70362cc..32c9681d2b 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -219,7 +219,7 @@ void r300_emit_scissor_state(struct r300_context* r300, } /* Emit all dirty state. */ -static void r300_emit_dirty_state(struct r300_context* r300) +void r300_emit_dirty_state(struct r300_context* r300) { struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 6ecd61e3a2..559844f9b4 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -22,7 +22,9 @@ #include "util/u_math.h" #include "util/u_pack_color.h" + #include "pipe/p_debug.h" +#include "pipe/internal/p_winsys_screen.h" #include "r300_context.h" #include "r300_reg.h" @@ -211,7 +213,24 @@ static void uint shader, uint index, const struct pipe_constant_buffer* buffer) { - /* XXX */ + struct r300_context* r300 = r300_context(pipe); + + /* This entire chunk of code seems ever-so-slightly baked. + * It's as if I've got pipe_buffer* matryoshkas... */ + if (buffer && buffer->buffer && buffer->buffer->size) { + void* map = pipe->winsys->buffer_map(pipe->winsys, buffer->buffer, + PIPE_BUFFER_USAGE_CPU_READ); + memcpy(r300->shader_constants[shader].constants, + map, buffer->buffer->size); + pipe->winsys->buffer_unmap(pipe->winsys, map); + + r300->shader_constants[shader].user_count = + buffer->buffer->size / (sizeof(float) * 4); + } else { + r300->shader_constants[shader].user_count = 0; + } + + r300->dirty_state |= R300_NEW_CONSTANTS; } static uint32_t translate_depth_stencil_function(int zs_func) { @@ -738,7 +757,12 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, const struct pipe_vertex_buffer* buffers) { struct r300_context* r300 = r300_context(pipe); - /* XXX Draw */ + + memcpy(r300->vertex_buffers, buffers, + sizeof(struct pipe_vertex_buffer) * count); + + r300->vertex_buffer_count = count; + draw_flush(r300->draw); draw_set_vertex_buffers(r300->draw, count, buffers); } diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c index e51ac2c28d..ca078d63e0 100644 --- a/src/gallium/drivers/r300/r300_swtcl_emit.c +++ b/src/gallium/drivers/r300/r300_swtcl_emit.c @@ -54,22 +54,22 @@ static INLINE void r300_emit_vertex(struct r300_context* r300, j = vinfo->attrib[i].src_index; switch (vinfo->attrib[i].emit) { case EMIT_1F: - CS_OUT_32F(vertex->data[j][0]); + OUT_CS_32F(vertex->data[j][0]); break; case EMIT_2F: - CS_OUT_32F(vertex->data[j][0]); - CS_OUT_32F(vertex->data[j][1]); + OUT_CS_32F(vertex->data[j][0]); + OUT_CS_32F(vertex->data[j][1]); break; case EMIT_3F: - CS_OUT_32F(vertex->data[j][0]); - CS_OUT_32F(vertex->data[j][1]); - CS_OUT_32F(vertex->data[j][2]); + OUT_CS_32F(vertex->data[j][0]); + OUT_CS_32F(vertex->data[j][1]); + OUT_CS_32F(vertex->data[j][2]); break; case EMIT_4F: - CS_OUT_32F(vertex->data[j][0]); - CS_OUT_32F(vertex->data[j][1]); - CS_OUT_32F(vertex->data[j][2]); - CS_OUT_32F(vertex->data[j][3]); + OUT_CS_32F(vertex->data[j][0]); + OUT_CS_32F(vertex->data[j][1]); + OUT_CS_32F(vertex->data[j][2]); + OUT_CS_32F(vertex->data[j][3]); break; default: debug_printf("r300: Unknown emit value %d\n", -- cgit v1.2.3 From b16d4399892dbf8ab2c72a60b46bbc03ee5cd9a6 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Feb 2009 03:03:28 -0800 Subject: r300-gallium: Include-guard r300_emit.h --- src/gallium/drivers/r300/r300_emit.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 7642cfb39e..f21ca33171 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -20,6 +20,9 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef R300_EMIT_H +#define R300_EMIT_H + #include "util/u_math.h" #include "r300_context.h" @@ -48,3 +51,9 @@ void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs); void r300_emit_scissor_state(struct r300_context* r300, struct r300_scissor_state* scissor); + + +/* Emit all dirty state. */ +void r300_emit_dirty_state(struct r300_context* r300); + +#endif /* R300_EMIT_H */ -- cgit v1.2.3 From 18f20b70b15f5daed28eb9f4fce1eccd46cf82d3 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Feb 2009 03:13:16 -0800 Subject: r300-gallium: Ooops, forgot to apply this stash. "git stash": The cause of, and solution to, all my problems. --- src/gallium/drivers/r300/r300_state_derived.c | 20 ++++++++++++++++++++ src/gallium/drivers/r300/r300_state_derived.h | 2 ++ 2 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index fc2730d4c6..df19f20fc8 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -107,8 +107,28 @@ static void r300_update_vertex_layout(struct r300_context* r300) vinfo.hwfmt[1] |= (4 << (3 * i)); } + draw_compute_vertex_size(&vinfo); + if (memcmp(&r300->vertex_info, &vinfo, sizeof(struct vertex_info))) { memcpy(&r300->vertex_info, &vinfo, sizeof(struct vertex_info)); r300->dirty_state |= R300_NEW_VERTEX_FORMAT; } } + +/* Set up the RS block. This is the part of the chipset that actually does + * the rasterization of vertices into fragments. This is also the part of the + * chipset that locks up if any part of it is even slightly wrong. */ +void r300_update_rs_block(struct r300_context* r300) +{ +} + +void r300_update_derived_state(struct r300_context* r300) +{ + if (r300->dirty_state & R300_NEW_FRAGMENT_SHADER) { + r300_update_vertex_layout(r300); + } + + if (r300->dirty_state & R300_NEW_VERTEX_FORMAT) { + r300_update_rs_block(r300); + } +} diff --git a/src/gallium/drivers/r300/r300_state_derived.h b/src/gallium/drivers/r300/r300_state_derived.h index 11d0787d12..72ba6b928d 100644 --- a/src/gallium/drivers/r300/r300_state_derived.h +++ b/src/gallium/drivers/r300/r300_state_derived.h @@ -28,4 +28,6 @@ #include "r300_context.h" #include "r300_reg.h" +void r300_update_derived_state(struct r300_context* r300); + #endif /* R300_STATE_DERIVED_H */ -- cgit v1.2.3 From 63b51b5cf17ddde09b72a2811296f37b9a4c5ad2 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Mon, 16 Feb 2009 11:44:40 +0000 Subject: dri2: support glXWaitX & glXWaitGL by using fake front buffer. --- src/glx/x11/dri2_glx.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ src/glx/x11/dri_glx.c | 2 ++ src/glx/x11/glxclient.h | 2 ++ src/glx/x11/glxcmds.c | 24 +++++++++++++++----- 4 files changed, 81 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index b878f05dda..776a14f614 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -77,6 +77,9 @@ struct __GLXDRIdrawablePrivateRec { int bufferCount; int width, height; unsigned long configureSeqno; + int have_back; + int have_front; + int have_fake_front; }; static void dri2DestroyContext(__GLXDRIcontext *context, @@ -196,6 +199,10 @@ static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw, XRectangle xrect; XserverRegion region; + /* Check we have the right attachments */ + if (!(priv->have_front && priv->have_back)) + return; + xrect.x = x; xrect.y = priv->height - y - height; xrect.width = width; @@ -214,6 +221,47 @@ static void dri2SwapBuffers(__GLXDRIdrawable *pdraw) dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height); } +static void dri2WaitX(__GLXDRIdrawable *pdraw) +{ + __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; + XRectangle xrect; + XserverRegion region; + + /* Check we have the right attachments */ + if (!(priv->have_fake_front && priv->have_front)) + return; + + xrect.x = 0; + xrect.y = 0; + xrect.width = priv->width; + xrect.height = priv->height; + + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); + DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, + DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); + XFixesDestroyRegion(pdraw->psc->dpy, region); +} + +static void dri2WaitGL(__GLXDRIdrawable *pdraw) +{ + __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; + XRectangle xrect; + XserverRegion region; + + if (!(priv->have_fake_front && priv->have_front)) + return; + + xrect.x = 0; + xrect.y = 0; + xrect.width = priv->width; + xrect.height = priv->height; + + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); + DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, + DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); + XFixesDestroyRegion(pdraw->psc->dpy, region); +} + static void dri2DestroyScreen(__GLXscreenConfigs *psc) { /* Free the direct rendering per screen data */ @@ -261,6 +309,9 @@ dri2GetBuffers(__DRIdrawable *driDrawable, pdraw->width = *width; pdraw->height = *height; pdraw->bufferCount = *out_count; + pdraw->have_front = 0; + pdraw->have_fake_front = 0; + pdraw->have_back = 0; /* This assumes the DRI2 buffer attachment tokens matches the * __DRIbuffer tokens. */ @@ -270,6 +321,12 @@ dri2GetBuffers(__DRIdrawable *driDrawable, pdraw->buffers[i].pitch = buffers[i].pitch; pdraw->buffers[i].cpp = buffers[i].cpp; pdraw->buffers[i].flags = buffers[i].flags; + if (pdraw->buffers[i].attachment == __DRI_BUFFER_FRONT_LEFT) + pdraw->have_front = 1; + if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT) + pdraw->have_fake_front = 1; + if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT) + pdraw->have_back = 1; } Xfree(buffers); @@ -366,6 +423,8 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, psp->createContext = dri2CreateContext; psp->createDrawable = dri2CreateDrawable; psp->swapBuffers = dri2SwapBuffers; + psp->waitGL = dri2WaitGL; + psp->waitX = dri2WaitX; /* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always * available.*/ diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 44724d2c7d..3089aa1728 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -655,6 +655,8 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, psp->createContext = driCreateContext; psp->createDrawable = driCreateDrawable; psp->swapBuffers = driSwapBuffers; + psp->waitX = NULL; + psp->waitGL = NULL; return psp; } diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 9332eb64d3..3e70759a6c 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -139,6 +139,8 @@ struct __GLXDRIscreenRec { void (*swapBuffers)(__GLXDRIdrawable *pdraw); void (*copySubBuffer)(__GLXDRIdrawable *pdraw, int x, int y, int width, int height); + void (*waitX)(__GLXDRIdrawable *pdraw); + void (*waitGL)(__GLXDRIdrawable *pdraw); }; struct __GLXDRIcontextRec { diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index c68b6ac4ef..fc0e593cb3 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -611,11 +611,15 @@ PUBLIC void glXWaitGL(void) #ifdef GLX_DIRECT_RENDERING if (gc->driContext) { -/* This bit of ugliness unwraps the glFinish function */ -#ifdef glFinish -#undef glFinish -#endif - glFinish(); + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen); + + if ( pdraw != NULL ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + glFlush(); + if (psc->driScreen->waitGL != NULL) + (*psc->driScreen->waitGL)(pdraw); + } return; } #endif @@ -647,7 +651,15 @@ PUBLIC void glXWaitX(void) #ifdef GLX_DIRECT_RENDERING if (gc->driContext) { - XSync(dpy, False); + int screen; + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen); + + if ( pdraw != NULL ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + if (psc->driScreen->waitX != NULL) + (*psc->driScreen->waitX)(pdraw); + } else + XSync(dpy, False); return; } #endif -- cgit v1.2.3 From 1bb2fb498ee65ba29aa4098983116be3d81cc2da Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Feb 2009 03:33:56 -0800 Subject: r300-gallium: Set up draw rasterizer. --- src/gallium/drivers/r300/r300_context.h | 3 +++ src/gallium/drivers/r300/r300_state.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 53e41bf76d..a3727c8fb4 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -59,6 +59,9 @@ struct r300_dsa_state { }; struct r300_rs_state { + /* XXX icky as fucking hell */ + struct pipe_rasterizer_state rs; + uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */ uint32_t point_size; /* R300_GA_POINT_SIZE: 0x421c */ uint32_t line_control; /* R300_GA_LINE_CNTL: 0x4234 */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 559844f9b4..eae1a5698d 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -222,7 +222,7 @@ static void PIPE_BUFFER_USAGE_CPU_READ); memcpy(r300->shader_constants[shader].constants, map, buffer->buffer->size); - pipe->winsys->buffer_unmap(pipe->winsys, map); + pipe->winsys->buffer_unmap(pipe->winsys, buffer->buffer); r300->shader_constants[shader].user_count = buffer->buffer->size / (sizeof(float) * 4); @@ -542,6 +542,8 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->line_stipple_value = state->line_stipple_pattern; } + rs->rs = *state; + return (void*)rs; } @@ -549,8 +551,11 @@ static void* r300_create_rs_state(struct pipe_context* pipe, static void r300_bind_rs_state(struct pipe_context* pipe, void* state) { struct r300_context* r300 = r300_context(pipe); + struct r300_rs_state* rs = (struct r300_rs_state*)state; + + draw_set_rasterizer_state(r300->draw, &rs->rs); - r300->rs_state = (struct r300_rs_state*)state; + r300->rs_state = rs; r300->dirty_state |= R300_NEW_RASTERIZER; } -- cgit v1.2.3 From f211da4c67fbe0e67475efcd9535b9cf9e5ae467 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Feb 2009 03:55:16 -0800 Subject: r300-gallium: Fix BEGIN_CS and END_CS counting and mismatch. --- src/gallium/drivers/r300/r300_emit.c | 3 ++- src/gallium/drivers/r300/r300_surface.c | 2 +- src/gallium/drivers/r300/r300_swtcl_emit.c | 5 +---- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 32c9681d2b..a2819294a4 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -194,7 +194,7 @@ void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs) struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen; CS_LOCALS(r300); - BEGIN_CS(14); + BEGIN_CS(13); OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status); OUT_CS_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 6); OUT_CS(rs->depth_scale_front); @@ -216,6 +216,7 @@ void r300_emit_scissor_state(struct r300_context* r300, OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); OUT_CS(scissor->scissor_top_left); OUT_CS(scissor->scissor_bottom_right); + END_CS; } /* Emit all dirty state. */ diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 0a4710151a..b2c4f4251d 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -54,7 +54,7 @@ static void r300_surface_fill(struct pipe_context* pipe, return; } - BEGIN_CS(161 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); + BEGIN_CS(163 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2)); /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c index ca078d63e0..76ef48962b 100644 --- a/src/gallium/drivers/r300/r300_swtcl_emit.c +++ b/src/gallium/drivers/r300/r300_swtcl_emit.c @@ -48,8 +48,6 @@ static INLINE void r300_emit_vertex(struct r300_context* r300, CS_LOCALS(r300); uint i, j; - BEGIN_CS(vinfo->size); - for (i = 0; i < vinfo->num_attribs; i++) { j = vinfo->attrib[i].src_index; switch (vinfo->attrib[i].emit) { @@ -77,8 +75,6 @@ static INLINE void r300_emit_vertex(struct r300_context* r300, break; } } - - END_CS; } static INLINE void r300_emit_prim(struct draw_stage* draw, @@ -96,6 +92,7 @@ static INLINE void r300_emit_prim(struct draw_stage* draw, OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); OUT_CS(r300->vertex_info.hwfmt[0]); OUT_CS(r300->vertex_info.hwfmt[1]); + END_CS; BEGIN_CS(2 + (count * r300->vertex_info.size) + 2); OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, count)); -- cgit v1.2.3 From ffbe28d25d755bc51d9f865ac176a110f6f8f5e0 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Feb 2009 03:56:03 -0800 Subject: r300-gallium: Add verbosity level to debugging. Makes it a bit more manageable to read through the console logs. --- src/gallium/drivers/r300/r300_cs.h | 14 +++++++++----- src/gallium/drivers/r300/r300_cs_inlines.h | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 3049702a94..d8038ff1e1 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -34,6 +34,8 @@ #define MAX_CS_SIZE 64 * 1024 / 4 +#define VERY_VERBOSE_REGISTERS 0 + /* XXX stolen from radeon_drm.h */ #define RADEON_GEM_DOMAIN_CPU 0x1 #define RADEON_GEM_DOMAIN_GTT 0x2 @@ -75,8 +77,9 @@ } while (0) #define OUT_CS_REG(register, value) do { \ - debug_printf("r300: writing 0x%08X to register 0x%04X\n", \ - value, register); \ + if (VERY_VERBOSE_REGISTERS) \ + debug_printf("r300: writing 0x%08X to register 0x%04X\n", \ + value, register); \ assert(register); \ OUT_CS(CP_PACKET0(register, 0)); \ OUT_CS(value); \ @@ -85,8 +88,9 @@ /* Note: This expects count to be the number of registers, * not the actual packet0 count! */ #define OUT_CS_REG_SEQ(register, count) do { \ - debug_printf("r300: writing register sequence of %d to 0x%04X\n", \ - count, register); \ + if (VERY_VERBOSE_REGISTERS) \ + debug_printf("r300: writing register sequence of %d to 0x%04X\n", \ + count, register); \ assert(register); \ OUT_CS(CP_PACKET0(register, ((count) - 1))); \ } while (0) @@ -109,7 +113,7 @@ } while (0) #define FLUSH_CS do { \ - debug_printf("r300: FLUSH_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \ + debug_printf("r300: FLUSH_CS in %s (%s:%d)\n\n", __FUNCTION__, __FILE__, \ __LINE__); \ cs_winsys->flush_cs(cs); \ } while (0) diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h index db931fd485..03bb608eb9 100644 --- a/src/gallium/drivers/r300/r300_cs_inlines.h +++ b/src/gallium/drivers/r300/r300_cs_inlines.h @@ -29,8 +29,9 @@ #define RADEON_ONE_REG_WR (1 << 15) #define OUT_CS_ONE_REG(register, count) do { \ - debug_printf("r300: writing data sequence of %d to 0x%04X\n", \ - count, register); \ + if (VERY_VERBOSE_REGISTERS) \ + debug_printf("r300: writing data sequence of %d to 0x%04X\n", \ + count, register); \ assert(register); \ OUT_CS(CP_PACKET0(register, ((count) - 1)) | RADEON_ONE_REG_WR); \ } while (0) -- cgit v1.2.3 From c51938afe1626bfccfe38fe2f508bf90e58ca74c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Feb 2009 08:25:33 -0700 Subject: cell: use some SPU intrinsics to get slightly better code in eval_inputs() Suggested by Jonathan Adamczewski. There may be more places to do this... --- src/gallium/drivers/cell/spu/spu_tri.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c index 04e4584b25..d727268475 100644 --- a/src/gallium/drivers/cell/spu/spu_tri.c +++ b/src/gallium/drivers/cell/spu/spu_tri.c @@ -219,10 +219,13 @@ eval_inputs(float x, float y, vector float *fragZ, vector float fragInputs[]) /* linear term */ vector float dadx = setup.coef[attr].dadx; vector float dady = setup.coef[attr].dady; - r0 += fragX * splatx(dadx) + fragY * splatx(dady); - r1 += fragX * splaty(dadx) + fragY * splaty(dady); - r2 += fragX * splatz(dadx) + fragY * splatz(dady); - r3 += fragX * splatw(dadx) + fragY * splatw(dady); + /* Use SPU intrinsics here to get slightly better code. + * originally: r0 += fragX * splatx(dadx) + fragY * splatx(dady); + */ + r0 = spu_madd(fragX, splatx(dadx), spu_madd(fragY, splatx(dady), r0)); + r1 = spu_madd(fragX, splaty(dadx), spu_madd(fragY, splaty(dady), r1)); + r2 = spu_madd(fragX, splatz(dadx), spu_madd(fragY, splatz(dady), r2)); + r3 = spu_madd(fragX, splatw(dadx), spu_madd(fragY, splatw(dady), r3)); if (interp == INTERP_PERSPECTIVE) { /* perspective term */ r0 *= wInv; -- cgit v1.2.3 From 9d49802b7a3a1e292965098da41c459fabf84cc4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Feb 2009 08:25:57 -0700 Subject: glsl: silence some uninit var warnings --- src/mesa/shader/slang/slang_codegen.c | 2 +- src/mesa/shader/slang/slang_compile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 11340d26e2..cfdb868d6c 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3662,7 +3662,7 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper) if (lhs && rhs) { /* convert lhs swizzle into writemask */ const GLuint swizzle = root_swizzle(lhs->Store); - GLuint writemask, newSwizzle; + GLuint writemask, newSwizzle = 0x0; if (!swizzle_to_writemask(A, swizzle, &writemask, &newSwizzle)) { /* Non-simple writemask, need to swizzle right hand side in * order to put components into the right place. diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index cfed977905..ab848579b7 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -1450,7 +1450,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O, case OP_CALL: { GLboolean array_constructor = GL_FALSE; - GLint array_constructor_size; + GLint array_constructor_size = 0; op->type = SLANG_OPER_CALL; op->a_id = parse_identifier(C); -- cgit v1.2.3 From 0f4a91b50908ce4c1ae5fc65d73791608de30f06 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Mon, 16 Feb 2009 18:43:56 +0100 Subject: nouveau: oops :-) --- src/gallium/drivers/nv30/nv30_miptree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 510c94d4e6..b11ed8c24e 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -85,8 +85,8 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY | -+ PIPE_TEXTURE_USAGE_DISPLAY_TARGET | -+ PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) + PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC) -- cgit v1.2.3 From a9e753c84cc5acc2a89686a5e4109f3b056d4fb4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Feb 2009 11:45:57 -0700 Subject: i965: tell GLSL compiler to emit code using condition codes The default for EmitCondCodes got flipped when gallium-0.2 was merged. This fixes GLSL if/else/endif regressions. Drivers that use GLSL should always explicitly set the flag to be safe. --- src/mesa/drivers/dri/i965/brw_context.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index eaac6224f6..d96ff29310 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -121,6 +121,9 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, /* if conformance mode is set, swrast can handle any size AA point */ ctx->Const.MaxPointSizeAA = 255.0; + /* We want the GLSL compiler to emit code that uses condition codes */ + ctx->Shader.EmitCondCodes = GL_TRUE; + /* ctx->Const.MaxNativeVertexProgramTemps = 32; */ brw_init_state( brw ); -- cgit v1.2.3 From c5c383596ddb26cd75e4b355918ad16915283b59 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Feb 2009 11:50:05 -0700 Subject: mesa: remove old comments Note: the default value for EmitCondCodes is FALSE. This means the GLSL compiler will emit code like this: SEQ TEMP[0].x, A, B; IF TEMP[0].x; ... ENDIF But if EmitCondCodes is TRUE, condition codes will be used instead: SEQ.C TEMP[0].x, A, B; IF (NE.xxxx); ... ENDIF --- src/mesa/shader/shader_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 013e912e5d..38f4cd03c4 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -406,7 +406,7 @@ _mesa_init_shader_state(GLcontext * ctx) * are generated by the GLSL compiler. */ ctx->Shader.EmitHighLevelInstructions = GL_TRUE; - ctx->Shader.EmitCondCodes = GL_FALSE;/*GL_TRUE;*/ /* XXX probably want GL_FALSE... */ + ctx->Shader.EmitCondCodes = GL_FALSE; ctx->Shader.EmitComments = GL_FALSE; ctx->Shader.Flags = get_shader_flags(); } -- cgit v1.2.3