From b0fe0d8a550c5182b4cd964f8745a104343b7654 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 15 May 2007 13:42:25 -0700 Subject: Bring framebuffer_texture's error checking more in-line with the spec. --- src/mesa/main/fbobject.c | 129 ++++++++++++++++++++++------------------------- 1 file changed, 61 insertions(+), 68 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 58bcc24b32c..eac2f787171 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1144,20 +1144,19 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) * Common code called by glFramebufferTexture1D/2D/3DEXT(). */ static void -framebuffer_texture(GLuint dims, GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, +framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, + GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) { struct gl_renderbuffer_attachment *att; struct gl_texture_object *texObj = NULL; struct gl_framebuffer *fb; - GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); if (target != GL_FRAMEBUFFER_EXT) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%dDEXT(target)", dims); + "glFramebufferTexture%sEXT(target)", caller); return; } @@ -1167,83 +1166,53 @@ framebuffer_texture(GLuint dims, GLenum target, GLenum attachment, /* check framebuffer binding */ if (fb->Name == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%dDEXT", dims); + "glFramebufferTexture%sEXT", caller); return; } + + /* The textarget, level, and zoffset parameters are only validated if + * texture is non-zero. + */ if (texture) { - texObj = _mesa_lookup_texture(ctx, texture); - } + GLboolean err = GL_TRUE; - /* Check dimension-dependent things */ - switch (dims) { - case 1: - if (textarget != GL_TEXTURE_1D) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture1DEXT(textarget)"); - return; - } - if (texObj && texObj->Target != GL_TEXTURE_1D) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture1DEXT(texture target mismatch)"); - return; - } - break; - case 2: - if (textarget != GL_TEXTURE_2D && - textarget != GL_TEXTURE_RECTANGLE_ARB && - !IS_CUBE_FACE(textarget)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture2DEXT(textarget)"); - return; - } - if (texObj) { - if ((texObj->Target == GL_TEXTURE_2D && textarget != GL_TEXTURE_2D) || - (texObj->Target == GL_TEXTURE_RECTANGLE_ARB - && textarget != GL_TEXTURE_RECTANGLE_ARB) || - (texObj->Target == GL_TEXTURE_CUBE_MAP - && !IS_CUBE_FACE(textarget))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture1DEXT(texture target mismatch)"); - return; - } - } - break; - case 3: - if (textarget != GL_TEXTURE_3D) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture3DEXT(textarget)"); - return; + texObj = _mesa_lookup_texture(ctx, texture); + if (texObj != NULL) { + err = (texObj->Target == GL_TEXTURE_CUBE_MAP) + ? !IS_CUBE_FACE(textarget) + : (texObj->Target != textarget); } - if (texObj && texObj->Target != GL_TEXTURE_3D) { + + if (err) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture3DEXT(texture target mismatch)"); + "glFramebufferTexture%sEXT(texture target mismatch)", + caller); return; } - { + + if (texObj->Target == GL_TEXTURE_3D) { const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); if (zoffset < 0 || zoffset >= maxSize) { _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture3DEXT(zoffset)"); + "glFramebufferTexture%sEXT(zoffset)", + caller); return; } } - break; - default: - _mesa_problem(ctx, "Unexpected dims in error_check_framebuffer_texture"); - return; - } - if ((level < 0) || level >= _mesa_max_texture_levels(ctx, textarget)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%dDEXT(level)", dims); - return; + if ((level < 0) || + (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferTexture%sEXT(level)", caller); + return; + } } att = _mesa_get_attachment(ctx, fb, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%dDEXT(attachment)", dims); + "glFramebufferTexture%sEXT(attachment)", caller); return; } @@ -1271,9 +1240,16 @@ void GLAPIENTRY _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { - const GLint zoffset = 0; - framebuffer_texture(1, target, attachment, textarget, texture, - level, zoffset); + GET_CURRENT_CONTEXT(ctx); + + if ((texture != 0) && (textarget != GL_TEXTURE_1D)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferTexture1DEXT(textarget)"); + return; + } + + framebuffer_texture(ctx, "1D", target, attachment, textarget, texture, + level, 0); } @@ -1281,9 +1257,19 @@ void GLAPIENTRY _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { - const GLint zoffset = 0; - framebuffer_texture(2, target, attachment, textarget, texture, - level, zoffset); + GET_CURRENT_CONTEXT(ctx); + + if ((texture != 0) && + (textarget != GL_TEXTURE_2D) && + (textarget != GL_TEXTURE_RECTANGLE_ARB) && + (!IS_CUBE_FACE(textarget))) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTexture2DEXT(textarget)"); + return; + } + + framebuffer_texture(ctx, "2D", target, attachment, textarget, texture, + level, 0); } @@ -1292,12 +1278,19 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) { - framebuffer_texture(3, target, attachment, textarget, texture, + GET_CURRENT_CONTEXT(ctx); + + if ((texture != 0) && (textarget != GL_TEXTURE_3D)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferTexture3DEXT(textarget)"); + return; + } + + framebuffer_texture(ctx, "3D", target, attachment, textarget, texture, level, zoffset); } - void GLAPIENTRY _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbufferTarget, -- cgit v1.2.3 From bb372f1c9bc08e8b0dca983cb4ba36b2f2f039fb Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 16 May 2007 15:34:22 -0700 Subject: Initial implementation of MESA_texture_array Shadow sampling from texture arrays is still not implemented. Everything else should be there, though. --- src/mesa/drivers/dri/common/extension_helper.h | 14 + src/mesa/glapi/EXT_framebuffer_object.xml | 42 +- src/mesa/glapi/dispatch.h | 17 +- src/mesa/glapi/glapioffsets.h | 12 +- src/mesa/glapi/glapitable.h | 9 +- src/mesa/glapi/glapitemp.h | 24 +- src/mesa/glapi/glprocs.h | 552 +-- src/mesa/main/attrib.c | 12 + src/mesa/main/config.h | 3 + src/mesa/main/context.c | 11 + src/mesa/main/enable.c | 16 + src/mesa/main/enums.c | 5319 ++++++++++++------------ src/mesa/main/extensions.c | 2 + src/mesa/main/fbobject.c | 36 +- src/mesa/main/fbobject.h | 4 + src/mesa/main/get_gen.py | 6 + src/mesa/main/mipmap.c | 148 +- src/mesa/main/mtypes.h | 35 +- src/mesa/main/state.c | 5 + src/mesa/main/teximage.c | 152 +- src/mesa/main/texobj.c | 50 +- src/mesa/main/texrender.c | 45 +- src/mesa/main/texstate.c | 46 + src/mesa/shader/arbprogparse.c | 22 +- src/mesa/shader/arbprogram.syn | 21 +- src/mesa/shader/arbprogram_syn.h | 15 +- src/mesa/sparc/glapi_sparc.S | 6 +- src/mesa/swrast/s_texfilter.c | 811 +++- src/mesa/x86-64/glapi_x86-64.S | 63 +- src/mesa/x86/glapi_x86.S | 13 +- 30 files changed, 4434 insertions(+), 3077 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index c7984964255..10f75edaaa4 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -440,6 +440,13 @@ static const char Color4ubVertex3fvSUN_names[] = ""; #endif +#if defined(need_GL_EXT_texture_array) +static const char FramebufferTextureLayerEXT_names[] = + "iiiii\0" /* Parameter signature */ + "glFramebufferTextureLayerEXT\0" + ""; +#endif + #if defined(need_GL_SGIX_list_priority) static const char GetListParameterivSGIX_names[] = "iip\0" /* Parameter signature */ @@ -5479,6 +5486,13 @@ static const struct dri_extension_function GL_EXT_texture3D_functions[] = { }; #endif +#if defined(need_GL_EXT_texture_array) +static const struct dri_extension_function GL_EXT_texture_array_functions[] = { + { FramebufferTextureLayerEXT_names, FramebufferTextureLayerEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + #if defined(need_GL_EXT_texture_object) static const struct dri_extension_function GL_EXT_texture_object_functions[] = { { PrioritizeTextures_names, -1, 331 }, diff --git a/src/mesa/glapi/EXT_framebuffer_object.xml b/src/mesa/glapi/EXT_framebuffer_object.xml index d2a18b64240..66f250c003f 100644 --- a/src/mesa/glapi/EXT_framebuffer_object.xml +++ b/src/mesa/glapi/EXT_framebuffer_object.xml @@ -172,8 +172,7 @@ - + @@ -186,4 +185,43 @@ offset="assign"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index a128164323a..0ce59f7b99c 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -2362,6 +2362,9 @@ #define CALL_BlitFramebufferEXT(disp, parameters) (*((disp)->BlitFramebufferEXT)) parameters #define GET_BlitFramebufferEXT(disp) ((disp)->BlitFramebufferEXT) #define SET_BlitFramebufferEXT(disp, fn) ((disp)->BlitFramebufferEXT = fn) +#define CALL_FramebufferTextureLayerEXT(disp, parameters) (*((disp)->FramebufferTextureLayerEXT)) parameters +#define GET_FramebufferTextureLayerEXT(disp) ((disp)->FramebufferTextureLayerEXT) +#define SET_FramebufferTextureLayerEXT(disp, fn) ((disp)->FramebufferTextureLayerEXT = fn) #define CALL_ProgramEnvParameters4fvEXT(disp, parameters) (*((disp)->ProgramEnvParameters4fvEXT)) parameters #define GET_ProgramEnvParameters4fvEXT(disp) ((disp)->ProgramEnvParameters4fvEXT) #define SET_ProgramEnvParameters4fvEXT(disp, fn) ((disp)->ProgramEnvParameters4fvEXT = fn) @@ -2377,7 +2380,7 @@ #else -#define driDispatchRemapTable_size 364 +#define driDispatchRemapTable_size 365 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define AttachShader_remap_index 0 @@ -2740,10 +2743,11 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define IsRenderbufferEXT_remap_index 357 #define RenderbufferStorageEXT_remap_index 358 #define BlitFramebufferEXT_remap_index 359 -#define ProgramEnvParameters4fvEXT_remap_index 360 -#define ProgramLocalParameters4fvEXT_remap_index 361 -#define GetQueryObjecti64vEXT_remap_index 362 -#define GetQueryObjectui64vEXT_remap_index 363 +#define FramebufferTextureLayerEXT_remap_index 360 +#define ProgramEnvParameters4fvEXT_remap_index 361 +#define ProgramLocalParameters4fvEXT_remap_index 362 +#define GetQueryObjecti64vEXT_remap_index 363 +#define GetQueryObjectui64vEXT_remap_index 364 #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]) @@ -3825,6 +3829,9 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_BlitFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)), driDispatchRemapTable[BlitFramebufferEXT_remap_index], parameters) #define GET_BlitFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index]) #define SET_BlitFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index], fn) +#define CALL_FramebufferTextureLayerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], parameters) +#define GET_FramebufferTextureLayerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index]) +#define SET_FramebufferTextureLayerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], fn) #define CALL_ProgramEnvParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], parameters) #define GET_ProgramEnvParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]) #define SET_ProgramEnvParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], fn) diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index cb0d21083ef..c207a06ac46 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -800,11 +800,12 @@ #define _gloffset_IsRenderbufferEXT 765 #define _gloffset_RenderbufferStorageEXT 766 #define _gloffset_BlitFramebufferEXT 767 -#define _gloffset_ProgramEnvParameters4fvEXT 768 -#define _gloffset_ProgramLocalParameters4fvEXT 769 -#define _gloffset_GetQueryObjecti64vEXT 770 -#define _gloffset_GetQueryObjectui64vEXT 771 -#define _gloffset_FIRST_DYNAMIC 772 +#define _gloffset_FramebufferTextureLayerEXT 768 +#define _gloffset_ProgramEnvParameters4fvEXT 769 +#define _gloffset_ProgramLocalParameters4fvEXT 770 +#define _gloffset_GetQueryObjecti64vEXT 771 +#define _gloffset_GetQueryObjectui64vEXT 772 +#define _gloffset_FIRST_DYNAMIC 773 #else @@ -1168,6 +1169,7 @@ #define _gloffset_IsRenderbufferEXT driDispatchRemapTable[IsRenderbufferEXT_remap_index] #define _gloffset_RenderbufferStorageEXT driDispatchRemapTable[RenderbufferStorageEXT_remap_index] #define _gloffset_BlitFramebufferEXT driDispatchRemapTable[BlitFramebufferEXT_remap_index] +#define _gloffset_FramebufferTextureLayerEXT driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index] #define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index] #define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index] #define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 4af0c2d43b8..1e4c2949e46 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -809,10 +809,11 @@ struct _glapi_table GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 765 */ void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 766 */ void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 767 */ - void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */ - void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 769 */ - void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 770 */ - void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 771 */ + void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 768 */ + void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 769 */ + void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 770 */ + void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 771 */ + void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 772 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 62407968ccc..2a2fe2a35df 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -5416,30 +5416,35 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GL 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_ALT void KEYWORD2 NAME(_dispatch_stub_768)(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 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) { - DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); + 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_769)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(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_770)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(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_770)(GLuint id, GLenum pname, GLint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(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_771)(GLuint id, GLenum pname, GLuint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_772)(GLuint id, GLenum pname, GLuint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLuint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_772)(GLuint id, GLenum pname, GLuint64EXT * params) { DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } @@ -6226,10 +6231,11 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(IsRenderbufferEXT), TABLE_ENTRY(RenderbufferStorageEXT), TABLE_ENTRY(_dispatch_stub_767), - TABLE_ENTRY(_dispatch_stub_768), + TABLE_ENTRY(FramebufferTextureLayerEXT), TABLE_ENTRY(_dispatch_stub_769), TABLE_ENTRY(_dispatch_stub_770), TABLE_ENTRY(_dispatch_stub_771), + TABLE_ENTRY(_dispatch_stub_772), /* 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. diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index 190d9ed149b..b6651a6bf4b 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -820,6 +820,7 @@ static const char gl_string_table[] = "glIsRenderbufferEXT\0" "glRenderbufferStorageEXT\0" "glBlitFramebufferEXT\0" + "glFramebufferTextureLayerEXT\0" "glProgramEnvParameters4fvEXT\0" "glProgramLocalParameters4fvEXT\0" "glGetQueryObjecti64vEXT\0" @@ -1138,10 +1139,10 @@ static const char gl_string_table[] = #define gl_dispatch_stub_748 mgl_dispatch_stub_748 #define gl_dispatch_stub_749 mgl_dispatch_stub_749 #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 #define gl_dispatch_stub_771 mgl_dispatch_stub_771 +#define gl_dispatch_stub_772 mgl_dispatch_stub_772 #endif /* USE_MGL_NAMESPACE */ @@ -1188,10 +1189,10 @@ extern void gl_dispatch_stub_741(void); extern void gl_dispatch_stub_748(void); extern void gl_dispatch_stub_749(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); extern void gl_dispatch_stub_771(void); +extern void gl_dispatch_stub_772(void); #endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ static const glprocs_table_t static_functions[] = { @@ -1963,279 +1964,280 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET(13404, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), NAME_FUNC_OFFSET(13424, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), NAME_FUNC_OFFSET(13449, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(13470, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_ProgramEnvParameters4fvEXT), - NAME_FUNC_OFFSET(13499, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_ProgramLocalParameters4fvEXT), - NAME_FUNC_OFFSET(13530, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_GetQueryObjecti64vEXT), - NAME_FUNC_OFFSET(13554, gl_dispatch_stub_771, gl_dispatch_stub_771, NULL, _gloffset_GetQueryObjectui64vEXT), - NAME_FUNC_OFFSET(13579, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET(13597, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET(13614, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET(13630, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET(13655, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET(13675, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET(13695, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET(13718, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET(13741, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET(13761, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), - NAME_FUNC_OFFSET(13778, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET(13795, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), - NAME_FUNC_OFFSET(13810, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET(13834, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET(13853, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET(13872, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET(13888, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET(13907, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET(13930, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(13946, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(13962, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET(13989, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET(14016, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET(14036, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14055, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14074, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14104, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14134, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14164, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14194, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET(14213, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET(14236, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET(14261, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET(14286, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET(14313, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET(14341, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET(14368, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET(14396, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET(14425, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET(14454, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET(14480, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET(14511, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET(14542, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET(14566, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET(14589, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), - NAME_FUNC_OFFSET(14607, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET(14636, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET(14665, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), - NAME_FUNC_OFFSET(14680, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET(14706, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET(14732, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET(14747, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET(14759, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET(14779, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET(14796, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET(14812, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET(14831, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET(14854, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET(14870, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET(14892, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET(14910, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET(14929, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET(14947, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET(14966, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET(14984, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET(15003, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET(15021, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET(15040, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET(15058, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET(15077, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET(15095, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET(15114, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET(15132, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET(15151, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET(15169, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET(15188, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET(15206, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET(15225, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET(15243, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET(15262, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET(15280, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET(15299, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET(15317, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET(15336, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET(15354, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET(15373, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET(15391, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET(15410, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET(15428, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET(15447, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET(15465, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET(15484, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET(15507, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET(15530, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET(15553, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET(15576, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET(15593, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET(15616, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET(15639, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET(15662, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET(15688, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET(15714, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET(15740, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET(15764, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET(15791, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET(15817, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET(15837, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET(15857, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET(15877, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET(15894, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET(15912, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET(15929, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET(15947, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET(15964, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET(15982, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET(15999, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET(16017, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET(16034, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET(16052, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET(16069, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET(16087, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET(16104, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET(16122, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET(16139, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET(16157, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET(16174, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET(16192, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET(16211, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET(16230, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET(16249, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET(16268, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET(16288, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET(16308, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(16328, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(16345, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(16363, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(16380, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(16398, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(16415, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(16433, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(16455, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(16468, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(16481, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(16497, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(16513, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(16526, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(16549, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(16569, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(16588, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(16599, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(16611, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(16625, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(16638, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(16654, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(16665, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(16678, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(16697, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(16717, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(16730, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(16740, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(16756, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(16775, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(16793, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(16814, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(16829, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(16844, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(16858, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(16873, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(16885, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(16898, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(16910, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(16923, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(16935, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(16948, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(16960, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(16973, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(16985, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(16998, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17010, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17023, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17035, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(17048, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(17060, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(17073, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(17092, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(17111, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(17130, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(17143, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(17161, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(17182, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(17200, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(17220, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17234, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17251, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(17267, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(17286, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17304, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17325, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17347, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17366, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17388, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17411, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(17430, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(17450, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(17469, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(17489, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(17508, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(17528, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(17547, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(17567, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(17586, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(17606, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(17626, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(17647, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(17667, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(17688, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(17708, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(17729, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(17753, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(17771, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(17791, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(17809, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(17821, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(17834, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(17846, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(17859, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(17879, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(17903, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(17917, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(17934, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(17949, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(17967, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(17981, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(17998, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18013, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18031, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18045, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18062, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18077, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18095, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18109, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18126, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18141, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18159, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18173, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18190, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18205, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18223, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18237, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18254, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18269, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18287, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18301, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18318, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18333, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18351, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18365, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18382, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18397, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18415, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(18432, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(18452, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(18469, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18495, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18524, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(18539, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(18557, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(18576, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(18600, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(13470, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(13499, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_ProgramEnvParameters4fvEXT), + NAME_FUNC_OFFSET(13528, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_ProgramLocalParameters4fvEXT), + NAME_FUNC_OFFSET(13559, gl_dispatch_stub_771, gl_dispatch_stub_771, NULL, _gloffset_GetQueryObjecti64vEXT), + NAME_FUNC_OFFSET(13583, gl_dispatch_stub_772, gl_dispatch_stub_772, NULL, _gloffset_GetQueryObjectui64vEXT), + NAME_FUNC_OFFSET(13608, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET(13626, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET(13643, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET(13659, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET(13684, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET(13704, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET(13724, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET(13747, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET(13770, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET(13790, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), + NAME_FUNC_OFFSET(13807, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET(13824, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), + NAME_FUNC_OFFSET(13839, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET(13863, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET(13882, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET(13901, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET(13917, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET(13936, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET(13959, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(13975, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(13991, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET(14018, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET(14045, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET(14065, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14084, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14103, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14133, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14163, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14193, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14223, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET(14242, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET(14265, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET(14290, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET(14315, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET(14342, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET(14370, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET(14397, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET(14425, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET(14454, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET(14483, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET(14509, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET(14540, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET(14571, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET(14595, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET(14618, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), + NAME_FUNC_OFFSET(14636, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET(14665, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET(14694, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), + NAME_FUNC_OFFSET(14709, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET(14735, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET(14761, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET(14776, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET(14788, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET(14808, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET(14825, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET(14841, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET(14860, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET(14883, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET(14899, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET(14921, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET(14939, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET(14958, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET(14976, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET(14995, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET(15013, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET(15032, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET(15050, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET(15069, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET(15087, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET(15106, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET(15124, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET(15143, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET(15161, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET(15180, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET(15198, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET(15217, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET(15235, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET(15254, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET(15272, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET(15291, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET(15309, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET(15328, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET(15346, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET(15365, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET(15383, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET(15402, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET(15420, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET(15439, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET(15457, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET(15476, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET(15494, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET(15513, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET(15536, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET(15559, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET(15582, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET(15605, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET(15622, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET(15645, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET(15668, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET(15691, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET(15717, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET(15743, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET(15769, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET(15793, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET(15820, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET(15846, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET(15866, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET(15886, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET(15906, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET(15923, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET(15941, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET(15958, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET(15976, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET(15993, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET(16011, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET(16028, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET(16046, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET(16063, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET(16081, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET(16098, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET(16116, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET(16133, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET(16151, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET(16168, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET(16186, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET(16203, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET(16221, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET(16240, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET(16259, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET(16278, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET(16297, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET(16317, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET(16337, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET(16357, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(16374, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(16392, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(16409, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(16427, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(16444, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(16462, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(16484, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(16497, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(16510, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(16526, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(16542, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(16555, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(16578, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(16598, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(16617, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(16628, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(16640, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(16654, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(16667, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(16683, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(16694, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(16707, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(16726, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(16746, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(16759, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(16769, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(16785, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(16804, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(16822, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(16843, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(16858, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(16873, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(16887, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(16902, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(16914, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(16927, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(16939, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(16952, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(16964, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(16977, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(16989, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(17002, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(17014, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(17027, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(17039, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(17052, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(17064, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(17077, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(17089, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(17102, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(17121, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(17140, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(17159, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(17172, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(17190, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(17211, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(17229, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(17249, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17263, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17280, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(17296, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(17315, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17333, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17354, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17376, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17395, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17417, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17440, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(17459, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(17479, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(17498, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(17518, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(17537, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(17557, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(17576, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(17596, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(17615, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(17635, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(17655, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(17676, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(17696, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(17717, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(17737, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(17758, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(17782, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(17800, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(17820, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(17838, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(17850, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(17863, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(17875, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(17888, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(17908, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(17932, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(17946, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(17963, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(17978, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(17996, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18010, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18027, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18042, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18060, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18074, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18091, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18106, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18124, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18138, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18155, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18170, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18188, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18202, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18219, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18234, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18252, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18266, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18283, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18298, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18316, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18330, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18347, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18362, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18380, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18394, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18411, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18426, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18444, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(18461, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(18481, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(18498, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(18524, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(18553, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(18568, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(18586, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(18605, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(18629, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index e2cfb8a1f66..4654704afd1 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -744,6 +744,18 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) target = GL_TEXTURE_RECTANGLE_NV; obj = &unit->SavedRect; break; + case 5: + if (!ctx->Extensions.MESA_texture_array) + continue; + target = GL_TEXTURE_1D_ARRAY_EXT; + obj = &unit->Saved1DArray; + break; + case 6: + if (!ctx->Extensions.MESA_texture_array) + continue; + target = GL_TEXTURE_2D_ARRAY_EXT; + obj = &unit->Saved2DArray; + break; default: ; /* silence warnings */ } diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index a4de3bd1fae..9e4d1838ade 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -108,6 +108,9 @@ /** Maximum rectangular texture size - GL_NV_texture_rectangle */ #define MAX_TEXTURE_RECT_SIZE 2048 +/** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */ +#define MAX_ARRAY_TEXTURE_LAYERS 64 + /** Number of texture units - GL_ARB_multitexture * This needs to be the larger of MAX_TEXTURE_COORD_UNITS and * MAX_TEXTURE_IMAGE_UNITS seen below, since MAX_TEXTURE_UNITS is used diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ace68499d79..ccaf6f64280 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -467,12 +467,22 @@ alloc_shared_state( GLcontext *ctx ) if (!ss->DefaultRect) goto cleanup; + ss->Default1DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D_ARRAY_EXT); + if (!ss->Default1DArray) + goto cleanup; + + ss->Default2DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_2D_ARRAY_EXT); + if (!ss->Default2DArray) + goto cleanup; + /* Effectively bind the default textures to all texture units */ ss->Default1D->RefCount += MAX_TEXTURE_IMAGE_UNITS; ss->Default2D->RefCount += MAX_TEXTURE_IMAGE_UNITS; ss->Default3D->RefCount += MAX_TEXTURE_IMAGE_UNITS; ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS; ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS; + ss->Default1DArray->RefCount += MAX_TEXTURE_IMAGE_UNITS; + ss->Default2DArray->RefCount += MAX_TEXTURE_IMAGE_UNITS; _glthread_INIT_MUTEX(ss->TexMutex); ss->TextureStateStamp = 0; @@ -772,6 +782,7 @@ _mesa_init_constants(GLcontext *ctx) ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS; ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS; ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE; + ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS; ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS; ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 0e14345e730..52dd63f2cef 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -922,6 +922,22 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) ctx->ATIFragmentShader.Enabled = state; break; #endif + + /* GL_MESA_texture_array */ + case GL_TEXTURE_1D_ARRAY_EXT: + CHECK_EXTENSION(MESA_texture_array, cap); + if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) { + return; + } + break; + + case GL_TEXTURE_2D_ARRAY_EXT: + CHECK_EXTENSION(MESA_texture_array, cap); + if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) { + return; + } + break; + default: _mesa_error(ctx, GL_INVALID_ENUM, "%s(0x%x)", state ? "glEnable" : "glDisable", cap); diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index bad33f7f642..d5019ae045a 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -251,6 +251,7 @@ LONGSTRING static const char enum_string_table[] = "GL_COMBINE_RGB\0" "GL_COMBINE_RGB_ARB\0" "GL_COMBINE_RGB_EXT\0" + "GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT\0" "GL_COMPARE_R_TO_TEXTURE\0" "GL_COMPARE_R_TO_TEXTURE_ARB\0" "GL_COMPILE\0" @@ -527,6 +528,7 @@ LONGSTRING static const char enum_string_table[] = "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0" "GL_FRAMEBUFFER_BINDING_EXT\0" "GL_FRAMEBUFFER_COMPLETE_EXT\0" @@ -828,6 +830,7 @@ LONGSTRING static const char enum_string_table[] = "GL_MATRIX_PALETTE_ARB\0" "GL_MAX\0" "GL_MAX_3D_TEXTURE_SIZE\0" + "GL_MAX_ARRAY_TEXTURE_LAYERS_EXT\0" "GL_MAX_ATTRIB_STACK_DEPTH\0" "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH\0" "GL_MAX_CLIPMAP_DEPTH_SGIX\0" @@ -1230,8 +1233,10 @@ LONGSTRING static const char enum_string_table[] = "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE\0" "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE\0" "GL_PROXY_TEXTURE_1D\0" + "GL_PROXY_TEXTURE_1D_ARRAY_EXT\0" "GL_PROXY_TEXTURE_1D_EXT\0" "GL_PROXY_TEXTURE_2D\0" + "GL_PROXY_TEXTURE_2D_ARRAY_EXT\0" "GL_PROXY_TEXTURE_2D_EXT\0" "GL_PROXY_TEXTURE_3D\0" "GL_PROXY_TEXTURE_COLOR_TABLE_SGI\0" @@ -1537,13 +1542,17 @@ LONGSTRING static const char enum_string_table[] = "GL_TEXTURE9\0" "GL_TEXTURE9_ARB\0" "GL_TEXTURE_1D\0" + "GL_TEXTURE_1D_ARRAY_EXT\0" "GL_TEXTURE_2D\0" + "GL_TEXTURE_2D_ARRAY_EXT\0" "GL_TEXTURE_3D\0" "GL_TEXTURE_ALPHA_SIZE\0" "GL_TEXTURE_ALPHA_SIZE_EXT\0" "GL_TEXTURE_BASE_LEVEL\0" "GL_TEXTURE_BINDING_1D\0" + "GL_TEXTURE_BINDING_1D_ARRAY_EXT\0" "GL_TEXTURE_BINDING_2D\0" + "GL_TEXTURE_BINDING_2D_ARRAY_EXT\0" "GL_TEXTURE_BINDING_3D\0" "GL_TEXTURE_BINDING_CUBE_MAP\0" "GL_TEXTURE_BINDING_CUBE_MAP_ARB\0" @@ -1774,7 +1783,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1737] = +static const enum_elt all_enums[1746] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -1992,2130 +2001,2139 @@ static const enum_elt all_enums[1737] = { 4100, 0x00008571 }, /* GL_COMBINE_RGB */ { 4115, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ { 4134, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ - { 4153, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ - { 4177, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ - { 4205, 0x00001300 }, /* GL_COMPILE */ - { 4216, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ - { 4239, 0x00008B81 }, /* GL_COMPILE_STATUS */ - { 4257, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ - { 4277, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ - { 4301, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ - { 4325, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ - { 4353, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ - { 4377, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - { 4407, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ - { 4441, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ - { 4469, 0x000084ED }, /* GL_COMPRESSED_RGB */ - { 4487, 0x000084EE }, /* GL_COMPRESSED_RGBA */ - { 4506, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ - { 4529, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - { 4558, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - { 4591, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - { 4624, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - { 4657, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ - { 4679, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - { 4707, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - { 4739, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ - { 4769, 0x00008576 }, /* GL_CONSTANT */ - { 4781, 0x00008003 }, /* GL_CONSTANT_ALPHA */ - { 4799, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ - { 4821, 0x00008576 }, /* GL_CONSTANT_ARB */ - { 4837, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ - { 4861, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ - { 4883, 0x00008001 }, /* GL_CONSTANT_COLOR */ - { 4901, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ - { 4923, 0x00008576 }, /* GL_CONSTANT_EXT */ - { 4939, 0x00008010 }, /* GL_CONVOLUTION_1D */ - { 4957, 0x00008011 }, /* GL_CONVOLUTION_2D */ - { 4975, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ - { 5003, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ - { 5034, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ - { 5061, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ - { 5092, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ - { 5119, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ - { 5150, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ - { 5178, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ - { 5210, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ - { 5232, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ - { 5258, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ - { 5280, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ - { 5306, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ - { 5327, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ - { 5352, 0x00008862 }, /* GL_COORD_REPLACE */ - { 5369, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ - { 5390, 0x00008862 }, /* GL_COORD_REPLACE_NV */ - { 5410, 0x00001503 }, /* GL_COPY */ - { 5418, 0x0000150C }, /* GL_COPY_INVERTED */ - { 5435, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ - { 5455, 0x00000B44 }, /* GL_CULL_FACE */ - { 5468, 0x00000B45 }, /* GL_CULL_FACE_MODE */ - { 5486, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ - { 5505, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - { 5537, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - { 5572, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ - { 5593, 0x00000001 }, /* GL_CURRENT_BIT */ - { 5608, 0x00000B00 }, /* GL_CURRENT_COLOR */ - { 5625, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ - { 5646, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ - { 5672, 0x00000B01 }, /* GL_CURRENT_INDEX */ - { 5689, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ - { 5711, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ - { 5739, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ - { 5760, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - { 5794, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ - { 5827, 0x00000B02 }, /* GL_CURRENT_NORMAL */ - { 5845, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - { 5875, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ - { 5894, 0x00008865 }, /* GL_CURRENT_QUERY */ - { 5911, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ - { 5932, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ - { 5956, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ - { 5983, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ - { 6007, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ - { 6034, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ - { 6067, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - { 6100, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ - { 6127, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ - { 6153, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ - { 6178, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - { 6207, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ - { 6229, 0x00000900 }, /* GL_CW */ - { 6235, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ - { 6256, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ - { 6277, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ - { 6297, 0x00002101 }, /* GL_DECAL */ - { 6306, 0x00001E03 }, /* GL_DECR */ - { 6314, 0x00008508 }, /* GL_DECR_WRAP */ - { 6327, 0x00008508 }, /* GL_DECR_WRAP_EXT */ - { 6344, 0x00008B80 }, /* GL_DELETE_STATUS */ - { 6361, 0x00001801 }, /* GL_DEPTH */ - { 6370, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 6394, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 6408, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 6422, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 6442, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 6467, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 6487, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 6505, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 6526, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 6545, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 6566, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 6591, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 6617, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 6638, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 6663, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 6689, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 6710, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 6735, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 6761, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 6775, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 6790, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 6805, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 6825, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 6853, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 6881, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 6895, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 6917, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 6943, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 6962, 0x00001201 }, /* GL_DIFFUSE */ - { 6973, 0x00000BD0 }, /* GL_DITHER */ - { 6983, 0x00000A02 }, /* GL_DOMAIN */ - { 6993, 0x00001100 }, /* GL_DONT_CARE */ - { 7006, 0x000086AE }, /* GL_DOT3_RGB */ - { 7018, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7031, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7048, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7065, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7081, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7097, 0x0000140A }, /* GL_DOUBLE */ - { 7107, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 7123, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 7138, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 7154, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 7174, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 7194, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 7210, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 7227, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 7248, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 7269, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 7286, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 7307, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 7328, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 7345, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 7366, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 7387, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 7404, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 7425, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 7446, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 7463, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 7484, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 7505, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 7522, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 7543, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 7564, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 7584, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 7604, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 7620, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 7640, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 7660, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 7676, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 7696, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 7716, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 7732, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 7752, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 7772, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 7788, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 7808, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 7828, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 7844, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 7864, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 7884, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 7900, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 7920, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 7940, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 7956, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 7976, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 7996, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8012, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8032, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8052, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 8084, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 8108, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 8128, 0x00000304 }, /* GL_DST_ALPHA */ - { 8141, 0x00000306 }, /* GL_DST_COLOR */ - { 8154, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 8170, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 8190, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 8206, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 8226, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 8242, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 8262, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 8275, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 8294, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 8328, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 8366, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 8393, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 8419, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 8443, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */ - { 8471, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 8503, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 8539, 0x00001600 }, /* GL_EMISSION */ - { 8551, 0x00002000 }, /* GL_ENABLE_BIT */ - { 8565, 0x00000202 }, /* GL_EQUAL */ - { 8574, 0x00001509 }, /* GL_EQUIV */ - { 8583, 0x00010000 }, /* GL_EVAL_BIT */ - { 8595, 0x00000800 }, /* GL_EXP */ - { 8602, 0x00000801 }, /* GL_EXP2 */ - { 8610, 0x00001F03 }, /* GL_EXTENSIONS */ - { 8624, 0x00002400 }, /* GL_EYE_LINEAR */ - { 8638, 0x00002502 }, /* GL_EYE_PLANE */ - { 8651, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 8676, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 8693, 0x00000000 }, /* GL_FALSE */ - { 8702, 0x00001101 }, /* GL_FASTEST */ - { 8713, 0x00001C01 }, /* GL_FEEDBACK */ - { 8725, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 8752, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 8776, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 8800, 0x00001B02 }, /* GL_FILL */ - { 8808, 0x00001D00 }, /* GL_FLAT */ - { 8816, 0x00001406 }, /* GL_FLOAT */ - { 8825, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 8839, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 8857, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 8871, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 8889, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 8903, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 8921, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 8935, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 8953, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 8967, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 8985, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 8999, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 9017, 0x00000B60 }, /* GL_FOG */ - { 9024, 0x00000080 }, /* GL_FOG_BIT */ - { 9035, 0x00000B66 }, /* GL_FOG_COLOR */ - { 9048, 0x00008451 }, /* GL_FOG_COORD */ - { 9061, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 9079, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 9103, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 9142, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 9185, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 9217, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 9248, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 9277, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 9302, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 9321, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 9355, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 9382, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 9408, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 9432, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 9449, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 9464, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 9488, 0x00000B64 }, /* GL_FOG_END */ - { 9499, 0x00000C54 }, /* GL_FOG_HINT */ - { 9511, 0x00000B61 }, /* GL_FOG_INDEX */ - { 9524, 0x00000B65 }, /* GL_FOG_MODE */ - { 9536, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 9555, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 9580, 0x00000B63 }, /* GL_FOG_START */ - { 9593, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 9611, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 9635, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 9654, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 9677, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 9712, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 9754, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 9796, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 9845, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 9897, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 9941, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 9968, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 9996, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 10015, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 10056, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 10097, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 10139, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 10190, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 10228, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 10277, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 10319, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 10351, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 10382, 0x00000404 }, /* GL_FRONT */ - { 10391, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 10409, 0x00000B46 }, /* GL_FRONT_FACE */ - { 10423, 0x00000400 }, /* GL_FRONT_LEFT */ - { 10437, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 10452, 0x00008006 }, /* GL_FUNC_ADD */ - { 10464, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 10480, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 10505, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 10534, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 10551, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 10572, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 10591, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 10615, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 10644, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 10668, 0x00000206 }, /* GL_GEQUAL */ - { 10678, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ - { 10703, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ - { 10731, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - { 10765, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ - { 10787, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - { 10815, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ - { 10852, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ - { 10871, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ - { 10890, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ - { 10909, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ - { 10928, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ - { 10947, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ - { 10966, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ - { 10990, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - { 11022, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ - { 11048, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 11082, 0x00008C46 }, /* GL_GL_SLUMINANCE */ - { 11099, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ - { 11117, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ - { 11142, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ - { 11165, 0x00008C40 }, /* GL_GL_SRGB */ - { 11176, 0x00008C41 }, /* GL_GL_SRGB8 */ - { 11188, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ - { 11207, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ - { 11224, 0x00000204 }, /* GL_GREATER */ - { 11235, 0x00001904 }, /* GL_GREEN */ - { 11244, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 11258, 0x00000D53 }, /* GL_GREEN_BITS */ - { 11272, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 11287, 0x00008000 }, /* GL_HINT_BIT */ - { 11299, 0x00008024 }, /* GL_HISTOGRAM */ - { 11312, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 11336, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 11364, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 11387, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 11414, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 11431, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 11451, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 11475, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 11499, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 11527, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 11555, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 11587, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 11609, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 11635, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 11653, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 11675, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 11694, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 11717, 0x0000862A }, /* GL_IDENTITY_NV */ - { 11732, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 11752, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 11792, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 11830, 0x00001E02 }, /* GL_INCR */ - { 11838, 0x00008507 }, /* GL_INCR_WRAP */ - { 11851, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 11868, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 11883, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 11913, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 11947, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 11970, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 11992, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 12012, 0x00000D51 }, /* GL_INDEX_BITS */ - { 12026, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 12047, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 12065, 0x00000C30 }, /* GL_INDEX_MODE */ - { 12079, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 12095, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 12110, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 12129, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 12148, 0x00001404 }, /* GL_INT */ - { 12155, 0x00008049 }, /* GL_INTENSITY */ - { 12168, 0x0000804C }, /* GL_INTENSITY12 */ - { 12183, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 12202, 0x0000804D }, /* GL_INTENSITY16 */ - { 12217, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 12236, 0x0000804A }, /* GL_INTENSITY4 */ - { 12250, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 12268, 0x0000804B }, /* GL_INTENSITY8 */ - { 12282, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 12300, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 12317, 0x00008575 }, /* GL_INTERPOLATE */ - { 12332, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 12351, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 12370, 0x00008B53 }, /* GL_INT_VEC2 */ - { 12382, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 12398, 0x00008B54 }, /* GL_INT_VEC3 */ - { 12410, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 12426, 0x00008B55 }, /* GL_INT_VEC4 */ - { 12438, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 12454, 0x00000500 }, /* GL_INVALID_ENUM */ - { 12470, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 12507, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 12528, 0x00000501 }, /* GL_INVALID_VALUE */ - { 12545, 0x0000862B }, /* GL_INVERSE_NV */ - { 12559, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 12583, 0x0000150A }, /* GL_INVERT */ - { 12593, 0x00001E00 }, /* GL_KEEP */ - { 12601, 0x00000406 }, /* GL_LEFT */ - { 12609, 0x00000203 }, /* GL_LEQUAL */ - { 12619, 0x00000201 }, /* GL_LESS */ - { 12627, 0x00004000 }, /* GL_LIGHT0 */ - { 12637, 0x00004001 }, /* GL_LIGHT1 */ - { 12647, 0x00004002 }, /* GL_LIGHT2 */ - { 12657, 0x00004003 }, /* GL_LIGHT3 */ - { 12667, 0x00004004 }, /* GL_LIGHT4 */ - { 12677, 0x00004005 }, /* GL_LIGHT5 */ - { 12687, 0x00004006 }, /* GL_LIGHT6 */ - { 12697, 0x00004007 }, /* GL_LIGHT7 */ - { 12707, 0x00000B50 }, /* GL_LIGHTING */ - { 12719, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 12735, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 12758, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 12787, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 12820, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 12848, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 12872, 0x00001B01 }, /* GL_LINE */ - { 12880, 0x00002601 }, /* GL_LINEAR */ - { 12890, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 12912, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 12942, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 12973, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 12997, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 13022, 0x00000001 }, /* GL_LINES */ - { 13031, 0x00000004 }, /* GL_LINE_BIT */ - { 13043, 0x00000002 }, /* GL_LINE_LOOP */ - { 13056, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 13076, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 13091, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 13111, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 13127, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 13151, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 13174, 0x00000003 }, /* GL_LINE_STRIP */ - { 13188, 0x00000702 }, /* GL_LINE_TOKEN */ - { 13202, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 13216, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 13242, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 13262, 0x00008B82 }, /* GL_LINK_STATUS */ - { 13277, 0x00000B32 }, /* GL_LIST_BASE */ - { 13290, 0x00020000 }, /* GL_LIST_BIT */ - { 13302, 0x00000B33 }, /* GL_LIST_INDEX */ - { 13316, 0x00000B30 }, /* GL_LIST_MODE */ - { 13329, 0x00000101 }, /* GL_LOAD */ - { 13337, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 13349, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 13366, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 13380, 0x00001909 }, /* GL_LUMINANCE */ - { 13393, 0x00008041 }, /* GL_LUMINANCE12 */ - { 13408, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 13431, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 13458, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 13480, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 13506, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 13525, 0x00008042 }, /* GL_LUMINANCE16 */ - { 13540, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 13563, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 13590, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 13609, 0x0000803F }, /* GL_LUMINANCE4 */ - { 13623, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 13644, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 13669, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 13687, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 13708, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 13733, 0x00008040 }, /* GL_LUMINANCE8 */ - { 13747, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 13768, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 13793, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 13811, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 13830, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 13846, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 13866, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 13888, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 13902, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 13917, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 13941, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 13965, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 13989, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 14013, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 14030, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 14047, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 14075, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 14104, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 14133, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 14162, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 14191, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 14220, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 14249, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 14277, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 14305, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 14333, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 14361, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 14389, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 14417, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 14445, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 14473, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 14501, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 14517, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 14537, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 14559, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 14573, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 14588, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 14612, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 14636, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 14660, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 14684, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 14701, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 14718, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 14746, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 14775, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 14804, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 14833, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 14862, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 14891, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 14920, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 14948, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 14976, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 15004, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 15032, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 15060, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 15088, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 15116, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 15144, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 15172, 0x00000D10 }, /* GL_MAP_COLOR */ - { 15185, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 15200, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 15215, 0x00008630 }, /* GL_MATRIX0_NV */ - { 15229, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 15245, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 15261, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 15277, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 15293, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 15309, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 15325, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 15341, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 15357, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 15373, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 15389, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 15404, 0x00008631 }, /* GL_MATRIX1_NV */ - { 15418, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 15434, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 15450, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 15466, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 15482, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 15498, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 15514, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 15530, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 15546, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 15562, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 15578, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 15593, 0x00008632 }, /* GL_MATRIX2_NV */ - { 15607, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 15623, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 15639, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 15654, 0x00008633 }, /* GL_MATRIX3_NV */ - { 15668, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 15683, 0x00008634 }, /* GL_MATRIX4_NV */ - { 15697, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 15712, 0x00008635 }, /* GL_MATRIX5_NV */ - { 15726, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 15741, 0x00008636 }, /* GL_MATRIX6_NV */ - { 15755, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 15770, 0x00008637 }, /* GL_MATRIX7_NV */ - { 15784, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 15799, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 15814, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 15840, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 15874, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 15905, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 15938, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 15969, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 15984, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 16006, 0x00008008 }, /* GL_MAX */ - { 16013, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 16036, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 16062, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 16095, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 16121, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 16155, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 16174, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 16203, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 16235, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 16271, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 16307, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 16347, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 16373, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 16403, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 16428, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 16457, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 16486, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 16519, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 16539, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 16563, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 16587, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 16611, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 16636, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 16654, 0x00008008 }, /* GL_MAX_EXT */ - { 16665, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 16700, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 16739, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 16753, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 16773, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 16811, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 16840, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 16864, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 16892, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 16915, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 16952, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 16988, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 17015, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 17044, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 17078, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 17114, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 17141, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 17173, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 17209, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 17238, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 17267, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 17295, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 17333, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 17377, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 17420, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 17454, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 17493, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 17530, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 17568, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 17611, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 17654, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 17684, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 17715, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 17751, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 17787, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 17817, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 17851, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 17884, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 17913, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 17933, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 17957, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 17979, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 18005, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 18032, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 18063, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 18087, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 18121, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 18141, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 18168, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 18189, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 18214, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 18239, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 18274, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 18296, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 18322, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 18344, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 18370, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 18404, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 18442, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 18475, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 18512, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 18536, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 18557, 0x00008007 }, /* GL_MIN */ - { 18564, 0x0000802E }, /* GL_MINMAX */ - { 18574, 0x0000802E }, /* GL_MINMAX_EXT */ - { 18588, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 18605, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 18626, 0x00008030 }, /* GL_MINMAX_SINK */ - { 18641, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 18660, 0x00008007 }, /* GL_MIN_EXT */ - { 18671, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 18690, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 18713, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 18736, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 18756, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 18776, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 18806, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 18834, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 18862, 0x00001700 }, /* GL_MODELVIEW */ - { 18875, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 18893, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 18912, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 18931, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 18950, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 18969, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 18988, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 19007, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 19026, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 19045, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 19064, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 19083, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 19101, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 19120, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 19139, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 19158, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 19177, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 19196, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 19215, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 19234, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 19253, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 19272, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 19291, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 19309, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 19328, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 19347, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 19365, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 19383, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 19401, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 19419, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 19437, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 19455, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 19473, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 19493, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 19520, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 19545, 0x00002100 }, /* GL_MODULATE */ - { 19557, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 19577, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 19604, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 19629, 0x00000103 }, /* GL_MULT */ - { 19637, 0x0000809D }, /* GL_MULTISAMPLE */ - { 19652, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 19672, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 19691, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 19710, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 19734, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 19757, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 19787, 0x00002A25 }, /* GL_N3F_V3F */ - { 19798, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 19818, 0x0000150E }, /* GL_NAND */ - { 19826, 0x00002600 }, /* GL_NEAREST */ - { 19837, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 19868, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 19900, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 19925, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 19951, 0x00000200 }, /* GL_NEVER */ - { 19960, 0x00001102 }, /* GL_NICEST */ - { 19970, 0x00000000 }, /* GL_NONE */ - { 19978, 0x00001505 }, /* GL_NOOP */ - { 19986, 0x00001508 }, /* GL_NOR */ - { 19993, 0x00000BA1 }, /* GL_NORMALIZE */ - { 20006, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 20022, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 20053, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 20088, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 20112, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 20135, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 20156, 0x00008511 }, /* GL_NORMAL_MAP */ - { 20170, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 20188, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 20205, 0x00000205 }, /* GL_NOTEQUAL */ - { 20217, 0x00000000 }, /* GL_NO_ERROR */ - { 20229, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 20263, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 20301, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 20333, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 20375, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 20405, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 20445, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 20476, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 20505, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 20533, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 20563, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 20580, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 20606, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 20622, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 20657, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 20679, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 20698, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 20728, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 20749, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 20777, 0x00000001 }, /* GL_ONE */ - { 20784, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 20812, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 20844, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 20872, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 20904, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 20927, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 20950, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 20973, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 20996, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 21014, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 21036, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 21058, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 21074, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 21094, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 21114, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 21132, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 21154, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 21176, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 21192, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 21212, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 21232, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 21250, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 21272, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 21294, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 21310, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 21330, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 21350, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 21371, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 21390, 0x00001507 }, /* GL_OR */ - { 21396, 0x00000A01 }, /* GL_ORDER */ - { 21405, 0x0000150D }, /* GL_OR_INVERTED */ - { 21420, 0x0000150B }, /* GL_OR_REVERSE */ - { 21434, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 21451, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 21469, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 21490, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 21510, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 21528, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 21547, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 21567, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 21587, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 21605, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 21624, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 21649, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 21673, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 21694, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 21716, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 21738, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 21763, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 21787, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 21808, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 21830, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 21852, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 21874, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 21905, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 21925, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 21950, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 21970, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 21995, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 22015, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 22040, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 22060, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 22085, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 22105, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 22130, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 22150, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 22175, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 22195, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 22220, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 22240, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 22265, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 22285, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 22310, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 22330, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 22355, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 22373, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 22406, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 22431, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 22466, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 22493, 0x00001B00 }, /* GL_POINT */ - { 22502, 0x00000000 }, /* GL_POINTS */ - { 22512, 0x00000002 }, /* GL_POINT_BIT */ - { 22525, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 22555, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 22589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 22623, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 22658, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 22687, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 22720, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 22753, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 22787, 0x00000B11 }, /* GL_POINT_SIZE */ - { 22801, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 22827, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 22845, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 22867, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 22889, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 22912, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 22930, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 22952, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 22974, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 22997, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 23017, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 23033, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 23054, 0x00008861 }, /* GL_POINT_SPRITE */ - { 23070, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 23090, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 23119, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 23138, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 23164, 0x00000701 }, /* GL_POINT_TOKEN */ - { 23179, 0x00000009 }, /* GL_POLYGON */ - { 23190, 0x00000008 }, /* GL_POLYGON_BIT */ - { 23205, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 23221, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 23244, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 23269, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 23292, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 23315, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 23339, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 23363, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 23381, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 23404, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 23423, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 23446, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 23463, 0x00001203 }, /* GL_POSITION */ - { 23475, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 23507, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 23543, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 23576, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 23613, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 23644, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 23679, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 23711, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 23747, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 23780, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 23812, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 23848, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 23881, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 23918, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 23948, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 23982, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 24013, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 24048, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 24079, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 24114, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 24146, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 24182, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 24212, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 24246, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 24277, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 24312, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 24344, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 24375, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 24410, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 24442, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 24478, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 24507, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 24540, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 24570, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 24604, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 24643, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 24676, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 24716, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 24750, 0x00008578 }, /* GL_PREVIOUS */ - { 24762, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 24778, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 24794, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 24811, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 24832, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 24853, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 24886, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 24918, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 24941, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 24964, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 24994, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 25023, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 25051, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 25073, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 25101, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 25129, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 25151, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 25172, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 25212, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 25251, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 25281, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 25316, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 25349, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 25383, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 25422, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 25461, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 25483, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 25509, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 25533, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 25556, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 25578, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 25599, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 25620, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 25647, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 25679, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 25711, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 25746, 0x00001701 }, /* GL_PROJECTION */ - { 25760, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 25781, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 25807, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 25828, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 25847, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 25870, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25909, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 25947, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 25967, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 25991, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 26011, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 26035, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 26055, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 26088, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 26114, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 26144, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 26175, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 26205, 0x00002003 }, /* GL_Q */ - { 26210, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 26235, 0x00000007 }, /* GL_QUADS */ - { 26244, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 26261, 0x00000008 }, /* GL_QUAD_STRIP */ - { 26275, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 26297, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 26323, 0x00008866 }, /* GL_QUERY_RESULT */ - { 26339, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 26359, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 26385, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 26415, 0x00002002 }, /* GL_R */ - { 26420, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 26432, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 26465, 0x00000C02 }, /* GL_READ_BUFFER */ - { 26480, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 26512, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 26536, 0x000088B8 }, /* GL_READ_ONLY */ - { 26549, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 26566, 0x000088BA }, /* GL_READ_WRITE */ - { 26580, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 26598, 0x00001903 }, /* GL_RED */ - { 26605, 0x00008016 }, /* GL_REDUCE */ - { 26615, 0x00008016 }, /* GL_REDUCE_EXT */ - { 26629, 0x00000D15 }, /* GL_RED_BIAS */ - { 26641, 0x00000D52 }, /* GL_RED_BITS */ - { 26653, 0x00000D14 }, /* GL_RED_SCALE */ - { 26666, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 26684, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 26706, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 26727, 0x00001C00 }, /* GL_RENDER */ - { 26737, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 26765, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 26785, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 26812, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 26848, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 26874, 0x00001F01 }, /* GL_RENDERER */ - { 26886, 0x00000C40 }, /* GL_RENDER_MODE */ - { 26901, 0x00002901 }, /* GL_REPEAT */ - { 26911, 0x00001E01 }, /* GL_REPLACE */ - { 26922, 0x00008062 }, /* GL_REPLACE_EXT */ - { 26937, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 26960, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 26978, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 27000, 0x00000102 }, /* GL_RETURN */ - { 27010, 0x00001907 }, /* GL_RGB */ - { 27017, 0x00008052 }, /* GL_RGB10 */ - { 27026, 0x00008059 }, /* GL_RGB10_A2 */ - { 27038, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 27054, 0x00008052 }, /* GL_RGB10_EXT */ - { 27067, 0x00008053 }, /* GL_RGB12 */ - { 27076, 0x00008053 }, /* GL_RGB12_EXT */ - { 27089, 0x00008054 }, /* GL_RGB16 */ - { 27098, 0x00008054 }, /* GL_RGB16_EXT */ - { 27111, 0x0000804E }, /* GL_RGB2_EXT */ - { 27123, 0x0000804F }, /* GL_RGB4 */ - { 27131, 0x0000804F }, /* GL_RGB4_EXT */ - { 27143, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 27156, 0x00008050 }, /* GL_RGB5 */ - { 27164, 0x00008057 }, /* GL_RGB5_A1 */ - { 27175, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 27190, 0x00008050 }, /* GL_RGB5_EXT */ - { 27202, 0x00008051 }, /* GL_RGB8 */ - { 27210, 0x00008051 }, /* GL_RGB8_EXT */ - { 27222, 0x00001908 }, /* GL_RGBA */ - { 27230, 0x0000805A }, /* GL_RGBA12 */ - { 27240, 0x0000805A }, /* GL_RGBA12_EXT */ - { 27254, 0x0000805B }, /* GL_RGBA16 */ - { 27264, 0x0000805B }, /* GL_RGBA16_EXT */ - { 27278, 0x00008055 }, /* GL_RGBA2 */ - { 27287, 0x00008055 }, /* GL_RGBA2_EXT */ - { 27300, 0x00008056 }, /* GL_RGBA4 */ - { 27309, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 27328, 0x00008056 }, /* GL_RGBA4_EXT */ - { 27341, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 27355, 0x00008058 }, /* GL_RGBA8 */ - { 27364, 0x00008058 }, /* GL_RGBA8_EXT */ - { 27377, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 27395, 0x00000C31 }, /* GL_RGBA_MODE */ - { 27408, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 27421, 0x000083A0 }, /* GL_RGB_S3TC */ - { 27433, 0x00008573 }, /* GL_RGB_SCALE */ - { 27446, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 27463, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 27480, 0x00000407 }, /* GL_RIGHT */ - { 27489, 0x00002000 }, /* GL_S */ - { 27494, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 27508, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 27529, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 27543, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 27564, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 27578, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 27594, 0x000080A9 }, /* GL_SAMPLES */ - { 27605, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 27621, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 27636, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 27654, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 27676, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 27704, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 27736, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 27759, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 27786, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 27804, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 27827, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 27849, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 27868, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 27891, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 27917, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 27947, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 27972, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 28001, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 28016, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 28031, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 28047, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 28072, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 28112, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 28156, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 28189, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 28219, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 28251, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 28281, 0x00001C02 }, /* GL_SELECT */ - { 28291, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 28319, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 28344, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 28360, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 28387, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 28418, 0x0000150F }, /* GL_SET */ - { 28425, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 28446, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 28470, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 28485, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 28500, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 28528, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 28551, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 28581, 0x00001601 }, /* GL_SHININESS */ - { 28594, 0x00001402 }, /* GL_SHORT */ - { 28603, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 28619, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 28639, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 28658, 0x00001D01 }, /* GL_SMOOTH */ - { 28668, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 28701, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 28728, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 28761, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 28788, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 28805, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 28826, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 28847, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 28862, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 28881, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 28900, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 28917, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 28938, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 28959, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 28974, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 28993, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 29012, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 29029, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 29050, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 29071, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 29086, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 29105, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 29124, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 29144, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 29162, 0x00001202 }, /* GL_SPECULAR */ - { 29174, 0x00002402 }, /* GL_SPHERE_MAP */ - { 29188, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 29203, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 29221, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 29238, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 29252, 0x00008580 }, /* GL_SRC0_RGB */ - { 29264, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 29278, 0x00008581 }, /* GL_SRC1_RGB */ - { 29290, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 29304, 0x00008582 }, /* GL_SRC2_RGB */ - { 29316, 0x00000302 }, /* GL_SRC_ALPHA */ - { 29329, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 29351, 0x00000300 }, /* GL_SRC_COLOR */ - { 29364, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 29382, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 29401, 0x000088E6 }, /* GL_STATIC_COPY */ - { 29416, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 29435, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 29450, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 29469, 0x000088E5 }, /* GL_STATIC_READ */ - { 29484, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 29503, 0x00001802 }, /* GL_STENCIL */ - { 29514, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 29540, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 29561, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 29582, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 29614, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 29646, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 29666, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 29693, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 29719, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 29735, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 29757, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 29780, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 29796, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 29812, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 29829, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 29852, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 29874, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 29896, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 29918, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 29939, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 29966, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 29993, 0x00000B97 }, /* GL_STENCIL_REF */ - { 30008, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 30024, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 30053, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 30075, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 30096, 0x00000C33 }, /* GL_STEREO */ - { 30106, 0x000088E2 }, /* GL_STREAM_COPY */ - { 30121, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 30140, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 30155, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 30174, 0x000088E1 }, /* GL_STREAM_READ */ - { 30189, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 30208, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 30225, 0x000084E7 }, /* GL_SUBTRACT */ - { 30237, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 30253, 0x00002001 }, /* GL_T */ - { 30258, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 30273, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 30292, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 30308, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 30323, 0x00002A27 }, /* GL_T2F_V3F */ - { 30334, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 30353, 0x00002A28 }, /* GL_T4F_V4F */ - { 30364, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 30387, 0x00001702 }, /* GL_TEXTURE */ - { 30398, 0x000084C0 }, /* GL_TEXTURE0 */ - { 30410, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 30426, 0x000084C1 }, /* GL_TEXTURE1 */ - { 30438, 0x000084CA }, /* GL_TEXTURE10 */ - { 30451, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 30468, 0x000084CB }, /* GL_TEXTURE11 */ - { 30481, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 30498, 0x000084CC }, /* GL_TEXTURE12 */ - { 30511, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 30528, 0x000084CD }, /* GL_TEXTURE13 */ - { 30541, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 30558, 0x000084CE }, /* GL_TEXTURE14 */ - { 30571, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 30588, 0x000084CF }, /* GL_TEXTURE15 */ - { 30601, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 30618, 0x000084D0 }, /* GL_TEXTURE16 */ - { 30631, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 30648, 0x000084D1 }, /* GL_TEXTURE17 */ - { 30661, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 30678, 0x000084D2 }, /* GL_TEXTURE18 */ - { 30691, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 30708, 0x000084D3 }, /* GL_TEXTURE19 */ - { 30721, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 30738, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 30754, 0x000084C2 }, /* GL_TEXTURE2 */ - { 30766, 0x000084D4 }, /* GL_TEXTURE20 */ - { 30779, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 30796, 0x000084D5 }, /* GL_TEXTURE21 */ - { 30809, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 30826, 0x000084D6 }, /* GL_TEXTURE22 */ - { 30839, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 30856, 0x000084D7 }, /* GL_TEXTURE23 */ - { 30869, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 30886, 0x000084D8 }, /* GL_TEXTURE24 */ - { 30899, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 30916, 0x000084D9 }, /* GL_TEXTURE25 */ - { 30929, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 30946, 0x000084DA }, /* GL_TEXTURE26 */ - { 30959, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 30976, 0x000084DB }, /* GL_TEXTURE27 */ - { 30989, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 31006, 0x000084DC }, /* GL_TEXTURE28 */ - { 31019, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 31036, 0x000084DD }, /* GL_TEXTURE29 */ - { 31049, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 31066, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 31082, 0x000084C3 }, /* GL_TEXTURE3 */ - { 31094, 0x000084DE }, /* GL_TEXTURE30 */ - { 31107, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 31124, 0x000084DF }, /* GL_TEXTURE31 */ - { 31137, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 31154, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 31170, 0x000084C4 }, /* GL_TEXTURE4 */ - { 31182, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 31198, 0x000084C5 }, /* GL_TEXTURE5 */ - { 31210, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 31226, 0x000084C6 }, /* GL_TEXTURE6 */ - { 31238, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 31254, 0x000084C7 }, /* GL_TEXTURE7 */ - { 31266, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 31282, 0x000084C8 }, /* GL_TEXTURE8 */ - { 31294, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 31310, 0x000084C9 }, /* GL_TEXTURE9 */ - { 31322, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 31338, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 31352, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 31366, 0x0000806F }, /* GL_TEXTURE_3D */ - { 31380, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 31402, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 31428, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 31450, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 31472, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 31494, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 31516, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 31544, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 31576, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 31609, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 31641, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 31656, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 31677, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 31702, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 31720, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 31744, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 31775, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 31805, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 31835, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 31870, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 31901, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 31939, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 31966, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 31998, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 32032, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 32056, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 32084, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 32108, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 32136, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 32169, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 32193, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 32215, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 32237, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 32263, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 32297, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 32330, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 32367, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 32395, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 32427, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 32450, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 32488, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 32530, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 32561, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 32589, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 32619, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 32647, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 32667, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 32691, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 32722, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 32757, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 32788, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 32823, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 32854, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 32889, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 32920, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 32955, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 32986, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 33021, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 33052, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 33087, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 33104, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 33126, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 33152, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 33167, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 33188, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 33208, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 33234, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 33254, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 33271, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 33288, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 33305, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 33322, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 33347, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 33369, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 33395, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 33413, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 33439, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 33465, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 33495, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 33522, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 33547, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 33567, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 33591, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 33618, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 33645, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 33672, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 33698, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 33728, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 33750, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 33768, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 33798, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 33826, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 33854, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 33882, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 33903, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 33922, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 33944, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 33963, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 33983, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 34008, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 34032, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 34052, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 34076, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 34096, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 34119, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 34144, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 34178, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 34195, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 34213, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 34231, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 34249, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 34269, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 34288, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 34317, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 34334, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 34360, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 34390, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 34422, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 34452, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 34486, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 34502, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 34533, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 34568, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 34596, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 34628, 0x00000004 }, /* GL_TRIANGLES */ - { 34641, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 34657, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 34678, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 34696, 0x00000001 }, /* GL_TRUE */ - { 34704, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 34724, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 34747, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 34767, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 34788, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 34810, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 34832, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 34852, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 34873, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 34890, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 34917, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 34940, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 34956, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 34983, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 35007, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 35038, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 35062, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 35090, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 35108, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 35138, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 35164, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 35194, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 35220, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 35244, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 35272, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 35300, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 35327, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 35359, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 35390, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 35404, 0x00002A20 }, /* GL_V2F */ - { 35411, 0x00002A21 }, /* GL_V3F */ - { 35418, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 35437, 0x00001F00 }, /* GL_VENDOR */ - { 35447, 0x00001F02 }, /* GL_VERSION */ - { 35458, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 35474, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 35504, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 35535, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 35570, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 35594, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 35615, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 35638, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 35659, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 35686, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 35714, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 35742, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 35770, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 35798, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 35826, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 35854, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 35881, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 35908, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 35935, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 35962, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 35989, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 36016, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 36043, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 36070, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 36097, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 36135, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 36177, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 36208, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 36243, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 36277, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 36315, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 36346, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 36381, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 36409, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 36441, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 36471, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 36505, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 36533, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 36565, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 36585, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 36607, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 36636, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 36657, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 36686, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 36719, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 36751, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 36778, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 36809, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 36839, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 36856, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 36877, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 36904, 0x00000BA2 }, /* GL_VIEWPORT */ - { 36916, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 36932, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 36952, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 36983, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 37018, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 37046, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 37071, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 37098, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 37123, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 37147, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 37166, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 37180, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 37198, 0x00001506 }, /* GL_XOR */ - { 37205, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 37224, 0x00008757 }, /* GL_YCBCR_MESA */ - { 37238, 0x00000000 }, /* GL_ZERO */ - { 37246, 0x00000D16 }, /* GL_ZOOM_X */ - { 37256, 0x00000D17 }, /* GL_ZOOM_Y */ + { 4153, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ + { 4189, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ + { 4213, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ + { 4241, 0x00001300 }, /* GL_COMPILE */ + { 4252, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ + { 4275, 0x00008B81 }, /* GL_COMPILE_STATUS */ + { 4293, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ + { 4313, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ + { 4337, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ + { 4361, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ + { 4389, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ + { 4413, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + { 4443, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ + { 4477, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ + { 4505, 0x000084ED }, /* GL_COMPRESSED_RGB */ + { 4523, 0x000084EE }, /* GL_COMPRESSED_RGBA */ + { 4542, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ + { 4565, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + { 4594, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + { 4627, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + { 4660, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + { 4693, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ + { 4715, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + { 4743, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + { 4775, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ + { 4805, 0x00008576 }, /* GL_CONSTANT */ + { 4817, 0x00008003 }, /* GL_CONSTANT_ALPHA */ + { 4835, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ + { 4857, 0x00008576 }, /* GL_CONSTANT_ARB */ + { 4873, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ + { 4897, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ + { 4919, 0x00008001 }, /* GL_CONSTANT_COLOR */ + { 4937, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ + { 4959, 0x00008576 }, /* GL_CONSTANT_EXT */ + { 4975, 0x00008010 }, /* GL_CONVOLUTION_1D */ + { 4993, 0x00008011 }, /* GL_CONVOLUTION_2D */ + { 5011, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ + { 5039, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ + { 5070, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ + { 5097, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ + { 5128, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ + { 5155, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ + { 5186, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ + { 5214, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ + { 5246, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ + { 5268, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ + { 5294, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ + { 5316, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ + { 5342, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ + { 5363, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ + { 5388, 0x00008862 }, /* GL_COORD_REPLACE */ + { 5405, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ + { 5426, 0x00008862 }, /* GL_COORD_REPLACE_NV */ + { 5446, 0x00001503 }, /* GL_COPY */ + { 5454, 0x0000150C }, /* GL_COPY_INVERTED */ + { 5471, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ + { 5491, 0x00000B44 }, /* GL_CULL_FACE */ + { 5504, 0x00000B45 }, /* GL_CULL_FACE_MODE */ + { 5522, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ + { 5541, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + { 5573, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + { 5608, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ + { 5629, 0x00000001 }, /* GL_CURRENT_BIT */ + { 5644, 0x00000B00 }, /* GL_CURRENT_COLOR */ + { 5661, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ + { 5682, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ + { 5708, 0x00000B01 }, /* GL_CURRENT_INDEX */ + { 5725, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ + { 5747, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ + { 5775, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ + { 5796, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + { 5830, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ + { 5863, 0x00000B02 }, /* GL_CURRENT_NORMAL */ + { 5881, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + { 5911, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ + { 5930, 0x00008865 }, /* GL_CURRENT_QUERY */ + { 5947, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ + { 5968, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ + { 5992, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ + { 6019, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ + { 6043, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ + { 6070, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ + { 6103, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + { 6136, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ + { 6163, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ + { 6189, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ + { 6214, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ + { 6243, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ + { 6265, 0x00000900 }, /* GL_CW */ + { 6271, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ + { 6292, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ + { 6313, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ + { 6333, 0x00002101 }, /* GL_DECAL */ + { 6342, 0x00001E03 }, /* GL_DECR */ + { 6350, 0x00008508 }, /* GL_DECR_WRAP */ + { 6363, 0x00008508 }, /* GL_DECR_WRAP_EXT */ + { 6380, 0x00008B80 }, /* GL_DELETE_STATUS */ + { 6397, 0x00001801 }, /* GL_DEPTH */ + { 6406, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 6430, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 6444, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 6458, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 6478, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 6503, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 6523, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 6541, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 6562, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 6581, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 6602, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 6627, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 6653, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 6674, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 6699, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 6725, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 6746, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 6771, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 6797, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 6811, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 6826, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 6841, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 6861, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 6889, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 6917, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 6931, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 6953, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 6979, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 6998, 0x00001201 }, /* GL_DIFFUSE */ + { 7009, 0x00000BD0 }, /* GL_DITHER */ + { 7019, 0x00000A02 }, /* GL_DOMAIN */ + { 7029, 0x00001100 }, /* GL_DONT_CARE */ + { 7042, 0x000086AE }, /* GL_DOT3_RGB */ + { 7054, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7067, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7084, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 7101, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 7117, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 7133, 0x0000140A }, /* GL_DOUBLE */ + { 7143, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 7159, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 7174, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 7190, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 7210, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 7230, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 7246, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 7263, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 7284, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 7305, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 7322, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 7343, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 7364, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 7381, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 7402, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 7423, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 7440, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 7461, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 7482, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 7499, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 7520, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 7541, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 7558, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 7579, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 7600, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 7620, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 7640, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 7656, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 7676, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 7696, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 7712, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 7732, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 7752, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 7768, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 7788, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 7808, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 7824, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 7844, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 7864, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 7880, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 7900, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 7920, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 7936, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 7956, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 7976, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 7992, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8012, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8032, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8048, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8068, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8088, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 8120, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 8144, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 8164, 0x00000304 }, /* GL_DST_ALPHA */ + { 8177, 0x00000306 }, /* GL_DST_COLOR */ + { 8190, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 8206, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 8226, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 8242, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 8262, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 8278, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 8298, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 8311, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 8330, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 8364, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 8402, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 8429, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 8455, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 8479, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */ + { 8507, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 8539, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 8575, 0x00001600 }, /* GL_EMISSION */ + { 8587, 0x00002000 }, /* GL_ENABLE_BIT */ + { 8601, 0x00000202 }, /* GL_EQUAL */ + { 8610, 0x00001509 }, /* GL_EQUIV */ + { 8619, 0x00010000 }, /* GL_EVAL_BIT */ + { 8631, 0x00000800 }, /* GL_EXP */ + { 8638, 0x00000801 }, /* GL_EXP2 */ + { 8646, 0x00001F03 }, /* GL_EXTENSIONS */ + { 8660, 0x00002400 }, /* GL_EYE_LINEAR */ + { 8674, 0x00002502 }, /* GL_EYE_PLANE */ + { 8687, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 8712, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 8729, 0x00000000 }, /* GL_FALSE */ + { 8738, 0x00001101 }, /* GL_FASTEST */ + { 8749, 0x00001C01 }, /* GL_FEEDBACK */ + { 8761, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 8788, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 8812, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 8836, 0x00001B02 }, /* GL_FILL */ + { 8844, 0x00001D00 }, /* GL_FLAT */ + { 8852, 0x00001406 }, /* GL_FLOAT */ + { 8861, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 8875, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 8893, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 8907, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 8925, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 8939, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 8957, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 8971, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 8989, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 9003, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 9021, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 9035, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 9053, 0x00000B60 }, /* GL_FOG */ + { 9060, 0x00000080 }, /* GL_FOG_BIT */ + { 9071, 0x00000B66 }, /* GL_FOG_COLOR */ + { 9084, 0x00008451 }, /* GL_FOG_COORD */ + { 9097, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 9115, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 9139, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 9178, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 9221, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 9253, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 9284, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 9313, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 9338, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 9357, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 9391, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 9418, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 9444, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 9468, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 9485, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 9500, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 9524, 0x00000B64 }, /* GL_FOG_END */ + { 9535, 0x00000C54 }, /* GL_FOG_HINT */ + { 9547, 0x00000B61 }, /* GL_FOG_INDEX */ + { 9560, 0x00000B65 }, /* GL_FOG_MODE */ + { 9572, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 9591, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 9616, 0x00000B63 }, /* GL_FOG_START */ + { 9629, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 9647, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 9671, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 9690, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 9713, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 9748, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 9790, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 9832, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 9881, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 9933, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 9977, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 10021, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 10048, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 10076, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 10095, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 10136, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 10177, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 10219, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 10270, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 10308, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 10357, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 10399, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 10431, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 10462, 0x00000404 }, /* GL_FRONT */ + { 10471, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 10489, 0x00000B46 }, /* GL_FRONT_FACE */ + { 10503, 0x00000400 }, /* GL_FRONT_LEFT */ + { 10517, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 10532, 0x00008006 }, /* GL_FUNC_ADD */ + { 10544, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 10560, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 10585, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 10614, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 10631, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 10652, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 10671, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 10695, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 10724, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 10748, 0x00000206 }, /* GL_GEQUAL */ + { 10758, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ + { 10783, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ + { 10811, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + { 10845, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ + { 10867, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + { 10895, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + { 10932, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ + { 10951, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ + { 10970, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ + { 10989, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ + { 11008, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ + { 11027, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ + { 11046, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ + { 11070, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + { 11102, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ + { 11128, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 11162, 0x00008C46 }, /* GL_GL_SLUMINANCE */ + { 11179, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ + { 11197, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ + { 11222, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ + { 11245, 0x00008C40 }, /* GL_GL_SRGB */ + { 11256, 0x00008C41 }, /* GL_GL_SRGB8 */ + { 11268, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ + { 11287, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ + { 11304, 0x00000204 }, /* GL_GREATER */ + { 11315, 0x00001904 }, /* GL_GREEN */ + { 11324, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 11338, 0x00000D53 }, /* GL_GREEN_BITS */ + { 11352, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 11367, 0x00008000 }, /* GL_HINT_BIT */ + { 11379, 0x00008024 }, /* GL_HISTOGRAM */ + { 11392, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 11416, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 11444, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 11467, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 11494, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 11511, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 11531, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 11555, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 11579, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 11607, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 11635, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 11667, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 11689, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 11715, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 11733, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 11755, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 11774, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 11797, 0x0000862A }, /* GL_IDENTITY_NV */ + { 11812, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 11832, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 11872, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 11910, 0x00001E02 }, /* GL_INCR */ + { 11918, 0x00008507 }, /* GL_INCR_WRAP */ + { 11931, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 11948, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 11963, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 11993, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 12027, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 12050, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 12072, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 12092, 0x00000D51 }, /* GL_INDEX_BITS */ + { 12106, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 12127, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 12145, 0x00000C30 }, /* GL_INDEX_MODE */ + { 12159, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 12175, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 12190, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 12209, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 12228, 0x00001404 }, /* GL_INT */ + { 12235, 0x00008049 }, /* GL_INTENSITY */ + { 12248, 0x0000804C }, /* GL_INTENSITY12 */ + { 12263, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 12282, 0x0000804D }, /* GL_INTENSITY16 */ + { 12297, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 12316, 0x0000804A }, /* GL_INTENSITY4 */ + { 12330, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 12348, 0x0000804B }, /* GL_INTENSITY8 */ + { 12362, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 12380, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 12397, 0x00008575 }, /* GL_INTERPOLATE */ + { 12412, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 12431, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 12450, 0x00008B53 }, /* GL_INT_VEC2 */ + { 12462, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 12478, 0x00008B54 }, /* GL_INT_VEC3 */ + { 12490, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 12506, 0x00008B55 }, /* GL_INT_VEC4 */ + { 12518, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 12534, 0x00000500 }, /* GL_INVALID_ENUM */ + { 12550, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 12587, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 12608, 0x00000501 }, /* GL_INVALID_VALUE */ + { 12625, 0x0000862B }, /* GL_INVERSE_NV */ + { 12639, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 12663, 0x0000150A }, /* GL_INVERT */ + { 12673, 0x00001E00 }, /* GL_KEEP */ + { 12681, 0x00000406 }, /* GL_LEFT */ + { 12689, 0x00000203 }, /* GL_LEQUAL */ + { 12699, 0x00000201 }, /* GL_LESS */ + { 12707, 0x00004000 }, /* GL_LIGHT0 */ + { 12717, 0x00004001 }, /* GL_LIGHT1 */ + { 12727, 0x00004002 }, /* GL_LIGHT2 */ + { 12737, 0x00004003 }, /* GL_LIGHT3 */ + { 12747, 0x00004004 }, /* GL_LIGHT4 */ + { 12757, 0x00004005 }, /* GL_LIGHT5 */ + { 12767, 0x00004006 }, /* GL_LIGHT6 */ + { 12777, 0x00004007 }, /* GL_LIGHT7 */ + { 12787, 0x00000B50 }, /* GL_LIGHTING */ + { 12799, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 12815, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 12838, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 12867, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 12900, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 12928, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 12952, 0x00001B01 }, /* GL_LINE */ + { 12960, 0x00002601 }, /* GL_LINEAR */ + { 12970, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 12992, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 13022, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 13053, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 13077, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 13102, 0x00000001 }, /* GL_LINES */ + { 13111, 0x00000004 }, /* GL_LINE_BIT */ + { 13123, 0x00000002 }, /* GL_LINE_LOOP */ + { 13136, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 13156, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 13171, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 13191, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 13207, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 13231, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 13254, 0x00000003 }, /* GL_LINE_STRIP */ + { 13268, 0x00000702 }, /* GL_LINE_TOKEN */ + { 13282, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 13296, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 13322, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 13342, 0x00008B82 }, /* GL_LINK_STATUS */ + { 13357, 0x00000B32 }, /* GL_LIST_BASE */ + { 13370, 0x00020000 }, /* GL_LIST_BIT */ + { 13382, 0x00000B33 }, /* GL_LIST_INDEX */ + { 13396, 0x00000B30 }, /* GL_LIST_MODE */ + { 13409, 0x00000101 }, /* GL_LOAD */ + { 13417, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 13429, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 13446, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 13460, 0x00001909 }, /* GL_LUMINANCE */ + { 13473, 0x00008041 }, /* GL_LUMINANCE12 */ + { 13488, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 13511, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 13538, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 13560, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 13586, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 13605, 0x00008042 }, /* GL_LUMINANCE16 */ + { 13620, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 13643, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 13670, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 13689, 0x0000803F }, /* GL_LUMINANCE4 */ + { 13703, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 13724, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 13749, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 13767, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 13788, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 13813, 0x00008040 }, /* GL_LUMINANCE8 */ + { 13827, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 13848, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 13873, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 13891, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 13910, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 13926, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 13946, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 13968, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 13982, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 13997, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 14021, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 14045, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 14069, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 14093, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 14110, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 14127, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 14155, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 14184, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 14213, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 14242, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 14271, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 14300, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 14329, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 14357, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 14385, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 14413, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 14441, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 14469, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 14497, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 14525, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 14553, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 14581, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 14597, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 14617, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 14639, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 14653, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 14668, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 14692, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 14716, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 14740, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 14764, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 14781, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 14798, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 14826, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 14855, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 14884, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 14913, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 14942, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 14971, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 15000, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 15028, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 15056, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 15084, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 15112, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 15140, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 15168, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 15196, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 15224, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 15252, 0x00000D10 }, /* GL_MAP_COLOR */ + { 15265, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 15280, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 15295, 0x00008630 }, /* GL_MATRIX0_NV */ + { 15309, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 15325, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 15341, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 15357, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 15373, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 15389, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 15405, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 15421, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 15437, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 15453, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 15469, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 15484, 0x00008631 }, /* GL_MATRIX1_NV */ + { 15498, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 15514, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 15530, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 15546, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 15562, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 15578, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 15594, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 15610, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 15626, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 15642, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 15658, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 15673, 0x00008632 }, /* GL_MATRIX2_NV */ + { 15687, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 15703, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 15719, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 15734, 0x00008633 }, /* GL_MATRIX3_NV */ + { 15748, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 15763, 0x00008634 }, /* GL_MATRIX4_NV */ + { 15777, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 15792, 0x00008635 }, /* GL_MATRIX5_NV */ + { 15806, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 15821, 0x00008636 }, /* GL_MATRIX6_NV */ + { 15835, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 15850, 0x00008637 }, /* GL_MATRIX7_NV */ + { 15864, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 15879, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 15894, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 15920, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 15954, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 15985, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 16018, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 16049, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 16064, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 16086, 0x00008008 }, /* GL_MAX */ + { 16093, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 16116, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 16148, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 16174, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 16207, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 16233, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 16267, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 16286, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 16315, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 16347, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 16383, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 16419, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 16459, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 16485, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 16515, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 16540, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 16569, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 16598, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 16631, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 16651, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 16675, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 16699, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 16723, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 16748, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 16766, 0x00008008 }, /* GL_MAX_EXT */ + { 16777, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 16812, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 16851, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 16865, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 16885, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 16923, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 16952, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 16976, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 17004, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 17027, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 17064, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 17100, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 17127, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 17156, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 17190, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 17226, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 17253, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 17285, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 17321, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 17350, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 17379, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 17407, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 17445, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 17489, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 17532, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 17566, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 17605, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 17642, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 17680, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 17723, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 17766, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 17796, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 17827, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 17863, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 17899, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 17929, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 17963, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 17996, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 18025, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 18045, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 18069, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 18091, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 18117, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 18144, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 18175, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 18199, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 18233, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 18253, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 18280, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 18301, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 18326, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 18351, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 18386, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 18408, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 18434, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 18456, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 18482, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 18516, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 18554, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 18587, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 18624, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 18648, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 18669, 0x00008007 }, /* GL_MIN */ + { 18676, 0x0000802E }, /* GL_MINMAX */ + { 18686, 0x0000802E }, /* GL_MINMAX_EXT */ + { 18700, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 18717, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 18738, 0x00008030 }, /* GL_MINMAX_SINK */ + { 18753, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 18772, 0x00008007 }, /* GL_MIN_EXT */ + { 18783, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 18802, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 18825, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 18848, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 18868, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 18888, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 18918, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 18946, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 18974, 0x00001700 }, /* GL_MODELVIEW */ + { 18987, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 19005, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 19024, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 19043, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 19062, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 19081, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 19100, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 19119, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 19138, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 19157, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 19176, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 19195, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 19213, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 19232, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 19251, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 19270, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 19289, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 19308, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 19327, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 19346, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 19365, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 19384, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 19403, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 19421, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 19440, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 19459, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 19477, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 19495, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 19513, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 19531, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 19549, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 19567, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 19585, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 19605, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 19632, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 19657, 0x00002100 }, /* GL_MODULATE */ + { 19669, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 19689, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 19716, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 19741, 0x00000103 }, /* GL_MULT */ + { 19749, 0x0000809D }, /* GL_MULTISAMPLE */ + { 19764, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 19784, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 19803, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 19822, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 19846, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 19869, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 19899, 0x00002A25 }, /* GL_N3F_V3F */ + { 19910, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 19930, 0x0000150E }, /* GL_NAND */ + { 19938, 0x00002600 }, /* GL_NEAREST */ + { 19949, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 19980, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 20012, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 20037, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 20063, 0x00000200 }, /* GL_NEVER */ + { 20072, 0x00001102 }, /* GL_NICEST */ + { 20082, 0x00000000 }, /* GL_NONE */ + { 20090, 0x00001505 }, /* GL_NOOP */ + { 20098, 0x00001508 }, /* GL_NOR */ + { 20105, 0x00000BA1 }, /* GL_NORMALIZE */ + { 20118, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 20134, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 20165, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 20200, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 20224, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 20247, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 20268, 0x00008511 }, /* GL_NORMAL_MAP */ + { 20282, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 20300, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 20317, 0x00000205 }, /* GL_NOTEQUAL */ + { 20329, 0x00000000 }, /* GL_NO_ERROR */ + { 20341, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 20375, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 20413, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 20445, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 20487, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 20517, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 20557, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 20588, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 20617, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 20645, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 20675, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 20692, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 20718, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 20734, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 20769, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 20791, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 20810, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 20840, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 20861, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 20889, 0x00000001 }, /* GL_ONE */ + { 20896, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 20924, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 20956, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 20984, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 21016, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 21039, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 21062, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 21085, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 21108, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 21126, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 21148, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 21170, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 21186, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 21206, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 21226, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 21244, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 21266, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 21288, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 21304, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 21324, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 21344, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 21362, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 21384, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 21406, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 21422, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 21442, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 21462, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 21483, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 21502, 0x00001507 }, /* GL_OR */ + { 21508, 0x00000A01 }, /* GL_ORDER */ + { 21517, 0x0000150D }, /* GL_OR_INVERTED */ + { 21532, 0x0000150B }, /* GL_OR_REVERSE */ + { 21546, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 21563, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 21581, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 21602, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 21622, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 21640, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 21659, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 21679, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 21699, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 21717, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 21736, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 21761, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 21785, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 21806, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 21828, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 21850, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 21875, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 21899, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 21920, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 21942, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 21964, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 21986, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 22017, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 22037, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 22062, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 22082, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 22107, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 22127, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 22152, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 22172, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 22197, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 22217, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 22242, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 22262, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 22287, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 22307, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 22332, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 22352, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 22377, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 22397, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 22422, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 22442, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 22467, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 22485, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 22518, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 22543, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 22578, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 22605, 0x00001B00 }, /* GL_POINT */ + { 22614, 0x00000000 }, /* GL_POINTS */ + { 22624, 0x00000002 }, /* GL_POINT_BIT */ + { 22637, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 22667, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 22701, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 22735, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 22770, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 22799, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 22832, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 22865, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 22899, 0x00000B11 }, /* GL_POINT_SIZE */ + { 22913, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 22939, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 22957, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 22979, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 23001, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 23024, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 23042, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 23064, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 23086, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 23109, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 23129, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 23145, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 23166, 0x00008861 }, /* GL_POINT_SPRITE */ + { 23182, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 23202, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 23231, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 23250, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 23276, 0x00000701 }, /* GL_POINT_TOKEN */ + { 23291, 0x00000009 }, /* GL_POLYGON */ + { 23302, 0x00000008 }, /* GL_POLYGON_BIT */ + { 23317, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 23333, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 23356, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 23381, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 23404, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 23427, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 23451, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 23475, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 23493, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 23516, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 23535, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 23558, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 23575, 0x00001203 }, /* GL_POSITION */ + { 23587, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 23619, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 23655, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 23688, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 23725, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 23756, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 23791, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 23823, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 23859, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 23892, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 23924, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 23960, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 23993, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 24030, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 24060, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 24094, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 24125, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 24160, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 24191, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 24226, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 24258, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 24294, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 24324, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 24358, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 24389, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 24424, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 24456, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 24487, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 24522, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 24554, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 24590, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 24619, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 24652, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 24682, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 24716, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 24755, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 24788, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 24828, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 24862, 0x00008578 }, /* GL_PREVIOUS */ + { 24874, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 24890, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 24906, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 24923, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 24944, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 24965, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 24998, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 25030, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 25053, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 25076, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 25106, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 25135, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 25163, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 25185, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 25213, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 25241, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 25263, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 25284, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 25324, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 25363, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 25393, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 25428, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 25461, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 25495, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 25534, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 25573, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 25595, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 25621, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 25645, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 25668, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 25690, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 25711, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 25732, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 25759, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 25791, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 25823, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 25858, 0x00001701 }, /* GL_PROJECTION */ + { 25872, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 25893, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 25919, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 25940, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 25959, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 25982, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 26021, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 26059, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 26079, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 26109, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 26133, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 26153, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 26183, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 26207, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 26227, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 26260, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 26286, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 26316, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 26347, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 26377, 0x00002003 }, /* GL_Q */ + { 26382, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 26407, 0x00000007 }, /* GL_QUADS */ + { 26416, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 26433, 0x00000008 }, /* GL_QUAD_STRIP */ + { 26447, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 26469, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 26495, 0x00008866 }, /* GL_QUERY_RESULT */ + { 26511, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 26531, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 26557, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 26587, 0x00002002 }, /* GL_R */ + { 26592, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 26604, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 26637, 0x00000C02 }, /* GL_READ_BUFFER */ + { 26652, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 26684, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 26708, 0x000088B8 }, /* GL_READ_ONLY */ + { 26721, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 26738, 0x000088BA }, /* GL_READ_WRITE */ + { 26752, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 26770, 0x00001903 }, /* GL_RED */ + { 26777, 0x00008016 }, /* GL_REDUCE */ + { 26787, 0x00008016 }, /* GL_REDUCE_EXT */ + { 26801, 0x00000D15 }, /* GL_RED_BIAS */ + { 26813, 0x00000D52 }, /* GL_RED_BITS */ + { 26825, 0x00000D14 }, /* GL_RED_SCALE */ + { 26838, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 26856, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 26878, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 26899, 0x00001C00 }, /* GL_RENDER */ + { 26909, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 26937, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 26957, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 26984, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 27020, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 27046, 0x00001F01 }, /* GL_RENDERER */ + { 27058, 0x00000C40 }, /* GL_RENDER_MODE */ + { 27073, 0x00002901 }, /* GL_REPEAT */ + { 27083, 0x00001E01 }, /* GL_REPLACE */ + { 27094, 0x00008062 }, /* GL_REPLACE_EXT */ + { 27109, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 27132, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 27150, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 27172, 0x00000102 }, /* GL_RETURN */ + { 27182, 0x00001907 }, /* GL_RGB */ + { 27189, 0x00008052 }, /* GL_RGB10 */ + { 27198, 0x00008059 }, /* GL_RGB10_A2 */ + { 27210, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 27226, 0x00008052 }, /* GL_RGB10_EXT */ + { 27239, 0x00008053 }, /* GL_RGB12 */ + { 27248, 0x00008053 }, /* GL_RGB12_EXT */ + { 27261, 0x00008054 }, /* GL_RGB16 */ + { 27270, 0x00008054 }, /* GL_RGB16_EXT */ + { 27283, 0x0000804E }, /* GL_RGB2_EXT */ + { 27295, 0x0000804F }, /* GL_RGB4 */ + { 27303, 0x0000804F }, /* GL_RGB4_EXT */ + { 27315, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 27328, 0x00008050 }, /* GL_RGB5 */ + { 27336, 0x00008057 }, /* GL_RGB5_A1 */ + { 27347, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 27362, 0x00008050 }, /* GL_RGB5_EXT */ + { 27374, 0x00008051 }, /* GL_RGB8 */ + { 27382, 0x00008051 }, /* GL_RGB8_EXT */ + { 27394, 0x00001908 }, /* GL_RGBA */ + { 27402, 0x0000805A }, /* GL_RGBA12 */ + { 27412, 0x0000805A }, /* GL_RGBA12_EXT */ + { 27426, 0x0000805B }, /* GL_RGBA16 */ + { 27436, 0x0000805B }, /* GL_RGBA16_EXT */ + { 27450, 0x00008055 }, /* GL_RGBA2 */ + { 27459, 0x00008055 }, /* GL_RGBA2_EXT */ + { 27472, 0x00008056 }, /* GL_RGBA4 */ + { 27481, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 27500, 0x00008056 }, /* GL_RGBA4_EXT */ + { 27513, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 27527, 0x00008058 }, /* GL_RGBA8 */ + { 27536, 0x00008058 }, /* GL_RGBA8_EXT */ + { 27549, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 27567, 0x00000C31 }, /* GL_RGBA_MODE */ + { 27580, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 27593, 0x000083A0 }, /* GL_RGB_S3TC */ + { 27605, 0x00008573 }, /* GL_RGB_SCALE */ + { 27618, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 27635, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 27652, 0x00000407 }, /* GL_RIGHT */ + { 27661, 0x00002000 }, /* GL_S */ + { 27666, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 27680, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 27701, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 27715, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 27736, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 27750, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 27766, 0x000080A9 }, /* GL_SAMPLES */ + { 27777, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 27793, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 27808, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 27826, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 27848, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 27876, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 27908, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 27931, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 27958, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 27976, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 27999, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 28021, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 28040, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 28063, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 28089, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 28119, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 28144, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 28173, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 28188, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 28203, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 28219, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 28244, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 28284, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 28328, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 28361, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 28391, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 28423, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 28453, 0x00001C02 }, /* GL_SELECT */ + { 28463, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 28491, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 28516, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 28532, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 28559, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 28590, 0x0000150F }, /* GL_SET */ + { 28597, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 28618, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 28642, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 28657, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 28672, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 28700, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 28723, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 28753, 0x00001601 }, /* GL_SHININESS */ + { 28766, 0x00001402 }, /* GL_SHORT */ + { 28775, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 28791, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 28811, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 28830, 0x00001D01 }, /* GL_SMOOTH */ + { 28840, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 28873, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 28900, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 28933, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 28960, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 28977, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 28998, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 29019, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 29034, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 29053, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 29072, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 29089, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 29110, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 29131, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 29146, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 29165, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 29184, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 29201, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 29222, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 29243, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 29258, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 29277, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 29296, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 29316, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 29334, 0x00001202 }, /* GL_SPECULAR */ + { 29346, 0x00002402 }, /* GL_SPHERE_MAP */ + { 29360, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 29375, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 29393, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 29410, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 29424, 0x00008580 }, /* GL_SRC0_RGB */ + { 29436, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 29450, 0x00008581 }, /* GL_SRC1_RGB */ + { 29462, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 29476, 0x00008582 }, /* GL_SRC2_RGB */ + { 29488, 0x00000302 }, /* GL_SRC_ALPHA */ + { 29501, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 29523, 0x00000300 }, /* GL_SRC_COLOR */ + { 29536, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 29554, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 29573, 0x000088E6 }, /* GL_STATIC_COPY */ + { 29588, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 29607, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 29622, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 29641, 0x000088E5 }, /* GL_STATIC_READ */ + { 29656, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 29675, 0x00001802 }, /* GL_STENCIL */ + { 29686, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 29712, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 29733, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 29754, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 29786, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 29818, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 29838, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 29865, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 29891, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 29907, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 29929, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 29952, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 29968, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 29984, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 30001, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 30024, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 30046, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 30068, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 30090, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 30111, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 30138, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 30165, 0x00000B97 }, /* GL_STENCIL_REF */ + { 30180, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 30196, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 30225, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 30247, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 30268, 0x00000C33 }, /* GL_STEREO */ + { 30278, 0x000088E2 }, /* GL_STREAM_COPY */ + { 30293, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 30312, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 30327, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 30346, 0x000088E1 }, /* GL_STREAM_READ */ + { 30361, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 30380, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 30397, 0x000084E7 }, /* GL_SUBTRACT */ + { 30409, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 30425, 0x00002001 }, /* GL_T */ + { 30430, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 30445, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 30464, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 30480, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 30495, 0x00002A27 }, /* GL_T2F_V3F */ + { 30506, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 30525, 0x00002A28 }, /* GL_T4F_V4F */ + { 30536, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 30559, 0x00001702 }, /* GL_TEXTURE */ + { 30570, 0x000084C0 }, /* GL_TEXTURE0 */ + { 30582, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 30598, 0x000084C1 }, /* GL_TEXTURE1 */ + { 30610, 0x000084CA }, /* GL_TEXTURE10 */ + { 30623, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 30640, 0x000084CB }, /* GL_TEXTURE11 */ + { 30653, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 30670, 0x000084CC }, /* GL_TEXTURE12 */ + { 30683, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 30700, 0x000084CD }, /* GL_TEXTURE13 */ + { 30713, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 30730, 0x000084CE }, /* GL_TEXTURE14 */ + { 30743, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 30760, 0x000084CF }, /* GL_TEXTURE15 */ + { 30773, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 30790, 0x000084D0 }, /* GL_TEXTURE16 */ + { 30803, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 30820, 0x000084D1 }, /* GL_TEXTURE17 */ + { 30833, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 30850, 0x000084D2 }, /* GL_TEXTURE18 */ + { 30863, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 30880, 0x000084D3 }, /* GL_TEXTURE19 */ + { 30893, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 30910, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 30926, 0x000084C2 }, /* GL_TEXTURE2 */ + { 30938, 0x000084D4 }, /* GL_TEXTURE20 */ + { 30951, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 30968, 0x000084D5 }, /* GL_TEXTURE21 */ + { 30981, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 30998, 0x000084D6 }, /* GL_TEXTURE22 */ + { 31011, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 31028, 0x000084D7 }, /* GL_TEXTURE23 */ + { 31041, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 31058, 0x000084D8 }, /* GL_TEXTURE24 */ + { 31071, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 31088, 0x000084D9 }, /* GL_TEXTURE25 */ + { 31101, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 31118, 0x000084DA }, /* GL_TEXTURE26 */ + { 31131, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 31148, 0x000084DB }, /* GL_TEXTURE27 */ + { 31161, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 31178, 0x000084DC }, /* GL_TEXTURE28 */ + { 31191, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 31208, 0x000084DD }, /* GL_TEXTURE29 */ + { 31221, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 31238, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 31254, 0x000084C3 }, /* GL_TEXTURE3 */ + { 31266, 0x000084DE }, /* GL_TEXTURE30 */ + { 31279, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 31296, 0x000084DF }, /* GL_TEXTURE31 */ + { 31309, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 31326, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 31342, 0x000084C4 }, /* GL_TEXTURE4 */ + { 31354, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 31370, 0x000084C5 }, /* GL_TEXTURE5 */ + { 31382, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 31398, 0x000084C6 }, /* GL_TEXTURE6 */ + { 31410, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 31426, 0x000084C7 }, /* GL_TEXTURE7 */ + { 31438, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 31454, 0x000084C8 }, /* GL_TEXTURE8 */ + { 31466, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 31482, 0x000084C9 }, /* GL_TEXTURE9 */ + { 31494, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 31510, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 31524, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 31548, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 31562, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 31586, 0x0000806F }, /* GL_TEXTURE_3D */ + { 31600, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 31622, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 31648, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 31670, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 31692, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 31724, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 31746, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 31778, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 31800, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 31828, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 31860, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 31893, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 31925, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 31940, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 31961, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 31986, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 32004, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 32028, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 32059, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 32089, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 32119, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 32154, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 32185, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 32223, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 32250, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 32282, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 32316, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 32340, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 32368, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 32392, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 32420, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 32453, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 32477, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 32499, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 32521, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 32547, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 32581, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 32614, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 32651, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 32679, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 32711, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 32734, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 32772, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 32814, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 32845, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 32873, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 32903, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 32931, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 32951, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 32975, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 33006, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 33041, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 33072, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 33107, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 33138, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 33173, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 33204, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 33239, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 33270, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 33305, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 33336, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 33371, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 33388, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 33410, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 33436, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 33451, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 33472, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 33492, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 33518, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 33538, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 33555, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 33572, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 33589, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 33606, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 33631, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 33653, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 33679, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 33697, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 33723, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 33749, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 33779, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 33806, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 33831, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 33851, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 33875, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 33902, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 33929, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 33956, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 33982, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 34012, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 34034, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 34052, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 34082, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 34110, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 34138, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 34166, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 34187, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 34206, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 34228, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 34247, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 34267, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 34292, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 34316, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 34336, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 34360, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 34380, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 34403, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 34428, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 34462, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 34479, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 34497, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 34515, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 34533, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 34553, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 34572, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 34601, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 34618, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 34644, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 34674, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 34706, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 34736, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 34770, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 34786, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 34817, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 34852, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 34880, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 34912, 0x00000004 }, /* GL_TRIANGLES */ + { 34925, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 34941, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 34962, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 34980, 0x00000001 }, /* GL_TRUE */ + { 34988, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 35008, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 35031, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 35051, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 35072, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 35094, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 35116, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 35136, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 35157, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 35174, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 35201, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 35224, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 35240, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 35267, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 35291, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 35322, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 35346, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 35374, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 35392, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 35422, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 35448, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 35478, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 35504, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 35528, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 35556, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 35584, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 35611, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 35643, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 35674, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 35688, 0x00002A20 }, /* GL_V2F */ + { 35695, 0x00002A21 }, /* GL_V3F */ + { 35702, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 35721, 0x00001F00 }, /* GL_VENDOR */ + { 35731, 0x00001F02 }, /* GL_VERSION */ + { 35742, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 35758, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 35788, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 35819, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 35854, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 35878, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 35899, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 35922, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 35943, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 35970, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 35998, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 36026, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 36054, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 36082, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 36110, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 36138, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 36165, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 36192, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 36219, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 36246, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 36273, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 36300, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 36327, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 36354, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 36381, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 36419, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 36461, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 36492, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 36527, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 36561, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 36599, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 36630, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 36665, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 36693, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 36725, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 36755, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 36789, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 36817, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 36849, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 36869, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 36891, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 36920, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 36941, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 36970, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 37003, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 37035, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 37062, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 37093, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 37123, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 37140, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 37161, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 37188, 0x00000BA2 }, /* GL_VIEWPORT */ + { 37200, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 37216, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 37236, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 37267, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 37302, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 37330, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 37355, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 37382, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 37407, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 37431, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 37450, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 37464, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 37482, 0x00001506 }, /* GL_XOR */ + { 37489, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 37508, 0x00008757 }, /* GL_YCBCR_MESA */ + { 37522, 0x00000000 }, /* GL_ZERO */ + { 37530, 0x00000D16 }, /* GL_ZOOM_X */ + { 37540, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1277] = +static const unsigned reduced_enums[1284] = { - 435, /* GL_FALSE */ - 643, /* GL_LINES */ - 645, /* GL_LINE_LOOP */ - 652, /* GL_LINE_STRIP */ - 1628, /* GL_TRIANGLES */ - 1631, /* GL_TRIANGLE_STRIP */ - 1629, /* GL_TRIANGLE_FAN */ - 1206, /* GL_QUADS */ - 1208, /* GL_QUAD_STRIP */ - 1096, /* GL_POLYGON */ - 1108, /* GL_POLYGON_STIPPLE_BIT */ - 1061, /* GL_PIXEL_MODE_BIT */ - 630, /* GL_LIGHTING_BIT */ - 457, /* GL_FOG_BIT */ + 436, /* GL_FALSE */ + 645, /* GL_LINES */ + 647, /* GL_LINE_LOOP */ + 654, /* GL_LINE_STRIP */ + 1637, /* GL_TRIANGLES */ + 1640, /* GL_TRIANGLE_STRIP */ + 1638, /* GL_TRIANGLE_FAN */ + 1211, /* GL_QUADS */ + 1213, /* GL_QUAD_STRIP */ + 1099, /* GL_POLYGON */ + 1111, /* GL_POLYGON_STIPPLE_BIT */ + 1064, /* GL_PIXEL_MODE_BIT */ + 632, /* GL_LIGHTING_BIT */ + 458, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 662, /* GL_LOAD */ - 1248, /* GL_RETURN */ - 934, /* GL_MULT */ + 664, /* GL_LOAD */ + 1253, /* GL_RETURN */ + 937, /* GL_MULT */ 23, /* GL_ADD */ - 950, /* GL_NEVER */ - 620, /* GL_LESS */ - 425, /* GL_EQUAL */ - 619, /* GL_LEQUAL */ - 545, /* GL_GREATER */ - 965, /* GL_NOTEQUAL */ - 520, /* GL_GEQUAL */ + 953, /* GL_NEVER */ + 622, /* GL_LESS */ + 426, /* GL_EQUAL */ + 621, /* GL_LEQUAL */ + 547, /* GL_GREATER */ + 968, /* GL_NOTEQUAL */ + 522, /* GL_GEQUAL */ 46, /* GL_ALWAYS */ - 1381, /* GL_SRC_COLOR */ - 994, /* GL_ONE_MINUS_SRC_COLOR */ - 1379, /* GL_SRC_ALPHA */ - 993, /* GL_ONE_MINUS_SRC_ALPHA */ - 405, /* GL_DST_ALPHA */ - 991, /* GL_ONE_MINUS_DST_ALPHA */ - 406, /* GL_DST_COLOR */ - 992, /* GL_ONE_MINUS_DST_COLOR */ - 1380, /* GL_SRC_ALPHA_SATURATE */ - 508, /* GL_FRONT_LEFT */ - 509, /* GL_FRONT_RIGHT */ + 1386, /* GL_SRC_COLOR */ + 997, /* GL_ONE_MINUS_SRC_COLOR */ + 1384, /* GL_SRC_ALPHA */ + 996, /* GL_ONE_MINUS_SRC_ALPHA */ + 406, /* GL_DST_ALPHA */ + 994, /* GL_ONE_MINUS_DST_ALPHA */ + 407, /* GL_DST_COLOR */ + 995, /* GL_ONE_MINUS_DST_COLOR */ + 1385, /* GL_SRC_ALPHA_SATURATE */ + 510, /* GL_FRONT_LEFT */ + 511, /* GL_FRONT_RIGHT */ 69, /* GL_BACK_LEFT */ 70, /* GL_BACK_RIGHT */ - 505, /* GL_FRONT */ + 507, /* GL_FRONT */ 68, /* GL_BACK */ - 618, /* GL_LEFT */ - 1288, /* GL_RIGHT */ - 506, /* GL_FRONT_AND_BACK */ + 620, /* GL_LEFT */ + 1293, /* GL_RIGHT */ + 508, /* GL_FRONT_AND_BACK */ 63, /* GL_AUX0 */ 64, /* GL_AUX1 */ 65, /* GL_AUX2 */ 66, /* GL_AUX3 */ - 610, /* GL_INVALID_ENUM */ - 613, /* GL_INVALID_VALUE */ - 612, /* GL_INVALID_OPERATION */ - 1382, /* GL_STACK_OVERFLOW */ - 1383, /* GL_STACK_UNDERFLOW */ - 1019, /* GL_OUT_OF_MEMORY */ - 611, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + 612, /* GL_INVALID_ENUM */ + 615, /* GL_INVALID_VALUE */ + 614, /* GL_INVALID_OPERATION */ + 1387, /* GL_STACK_OVERFLOW */ + 1388, /* GL_STACK_UNDERFLOW */ + 1022, /* GL_OUT_OF_MEMORY */ + 613, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1039, /* GL_PASS_THROUGH_TOKEN */ - 1095, /* GL_POINT_TOKEN */ - 653, /* GL_LINE_TOKEN */ - 1109, /* GL_POLYGON_TOKEN */ + 1042, /* GL_PASS_THROUGH_TOKEN */ + 1098, /* GL_POINT_TOKEN */ + 655, /* GL_LINE_TOKEN */ + 1112, /* GL_POLYGON_TOKEN */ 74, /* GL_BITMAP_TOKEN */ - 404, /* GL_DRAW_PIXEL_TOKEN */ - 270, /* GL_COPY_PIXEL_TOKEN */ - 646, /* GL_LINE_RESET_TOKEN */ - 428, /* GL_EXP */ - 429, /* GL_EXP2 */ - 303, /* GL_CW */ + 405, /* GL_DRAW_PIXEL_TOKEN */ + 271, /* GL_COPY_PIXEL_TOKEN */ + 648, /* GL_LINE_RESET_TOKEN */ + 429, /* GL_EXP */ + 430, /* GL_EXP2 */ + 304, /* GL_CW */ 116, /* GL_CCW */ 137, /* GL_COEFF */ - 1016, /* 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 */ - 1088, /* GL_POINT_SMOOTH */ - 1077, /* GL_POINT_SIZE */ - 1087, /* GL_POINT_SIZE_RANGE */ - 1078, /* 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 */ - 819, /* GL_MAX_LIST_NESTING */ - 658, /* GL_LIST_BASE */ - 660, /* GL_LIST_INDEX */ - 1098, /* GL_POLYGON_MODE */ - 1105, /* GL_POLYGON_SMOOTH */ - 1107, /* 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 */ - 1334, /* GL_SHADE_MODEL */ + 1019, /* GL_ORDER */ + 344, /* GL_DOMAIN */ + 279, /* GL_CURRENT_COLOR */ + 282, /* GL_CURRENT_INDEX */ + 288, /* GL_CURRENT_NORMAL */ + 300, /* GL_CURRENT_TEXTURE_COORDS */ + 293, /* GL_CURRENT_RASTER_COLOR */ + 295, /* GL_CURRENT_RASTER_INDEX */ + 298, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + 296, /* GL_CURRENT_RASTER_POSITION */ + 297, /* GL_CURRENT_RASTER_POSITION_VALID */ + 294, /* GL_CURRENT_RASTER_DISTANCE */ + 1091, /* GL_POINT_SMOOTH */ + 1080, /* GL_POINT_SIZE */ + 1090, /* GL_POINT_SIZE_RANGE */ + 1081, /* GL_POINT_SIZE_GRANULARITY */ + 649, /* GL_LINE_SMOOTH */ + 656, /* GL_LINE_WIDTH */ + 658, /* GL_LINE_WIDTH_RANGE */ + 657, /* GL_LINE_WIDTH_GRANULARITY */ + 651, /* GL_LINE_STIPPLE */ + 652, /* GL_LINE_STIPPLE_PATTERN */ + 653, /* GL_LINE_STIPPLE_REPEAT */ + 663, /* GL_LIST_MODE */ + 822, /* GL_MAX_LIST_NESTING */ + 660, /* GL_LIST_BASE */ + 662, /* GL_LIST_INDEX */ + 1101, /* GL_POLYGON_MODE */ + 1108, /* GL_POLYGON_SMOOTH */ + 1110, /* GL_POLYGON_STIPPLE */ + 414, /* GL_EDGE_FLAG */ + 272, /* GL_CULL_FACE */ + 273, /* GL_CULL_FACE_MODE */ + 509, /* GL_FRONT_FACE */ + 631, /* GL_LIGHTING */ + 636, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 637, /* GL_LIGHT_MODEL_TWO_SIDE */ + 633, /* GL_LIGHT_MODEL_AMBIENT */ + 1339, /* GL_SHADE_MODEL */ 168, /* GL_COLOR_MATERIAL_FACE */ 169, /* GL_COLOR_MATERIAL_PARAMETER */ 167, /* GL_COLOR_MATERIAL */ - 456, /* GL_FOG */ - 478, /* GL_FOG_INDEX */ - 474, /* GL_FOG_DENSITY */ - 482, /* GL_FOG_START */ - 476, /* GL_FOG_END */ - 479, /* GL_FOG_MODE */ - 458, /* GL_FOG_COLOR */ - 332, /* GL_DEPTH_RANGE */ - 337, /* GL_DEPTH_TEST */ - 340, /* GL_DEPTH_WRITEMASK */ - 320, /* GL_DEPTH_CLEAR_VALUE */ - 331, /* GL_DEPTH_FUNC */ + 457, /* GL_FOG */ + 479, /* GL_FOG_INDEX */ + 475, /* GL_FOG_DENSITY */ + 483, /* GL_FOG_START */ + 477, /* GL_FOG_END */ + 480, /* GL_FOG_MODE */ + 459, /* GL_FOG_COLOR */ + 333, /* GL_DEPTH_RANGE */ + 338, /* GL_DEPTH_TEST */ + 341, /* GL_DEPTH_WRITEMASK */ + 321, /* GL_DEPTH_CLEAR_VALUE */ + 332, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1413, /* GL_STENCIL_TEST */ - 1401, /* GL_STENCIL_CLEAR_VALUE */ - 1403, /* GL_STENCIL_FUNC */ - 1415, /* GL_STENCIL_VALUE_MASK */ - 1402, /* GL_STENCIL_FAIL */ - 1410, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1411, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1412, /* GL_STENCIL_REF */ - 1416, /* GL_STENCIL_WRITEMASK */ - 789, /* GL_MATRIX_MODE */ - 955, /* GL_NORMALIZE */ - 1718, /* GL_VIEWPORT */ - 929, /* GL_MODELVIEW_STACK_DEPTH */ - 1188, /* GL_PROJECTION_STACK_DEPTH */ - 1607, /* GL_TEXTURE_STACK_DEPTH */ - 927, /* GL_MODELVIEW_MATRIX */ - 1187, /* GL_PROJECTION_MATRIX */ - 1592, /* GL_TEXTURE_MATRIX */ + 1418, /* GL_STENCIL_TEST */ + 1406, /* GL_STENCIL_CLEAR_VALUE */ + 1408, /* GL_STENCIL_FUNC */ + 1420, /* GL_STENCIL_VALUE_MASK */ + 1407, /* GL_STENCIL_FAIL */ + 1415, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1416, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1417, /* GL_STENCIL_REF */ + 1421, /* GL_STENCIL_WRITEMASK */ + 791, /* GL_MATRIX_MODE */ + 958, /* GL_NORMALIZE */ + 1727, /* GL_VIEWPORT */ + 932, /* GL_MODELVIEW_STACK_DEPTH */ + 1191, /* GL_PROJECTION_STACK_DEPTH */ + 1616, /* GL_TEXTURE_STACK_DEPTH */ + 930, /* GL_MODELVIEW_MATRIX */ + 1190, /* GL_PROJECTION_MATRIX */ + 1601, /* GL_TEXTURE_MATRIX */ 61, /* GL_ATTRIB_STACK_DEPTH */ 127, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 342, /* GL_DITHER */ + 343, /* GL_DITHER */ 78, /* GL_BLEND_DST */ 86, /* GL_BLEND_SRC */ 75, /* GL_BLEND */ - 664, /* GL_LOGIC_OP_MODE */ - 584, /* GL_INDEX_LOGIC_OP */ + 666, /* GL_LOGIC_OP_MODE */ + 586, /* GL_INDEX_LOGIC_OP */ 166, /* GL_COLOR_LOGIC_OP */ 67, /* GL_AUX_BUFFERS */ - 353, /* GL_DRAW_BUFFER */ - 1218, /* GL_READ_BUFFER */ - 1315, /* GL_SCISSOR_BOX */ - 1316, /* GL_SCISSOR_TEST */ - 583, /* GL_INDEX_CLEAR_VALUE */ - 588, /* GL_INDEX_WRITEMASK */ + 354, /* GL_DRAW_BUFFER */ + 1223, /* GL_READ_BUFFER */ + 1320, /* GL_SCISSOR_BOX */ + 1321, /* GL_SCISSOR_TEST */ + 585, /* GL_INDEX_CLEAR_VALUE */ + 590, /* GL_INDEX_WRITEMASK */ 163, /* GL_COLOR_CLEAR_VALUE */ 205, /* GL_COLOR_WRITEMASK */ - 585, /* GL_INDEX_MODE */ - 1282, /* GL_RGBA_MODE */ - 352, /* GL_DOUBLEBUFFER */ - 1417, /* GL_STEREO */ - 1241, /* GL_RENDER_MODE */ - 1040, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1089, /* GL_POINT_SMOOTH_HINT */ - 648, /* GL_LINE_SMOOTH_HINT */ - 1106, /* GL_POLYGON_SMOOTH_HINT */ - 477, /* GL_FOG_HINT */ - 1573, /* GL_TEXTURE_GEN_S */ - 1574, /* GL_TEXTURE_GEN_T */ - 1572, /* GL_TEXTURE_GEN_R */ - 1571, /* GL_TEXTURE_GEN_Q */ - 1053, /* GL_PIXEL_MAP_I_TO_I */ - 1059, /* GL_PIXEL_MAP_S_TO_S */ - 1055, /* GL_PIXEL_MAP_I_TO_R */ - 1051, /* GL_PIXEL_MAP_I_TO_G */ - 1049, /* GL_PIXEL_MAP_I_TO_B */ - 1047, /* GL_PIXEL_MAP_I_TO_A */ - 1057, /* GL_PIXEL_MAP_R_TO_R */ - 1045, /* GL_PIXEL_MAP_G_TO_G */ - 1043, /* GL_PIXEL_MAP_B_TO_B */ - 1041, /* GL_PIXEL_MAP_A_TO_A */ - 1054, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1060, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1056, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1052, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1050, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1048, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1058, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1046, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1044, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1042, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1640, /* GL_UNPACK_SWAP_BYTES */ - 1635, /* GL_UNPACK_LSB_FIRST */ - 1636, /* GL_UNPACK_ROW_LENGTH */ - 1639, /* GL_UNPACK_SKIP_ROWS */ - 1638, /* GL_UNPACK_SKIP_PIXELS */ - 1633, /* GL_UNPACK_ALIGNMENT */ - 1028, /* GL_PACK_SWAP_BYTES */ - 1023, /* GL_PACK_LSB_FIRST */ - 1024, /* GL_PACK_ROW_LENGTH */ - 1027, /* GL_PACK_SKIP_ROWS */ - 1026, /* GL_PACK_SKIP_PIXELS */ - 1020, /* GL_PACK_ALIGNMENT */ - 742, /* GL_MAP_COLOR */ - 743, /* GL_MAP_STENCIL */ - 587, /* GL_INDEX_SHIFT */ - 586, /* GL_INDEX_OFFSET */ - 1230, /* GL_RED_SCALE */ - 1228, /* GL_RED_BIAS */ - 1735, /* GL_ZOOM_X */ - 1736, /* GL_ZOOM_Y */ - 549, /* GL_GREEN_SCALE */ - 547, /* GL_GREEN_BIAS */ + 587, /* GL_INDEX_MODE */ + 1287, /* GL_RGBA_MODE */ + 353, /* GL_DOUBLEBUFFER */ + 1422, /* GL_STEREO */ + 1246, /* GL_RENDER_MODE */ + 1043, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1092, /* GL_POINT_SMOOTH_HINT */ + 650, /* GL_LINE_SMOOTH_HINT */ + 1109, /* GL_POLYGON_SMOOTH_HINT */ + 478, /* GL_FOG_HINT */ + 1582, /* GL_TEXTURE_GEN_S */ + 1583, /* GL_TEXTURE_GEN_T */ + 1581, /* GL_TEXTURE_GEN_R */ + 1580, /* GL_TEXTURE_GEN_Q */ + 1056, /* GL_PIXEL_MAP_I_TO_I */ + 1062, /* GL_PIXEL_MAP_S_TO_S */ + 1058, /* GL_PIXEL_MAP_I_TO_R */ + 1054, /* GL_PIXEL_MAP_I_TO_G */ + 1052, /* GL_PIXEL_MAP_I_TO_B */ + 1050, /* GL_PIXEL_MAP_I_TO_A */ + 1060, /* GL_PIXEL_MAP_R_TO_R */ + 1048, /* GL_PIXEL_MAP_G_TO_G */ + 1046, /* GL_PIXEL_MAP_B_TO_B */ + 1044, /* GL_PIXEL_MAP_A_TO_A */ + 1057, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1063, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1059, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1055, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1053, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1051, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1061, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1049, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1047, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1045, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1649, /* GL_UNPACK_SWAP_BYTES */ + 1644, /* GL_UNPACK_LSB_FIRST */ + 1645, /* GL_UNPACK_ROW_LENGTH */ + 1648, /* GL_UNPACK_SKIP_ROWS */ + 1647, /* GL_UNPACK_SKIP_PIXELS */ + 1642, /* GL_UNPACK_ALIGNMENT */ + 1031, /* GL_PACK_SWAP_BYTES */ + 1026, /* GL_PACK_LSB_FIRST */ + 1027, /* GL_PACK_ROW_LENGTH */ + 1030, /* GL_PACK_SKIP_ROWS */ + 1029, /* GL_PACK_SKIP_PIXELS */ + 1023, /* GL_PACK_ALIGNMENT */ + 744, /* GL_MAP_COLOR */ + 745, /* GL_MAP_STENCIL */ + 589, /* GL_INDEX_SHIFT */ + 588, /* GL_INDEX_OFFSET */ + 1235, /* GL_RED_SCALE */ + 1233, /* GL_RED_BIAS */ + 1744, /* GL_ZOOM_X */ + 1745, /* GL_ZOOM_Y */ + 551, /* GL_GREEN_SCALE */ + 549, /* GL_GREEN_BIAS */ 92, /* GL_BLUE_SCALE */ 90, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 333, /* GL_DEPTH_SCALE */ - 314, /* GL_DEPTH_BIAS */ - 814, /* GL_MAX_EVAL_ORDER */ - 818, /* GL_MAX_LIGHTS */ - 797, /* GL_MAX_CLIP_PLANES */ - 862, /* GL_MAX_TEXTURE_SIZE */ - 824, /* GL_MAX_PIXEL_MAP_TABLE */ - 793, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 821, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 822, /* GL_MAX_NAME_STACK_DEPTH */ - 850, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 863, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 877, /* GL_MAX_VIEWPORT_DIMS */ - 794, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1424, /* GL_SUBPIXEL_BITS */ - 582, /* GL_INDEX_BITS */ - 1229, /* GL_RED_BITS */ - 548, /* GL_GREEN_BITS */ + 334, /* GL_DEPTH_SCALE */ + 315, /* GL_DEPTH_BIAS */ + 817, /* GL_MAX_EVAL_ORDER */ + 821, /* GL_MAX_LIGHTS */ + 800, /* GL_MAX_CLIP_PLANES */ + 865, /* GL_MAX_TEXTURE_SIZE */ + 827, /* GL_MAX_PIXEL_MAP_TABLE */ + 796, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 824, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 825, /* GL_MAX_NAME_STACK_DEPTH */ + 853, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 866, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 880, /* GL_MAX_VIEWPORT_DIMS */ + 797, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1429, /* GL_SUBPIXEL_BITS */ + 584, /* GL_INDEX_BITS */ + 1234, /* GL_RED_BITS */ + 550, /* GL_GREEN_BITS */ 91, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ - 315, /* GL_DEPTH_BITS */ - 1399, /* GL_STENCIL_BITS */ + 316, /* GL_DEPTH_BITS */ + 1404, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 943, /* GL_NAME_STACK_DEPTH */ + 946, /* GL_NAME_STACK_DEPTH */ 62, /* 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 */ - 1501, /* GL_TEXTURE_1D */ - 1502, /* GL_TEXTURE_2D */ - 438, /* GL_FEEDBACK_BUFFER_POINTER */ - 439, /* GL_FEEDBACK_BUFFER_SIZE */ - 440, /* GL_FEEDBACK_BUFFER_TYPE */ - 1325, /* GL_SELECTION_BUFFER_POINTER */ - 1326, /* GL_SELECTION_BUFFER_SIZE */ - 1610, /* GL_TEXTURE_WIDTH */ - 1578, /* GL_TEXTURE_HEIGHT */ - 1534, /* GL_TEXTURE_COMPONENTS */ - 1518, /* GL_TEXTURE_BORDER_COLOR */ - 1517, /* GL_TEXTURE_BORDER */ - 344, /* GL_DONT_CARE */ - 436, /* GL_FASTEST */ - 951, /* GL_NICEST */ + 690, /* GL_MAP1_COLOR_4 */ + 693, /* GL_MAP1_INDEX */ + 694, /* GL_MAP1_NORMAL */ + 695, /* GL_MAP1_TEXTURE_COORD_1 */ + 696, /* GL_MAP1_TEXTURE_COORD_2 */ + 697, /* GL_MAP1_TEXTURE_COORD_3 */ + 698, /* GL_MAP1_TEXTURE_COORD_4 */ + 699, /* GL_MAP1_VERTEX_3 */ + 700, /* GL_MAP1_VERTEX_4 */ + 717, /* GL_MAP2_COLOR_4 */ + 720, /* GL_MAP2_INDEX */ + 721, /* GL_MAP2_NORMAL */ + 722, /* GL_MAP2_TEXTURE_COORD_1 */ + 723, /* GL_MAP2_TEXTURE_COORD_2 */ + 724, /* GL_MAP2_TEXTURE_COORD_3 */ + 725, /* GL_MAP2_TEXTURE_COORD_4 */ + 726, /* GL_MAP2_VERTEX_3 */ + 727, /* GL_MAP2_VERTEX_4 */ + 691, /* GL_MAP1_GRID_DOMAIN */ + 692, /* GL_MAP1_GRID_SEGMENTS */ + 718, /* GL_MAP2_GRID_DOMAIN */ + 719, /* GL_MAP2_GRID_SEGMENTS */ + 1506, /* GL_TEXTURE_1D */ + 1508, /* GL_TEXTURE_2D */ + 439, /* GL_FEEDBACK_BUFFER_POINTER */ + 440, /* GL_FEEDBACK_BUFFER_SIZE */ + 441, /* GL_FEEDBACK_BUFFER_TYPE */ + 1330, /* GL_SELECTION_BUFFER_POINTER */ + 1331, /* GL_SELECTION_BUFFER_SIZE */ + 1619, /* GL_TEXTURE_WIDTH */ + 1587, /* GL_TEXTURE_HEIGHT */ + 1543, /* GL_TEXTURE_COMPONENTS */ + 1527, /* GL_TEXTURE_BORDER_COLOR */ + 1526, /* GL_TEXTURE_BORDER */ + 345, /* GL_DONT_CARE */ + 437, /* GL_FASTEST */ + 954, /* GL_NICEST */ 47, /* GL_AMBIENT */ - 341, /* GL_DIFFUSE */ - 1368, /* GL_SPECULAR */ - 1110, /* GL_POSITION */ - 1371, /* GL_SPOT_DIRECTION */ - 1372, /* GL_SPOT_EXPONENT */ - 1370, /* GL_SPOT_CUTOFF */ - 244, /* GL_CONSTANT_ATTENUATION */ - 638, /* GL_LINEAR_ATTENUATION */ - 1205, /* GL_QUADRATIC_ATTENUATION */ - 218, /* GL_COMPILE */ - 219, /* GL_COMPILE_AND_EXECUTE */ + 342, /* GL_DIFFUSE */ + 1373, /* GL_SPECULAR */ + 1113, /* GL_POSITION */ + 1376, /* GL_SPOT_DIRECTION */ + 1377, /* GL_SPOT_EXPONENT */ + 1375, /* GL_SPOT_CUTOFF */ + 245, /* GL_CONSTANT_ATTENUATION */ + 640, /* GL_LINEAR_ATTENUATION */ + 1210, /* GL_QUADRATIC_ATTENUATION */ + 219, /* GL_COMPILE */ + 220, /* GL_COMPILE_AND_EXECUTE */ 111, /* GL_BYTE */ - 1641, /* GL_UNSIGNED_BYTE */ - 1339, /* GL_SHORT */ - 1650, /* GL_UNSIGNED_SHORT */ - 590, /* GL_INT */ - 1644, /* GL_UNSIGNED_INT */ - 443, /* GL_FLOAT */ + 1650, /* GL_UNSIGNED_BYTE */ + 1344, /* GL_SHORT */ + 1659, /* GL_UNSIGNED_SHORT */ + 592, /* GL_INT */ + 1653, /* GL_UNSIGNED_INT */ + 444, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 351, /* GL_DOUBLE */ + 352, /* GL_DOUBLE */ 123, /* GL_CLEAR */ 49, /* GL_AND */ 51, /* GL_AND_REVERSE */ - 268, /* GL_COPY */ + 269, /* GL_COPY */ 50, /* GL_AND_INVERTED */ - 953, /* GL_NOOP */ - 1731, /* GL_XOR */ - 1015, /* GL_OR */ - 954, /* GL_NOR */ - 426, /* GL_EQUIV */ - 616, /* GL_INVERT */ - 1018, /* GL_OR_REVERSE */ - 269, /* GL_COPY_INVERTED */ - 1017, /* GL_OR_INVERTED */ - 944, /* GL_NAND */ - 1330, /* GL_SET */ - 423, /* GL_EMISSION */ - 1338, /* GL_SHININESS */ + 956, /* GL_NOOP */ + 1740, /* GL_XOR */ + 1018, /* GL_OR */ + 957, /* GL_NOR */ + 427, /* GL_EQUIV */ + 618, /* GL_INVERT */ + 1021, /* GL_OR_REVERSE */ + 270, /* GL_COPY_INVERTED */ + 1020, /* GL_OR_INVERTED */ + 947, /* GL_NAND */ + 1335, /* GL_SET */ + 424, /* GL_EMISSION */ + 1343, /* GL_SHININESS */ 48, /* GL_AMBIENT_AND_DIFFUSE */ 165, /* GL_COLOR_INDEXES */ - 894, /* GL_MODELVIEW */ - 1186, /* GL_PROJECTION */ - 1436, /* GL_TEXTURE */ + 897, /* GL_MODELVIEW */ + 1189, /* GL_PROJECTION */ + 1441, /* GL_TEXTURE */ 138, /* GL_COLOR */ - 312, /* GL_DEPTH */ - 1390, /* GL_STENCIL */ + 313, /* GL_DEPTH */ + 1395, /* GL_STENCIL */ 164, /* GL_COLOR_INDEX */ - 1404, /* GL_STENCIL_INDEX */ - 321, /* GL_DEPTH_COMPONENT */ - 1225, /* GL_RED */ - 546, /* GL_GREEN */ + 1409, /* GL_STENCIL_INDEX */ + 322, /* GL_DEPTH_COMPONENT */ + 1230, /* GL_RED */ + 548, /* GL_GREEN */ 89, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1249, /* GL_RGB */ - 1268, /* GL_RGBA */ - 666, /* GL_LUMINANCE */ - 687, /* GL_LUMINANCE_ALPHA */ + 1254, /* GL_RGB */ + 1273, /* GL_RGBA */ + 668, /* GL_LUMINANCE */ + 689, /* GL_LUMINANCE_ALPHA */ 73, /* GL_BITMAP */ - 1066, /* GL_POINT */ - 636, /* GL_LINE */ - 441, /* GL_FILL */ - 1234, /* GL_RENDER */ - 437, /* GL_FEEDBACK */ - 1324, /* GL_SELECT */ - 442, /* GL_FLAT */ - 1343, /* GL_SMOOTH */ - 617, /* GL_KEEP */ - 1243, /* GL_REPLACE */ - 573, /* GL_INCR */ - 308, /* GL_DECR */ - 1665, /* GL_VENDOR */ - 1240, /* GL_RENDERER */ - 1666, /* GL_VERSION */ - 430, /* GL_EXTENSIONS */ - 1289, /* GL_S */ - 1427, /* GL_T */ - 1215, /* GL_R */ - 1204, /* GL_Q */ - 930, /* GL_MODULATE */ - 307, /* GL_DECAL */ - 1568, /* GL_TEXTURE_ENV_MODE */ - 1567, /* GL_TEXTURE_ENV_COLOR */ - 1566, /* GL_TEXTURE_ENV */ - 431, /* GL_EYE_LINEAR */ - 977, /* GL_OBJECT_LINEAR */ - 1369, /* GL_SPHERE_MAP */ - 1570, /* GL_TEXTURE_GEN_MODE */ - 979, /* GL_OBJECT_PLANE */ - 432, /* GL_EYE_PLANE */ - 945, /* GL_NEAREST */ - 637, /* GL_LINEAR */ - 949, /* GL_NEAREST_MIPMAP_NEAREST */ - 642, /* GL_LINEAR_MIPMAP_NEAREST */ - 948, /* GL_NEAREST_MIPMAP_LINEAR */ - 641, /* GL_LINEAR_MIPMAP_LINEAR */ - 1591, /* GL_TEXTURE_MAG_FILTER */ - 1599, /* GL_TEXTURE_MIN_FILTER */ - 1612, /* GL_TEXTURE_WRAP_S */ - 1613, /* GL_TEXTURE_WRAP_T */ + 1069, /* GL_POINT */ + 638, /* GL_LINE */ + 442, /* GL_FILL */ + 1239, /* GL_RENDER */ + 438, /* GL_FEEDBACK */ + 1329, /* GL_SELECT */ + 443, /* GL_FLAT */ + 1348, /* GL_SMOOTH */ + 619, /* GL_KEEP */ + 1248, /* GL_REPLACE */ + 575, /* GL_INCR */ + 309, /* GL_DECR */ + 1674, /* GL_VENDOR */ + 1245, /* GL_RENDERER */ + 1675, /* GL_VERSION */ + 431, /* GL_EXTENSIONS */ + 1294, /* GL_S */ + 1432, /* GL_T */ + 1220, /* GL_R */ + 1209, /* GL_Q */ + 933, /* GL_MODULATE */ + 308, /* GL_DECAL */ + 1577, /* GL_TEXTURE_ENV_MODE */ + 1576, /* GL_TEXTURE_ENV_COLOR */ + 1575, /* GL_TEXTURE_ENV */ + 432, /* GL_EYE_LINEAR */ + 980, /* GL_OBJECT_LINEAR */ + 1374, /* GL_SPHERE_MAP */ + 1579, /* GL_TEXTURE_GEN_MODE */ + 982, /* GL_OBJECT_PLANE */ + 433, /* GL_EYE_PLANE */ + 948, /* GL_NEAREST */ + 639, /* GL_LINEAR */ + 952, /* GL_NEAREST_MIPMAP_NEAREST */ + 644, /* GL_LINEAR_MIPMAP_NEAREST */ + 951, /* GL_NEAREST_MIPMAP_LINEAR */ + 643, /* GL_LINEAR_MIPMAP_LINEAR */ + 1600, /* GL_TEXTURE_MAG_FILTER */ + 1608, /* GL_TEXTURE_MIN_FILTER */ + 1621, /* GL_TEXTURE_WRAP_S */ + 1622, /* GL_TEXTURE_WRAP_T */ 117, /* GL_CLAMP */ - 1242, /* GL_REPEAT */ - 1104, /* GL_POLYGON_OFFSET_UNITS */ - 1103, /* GL_POLYGON_OFFSET_POINT */ - 1102, /* GL_POLYGON_OFFSET_LINE */ - 1216, /* GL_R3_G3_B2 */ - 1662, /* GL_V2F */ - 1663, /* GL_V3F */ + 1247, /* GL_REPEAT */ + 1107, /* GL_POLYGON_OFFSET_UNITS */ + 1106, /* GL_POLYGON_OFFSET_POINT */ + 1105, /* GL_POLYGON_OFFSET_LINE */ + 1221, /* GL_R3_G3_B2 */ + 1671, /* GL_V2F */ + 1672, /* GL_V3F */ 114, /* GL_C4UB_V2F */ 115, /* GL_C4UB_V3F */ 112, /* GL_C3F_V3F */ - 942, /* GL_N3F_V3F */ + 945, /* GL_N3F_V3F */ 113, /* GL_C4F_N3F_V3F */ - 1432, /* GL_T2F_V3F */ - 1434, /* GL_T4F_V4F */ - 1430, /* GL_T2F_C4UB_V3F */ - 1428, /* GL_T2F_C3F_V3F */ - 1431, /* GL_T2F_N3F_V3F */ - 1429, /* GL_T2F_C4F_N3F_V3F */ - 1433, /* GL_T4F_C4F_N3F_V4F */ + 1437, /* GL_T2F_V3F */ + 1439, /* GL_T4F_V4F */ + 1435, /* GL_T2F_C4UB_V3F */ + 1433, /* GL_T2F_C3F_V3F */ + 1436, /* GL_T2F_N3F_V3F */ + 1434, /* GL_T2F_C4F_N3F_V3F */ + 1438, /* GL_T4F_C4F_N3F_V4F */ 130, /* GL_CLIP_PLANE0 */ 131, /* GL_CLIP_PLANE1 */ 132, /* GL_CLIP_PLANE2 */ 133, /* GL_CLIP_PLANE3 */ 134, /* GL_CLIP_PLANE4 */ 135, /* 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 */ - 989, /* GL_ONE_MINUS_CONSTANT_COLOR */ - 241, /* GL_CONSTANT_ALPHA */ - 987, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 623, /* GL_LIGHT0 */ + 624, /* GL_LIGHT1 */ + 625, /* GL_LIGHT2 */ + 626, /* GL_LIGHT3 */ + 627, /* GL_LIGHT4 */ + 628, /* GL_LIGHT5 */ + 629, /* GL_LIGHT6 */ + 630, /* GL_LIGHT7 */ + 552, /* GL_HINT_BIT */ + 247, /* GL_CONSTANT_COLOR */ + 992, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 242, /* GL_CONSTANT_ALPHA */ + 990, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 76, /* GL_BLEND_COLOR */ - 510, /* GL_FUNC_ADD */ - 878, /* GL_MIN */ - 791, /* GL_MAX */ + 512, /* GL_FUNC_ADD */ + 881, /* GL_MIN */ + 793, /* GL_MAX */ 81, /* GL_BLEND_EQUATION */ - 514, /* GL_FUNC_SUBTRACT */ - 512, /* GL_FUNC_REVERSE_SUBTRACT */ - 249, /* GL_CONVOLUTION_1D */ - 250, /* GL_CONVOLUTION_2D */ - 1327, /* GL_SEPARABLE_2D */ - 253, /* GL_CONVOLUTION_BORDER_MODE */ - 257, /* GL_CONVOLUTION_FILTER_SCALE */ - 255, /* GL_CONVOLUTION_FILTER_BIAS */ - 1226, /* GL_REDUCE */ - 259, /* GL_CONVOLUTION_FORMAT */ - 263, /* GL_CONVOLUTION_WIDTH */ - 261, /* GL_CONVOLUTION_HEIGHT */ - 805, /* GL_MAX_CONVOLUTION_WIDTH */ - 803, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1143, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1139, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1134, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1130, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1141, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1137, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1132, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1128, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 551, /* GL_HISTOGRAM */ - 1190, /* 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 */ - 879, /* GL_MINMAX */ - 881, /* GL_MINMAX_FORMAT */ - 883, /* GL_MINMAX_SINK */ - 1435, /* GL_TABLE_TOO_LARGE_EXT */ - 1643, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1652, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1654, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1648, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1645, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1101, /* GL_POLYGON_OFFSET_FILL */ - 1100, /* GL_POLYGON_OFFSET_FACTOR */ - 1099, /* GL_POLYGON_OFFSET_BIAS */ - 1246, /* GL_RESCALE_NORMAL */ + 516, /* GL_FUNC_SUBTRACT */ + 514, /* GL_FUNC_REVERSE_SUBTRACT */ + 250, /* GL_CONVOLUTION_1D */ + 251, /* GL_CONVOLUTION_2D */ + 1332, /* GL_SEPARABLE_2D */ + 254, /* GL_CONVOLUTION_BORDER_MODE */ + 258, /* GL_CONVOLUTION_FILTER_SCALE */ + 256, /* GL_CONVOLUTION_FILTER_BIAS */ + 1231, /* GL_REDUCE */ + 260, /* GL_CONVOLUTION_FORMAT */ + 264, /* GL_CONVOLUTION_WIDTH */ + 262, /* GL_CONVOLUTION_HEIGHT */ + 808, /* GL_MAX_CONVOLUTION_WIDTH */ + 806, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1146, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1142, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1137, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1133, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1144, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1140, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1135, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1131, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 553, /* GL_HISTOGRAM */ + 1193, /* GL_PROXY_HISTOGRAM */ + 569, /* GL_HISTOGRAM_WIDTH */ + 559, /* GL_HISTOGRAM_FORMAT */ + 565, /* GL_HISTOGRAM_RED_SIZE */ + 561, /* GL_HISTOGRAM_GREEN_SIZE */ + 556, /* GL_HISTOGRAM_BLUE_SIZE */ + 554, /* GL_HISTOGRAM_ALPHA_SIZE */ + 563, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 567, /* GL_HISTOGRAM_SINK */ + 882, /* GL_MINMAX */ + 884, /* GL_MINMAX_FORMAT */ + 886, /* GL_MINMAX_SINK */ + 1440, /* GL_TABLE_TOO_LARGE_EXT */ + 1652, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1661, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1663, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1657, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1654, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1104, /* GL_POLYGON_OFFSET_FILL */ + 1103, /* GL_POLYGON_OFFSET_FACTOR */ + 1102, /* GL_POLYGON_OFFSET_BIAS */ + 1251, /* 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 */ - 1258, /* GL_RGB2_EXT */ - 1259, /* GL_RGB4 */ - 1262, /* GL_RGB5 */ - 1266, /* GL_RGB8 */ - 1250, /* GL_RGB10 */ - 1254, /* GL_RGB12 */ - 1256, /* GL_RGB16 */ - 1273, /* GL_RGBA2 */ - 1275, /* GL_RGBA4 */ - 1263, /* GL_RGB5_A1 */ - 1279, /* GL_RGBA8 */ - 1251, /* GL_RGB10_A2 */ - 1269, /* GL_RGBA12 */ - 1271, /* GL_RGBA16 */ - 1604, /* GL_TEXTURE_RED_SIZE */ - 1576, /* GL_TEXTURE_GREEN_SIZE */ - 1515, /* GL_TEXTURE_BLUE_SIZE */ - 1504, /* GL_TEXTURE_ALPHA_SIZE */ - 1589, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1580, /* GL_TEXTURE_INTENSITY_SIZE */ - 1244, /* GL_REPLACE_EXT */ - 1194, /* GL_PROXY_TEXTURE_1D */ - 1196, /* GL_PROXY_TEXTURE_2D */ - 1608, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1601, /* GL_TEXTURE_PRIORITY */ - 1606, /* GL_TEXTURE_RESIDENT */ - 1507, /* GL_TEXTURE_BINDING_1D */ - 1508, /* GL_TEXTURE_BINDING_2D */ - 1509, /* GL_TEXTURE_BINDING_3D */ - 1025, /* GL_PACK_SKIP_IMAGES */ - 1021, /* GL_PACK_IMAGE_HEIGHT */ - 1637, /* GL_UNPACK_SKIP_IMAGES */ - 1634, /* GL_UNPACK_IMAGE_HEIGHT */ - 1503, /* GL_TEXTURE_3D */ - 1198, /* GL_PROXY_TEXTURE_3D */ - 1563, /* GL_TEXTURE_DEPTH */ - 1611, /* GL_TEXTURE_WRAP_R */ - 792, /* GL_MAX_3D_TEXTURE_SIZE */ - 1667, /* GL_VERTEX_ARRAY */ - 956, /* GL_NORMAL_ARRAY */ + 679, /* GL_LUMINANCE4 */ + 685, /* GL_LUMINANCE8 */ + 669, /* GL_LUMINANCE12 */ + 675, /* GL_LUMINANCE16 */ + 680, /* GL_LUMINANCE4_ALPHA4 */ + 683, /* GL_LUMINANCE6_ALPHA2 */ + 686, /* GL_LUMINANCE8_ALPHA8 */ + 672, /* GL_LUMINANCE12_ALPHA4 */ + 670, /* GL_LUMINANCE12_ALPHA12 */ + 676, /* GL_LUMINANCE16_ALPHA16 */ + 593, /* GL_INTENSITY */ + 598, /* GL_INTENSITY4 */ + 600, /* GL_INTENSITY8 */ + 594, /* GL_INTENSITY12 */ + 596, /* GL_INTENSITY16 */ + 1263, /* GL_RGB2_EXT */ + 1264, /* GL_RGB4 */ + 1267, /* GL_RGB5 */ + 1271, /* GL_RGB8 */ + 1255, /* GL_RGB10 */ + 1259, /* GL_RGB12 */ + 1261, /* GL_RGB16 */ + 1278, /* GL_RGBA2 */ + 1280, /* GL_RGBA4 */ + 1268, /* GL_RGB5_A1 */ + 1284, /* GL_RGBA8 */ + 1256, /* GL_RGB10_A2 */ + 1274, /* GL_RGBA12 */ + 1276, /* GL_RGBA16 */ + 1613, /* GL_TEXTURE_RED_SIZE */ + 1585, /* GL_TEXTURE_GREEN_SIZE */ + 1524, /* GL_TEXTURE_BLUE_SIZE */ + 1511, /* GL_TEXTURE_ALPHA_SIZE */ + 1598, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1589, /* GL_TEXTURE_INTENSITY_SIZE */ + 1249, /* GL_REPLACE_EXT */ + 1197, /* GL_PROXY_TEXTURE_1D */ + 1200, /* GL_PROXY_TEXTURE_2D */ + 1617, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1610, /* GL_TEXTURE_PRIORITY */ + 1615, /* GL_TEXTURE_RESIDENT */ + 1514, /* GL_TEXTURE_BINDING_1D */ + 1516, /* GL_TEXTURE_BINDING_2D */ + 1518, /* GL_TEXTURE_BINDING_3D */ + 1028, /* GL_PACK_SKIP_IMAGES */ + 1024, /* GL_PACK_IMAGE_HEIGHT */ + 1646, /* GL_UNPACK_SKIP_IMAGES */ + 1643, /* GL_UNPACK_IMAGE_HEIGHT */ + 1510, /* GL_TEXTURE_3D */ + 1203, /* GL_PROXY_TEXTURE_3D */ + 1572, /* GL_TEXTURE_DEPTH */ + 1620, /* GL_TEXTURE_WRAP_R */ + 794, /* GL_MAX_3D_TEXTURE_SIZE */ + 1676, /* GL_VERTEX_ARRAY */ + 959, /* GL_NORMAL_ARRAY */ 139, /* GL_COLOR_ARRAY */ - 576, /* GL_INDEX_ARRAY */ - 1542, /* GL_TEXTURE_COORD_ARRAY */ - 414, /* GL_EDGE_FLAG_ARRAY */ - 1672, /* GL_VERTEX_ARRAY_SIZE */ - 1674, /* GL_VERTEX_ARRAY_TYPE */ - 1673, /* GL_VERTEX_ARRAY_STRIDE */ - 961, /* GL_NORMAL_ARRAY_TYPE */ - 960, /* GL_NORMAL_ARRAY_STRIDE */ + 578, /* GL_INDEX_ARRAY */ + 1551, /* GL_TEXTURE_COORD_ARRAY */ + 415, /* GL_EDGE_FLAG_ARRAY */ + 1681, /* GL_VERTEX_ARRAY_SIZE */ + 1683, /* GL_VERTEX_ARRAY_TYPE */ + 1682, /* GL_VERTEX_ARRAY_STRIDE */ + 964, /* GL_NORMAL_ARRAY_TYPE */ + 963, /* GL_NORMAL_ARRAY_STRIDE */ 143, /* GL_COLOR_ARRAY_SIZE */ 145, /* GL_COLOR_ARRAY_TYPE */ 144, /* GL_COLOR_ARRAY_STRIDE */ - 581, /* GL_INDEX_ARRAY_TYPE */ - 580, /* GL_INDEX_ARRAY_STRIDE */ - 1546, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1548, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1547, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 418, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1671, /* GL_VERTEX_ARRAY_POINTER */ - 959, /* GL_NORMAL_ARRAY_POINTER */ + 583, /* GL_INDEX_ARRAY_TYPE */ + 582, /* GL_INDEX_ARRAY_STRIDE */ + 1555, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1557, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1556, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 419, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1680, /* GL_VERTEX_ARRAY_POINTER */ + 962, /* GL_NORMAL_ARRAY_POINTER */ 142, /* GL_COLOR_ARRAY_POINTER */ - 579, /* GL_INDEX_ARRAY_POINTER */ - 1545, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 417, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 935, /* GL_MULTISAMPLE */ - 1301, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1303, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1308, /* GL_SAMPLE_COVERAGE */ - 1305, /* GL_SAMPLE_BUFFERS */ - 1296, /* GL_SAMPLES */ - 1312, /* GL_SAMPLE_COVERAGE_VALUE */ - 1310, /* GL_SAMPLE_COVERAGE_INVERT */ + 581, /* GL_INDEX_ARRAY_POINTER */ + 1554, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 418, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 938, /* GL_MULTISAMPLE */ + 1306, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1308, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1313, /* GL_SAMPLE_COVERAGE */ + 1310, /* GL_SAMPLE_BUFFERS */ + 1301, /* GL_SAMPLES */ + 1317, /* GL_SAMPLE_COVERAGE_VALUE */ + 1315, /* GL_SAMPLE_COVERAGE_INVERT */ 170, /* GL_COLOR_MATRIX */ 172, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 799, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1126, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1122, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1117, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1113, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1124, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1120, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1115, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1111, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1525, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1199, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1527, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 802, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1129, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1125, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1120, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1116, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1127, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1123, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1118, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1114, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1534, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1204, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1536, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 80, /* GL_BLEND_DST_RGB */ 88, /* GL_BLEND_SRC_RGB */ 79, /* GL_BLEND_DST_ALPHA */ 87, /* GL_BLEND_SRC_ALPHA */ 176, /* GL_COLOR_TABLE */ - 1136, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1119, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1189, /* GL_PROXY_COLOR_TABLE */ - 1193, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1192, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 1139, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1122, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1192, /* GL_PROXY_COLOR_TABLE */ + 1196, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1195, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ 200, /* GL_COLOR_TABLE_SCALE */ 180, /* GL_COLOR_TABLE_BIAS */ 185, /* GL_COLOR_TABLE_FORMAT */ @@ -4128,636 +4146,643 @@ static const unsigned reduced_enums[1277] = 191, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 71, /* GL_BGR */ 72, /* GL_BGRA */ - 813, /* GL_MAX_ELEMENTS_VERTICES */ - 812, /* GL_MAX_ELEMENTS_INDICES */ - 1579, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 816, /* GL_MAX_ELEMENTS_VERTICES */ + 815, /* GL_MAX_ELEMENTS_INDICES */ + 1588, /* GL_TEXTURE_INDEX_SIZE_EXT */ 136, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1083, /* GL_POINT_SIZE_MIN */ - 1079, /* GL_POINT_SIZE_MAX */ - 1073, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1069, /* GL_POINT_DISTANCE_ATTENUATION */ + 1086, /* GL_POINT_SIZE_MIN */ + 1082, /* GL_POINT_SIZE_MAX */ + 1076, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1072, /* GL_POINT_DISTANCE_ATTENUATION */ 118, /* GL_CLAMP_TO_BORDER */ 121, /* GL_CLAMP_TO_EDGE */ - 1600, /* GL_TEXTURE_MIN_LOD */ - 1598, /* GL_TEXTURE_MAX_LOD */ - 1506, /* GL_TEXTURE_BASE_LEVEL */ - 1597, /* GL_TEXTURE_MAX_LEVEL */ - 570, /* GL_IGNORE_BORDER_HP */ - 245, /* GL_CONSTANT_BORDER_HP */ - 1245, /* GL_REPLICATE_BORDER_HP */ - 251, /* GL_CONVOLUTION_BORDER_COLOR */ - 984, /* GL_OCCLUSION_TEST_HP */ - 985, /* GL_OCCLUSION_TEST_RESULT_HP */ - 639, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1519, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1521, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1523, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1524, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1522, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1520, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 795, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 796, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1146, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1148, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1145, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1147, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1587, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1588, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1586, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 516, /* GL_GENERATE_MIPMAP */ - 517, /* GL_GENERATE_MIPMAP_HINT */ - 480, /* GL_FOG_OFFSET_SGIX */ - 481, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1533, /* GL_TEXTURE_COMPARE_SGIX */ - 1532, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1583, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1575, /* 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 */ - 1728, /* GL_WRAP_BORDER_SUN */ - 1526, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 632, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1340, /* GL_SINGLE_COLOR */ - 1328, /* GL_SEPARATE_SPECULAR_COLOR */ - 1337, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 1642, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1655, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1656, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1653, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1651, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1649, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1647, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1595, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1596, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1594, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 886, /* GL_MIRRORED_REPEAT */ - 1284, /* GL_RGB_S3TC */ - 1261, /* GL_RGB4_S3TC */ - 1283, /* GL_RGBA_S3TC */ - 1278, /* GL_RGBA4_S3TC */ - 1281, /* GL_RGBA_DXT5_S3TC */ - 1276, /* 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 */ - 947, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 946, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 640, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 467, /* GL_FOG_COORDINATE_SOURCE */ - 459, /* GL_FOG_COORD */ - 483, /* GL_FRAGMENT_DEPTH */ - 279, /* GL_CURRENT_FOG_COORD */ - 466, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 465, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 464, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 461, /* GL_FOG_COORDINATE_ARRAY */ + 1609, /* GL_TEXTURE_MIN_LOD */ + 1607, /* GL_TEXTURE_MAX_LOD */ + 1513, /* GL_TEXTURE_BASE_LEVEL */ + 1606, /* GL_TEXTURE_MAX_LEVEL */ + 572, /* GL_IGNORE_BORDER_HP */ + 246, /* GL_CONSTANT_BORDER_HP */ + 1250, /* GL_REPLICATE_BORDER_HP */ + 252, /* GL_CONVOLUTION_BORDER_COLOR */ + 987, /* GL_OCCLUSION_TEST_HP */ + 988, /* GL_OCCLUSION_TEST_RESULT_HP */ + 641, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1528, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1530, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1532, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1533, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1531, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1529, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 798, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 799, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1149, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1151, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1148, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1150, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1596, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1597, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1595, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 518, /* GL_GENERATE_MIPMAP */ + 519, /* GL_GENERATE_MIPMAP_HINT */ + 481, /* GL_FOG_OFFSET_SGIX */ + 482, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1542, /* GL_TEXTURE_COMPARE_SGIX */ + 1541, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1592, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1584, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 323, /* GL_DEPTH_COMPONENT16 */ + 326, /* GL_DEPTH_COMPONENT24 */ + 329, /* GL_DEPTH_COMPONENT32 */ + 274, /* GL_CULL_VERTEX_EXT */ + 276, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + 275, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + 1737, /* GL_WRAP_BORDER_SUN */ + 1535, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 634, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1345, /* GL_SINGLE_COLOR */ + 1333, /* GL_SEPARATE_SPECULAR_COLOR */ + 1342, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 1651, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1664, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1665, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1662, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1660, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1658, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1656, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1604, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1605, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1603, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 889, /* GL_MIRRORED_REPEAT */ + 1289, /* GL_RGB_S3TC */ + 1266, /* GL_RGB4_S3TC */ + 1288, /* GL_RGBA_S3TC */ + 1283, /* GL_RGBA4_S3TC */ + 1286, /* GL_RGBA_DXT5_S3TC */ + 1281, /* GL_RGBA4_DXT5_S3TC */ + 239, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + 234, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + 235, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + 236, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + 950, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 949, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 642, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 468, /* GL_FOG_COORDINATE_SOURCE */ + 460, /* GL_FOG_COORD */ + 484, /* GL_FRAGMENT_DEPTH */ + 280, /* GL_CURRENT_FOG_COORD */ + 467, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 466, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 465, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 462, /* GL_FOG_COORDINATE_ARRAY */ 174, /* GL_COLOR_SUM */ - 298, /* GL_CURRENT_SECONDARY_COLOR */ - 1321, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1323, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1322, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1320, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1317, /* GL_SECONDARY_COLOR_ARRAY */ - 526, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + 299, /* GL_CURRENT_SECONDARY_COLOR */ + 1326, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1328, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1327, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1325, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1322, /* GL_SECONDARY_COLOR_ARRAY */ + 528, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1437, /* GL_TEXTURE0 */ - 1439, /* GL_TEXTURE1 */ - 1461, /* GL_TEXTURE2 */ - 1483, /* GL_TEXTURE3 */ - 1489, /* GL_TEXTURE4 */ - 1491, /* GL_TEXTURE5 */ - 1493, /* GL_TEXTURE6 */ - 1495, /* GL_TEXTURE7 */ - 1497, /* GL_TEXTURE8 */ - 1499, /* GL_TEXTURE9 */ - 1440, /* GL_TEXTURE10 */ - 1442, /* GL_TEXTURE11 */ - 1444, /* GL_TEXTURE12 */ - 1446, /* GL_TEXTURE13 */ - 1448, /* GL_TEXTURE14 */ - 1450, /* GL_TEXTURE15 */ - 1452, /* GL_TEXTURE16 */ - 1454, /* GL_TEXTURE17 */ - 1456, /* GL_TEXTURE18 */ - 1458, /* GL_TEXTURE19 */ - 1462, /* GL_TEXTURE20 */ - 1464, /* GL_TEXTURE21 */ - 1466, /* GL_TEXTURE22 */ - 1468, /* GL_TEXTURE23 */ - 1470, /* GL_TEXTURE24 */ - 1472, /* GL_TEXTURE25 */ - 1474, /* GL_TEXTURE26 */ - 1476, /* GL_TEXTURE27 */ - 1478, /* GL_TEXTURE28 */ - 1480, /* GL_TEXTURE29 */ - 1484, /* GL_TEXTURE30 */ - 1486, /* GL_TEXTURE31 */ + 1442, /* GL_TEXTURE0 */ + 1444, /* GL_TEXTURE1 */ + 1466, /* GL_TEXTURE2 */ + 1488, /* GL_TEXTURE3 */ + 1494, /* GL_TEXTURE4 */ + 1496, /* GL_TEXTURE5 */ + 1498, /* GL_TEXTURE6 */ + 1500, /* GL_TEXTURE7 */ + 1502, /* GL_TEXTURE8 */ + 1504, /* GL_TEXTURE9 */ + 1445, /* GL_TEXTURE10 */ + 1447, /* GL_TEXTURE11 */ + 1449, /* GL_TEXTURE12 */ + 1451, /* GL_TEXTURE13 */ + 1453, /* GL_TEXTURE14 */ + 1455, /* GL_TEXTURE15 */ + 1457, /* GL_TEXTURE16 */ + 1459, /* GL_TEXTURE17 */ + 1461, /* GL_TEXTURE18 */ + 1463, /* GL_TEXTURE19 */ + 1467, /* GL_TEXTURE20 */ + 1469, /* GL_TEXTURE21 */ + 1471, /* GL_TEXTURE22 */ + 1473, /* GL_TEXTURE23 */ + 1475, /* GL_TEXTURE24 */ + 1477, /* GL_TEXTURE25 */ + 1479, /* GL_TEXTURE26 */ + 1481, /* GL_TEXTURE27 */ + 1483, /* GL_TEXTURE28 */ + 1485, /* GL_TEXTURE29 */ + 1489, /* GL_TEXTURE30 */ + 1491, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ 124, /* GL_CLIENT_ACTIVE_TEXTURE */ - 864, /* GL_MAX_TEXTURE_UNITS */ - 1621, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1624, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1626, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1618, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1425, /* GL_SUBTRACT */ - 853, /* 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 */ - 1540, /* GL_TEXTURE_COMPRESSION_HINT */ - 1602, /* GL_TEXTURE_RECTANGLE_ARB */ - 1512, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1202, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 851, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 334, /* GL_DEPTH_STENCIL_NV */ - 1646, /* GL_UNSIGNED_INT_24_8_NV */ - 860, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1593, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 861, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1569, /* GL_TEXTURE_FILTER_CONTROL */ - 1584, /* GL_TEXTURE_LOD_BIAS */ + 867, /* GL_MAX_TEXTURE_UNITS */ + 1630, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1633, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1635, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1627, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1430, /* GL_SUBTRACT */ + 856, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 222, /* GL_COMPRESSED_ALPHA */ + 226, /* GL_COMPRESSED_LUMINANCE */ + 227, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + 224, /* GL_COMPRESSED_INTENSITY */ + 230, /* GL_COMPRESSED_RGB */ + 231, /* GL_COMPRESSED_RGBA */ + 1549, /* GL_TEXTURE_COMPRESSION_HINT */ + 1611, /* GL_TEXTURE_RECTANGLE_ARB */ + 1521, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1207, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 854, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 335, /* GL_DEPTH_STENCIL_NV */ + 1655, /* GL_UNSIGNED_INT_24_8_NV */ + 863, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1602, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 864, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1578, /* GL_TEXTURE_FILTER_CONTROL */ + 1593, /* GL_TEXTURE_LOD_BIAS */ 207, /* GL_COMBINE4 */ - 854, /* GL_MAX_SHININESS_NV */ - 855, /* GL_MAX_SPOT_EXPONENT_NV */ - 574, /* GL_INCR_WRAP */ - 309, /* GL_DECR_WRAP */ - 906, /* GL_MODELVIEW1_ARB */ - 962, /* GL_NORMAL_MAP */ - 1231, /* GL_REFLECTION_MAP */ - 1549, /* GL_TEXTURE_CUBE_MAP */ - 1510, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1557, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1551, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1559, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1553, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1561, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1555, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1200, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 807, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 941, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 475, /* GL_FOG_DISTANCE_MODE_NV */ - 434, /* GL_EYE_RADIAL_NV */ - 433, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 857, /* GL_MAX_SHININESS_NV */ + 858, /* GL_MAX_SPOT_EXPONENT_NV */ + 576, /* GL_INCR_WRAP */ + 310, /* GL_DECR_WRAP */ + 909, /* GL_MODELVIEW1_ARB */ + 965, /* GL_NORMAL_MAP */ + 1236, /* GL_REFLECTION_MAP */ + 1558, /* GL_TEXTURE_CUBE_MAP */ + 1519, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1566, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1560, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1568, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1562, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1570, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1564, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1205, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 810, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 944, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 476, /* GL_FOG_DISTANCE_MODE_NV */ + 435, /* GL_EYE_RADIAL_NV */ + 434, /* GL_EYE_PLANE_ABSOLUTE_NV */ 206, /* GL_COMBINE */ 213, /* GL_COMBINE_RGB */ 208, /* GL_COMBINE_ALPHA */ - 1285, /* GL_RGB_SCALE */ + 1290, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 601, /* GL_INTERPOLATE */ - 240, /* GL_CONSTANT */ - 1152, /* GL_PRIMARY_COLOR */ - 1149, /* GL_PREVIOUS */ - 1351, /* GL_SOURCE0_RGB */ - 1357, /* GL_SOURCE1_RGB */ - 1363, /* GL_SOURCE2_RGB */ - 1367, /* GL_SOURCE3_RGB_NV */ - 1348, /* GL_SOURCE0_ALPHA */ - 1354, /* GL_SOURCE1_ALPHA */ - 1360, /* GL_SOURCE2_ALPHA */ - 1366, /* GL_SOURCE3_ALPHA_NV */ - 998, /* GL_OPERAND0_RGB */ - 1004, /* GL_OPERAND1_RGB */ - 1010, /* GL_OPERAND2_RGB */ - 1014, /* GL_OPERAND3_RGB_NV */ - 995, /* GL_OPERAND0_ALPHA */ - 1001, /* GL_OPERAND1_ALPHA */ - 1007, /* GL_OPERAND2_ALPHA */ - 1013, /* GL_OPERAND3_ALPHA_NV */ - 1668, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - 1732, /* GL_YCBCR_422_APPLE */ - 1657, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1659, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1342, /* GL_SLICE_ACCUM_SUN */ - 1207, /* GL_QUAD_MESH_SUN */ - 1630, /* GL_TRIANGLE_MESH_SUN */ - 1706, /* GL_VERTEX_PROGRAM_ARB */ - 1717, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1693, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1699, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1701, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1703, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - 300, /* GL_CURRENT_VERTEX_ATTRIB */ - 1165, /* GL_PROGRAM_LENGTH_ARB */ - 1179, /* GL_PROGRAM_STRING_ARB */ - 928, /* GL_MODELVIEW_PROJECTION_NV */ - 569, /* GL_IDENTITY_NV */ - 614, /* GL_INVERSE_NV */ - 1623, /* GL_TRANSPOSE_NV */ - 615, /* GL_INVERSE_TRANSPOSE_NV */ - 837, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 836, /* 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 */ - 1709, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1712, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1177, /* GL_PROGRAM_PARAMETER_NV */ - 1697, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1181, /* GL_PROGRAM_TARGET_NV */ - 1178, /* GL_PROGRAM_RESIDENT_NV */ - 1615, /* GL_TRACK_MATRIX_NV */ - 1616, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1707, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1159, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 319, /* GL_DEPTH_CLAMP_NV */ - 1675, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1682, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1683, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1684, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1685, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1686, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1687, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1688, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1689, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1690, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1676, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1677, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1678, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1679, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1680, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1681, /* 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 */ - 1158, /* 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 */ - 1538, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1535, /* GL_TEXTURE_COMPRESSED */ - 967, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - 239, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 876, /* GL_MAX_VERTEX_UNITS_ARB */ + 603, /* GL_INTERPOLATE */ + 241, /* GL_CONSTANT */ + 1155, /* GL_PRIMARY_COLOR */ + 1152, /* GL_PREVIOUS */ + 1356, /* GL_SOURCE0_RGB */ + 1362, /* GL_SOURCE1_RGB */ + 1368, /* GL_SOURCE2_RGB */ + 1372, /* GL_SOURCE3_RGB_NV */ + 1353, /* GL_SOURCE0_ALPHA */ + 1359, /* GL_SOURCE1_ALPHA */ + 1365, /* GL_SOURCE2_ALPHA */ + 1371, /* GL_SOURCE3_ALPHA_NV */ + 1001, /* GL_OPERAND0_RGB */ + 1007, /* GL_OPERAND1_RGB */ + 1013, /* GL_OPERAND2_RGB */ + 1017, /* GL_OPERAND3_RGB_NV */ + 998, /* GL_OPERAND0_ALPHA */ + 1004, /* GL_OPERAND1_ALPHA */ + 1010, /* GL_OPERAND2_ALPHA */ + 1016, /* GL_OPERAND3_ALPHA_NV */ + 1677, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + 1741, /* GL_YCBCR_422_APPLE */ + 1666, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1668, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1347, /* GL_SLICE_ACCUM_SUN */ + 1212, /* GL_QUAD_MESH_SUN */ + 1639, /* GL_TRIANGLE_MESH_SUN */ + 1715, /* GL_VERTEX_PROGRAM_ARB */ + 1726, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1702, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1708, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1710, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1712, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 301, /* GL_CURRENT_VERTEX_ATTRIB */ + 1168, /* GL_PROGRAM_LENGTH_ARB */ + 1182, /* GL_PROGRAM_STRING_ARB */ + 931, /* GL_MODELVIEW_PROJECTION_NV */ + 571, /* GL_IDENTITY_NV */ + 616, /* GL_INVERSE_NV */ + 1632, /* GL_TRANSPOSE_NV */ + 617, /* GL_INVERSE_TRANSPOSE_NV */ + 840, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 839, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 747, /* GL_MATRIX0_NV */ + 759, /* GL_MATRIX1_NV */ + 771, /* GL_MATRIX2_NV */ + 775, /* GL_MATRIX3_NV */ + 777, /* GL_MATRIX4_NV */ + 779, /* GL_MATRIX5_NV */ + 781, /* GL_MATRIX6_NV */ + 783, /* GL_MATRIX7_NV */ + 286, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + 283, /* GL_CURRENT_MATRIX_ARB */ + 1718, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1721, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1180, /* GL_PROGRAM_PARAMETER_NV */ + 1706, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1184, /* GL_PROGRAM_TARGET_NV */ + 1181, /* GL_PROGRAM_RESIDENT_NV */ + 1624, /* GL_TRACK_MATRIX_NV */ + 1625, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1716, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1162, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 320, /* GL_DEPTH_CLAMP_NV */ + 1684, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1691, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1692, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1693, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1694, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1695, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1696, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1697, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1698, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1699, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1685, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1686, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1687, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1688, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1689, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1690, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 701, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 708, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 709, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 710, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 711, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 712, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 713, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 714, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 715, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 716, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 702, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 703, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 704, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 705, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 706, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 707, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 728, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 735, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 736, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 737, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 738, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 739, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 740, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1161, /* GL_PROGRAM_BINDING_ARB */ + 742, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 743, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 729, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 730, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 731, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 732, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 733, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 734, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1547, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1544, /* GL_TEXTURE_COMPRESSED */ + 970, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 240, /* GL_COMPRESSED_TEXTURE_FORMATS */ + 879, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1727, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1705, /* GL_VERTEX_BLEND_ARB */ - 302, /* GL_CURRENT_WEIGHT_ARB */ - 1726, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1725, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1724, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1723, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1720, /* GL_WEIGHT_ARRAY_ARB */ - 345, /* GL_DOT3_RGB */ - 346, /* GL_DOT3_RGBA */ - 237, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - 232, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 936, /* GL_MULTISAMPLE_3DFX */ - 1306, /* GL_SAMPLE_BUFFERS_3DFX */ - 1297, /* GL_SAMPLES_3DFX */ - 917, /* GL_MODELVIEW2_ARB */ - 920, /* GL_MODELVIEW3_ARB */ - 921, /* GL_MODELVIEW4_ARB */ - 922, /* GL_MODELVIEW5_ARB */ - 923, /* GL_MODELVIEW6_ARB */ - 924, /* GL_MODELVIEW7_ARB */ - 925, /* GL_MODELVIEW8_ARB */ - 926, /* GL_MODELVIEW9_ARB */ - 896, /* GL_MODELVIEW10_ARB */ - 897, /* GL_MODELVIEW11_ARB */ - 898, /* GL_MODELVIEW12_ARB */ - 899, /* GL_MODELVIEW13_ARB */ - 900, /* GL_MODELVIEW14_ARB */ - 901, /* GL_MODELVIEW15_ARB */ - 902, /* GL_MODELVIEW16_ARB */ - 903, /* GL_MODELVIEW17_ARB */ - 904, /* GL_MODELVIEW18_ARB */ - 905, /* GL_MODELVIEW19_ARB */ - 907, /* GL_MODELVIEW20_ARB */ - 908, /* GL_MODELVIEW21_ARB */ - 909, /* GL_MODELVIEW22_ARB */ - 910, /* GL_MODELVIEW23_ARB */ - 911, /* GL_MODELVIEW24_ARB */ - 912, /* GL_MODELVIEW25_ARB */ - 913, /* GL_MODELVIEW26_ARB */ - 914, /* GL_MODELVIEW27_ARB */ - 915, /* GL_MODELVIEW28_ARB */ - 916, /* GL_MODELVIEW29_ARB */ - 918, /* GL_MODELVIEW30_ARB */ - 919, /* GL_MODELVIEW31_ARB */ - 350, /* GL_DOT3_RGB_EXT */ - 348, /* GL_DOT3_RGBA_EXT */ - 890, /* GL_MIRROR_CLAMP_EXT */ - 893, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 931, /* GL_MODULATE_ADD_ATI */ - 932, /* GL_MODULATE_SIGNED_ADD_ATI */ - 933, /* GL_MODULATE_SUBTRACT_ATI */ - 1733, /* GL_YCBCR_MESA */ - 1022, /* GL_PACK_INVERT_MESA */ - 305, /* GL_DEBUG_OBJECT_MESA */ - 306, /* GL_DEBUG_PRINT_MESA */ - 304, /* GL_DEBUG_ASSERT_MESA */ + 1736, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1714, /* GL_VERTEX_BLEND_ARB */ + 303, /* GL_CURRENT_WEIGHT_ARB */ + 1735, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1734, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1733, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1732, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1729, /* GL_WEIGHT_ARRAY_ARB */ + 346, /* GL_DOT3_RGB */ + 347, /* GL_DOT3_RGBA */ + 238, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + 233, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + 939, /* GL_MULTISAMPLE_3DFX */ + 1311, /* GL_SAMPLE_BUFFERS_3DFX */ + 1302, /* GL_SAMPLES_3DFX */ + 920, /* GL_MODELVIEW2_ARB */ + 923, /* GL_MODELVIEW3_ARB */ + 924, /* GL_MODELVIEW4_ARB */ + 925, /* GL_MODELVIEW5_ARB */ + 926, /* GL_MODELVIEW6_ARB */ + 927, /* GL_MODELVIEW7_ARB */ + 928, /* GL_MODELVIEW8_ARB */ + 929, /* GL_MODELVIEW9_ARB */ + 899, /* GL_MODELVIEW10_ARB */ + 900, /* GL_MODELVIEW11_ARB */ + 901, /* GL_MODELVIEW12_ARB */ + 902, /* GL_MODELVIEW13_ARB */ + 903, /* GL_MODELVIEW14_ARB */ + 904, /* GL_MODELVIEW15_ARB */ + 905, /* GL_MODELVIEW16_ARB */ + 906, /* GL_MODELVIEW17_ARB */ + 907, /* GL_MODELVIEW18_ARB */ + 908, /* GL_MODELVIEW19_ARB */ + 910, /* GL_MODELVIEW20_ARB */ + 911, /* GL_MODELVIEW21_ARB */ + 912, /* GL_MODELVIEW22_ARB */ + 913, /* GL_MODELVIEW23_ARB */ + 914, /* GL_MODELVIEW24_ARB */ + 915, /* GL_MODELVIEW25_ARB */ + 916, /* GL_MODELVIEW26_ARB */ + 917, /* GL_MODELVIEW27_ARB */ + 918, /* GL_MODELVIEW28_ARB */ + 919, /* GL_MODELVIEW29_ARB */ + 921, /* GL_MODELVIEW30_ARB */ + 922, /* GL_MODELVIEW31_ARB */ + 351, /* GL_DOT3_RGB_EXT */ + 349, /* GL_DOT3_RGBA_EXT */ + 893, /* GL_MIRROR_CLAMP_EXT */ + 896, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 934, /* GL_MODULATE_ADD_ATI */ + 935, /* GL_MODULATE_SIGNED_ADD_ATI */ + 936, /* GL_MODULATE_SUBTRACT_ATI */ + 1742, /* GL_YCBCR_MESA */ + 1025, /* GL_PACK_INVERT_MESA */ + 306, /* GL_DEBUG_OBJECT_MESA */ + 307, /* GL_DEBUG_PRINT_MESA */ + 305, /* GL_DEBUG_ASSERT_MESA */ 107, /* GL_BUFFER_SIZE */ 109, /* GL_BUFFER_USAGE */ - 1393, /* GL_STENCIL_BACK_FUNC */ - 1392, /* GL_STENCIL_BACK_FAIL */ - 1394, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1395, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 484, /* GL_FRAGMENT_PROGRAM_ARB */ - 1156, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1184, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1183, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1168, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1174, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1173, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 826, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 849, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 848, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 839, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 845, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 844, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 809, /* 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 */ + 1398, /* GL_STENCIL_BACK_FUNC */ + 1397, /* GL_STENCIL_BACK_FAIL */ + 1399, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1400, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 485, /* GL_FRAGMENT_PROGRAM_ARB */ + 1159, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1187, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1186, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1171, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1177, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1176, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 829, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 852, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 851, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 842, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 848, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 847, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 812, /* GL_MAX_DRAW_BUFFERS */ + 355, /* GL_DRAW_BUFFER0 */ + 358, /* GL_DRAW_BUFFER1 */ + 379, /* GL_DRAW_BUFFER2 */ + 382, /* GL_DRAW_BUFFER3 */ + 385, /* GL_DRAW_BUFFER4 */ + 388, /* GL_DRAW_BUFFER5 */ + 391, /* GL_DRAW_BUFFER6 */ + 394, /* GL_DRAW_BUFFER7 */ + 397, /* GL_DRAW_BUFFER8 */ + 400, /* GL_DRAW_BUFFER9 */ + 359, /* GL_DRAW_BUFFER10 */ + 362, /* GL_DRAW_BUFFER11 */ + 365, /* GL_DRAW_BUFFER12 */ + 368, /* GL_DRAW_BUFFER13 */ + 371, /* GL_DRAW_BUFFER14 */ + 374, /* GL_DRAW_BUFFER15 */ 82, /* GL_BLEND_EQUATION_ALPHA */ - 790, /* GL_MATRIX_PALETTE_ARB */ - 820, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 823, /* 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 */ - 1564, /* GL_TEXTURE_DEPTH_SIZE */ - 338, /* GL_DEPTH_TEXTURE_MODE */ - 1530, /* GL_TEXTURE_COMPARE_MODE */ - 1528, /* GL_TEXTURE_COMPARE_FUNC */ - 216, /* GL_COMPARE_R_TO_TEXTURE */ - 1090, /* GL_POINT_SPRITE */ - 265, /* GL_COORD_REPLACE */ - 1094, /* GL_POINT_SPRITE_R_MODE_NV */ - 1209, /* GL_QUERY_COUNTER_BITS */ - 290, /* GL_CURRENT_QUERY */ - 1211, /* GL_QUERY_RESULT */ - 1213, /* GL_QUERY_RESULT_AVAILABLE */ - 870, /* GL_MAX_VERTEX_ATTRIBS */ - 1695, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 336, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 335, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 856, /* GL_MAX_TEXTURE_COORDS */ - 858, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1161, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1163, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1162, /* GL_PROGRAM_FORMAT_ARB */ - 1609, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 317, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 316, /* GL_DEPTH_BOUNDS_EXT */ + 792, /* GL_MATRIX_PALETTE_ARB */ + 823, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 826, /* GL_MAX_PALETTE_MATRICES_ARB */ + 289, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + 786, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 284, /* GL_CURRENT_MATRIX_INDEX_ARB */ + 788, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 790, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 789, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 787, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1573, /* GL_TEXTURE_DEPTH_SIZE */ + 339, /* GL_DEPTH_TEXTURE_MODE */ + 1539, /* GL_TEXTURE_COMPARE_MODE */ + 1537, /* GL_TEXTURE_COMPARE_FUNC */ + 217, /* GL_COMPARE_R_TO_TEXTURE */ + 1093, /* GL_POINT_SPRITE */ + 266, /* GL_COORD_REPLACE */ + 1097, /* GL_POINT_SPRITE_R_MODE_NV */ + 1214, /* GL_QUERY_COUNTER_BITS */ + 291, /* GL_CURRENT_QUERY */ + 1216, /* GL_QUERY_RESULT */ + 1218, /* GL_QUERY_RESULT_AVAILABLE */ + 873, /* GL_MAX_VERTEX_ATTRIBS */ + 1704, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 337, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 336, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 859, /* GL_MAX_TEXTURE_COORDS */ + 861, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1164, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1166, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1165, /* GL_PROGRAM_FORMAT_ARB */ + 1618, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 318, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 317, /* GL_DEPTH_BOUNDS_EXT */ 52, /* GL_ARRAY_BUFFER */ - 419, /* GL_ELEMENT_ARRAY_BUFFER */ + 420, /* GL_ELEMENT_ARRAY_BUFFER */ 54, /* GL_ARRAY_BUFFER_BINDING */ - 421, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1669, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 957, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 422, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1678, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 960, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 140, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 577, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1543, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 415, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1318, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 462, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1721, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1691, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1164, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 832, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1170, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 841, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1182, /* GL_PROGRAM_TEMPORARIES_ARB */ - 847, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1172, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 843, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1176, /* GL_PROGRAM_PARAMETERS_ARB */ - 846, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1171, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 842, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1157, /* GL_PROGRAM_ATTRIBS_ARB */ - 827, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1169, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 840, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1155, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 825, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1167, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 838, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 833, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 829, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1185, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1620, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1221, /* GL_READ_ONLY */ - 1729, /* GL_WRITE_ONLY */ - 1223, /* GL_READ_WRITE */ + 579, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1552, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 416, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1323, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 463, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1730, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1700, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1167, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 835, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1173, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 844, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1185, /* GL_PROGRAM_TEMPORARIES_ARB */ + 850, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1175, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 846, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1179, /* GL_PROGRAM_PARAMETERS_ARB */ + 849, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1174, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 845, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1160, /* GL_PROGRAM_ATTRIBS_ARB */ + 830, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1172, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 843, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1158, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 828, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1170, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 841, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 836, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 832, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1188, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1629, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1226, /* GL_READ_ONLY */ + 1738, /* GL_WRITE_ONLY */ + 1228, /* GL_READ_WRITE */ 101, /* GL_BUFFER_ACCESS */ 103, /* GL_BUFFER_MAPPED */ 105, /* GL_BUFFER_MAP_POINTER */ - 1614, /* 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 */ - 1420, /* GL_STREAM_DRAW */ - 1422, /* GL_STREAM_READ */ - 1418, /* GL_STREAM_COPY */ - 1386, /* GL_STATIC_DRAW */ - 1388, /* GL_STATIC_READ */ - 1384, /* 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 */ - 830, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - 828, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 831, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 835, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 834, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 1414, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1623, /* GL_TIME_ELAPSED_EXT */ + 746, /* GL_MATRIX0_ARB */ + 758, /* GL_MATRIX1_ARB */ + 770, /* GL_MATRIX2_ARB */ + 774, /* GL_MATRIX3_ARB */ + 776, /* GL_MATRIX4_ARB */ + 778, /* GL_MATRIX5_ARB */ + 780, /* GL_MATRIX6_ARB */ + 782, /* GL_MATRIX7_ARB */ + 784, /* GL_MATRIX8_ARB */ + 785, /* GL_MATRIX9_ARB */ + 748, /* GL_MATRIX10_ARB */ + 749, /* GL_MATRIX11_ARB */ + 750, /* GL_MATRIX12_ARB */ + 751, /* GL_MATRIX13_ARB */ + 752, /* GL_MATRIX14_ARB */ + 753, /* GL_MATRIX15_ARB */ + 754, /* GL_MATRIX16_ARB */ + 755, /* GL_MATRIX17_ARB */ + 756, /* GL_MATRIX18_ARB */ + 757, /* GL_MATRIX19_ARB */ + 760, /* GL_MATRIX20_ARB */ + 761, /* GL_MATRIX21_ARB */ + 762, /* GL_MATRIX22_ARB */ + 763, /* GL_MATRIX23_ARB */ + 764, /* GL_MATRIX24_ARB */ + 765, /* GL_MATRIX25_ARB */ + 766, /* GL_MATRIX26_ARB */ + 767, /* GL_MATRIX27_ARB */ + 768, /* GL_MATRIX28_ARB */ + 769, /* GL_MATRIX29_ARB */ + 772, /* GL_MATRIX30_ARB */ + 773, /* GL_MATRIX31_ARB */ + 1425, /* GL_STREAM_DRAW */ + 1427, /* GL_STREAM_READ */ + 1423, /* GL_STREAM_COPY */ + 1391, /* GL_STATIC_DRAW */ + 1393, /* GL_STATIC_READ */ + 1389, /* GL_STATIC_COPY */ + 410, /* GL_DYNAMIC_DRAW */ + 412, /* GL_DYNAMIC_READ */ + 408, /* GL_DYNAMIC_COPY */ + 535, /* GL_GL_PIXEL_PACK_BUFFER */ + 537, /* GL_GL_PIXEL_UNPACK_BUFFER */ + 536, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + 538, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + 833, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + 831, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 834, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 838, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 837, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 795, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1419, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 891, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1299, /* GL_SAMPLES_PASSED */ - 485, /* GL_FRAGMENT_SHADER */ - 1715, /* GL_VERTEX_SHADER */ - 1175, /* GL_PROGRAM_OBJECT_ARB */ - 1331, /* GL_SHADER_OBJECT_ARB */ - 816, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 874, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 868, /* GL_MAX_VARYING_FLOATS */ - 872, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 801, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 982, /* GL_OBJECT_TYPE_ARB */ - 1333, /* GL_SHADER_TYPE */ - 450, /* GL_FLOAT_VEC2 */ - 452, /* GL_FLOAT_VEC3 */ - 454, /* GL_FLOAT_VEC4 */ - 604, /* GL_INT_VEC2 */ - 606, /* GL_INT_VEC3 */ - 608, /* GL_INT_VEC4 */ + 894, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1304, /* GL_SAMPLES_PASSED */ + 486, /* GL_FRAGMENT_SHADER */ + 1724, /* GL_VERTEX_SHADER */ + 1178, /* GL_PROGRAM_OBJECT_ARB */ + 1336, /* GL_SHADER_OBJECT_ARB */ + 819, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 877, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 871, /* GL_MAX_VARYING_FLOATS */ + 875, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 804, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 985, /* GL_OBJECT_TYPE_ARB */ + 1338, /* GL_SHADER_TYPE */ + 451, /* GL_FLOAT_VEC2 */ + 453, /* GL_FLOAT_VEC3 */ + 455, /* GL_FLOAT_VEC4 */ + 606, /* GL_INT_VEC2 */ + 608, /* GL_INT_VEC3 */ + 610, /* GL_INT_VEC4 */ 93, /* GL_BOOL */ 95, /* GL_BOOL_VEC2 */ 97, /* GL_BOOL_VEC3 */ 99, /* GL_BOOL_VEC4 */ - 444, /* GL_FLOAT_MAT2 */ - 446, /* GL_FLOAT_MAT3 */ - 448, /* GL_FLOAT_MAT4 */ - 1290, /* GL_SAMPLER_1D */ - 1292, /* GL_SAMPLER_2D */ - 1294, /* GL_SAMPLER_3D */ - 1295, /* GL_SAMPLER_CUBE */ - 1291, /* GL_SAMPLER_1D_SHADOW */ - 1293, /* 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 */ - 1664, /* GL_VALIDATE_STATUS */ - 589, /* GL_INFO_LOG_LENGTH */ + 445, /* GL_FLOAT_MAT2 */ + 447, /* GL_FLOAT_MAT3 */ + 449, /* GL_FLOAT_MAT4 */ + 1295, /* GL_SAMPLER_1D */ + 1297, /* GL_SAMPLER_2D */ + 1299, /* GL_SAMPLER_3D */ + 1300, /* GL_SAMPLER_CUBE */ + 1296, /* GL_SAMPLER_1D_SHADOW */ + 1298, /* GL_SAMPLER_2D_SHADOW */ + 529, /* GL_GL_FLOAT_MAT2x3 */ + 530, /* GL_GL_FLOAT_MAT2x4 */ + 531, /* GL_GL_FLOAT_MAT3x2 */ + 532, /* GL_GL_FLOAT_MAT3x4 */ + 533, /* GL_GL_FLOAT_MAT4x2 */ + 534, /* GL_GL_FLOAT_MAT4x3 */ + 312, /* GL_DELETE_STATUS */ + 221, /* GL_COMPILE_STATUS */ + 659, /* GL_LINK_STATUS */ + 1673, /* GL_VALIDATE_STATUS */ + 591, /* GL_INFO_LOG_LENGTH */ 56, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1332, /* GL_SHADER_SOURCE_LENGTH */ + 1337, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 487, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1335, /* GL_SHADING_LANGUAGE_VERSION */ - 289, /* GL_CURRENT_PROGRAM */ - 1031, /* GL_PALETTE4_RGB8_OES */ - 1033, /* GL_PALETTE4_RGBA8_OES */ - 1029, /* GL_PALETTE4_R5_G6_B5_OES */ - 1032, /* GL_PALETTE4_RGBA4_OES */ - 1030, /* GL_PALETTE4_RGB5_A1_OES */ - 1036, /* GL_PALETTE8_RGB8_OES */ - 1038, /* GL_PALETTE8_RGBA8_OES */ - 1034, /* GL_PALETTE8_R5_G6_B5_OES */ - 1037, /* GL_PALETTE8_RGBA4_OES */ - 1035, /* GL_PALETTE8_RGB5_A1_OES */ - 572, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 571, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 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 */ - 1092, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 665, /* GL_LOWER_LEFT */ - 1661, /* GL_UPPER_LEFT */ - 1396, /* GL_STENCIL_BACK_REF */ - 1397, /* GL_STENCIL_BACK_VALUE_MASK */ - 1398, /* GL_STENCIL_BACK_WRITEMASK */ - 402, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1235, /* GL_RENDERBUFFER_BINDING_EXT */ - 1220, /* GL_READ_FRAMEBUFFER_EXT */ - 403, /* GL_DRAW_FRAMEBUFFER_EXT */ - 1219, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 489, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - 488, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - 491, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - 490, /* 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 */ - 798, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 488, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1340, /* GL_SHADING_LANGUAGE_VERSION */ + 290, /* GL_CURRENT_PROGRAM */ + 1034, /* GL_PALETTE4_RGB8_OES */ + 1036, /* GL_PALETTE4_RGBA8_OES */ + 1032, /* GL_PALETTE4_R5_G6_B5_OES */ + 1035, /* GL_PALETTE4_RGBA4_OES */ + 1033, /* GL_PALETTE4_RGB5_A1_OES */ + 1039, /* GL_PALETTE8_RGB8_OES */ + 1041, /* GL_PALETTE8_RGBA8_OES */ + 1037, /* GL_PALETTE8_R5_G6_B5_OES */ + 1040, /* GL_PALETTE8_RGBA4_OES */ + 1038, /* GL_PALETTE8_RGB5_A1_OES */ + 574, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 573, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1507, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1198, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1509, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1201, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1515, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1517, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 543, /* GL_GL_SRGB */ + 544, /* GL_GL_SRGB8 */ + 546, /* GL_GL_SRGB_ALPHA */ + 545, /* GL_GL_SRGB8_ALPHA8 */ + 542, /* GL_GL_SLUMINANCE_ALPHA */ + 541, /* GL_GL_SLUMINANCE8_ALPHA8 */ + 539, /* GL_GL_SLUMINANCE */ + 540, /* GL_GL_SLUMINANCE8 */ + 526, /* GL_GL_COMPRESSED_SRGB */ + 527, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + 524, /* GL_GL_COMPRESSED_SLUMINANCE */ + 525, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + 1095, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 667, /* GL_LOWER_LEFT */ + 1670, /* GL_UPPER_LEFT */ + 1401, /* GL_STENCIL_BACK_REF */ + 1402, /* GL_STENCIL_BACK_VALUE_MASK */ + 1403, /* GL_STENCIL_BACK_WRITEMASK */ + 403, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + 1240, /* GL_RENDERBUFFER_BINDING_EXT */ + 1225, /* GL_READ_FRAMEBUFFER_EXT */ + 404, /* GL_DRAW_FRAMEBUFFER_EXT */ + 1224, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + 490, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + 489, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + 494, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + 491, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + 496, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + 498, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + 503, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + 501, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 499, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 502, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 500, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + 504, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + 506, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + 505, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 801, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ 146, /* GL_COLOR_ATTACHMENT0_EXT */ 153, /* GL_COLOR_ATTACHMENT1_EXT */ 154, /* GL_COLOR_ATTACHMENT2_EXT */ @@ -4774,25 +4799,25 @@ static const unsigned reduced_enums[1277] = 150, /* GL_COLOR_ATTACHMENT13_EXT */ 151, /* GL_COLOR_ATTACHMENT14_EXT */ 152, /* GL_COLOR_ATTACHMENT15_EXT */ - 313, /* GL_DEPTH_ATTACHMENT_EXT */ - 1391, /* GL_STENCIL_ATTACHMENT_EXT */ - 495, /* GL_FRAMEBUFFER_EXT */ - 1236, /* GL_RENDERBUFFER_EXT */ - 1239, /* GL_RENDERBUFFER_WIDTH_EXT */ - 1237, /* GL_RENDERBUFFER_HEIGHT_EXT */ - 1238, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - 1409, /* GL_STENCIL_INDEX_EXT */ - 1406, /* GL_STENCIL_INDEX1_EXT */ - 1407, /* GL_STENCIL_INDEX4_EXT */ - 1408, /* GL_STENCIL_INDEX8_EXT */ - 1405, /* GL_STENCIL_INDEX16_EXT */ - 427, /* GL_EVAL_BIT */ - 1217, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 659, /* GL_LIST_BIT */ - 1514, /* GL_TEXTURE_BIT */ - 1314, /* GL_SCISSOR_BIT */ + 314, /* GL_DEPTH_ATTACHMENT_EXT */ + 1396, /* GL_STENCIL_ATTACHMENT_EXT */ + 497, /* GL_FRAMEBUFFER_EXT */ + 1241, /* GL_RENDERBUFFER_EXT */ + 1244, /* GL_RENDERBUFFER_WIDTH_EXT */ + 1242, /* GL_RENDERBUFFER_HEIGHT_EXT */ + 1243, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + 1414, /* GL_STENCIL_INDEX_EXT */ + 1411, /* GL_STENCIL_INDEX1_EXT */ + 1412, /* GL_STENCIL_INDEX4_EXT */ + 1413, /* GL_STENCIL_INDEX8_EXT */ + 1410, /* GL_STENCIL_INDEX16_EXT */ + 428, /* GL_EVAL_BIT */ + 1222, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 661, /* GL_LIST_BIT */ + 1523, /* GL_TEXTURE_BIT */ + 1319, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 938, /* GL_MULTISAMPLE_BIT */ + 941, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 4e44c5b7103..a4a6cdae366 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -145,6 +145,7 @@ static const struct { { OFF, "GL_MESA_packed_depth_stencil", F(MESA_packed_depth_stencil) }, { OFF, "GL_MESA_program_debug", F(MESA_program_debug) }, { OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) }, + { OFF, "GL_MESA_texture_array", F(MESA_texture_array) }, { OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) }, { ON, "GL_MESA_window_pos", F(ARB_window_pos) }, { OFF, "GL_NV_blend_square", F(NV_blend_square) }, @@ -270,6 +271,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.MESA_program_debug = GL_TRUE; #endif ctx->Extensions.MESA_resize_buffers = GL_TRUE; + ctx->Extensions.MESA_texture_array = GL_TRUE; ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; ctx->Extensions.NV_blend_square = GL_TRUE; /*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/ diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index eac2f787171..e3bada5ae89 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1179,9 +1179,16 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, texObj = _mesa_lookup_texture(ctx, texture); if (texObj != NULL) { - err = (texObj->Target == GL_TEXTURE_CUBE_MAP) - ? !IS_CUBE_FACE(textarget) - : (texObj->Target != textarget); + if (textarget == 0) { + err = (texObj->Target != GL_TEXTURE_3D) && + (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) && + (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT); + } + else { + err = (texObj->Target == GL_TEXTURE_CUBE_MAP) + ? !IS_CUBE_FACE(textarget) + : (texObj->Target != textarget); + } } if (err) { @@ -1195,12 +1202,20 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); if (zoffset < 0 || zoffset >= maxSize) { _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(zoffset)", - caller); + "glFramebufferTexture%sEXT(zoffset)", caller); + return; + } + } + else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) || + (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) { + if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferTexture%sEXT(layer)", caller); return; } } + if ((level < 0) || (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1291,6 +1306,17 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, } +void GLAPIENTRY +_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLint layer) +{ + GET_CURRENT_CONTEXT(ctx); + + framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, + level, layer); +} + + void GLAPIENTRY _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbufferTarget, diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index 301e2da4495..782ad8cb180 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -112,6 +112,10 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +extern void GLAPIENTRY +_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLint layer); + extern void GLAPIENTRY _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 33be7689997..90554332814 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -425,12 +425,18 @@ StateVars = [ ( "GL_TEXTURE_1D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D)"], "", None ), ( "GL_TEXTURE_2D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ), ( "GL_TEXTURE_3D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_3D)"], "", None ), + ( "GL_TEXTURE_1D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), + ( "GL_TEXTURE_2D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), ( "GL_TEXTURE_BINDING_1D", GLint, ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name"], "", None ), ( "GL_TEXTURE_BINDING_2D", GLint, ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name"], "", None ), ( "GL_TEXTURE_BINDING_3D", GLint, ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name"], "", None ), + ( "GL_TEXTURE_BINDING_1D_ARRAY_EXT", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1DArray->Name"], "", ["MESA_texture_array"] ), + ( "GL_TEXTURE_BINDING_2D_ARRAY_EXT", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2DArray->Name"], "", ["MESA_texture_array"] ), ( "GL_TEXTURE_ENV_COLOR", GLfloatN, ["color[0]", "color[1]", "color[2]", "color[3]"], "const GLfloat *color = ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvColor;", diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index cc1fb97eedd..1dc51440c8e 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -551,7 +551,7 @@ make_2d_mipmap(const struct gl_texture_format *format, GLint border, /* Compute src and dst pointers, skipping any border */ srcA = srcPtr + border * ((srcWidth + 1) * bpt); - if (srcHeight > 1) + if (srcHeight > 1) srcB = srcA + srcRowStride; else srcB = srcA; @@ -796,6 +796,136 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border, } +static void +make_1d_stack_mipmap(const struct gl_texture_format *format, GLint border, + GLint srcWidth, GLubyte *srcPtr, + GLint dstWidth, GLint dstHeight, GLubyte *dstPtr) +{ + const GLint bpt = format->TexelBytes; + const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ + const GLint dstWidthNB = dstWidth - 2 * border; + const GLint dstHeightNB = dstHeight - 2 * border; + const GLint srcRowStride = bpt * srcWidth; + const GLint dstRowStride = bpt * dstWidth; + const GLubyte *src; + GLubyte *dst; + GLint row; + + /* Compute src and dst pointers, skipping any border */ + src = srcPtr + border * ((srcWidth + 1) * bpt); + dst = dstPtr + border * ((dstWidth + 1) * bpt); + + for (row = 0; row < dstHeightNB; row++) { + do_row(format, srcWidthNB, src, src, + dstWidthNB, dst); + src += srcRowStride; + dst += dstRowStride; + } + + if (border) { + /* copy left-most pixel from source */ + MEMCPY(dstPtr, srcPtr, bpt); + /* copy right-most pixel from source */ + MEMCPY(dstPtr + (dstWidth - 1) * bpt, + srcPtr + (srcWidth - 1) * bpt, + bpt); + } +} + + +/** + * \bugs + * There is quite a bit of refactoring that could be done with this function + * and \c make_2d_mipmap. + */ +static void +make_2d_stack_mipmap(const struct gl_texture_format *format, GLint border, + GLint srcWidth, GLint srcHeight, const GLubyte *srcPtr, + GLint dstWidth, GLint dstHeight, GLint dstDepth, + GLubyte *dstPtr) +{ + const GLint bpt = format->TexelBytes; + const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ + const GLint dstWidthNB = dstWidth - 2 * border; + const GLint dstHeightNB = dstHeight - 2 * border; + const GLint dstDepthNB = dstDepth - 2 * border; + const GLint srcRowStride = bpt * srcWidth; + const GLint dstRowStride = bpt * dstWidth; + const GLubyte *srcA, *srcB; + GLubyte *dst; + GLint layer; + GLint row; + + /* Compute src and dst pointers, skipping any border */ + srcA = srcPtr + border * ((srcWidth + 1) * bpt); + if (srcHeight > 1) + srcB = srcA + srcRowStride; + else + srcB = srcA; + dst = dstPtr + border * ((dstWidth + 1) * bpt); + + for (layer = 0; layer < dstDepthNB; layer++) { + for (row = 0; row < dstHeightNB; row++) { + do_row(format, srcWidthNB, srcA, srcB, + dstWidthNB, dst); + srcA += 2 * srcRowStride; + srcB += 2 * srcRowStride; + dst += dstRowStride; + } + + /* This is ugly but probably won't be used much */ + if (border > 0) { + /* fill in dest border */ + /* lower-left border pixel */ + MEMCPY(dstPtr, srcPtr, bpt); + /* lower-right border pixel */ + MEMCPY(dstPtr + (dstWidth - 1) * bpt, + srcPtr + (srcWidth - 1) * bpt, bpt); + /* upper-left border pixel */ + MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); + /* upper-right border pixel */ + MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); + /* lower border */ + do_row(format, srcWidthNB, + srcPtr + bpt, + srcPtr + bpt, + dstWidthNB, dstPtr + bpt); + /* upper border */ + do_row(format, srcWidthNB, + srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, + srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, + dstWidthNB, + dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt); + /* left and right borders */ + if (srcHeight == dstHeight) { + /* copy border pixel from src to dst */ + for (row = 1; row < srcHeight; row++) { + MEMCPY(dstPtr + dstWidth * row * bpt, + srcPtr + srcWidth * row * bpt, bpt); + MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); + } + } + else { + /* average two src pixels each dest pixel */ + for (row = 0; row < dstHeightNB; row += 2) { + do_row(format, 1, + srcPtr + (srcWidth * (row * 2 + 1)) * bpt, + srcPtr + (srcWidth * (row * 2 + 2)) * bpt, + 1, dstPtr + (dstWidth * row + 1) * bpt); + do_row(format, 1, + srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt, + srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt, + 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt); + } + } + } + } +} + + /** * For GL_SGIX_generate_mipmap: * Generate a complete set of mipmaps from texObj's base-level image. @@ -897,13 +1027,15 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, else { dstWidth = srcWidth; /* can't go smaller */ } - if (srcHeight - 2 * border > 1) { + if ((srcHeight - 2 * border > 1) && + (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT)) { dstHeight = (srcHeight - 2 * border) / 2 + 2 * border; } else { dstHeight = srcHeight; /* can't go smaller */ } - if (srcDepth - 2 * border > 1) { + if ((srcDepth - 2 * border > 1) && + (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT)) { dstDepth = (srcDepth - 2 * border) / 2 + 2 * border; } else { @@ -1007,6 +1139,16 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, srcWidth, srcHeight, srcDepth, srcData, dstWidth, dstHeight, dstDepth, dstData); break; + case GL_TEXTURE_1D_ARRAY_EXT: + make_1d_stack_mipmap(convertFormat, border, + srcWidth, srcData, + dstWidth, dstHeight, dstData); + break; + case GL_TEXTURE_2D_ARRAY_EXT: + make_2d_stack_mipmap(convertFormat, border, + srcWidth, srcHeight, srcData, + dstWidth, dstHeight, dstDepth, dstData); + break; case GL_TEXTURE_RECTANGLE_NV: /* no mipmaps, do nothing */ break; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 71215d54709..894b9edb36f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1127,7 +1127,7 @@ struct gl_stencil_attrib }; -#define NUM_TEXTURE_TARGETS 5 /* 1D, 2D, 3D, CUBE and RECT */ +#define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */ /** * An index for each type of texture object @@ -1138,6 +1138,8 @@ struct gl_stencil_attrib #define TEXTURE_3D_INDEX 2 #define TEXTURE_CUBE_INDEX 3 #define TEXTURE_RECT_INDEX 4 +#define TEXTURE_1D_ARRAY_INDEX 5 +#define TEXTURE_2D_ARRAY_INDEX 6 /*@}*/ /** @@ -1150,6 +1152,8 @@ struct gl_stencil_attrib #define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX) #define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX) #define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX) +#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) +#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) /*@}*/ @@ -1520,6 +1524,8 @@ struct gl_texture_unit struct gl_texture_object *Current3D; struct gl_texture_object *CurrentCubeMap; /**< GL_ARB_texture_cube_map */ struct gl_texture_object *CurrentRect; /**< GL_NV_texture_rectangle */ + struct gl_texture_object *Current1DArray; /**< GL_MESA_texture_array */ + struct gl_texture_object *Current2DArray; /**< GL_MESA_texture_array */ struct gl_texture_object *_Current; /**< Points to really enabled tex obj */ @@ -1528,6 +1534,8 @@ struct gl_texture_unit struct gl_texture_object Saved3D; struct gl_texture_object SavedCubeMap; struct gl_texture_object SavedRect; + struct gl_texture_object Saved1DArray; + struct gl_texture_object Saved2DArray; /* GL_SGI_texture_color_table */ struct gl_color_table ColorTable; @@ -1572,6 +1580,8 @@ struct gl_texture_attrib struct gl_texture_object *Proxy3D; struct gl_texture_object *ProxyCubeMap; struct gl_texture_object *ProxyRect; + struct gl_texture_object *Proxy1DArray; + struct gl_texture_object *Proxy2DArray; /** GL_EXT_shared_texture_palette */ GLboolean SharedPalette; @@ -2156,6 +2166,8 @@ struct gl_shared_state struct gl_texture_object *Default3D; struct gl_texture_object *DefaultCubeMap; struct gl_texture_object *DefaultRect; + struct gl_texture_object *Default1DArray; + struct gl_texture_object *Default2DArray; /*@}*/ /** @@ -2322,17 +2334,24 @@ struct gl_renderbuffer */ struct gl_renderbuffer_attachment { - GLenum Type; /* GL_NONE or GL_TEXTURE or GL_RENDERBUFFER_EXT */ + GLenum Type; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */ GLboolean Complete; - /* IF Type == GL_RENDERBUFFER_EXT: */ + /** + * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the + * application supplied renderbuffer object. + */ struct gl_renderbuffer *Renderbuffer; - /* IF Type == GL_TEXTURE: */ + /** + * If \c Type is \c GL_TEXTURE, this stores a pointer to the application + * supplied texture object. + */ struct gl_texture_object *Texture; - GLuint TextureLevel; - GLuint CubeMapFace; /* 0 .. 5, for cube map textures */ - GLuint Zoffset; /* for 3D textures */ + GLuint TextureLevel; /**< Attached mipmap level. */ + GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */ + GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D + * and 2D array textures */ }; @@ -2438,6 +2457,7 @@ struct gl_constants GLint MaxTextureLevels; /**< Maximum number of allowed mipmap levels. */ GLint Max3DTextureLevels; /**< Maximum number of allowed mipmap levels for 3D texture targets. */ GLint MaxCubeTextureLevels; /**< Maximum number of allowed mipmap levels for GL_ARB_texture_cube_map */ + GLint MaxArrayTextureLayers; /**< Maximum number of layers in an array texture. */ GLint MaxTextureRectSize; /* GL_NV_texture_rectangle */ GLuint MaxTextureCoordUnits; GLuint MaxTextureImageUnits; @@ -2586,6 +2606,7 @@ struct gl_extensions GLboolean MESA_program_debug; GLboolean MESA_resize_buffers; GLboolean MESA_ycbcr_texture; + GLboolean MESA_texture_array; GLboolean NV_blend_square; GLboolean NV_fragment_program; GLboolean NV_light_max_exponent; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 96ee5127e11..0a83abc7dda 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -812,6 +812,11 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT); SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT); #endif + + /* GL_MESA_texture_array / GL_EXT_texture_array */ +#if FEATURE_EXT_framebuffer_object + SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT); +#endif } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 9fb430f39b4..8e528d9bbb8 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -629,6 +629,8 @@ _mesa_set_tex_image(struct gl_texture_object *tObj, case GL_TEXTURE_1D: case GL_TEXTURE_2D: case GL_TEXTURE_3D: + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_TEXTURE_2D_ARRAY_EXT: tObj->Image[0][level] = texImage; break; case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: @@ -733,7 +735,9 @@ _mesa_is_proxy_texture(GLenum target) target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_3D || target == GL_PROXY_TEXTURE_CUBE_MAP_ARB || - target == GL_PROXY_TEXTURE_RECTANGLE_NV); + target == GL_PROXY_TEXTURE_RECTANGLE_NV || + target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || + target == GL_PROXY_TEXTURE_2D_ARRAY_EXT); } @@ -783,6 +787,18 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, case GL_PROXY_TEXTURE_RECTANGLE_NV: return ctx->Extensions.NV_texture_rectangle ? ctx->Texture.ProxyRect : NULL; + case GL_TEXTURE_1D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array + ? texUnit->Current1DArray : NULL; + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array + ? ctx->Texture.Proxy1DArray : NULL; + case GL_TEXTURE_2D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array + ? texUnit->Current2DArray : NULL; + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array + ? ctx->Texture.Proxy2DArray : NULL; default: _mesa_problem(NULL, "bad target in _mesa_select_tex_object()"); return NULL; @@ -848,6 +864,13 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, else return NULL; + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + return (ctx->Extensions.MESA_texture_array) + ? texObj->Image[0][level] : NULL; + default: return NULL; } @@ -973,6 +996,36 @@ _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level) texImage->TexObject = ctx->Texture.ProxyRect; } return texImage; + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + if (level >= ctx->Const.MaxTextureLevels) + return NULL; + texImage = ctx->Texture.Proxy1DArray->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.Proxy1DArray->Image[0][level] = texImage; + /* Set the 'back' pointer */ + texImage->TexObject = ctx->Texture.Proxy1DArray; + } + return texImage; + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + if (level >= ctx->Const.MaxTextureLevels) + return NULL; + texImage = ctx->Texture.Proxy2DArray->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.Proxy2DArray->Image[0][level] = texImage; + /* Set the 'back' pointer */ + texImage->TexObject = ctx->Texture.Proxy2DArray; + } + return texImage; default: return NULL; } @@ -998,6 +1051,10 @@ _mesa_max_texture_levels(GLcontext *ctx, GLenum target) case GL_PROXY_TEXTURE_1D: case GL_TEXTURE_2D: case GL_PROXY_TEXTURE_2D: + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: return ctx->Const.MaxTextureLevels; case GL_TEXTURE_3D: case GL_PROXY_TEXTURE_3D: @@ -1292,6 +1349,36 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, return GL_FALSE; } return GL_TRUE; + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); + if (width < 2 * border || width > 2 + maxSize || + (!ctx->Extensions.ARB_texture_non_power_of_two && + _mesa_bitcount(width - 2 * border) != 1) || + level >= ctx->Const.MaxTextureLevels) { + /* bad width or level */ + return GL_FALSE; + } + + if (height < 1 || height > ctx->Const.MaxArrayTextureLayers) { + return GL_FALSE; + } + return GL_TRUE; + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); + if (width < 2 * border || width > 2 + maxSize || + (!ctx->Extensions.ARB_texture_non_power_of_two && + _mesa_bitcount(width - 2 * border) != 1) || + height < 2 * border || height > 2 + maxSize || + (!ctx->Extensions.ARB_texture_non_power_of_two && + _mesa_bitcount(height - 2 * border) != 1) || + level >= ctx->Const.MaxTextureLevels) { + /* bad width or height or level */ + return GL_FALSE; + } + if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers) { + return GL_FALSE; + } + return GL_TRUE; default: _mesa_problem(ctx, "Invalid target in _mesa_test_proxy_teximage"); return GL_FALSE; @@ -1398,6 +1485,10 @@ texture_error_check( GLcontext *ctx, GLenum target, } proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV; } + else if (target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || + target == GL_TEXTURE_1D_ARRAY_EXT) { + proxy_target = GL_PROXY_TEXTURE_1D_ARRAY_EXT; + } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); return GL_TRUE; @@ -1407,6 +1498,10 @@ texture_error_check( GLcontext *ctx, GLenum target, if (target == GL_PROXY_TEXTURE_3D || target == GL_TEXTURE_3D) { proxy_target = GL_PROXY_TEXTURE_3D; } + else if (target == GL_PROXY_TEXTURE_2D_ARRAY_EXT || + target == GL_TEXTURE_2D_ARRAY_EXT) { + proxy_target = GL_PROXY_TEXTURE_2D_ARRAY_EXT; + } else { _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" ); return GL_TRUE; @@ -1595,13 +1690,25 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, return GL_TRUE; } } + else if (target == GL_TEXTURE_1D_ARRAY_EXT) { + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); + return GL_TRUE; + } + } else if (target != GL_TEXTURE_2D) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); return GL_TRUE; } } else if (dimensions == 3) { - if (target != GL_TEXTURE_3D) { + if (target == GL_TEXTURE_2D_ARRAY_EXT) { + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage3D(target)" ); + return GL_TRUE; + } + } + else if (target != GL_TEXTURE_3D) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage3D(target)" ); return GL_TRUE; } @@ -1855,6 +1962,17 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, format, type, width, height, 1, border); } + else if (target == GL_TEXTURE_1D_ARRAY_EXT) { + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)"); + return GL_TRUE; + } + sizeOK = ctx->Driver.TestProxyTexImage(ctx, + GL_PROXY_TEXTURE_1D_ARRAY_EXT, + level, internalFormat, + format, type, + width, height, 1, border); + } else { _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); return GL_TRUE; @@ -1968,15 +2086,23 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, return GL_TRUE; } } + else if (target == GL_TEXTURE_1D_ARRAY_EXT) { + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); + return GL_TRUE; + } + } else if (target != GL_TEXTURE_2D) { _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); return GL_TRUE; } } else if (dimensions == 3) { - if (target != GL_TEXTURE_3D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage3D(target)" ); - return GL_TRUE; + if (((target != GL_TEXTURE_2D_ARRAY_EXT) || + (!ctx->Extensions.MESA_texture_array)) + && (target != GL_TEXTURE_3D)) { + _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage3D(target)" ); + return GL_TRUE; } } @@ -2393,7 +2519,9 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) || (ctx->Extensions.NV_texture_rectangle && - target == GL_TEXTURE_RECTANGLE_NV)) { + target == GL_TEXTURE_RECTANGLE_NV) || + (ctx->Extensions.MESA_texture_array && + target == GL_TEXTURE_1D_ARRAY_EXT)) { /* non-proxy target */ struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; @@ -2451,7 +2579,9 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB && ctx->Extensions.ARB_texture_cube_map) || (target == GL_PROXY_TEXTURE_RECTANGLE_NV && - ctx->Extensions.NV_texture_rectangle)) { + ctx->Extensions.NV_texture_rectangle) || + (ctx->Extensions.MESA_texture_array && + target == GL_PROXY_TEXTURE_1D_ARRAY_EXT)) { /* Proxy texture: check for errors and update proxy state */ struct gl_texture_image *texImage; texImage = _mesa_get_proxy_tex_image(ctx, target, level); @@ -2491,7 +2621,9 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (target == GL_TEXTURE_3D) { + if (target == GL_TEXTURE_3D || + (ctx->Extensions.MESA_texture_array && + target == GL_TEXTURE_2D_ARRAY_EXT)) { /* non-proxy target */ struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; @@ -2544,7 +2676,9 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, out: _mesa_unlock_texture(ctx, texObj); } - else if (target == GL_PROXY_TEXTURE_3D) { + else if (target == GL_PROXY_TEXTURE_3D || + (ctx->Extensions.MESA_texture_array && + target == GL_PROXY_TEXTURE_2D_ARRAY_EXT)) { /* Proxy texture: check for errors and update proxy state */ struct gl_texture_image *texImage; texImage = _mesa_get_proxy_tex_image(ctx, target, level); diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 56d816e45f7..bd447ac0688 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -104,7 +104,9 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, target == GL_TEXTURE_2D || target == GL_TEXTURE_3D || target == GL_TEXTURE_CUBE_MAP_ARB || - target == GL_TEXTURE_RECTANGLE_NV); + target == GL_TEXTURE_RECTANGLE_NV || + target == GL_TEXTURE_1D_ARRAY_EXT || + target == GL_TEXTURE_2D_ARRAY_EXT); _mesa_bzero(obj, sizeof(*obj)); /* init the non-zero fields */ @@ -279,11 +281,13 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, } /* Compute _MaxLevel */ - if (t->Target == GL_TEXTURE_1D) { + if ((t->Target == GL_TEXTURE_1D) || + (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) { maxLog2 = t->Image[0][baseLevel]->WidthLog2; maxLevels = ctx->Const.MaxTextureLevels; } - else if (t->Target == GL_TEXTURE_2D) { + else if ((t->Target == GL_TEXTURE_2D) || + (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) { maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2, t->Image[0][baseLevel]->HeightLog2); maxLevels = ctx->Const.MaxTextureLevels; @@ -365,7 +369,8 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, } /* Test things which depend on number of texture image dimensions */ - if (t->Target == GL_TEXTURE_1D) { + if ((t->Target == GL_TEXTURE_1D) || + (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) { /* Test 1-D mipmaps */ GLuint width = t->Image[0][baseLevel]->Width2; for (i = baseLevel + 1; i < maxLevels; i++) { @@ -389,7 +394,8 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, } } } - else if (t->Target == GL_TEXTURE_2D) { + else if ((t->Target == GL_TEXTURE_2D) || + (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) { /* Test 2-D mipmaps */ GLuint width = t->Image[0][baseLevel]->Width2; GLuint height = t->Image[0][baseLevel]->Height2; @@ -652,6 +658,14 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj) curr = &unit->CurrentRect; unit->CurrentRect = ctx->Shared->DefaultRect; } + else if (texObj == unit->Current1DArray) { + curr = &unit->Current1DArray; + unit->CurrentRect = ctx->Shared->Default1DArray; + } + else if (texObj == unit->Current2DArray) { + curr = &unit->Current1DArray; + unit->CurrentRect = ctx->Shared->Default2DArray; + } if (curr) { (*curr)->RefCount++; @@ -796,6 +810,20 @@ _mesa_BindTexture( GLenum target, GLuint texName ) } oldTexObj = texUnit->CurrentRect; break; + case GL_TEXTURE_1D_ARRAY_EXT: + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error( ctx, GL_INVALID_ENUM, "glBindTexture(target)" ); + return; + } + oldTexObj = texUnit->Current1DArray; + break; + case GL_TEXTURE_2D_ARRAY_EXT: + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error( ctx, GL_INVALID_ENUM, "glBindTexture(target)" ); + return; + } + oldTexObj = texUnit->Current2DArray; + break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glBindTexture(target)" ); return; @@ -832,6 +860,12 @@ _mesa_BindTexture( GLenum target, GLuint texName ) case GL_TEXTURE_RECTANGLE_NV: newTexObj = ctx->Shared->DefaultRect; break; + case GL_TEXTURE_1D_ARRAY_EXT: + newTexObj = ctx->Shared->Default1DArray; + break; + case GL_TEXTURE_2D_ARRAY_EXT: + newTexObj = ctx->Shared->Default2DArray; + break; default: ; /* Bad targets are caught above */ } @@ -902,6 +936,12 @@ _mesa_BindTexture( GLenum target, GLuint texName ) case GL_TEXTURE_RECTANGLE_NV: texUnit->CurrentRect = newTexObj; break; + case GL_TEXTURE_1D_ARRAY_EXT: + texUnit->Current1DArray = newTexObj; + break; + case GL_TEXTURE_2D_ARRAY_EXT: + texUnit->Current2DArray = newTexObj; + break; default: _mesa_problem(ctx, "bad target in BindTexture"); return; diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index f7385845124..8d5468aff0d 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -16,10 +16,13 @@ */ struct texture_renderbuffer { - struct gl_renderbuffer Base; /* Base class object */ + struct gl_renderbuffer Base; /**< Base class object */ struct gl_texture_image *TexImage; StoreTexelFunc Store; - GLint Zoffset; + GLint Yoffset; /**< Layer for 1D array textures. */ + GLint Zoffset; /**< Layer for 2D array textures, or slice + * for 3D textures + */ }; @@ -38,6 +41,8 @@ texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, ASSERT(trb->TexImage->Width == rb->Width); ASSERT(trb->TexImage->Height == rb->Height); + y += trb->Yoffset; + if (rb->DataType == CHAN_TYPE) { GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { @@ -87,15 +92,16 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, if (rb->DataType == CHAN_TYPE) { GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { - trb->TexImage->FetchTexelc(trb->TexImage, x[i], y[i], z, - rgbaOut + 4 * i); + trb->TexImage->FetchTexelc(trb->TexImage, x[i], y[i] + trb->Yoffset, + z, rgbaOut + 4 * i); } } else if (rb->DataType == GL_UNSIGNED_INT) { GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i], z, &flt); + trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + z, &flt); #if 0 zValues[i] = (GLuint) (flt * 0xffffffff); #else @@ -107,7 +113,8 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i], z, &flt); + trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + z, &flt); zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; } } @@ -129,6 +136,8 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint z = trb->Zoffset; GLuint i; + y += trb->Yoffset; + if (rb->DataType == CHAN_TYPE) { const GLchan *rgba = (const GLchan *) values; for (i = 0; i < count; i++) { @@ -170,6 +179,8 @@ texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint z = trb->Zoffset; GLuint i; + y += trb->Yoffset; + if (rb->DataType == CHAN_TYPE) { const GLchan *rgba = (const GLchan *) value; for (i = 0; i < count; i++) { @@ -215,7 +226,7 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLchan *rgba = (const GLchan *) values; for (i = 0; i < count; i++) { if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i], z, rgba); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba); } rgba += 4; } @@ -224,7 +235,8 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint *zValues = (const GLuint *) values; for (i = 0; i < count; i++) { if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i], z, zValues + i); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, + zValues + i); } } } @@ -233,7 +245,7 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, for (i = 0; i < count; i++) { if (!mask || mask[i]) { GLfloat flt = (zValues[i] >> 8) * (1.0 / 0xffffff); - trb->Store(trb->TexImage, x[i], y[i], z, &flt); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); } } } @@ -257,7 +269,7 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, const GLchan *rgba = (const GLchan *) value; for (i = 0; i < count; i++) { if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i], z, rgba); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba); } } } @@ -265,7 +277,7 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, const GLuint zValue = *((const GLuint *) value); for (i = 0; i < count; i++) { if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i], z, &zValue); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue); } } } @@ -274,7 +286,7 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, const GLfloat flt = (zValue >> 8) * (1.0 / 0xffffff); for (i = 0; i < count; i++) { if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i], z, &flt); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); } } } @@ -350,7 +362,14 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Store = trb->TexImage->TexFormat->StoreTexel; ASSERT(trb->Store); - trb->Zoffset = att->Zoffset; + if (att->Texture->Target == GL_TEXTURE_1D_ARRAY_EXT) { + trb->Yoffset = att->Zoffset; + trb->Zoffset = 0; + } + else { + trb->Yoffset = 0; + trb->Zoffset = att->Zoffset; + } trb->Base.Width = trb->TexImage->Width; trb->Base.Height = trb->TexImage->Height; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 1b45eae42c3..d15af22b7db 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -154,6 +154,10 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) src->Texture.Unit[i].CurrentCubeMap); copy_texture_binding(src, &dst->Texture.Unit[i].CurrentRect, src->Texture.Unit[i].CurrentRect); + copy_texture_binding(src, &dst->Texture.Unit[i].Current1DArray, + src->Texture.Unit[i].Current1DArray); + copy_texture_binding(src, &dst->Texture.Unit[i].Current2DArray, + src->Texture.Unit[i].Current2DArray); _mesa_unlock_context_textures(dst); } @@ -1221,6 +1225,20 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) } 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; @@ -1574,6 +1592,12 @@ tex_image_dimensions(GLcontext *ctx, GLenum target) case GL_TEXTURE_RECTANGLE_NV: case GL_PROXY_TEXTURE_RECTANGLE_NV: return ctx->Extensions.NV_texture_rectangle ? 2 : 0; + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array ? 2 : 0; + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array ? 3 : 0; default: _mesa_problem(ctx, "bad target in _mesa_tex_target_dimensions()"); return 0; @@ -2864,6 +2888,10 @@ update_texture_state( GLcontext *ctx ) * complete. That's the one we'll use for texturing. If we're using * a fragment program we're guaranteed that bitcount(enabledBits) <= 1. */ + texture_override(ctx, texUnit, enableBits, + texUnit->Current2DArray, TEXTURE_2D_ARRAY_BIT); + texture_override(ctx, texUnit, enableBits, + texUnit->Current1DArray, TEXTURE_1D_ARRAY_BIT); texture_override(ctx, texUnit, enableBits, texUnit->CurrentCubeMap, TEXTURE_CUBE_BIT); texture_override(ctx, texUnit, enableBits, @@ -3032,6 +3060,14 @@ alloc_proxy_textures( GLcontext *ctx ) if (!ctx->Texture.ProxyRect) goto cleanup; + ctx->Texture.Proxy1DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D_ARRAY_EXT); + if (!ctx->Texture.Proxy1DArray) + goto cleanup; + + ctx->Texture.Proxy2DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_2D_ARRAY_EXT); + if (!ctx->Texture.Proxy2DArray) + goto cleanup; + return GL_TRUE; cleanup: @@ -3045,6 +3081,10 @@ alloc_proxy_textures( GLcontext *ctx ) (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.ProxyCubeMap); if (ctx->Texture.ProxyRect) (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.ProxyRect); + if (ctx->Texture.Proxy1DArray) + (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy1DArray); + if (ctx->Texture.Proxy2DArray) + (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy2DArray); return GL_FALSE; } @@ -3092,6 +3132,8 @@ init_texture_unit( GLcontext *ctx, GLuint unit ) texUnit->Current3D = ctx->Shared->Default3D; texUnit->CurrentCubeMap = ctx->Shared->DefaultCubeMap; texUnit->CurrentRect = ctx->Shared->DefaultRect; + texUnit->Current1DArray = ctx->Shared->Default1DArray; + texUnit->Current2DArray = ctx->Shared->Default2DArray; } @@ -3112,6 +3154,8 @@ _mesa_init_texture(GLcontext *ctx) ctx->Shared->Default3D->RefCount += MAX_TEXTURE_UNITS; ctx->Shared->DefaultCubeMap->RefCount += MAX_TEXTURE_UNITS; ctx->Shared->DefaultRect->RefCount += MAX_TEXTURE_UNITS; + ctx->Shared->Default1DArray->RefCount += MAX_TEXTURE_UNITS; + ctx->Shared->Default2DArray->RefCount += MAX_TEXTURE_UNITS; /* Texture group */ ctx->Texture.CurrentUnit = 0; /* multitexture */ @@ -3145,6 +3189,8 @@ _mesa_free_texture_data(GLcontext *ctx) (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy3D ); (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.ProxyCubeMap ); (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.ProxyRect ); + (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy1DArray ); + (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy2DArray ); for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable ); diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 5027264f031..7da3c19a89a 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -181,7 +181,7 @@ LONGSTRING static char arb_grammar_text[] = - changed and merged V_* and F_* opcode values to OP_*. - added GL_ARB_fragment_program_shadow specific tokens (michal) */ -#define REVISION 0x09 +#define REVISION 0x0a /* program type */ #define FRAGMENT_PROGRAM 0x01 @@ -209,6 +209,9 @@ LONGSTRING static char arb_grammar_text[] = /* GL_ARB_draw_buffers option */ #define ARB_DRAW_BUFFERS 0x07 +/* GL_MESA_texture_array option */ +#define MESA_TEXTURE_ARRAY 0x08 + /* GL_ARB_fragment_program instruction class */ #define OP_ALU_INST 0x00 #define OP_TEX_INST 0x01 @@ -368,6 +371,9 @@ LONGSTRING static char arb_grammar_text[] = #define TEXTARGET_SHADOW1D 0x06 #define TEXTARGET_SHADOW2D 0x07 #define TEXTARGET_SHADOWRECT 0x08 +/* GL_MESA_texture_array */ +#define TEXTARGET_1D_ARRAY 0x09 +#define TEXTARGET_2D_ARRAY 0x0a /* face type */ #define FACE_FRONT 0x00 @@ -2990,6 +2996,12 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, case TEXTARGET_SHADOWRECT: /* TODO ARB_fragment_program_shadow code */ break; + case TEXTARGET_1D_ARRAY: + fp->TexSrcTarget = TEXTURE_1D_ARRAY_INDEX; + break; + case TEXTARGET_2D_ARRAY: + fp->TexSrcTarget = TEXTURE_2D_ARRAY_INDEX; + break; } Program->TexturesUsed[texcoord] |= (1 << fp->TexSrcTarget); /* Check that both "2D" and "CUBE" (for example) aren't both used */ @@ -3464,6 +3476,10 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst, /* do nothing for now */ } break; + + case MESA_TEXTURE_ARRAY: + /* do nothing for now */ + break; } break; @@ -3603,7 +3619,9 @@ enable_parser_extensions(GLcontext *ctx, grammar id) if (ctx->Extensions.ARB_draw_buffers && !enable_ext(ctx, id, "draw_buffers")) return GL_FALSE; - + if (ctx->Extensions.MESA_texture_array + && !enable_ext(ctx, id, "texture_array")) + return GL_FALSE; #if 1 /* hack for Warcraft (see bug 8060) */ enable_ext(ctx, id, "vertex_blend"); diff --git a/src/mesa/shader/arbprogram.syn b/src/mesa/shader/arbprogram.syn index 6ab0f269380..4f82717873e 100644 --- a/src/mesa/shader/arbprogram.syn +++ b/src/mesa/shader/arbprogram.syn @@ -36,7 +36,7 @@ compares the value with its REVISION value. If they do not match, the loader is not up to date. */ -.emtcode REVISION 0x09 +.emtcode REVISION 0x0a /* program type */ .emtcode FRAGMENT_PROGRAM 0x01 @@ -64,6 +64,9 @@ /* GL_ARB_draw_buffers option */ .emtcode ARB_DRAW_BUFFERS 0x07 +/* GL_MESA_texture_array option */ +.emtcode MESA_TEXTURE_ARRAY 0x08 + /* GL_ARB_fragment_program instruction class */ .emtcode OP_ALU_INST 0x00 .emtcode OP_TEX_INST 0x01 @@ -223,6 +226,8 @@ .emtcode TEXTARGET_SHADOW1D 0x06 .emtcode TEXTARGET_SHADOW2D 0x07 .emtcode TEXTARGET_SHADOWRECT 0x08 +.emtcode TEXTARGET_1D_ARRAY 0x09 +.emtcode TEXTARGET_2D_ARRAY 0x0a /* face type */ .emtcode FACE_FRONT 0x00 @@ -436,6 +441,9 @@ /* GL_ARB_draw_buffers */ .regbyte draw_buffers 0x00 +/* GL_MESA_texture_array */ +.regbyte texture_array 0x00 + /* option presence condition registers */ /* they are all initially set to zero - when a particular OPTION is encountered, the appropriate */ /* register is set to 1 to indicate that the OPTION was specified. */ @@ -456,6 +464,9 @@ /* GL_ARB_draw_buffers */ .regbyte ARB_draw_buffers 0x00 +/* GL_MESA_texture_array */ +.regbyte MESA_texture_array 0x00 + /* program target condition register */ /* this syntax script deals with two program targets - VERTEX_PROGRAM and FRAGMENT_PROGRAM. */ /* to distinguish between them we need a register that will store for us the current target. */ @@ -523,7 +534,9 @@ fp_optionString .if (fragment_program_shadow != 0x00) "ARB_fragment_program_shadow" .emit ARB_FRAGMENT_PROGRAM_SHADOW .load ARB_fragment_program_shadow 0x01 .or .if (draw_buffers != 0x00) "ARB_draw_buffers" .emit ARB_DRAW_BUFFERS - .load ARB_draw_buffers 0x01; + .load ARB_draw_buffers 0x01 .or + .if (texture_array != 0x00) "MESA_texture_array" .emit MESA_TEXTURE_ARRAY + .load MESA_texture_array 0x01; vp_optionString "ARB_position_invariant" .emit ARB_POSITION_INVARIANT .load ARB_position_invariant 0x01; fp_ARB_fog_exp @@ -906,7 +919,9 @@ texTarget "3D" .emit TEXTARGET_3D .or .if (texture_rectangle != 0x00) "RECT" .emit TEXTARGET_RECT .or "CUBE" .emit TEXTARGET_CUBE .or - .if (ARB_fragment_program_shadow != 0x00) shadowTarget; + .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or + .if (MESA_texture_array != 0x00) "ARRAY1D" .emit TEXTARGET_1D_ARRAY .or + .if (MESA_texture_array != 0x00) "ARRAY2D" .emit TEXTARGET_2D_ARRAY; /* GL_ARB_fragment_program_shadow diff --git a/src/mesa/shader/arbprogram_syn.h b/src/mesa/shader/arbprogram_syn.h index c67afc67db9..30dc9f4594e 100644 --- a/src/mesa/shader/arbprogram_syn.h +++ b/src/mesa/shader/arbprogram_syn.h @@ -1,5 +1,5 @@ ".syntax program;\n" -".emtcode REVISION 0x09\n" +".emtcode REVISION 0x0a\n" ".emtcode FRAGMENT_PROGRAM 0x01\n" ".emtcode VERTEX_PROGRAM 0x02\n" ".emtcode OPTION 0x01\n" @@ -14,6 +14,7 @@ ".emtcode ARB_POSITION_INVARIANT 0x05\n" ".emtcode ARB_FRAGMENT_PROGRAM_SHADOW 0x06\n" ".emtcode ARB_DRAW_BUFFERS 0x07\n" +".emtcode MESA_TEXTURE_ARRAY 0x08\n" ".emtcode OP_ALU_INST 0x00\n" ".emtcode OP_TEX_INST 0x01\n" ".emtcode OP_ALU_VECTOR 0x00\n" @@ -120,6 +121,8 @@ ".emtcode TEXTARGET_SHADOW1D 0x06\n" ".emtcode TEXTARGET_SHADOW2D 0x07\n" ".emtcode TEXTARGET_SHADOWRECT 0x08\n" +".emtcode TEXTARGET_1D_ARRAY 0x09\n" +".emtcode TEXTARGET_2D_ARRAY 0x0A\n" ".emtcode FACE_FRONT 0x00\n" ".emtcode FACE_BACK 0x01\n" ".emtcode COLOR_PRIMARY 0x00\n" @@ -264,6 +267,7 @@ ".regbyte texture_rectangle 0x00\n" ".regbyte fragment_program_shadow 0x00\n" ".regbyte draw_buffers 0x00\n" +".regbyte texture_array 0x00\n" ".regbyte ARB_precision_hint_fastest 0x00\n" ".regbyte ARB_precision_hint_nicest 0x00\n" ".regbyte ARB_fog_exp 0x00\n" @@ -272,6 +276,7 @@ ".regbyte ARB_position_invariant 0x00\n" ".regbyte ARB_fragment_program_shadow 0x00\n" ".regbyte ARB_draw_buffers 0x00\n" +".regbyte MESA_texture_array 0x00\n" ".regbyte program_target 0x00\n" "program\n" " programs .error UNKNOWN_PROGRAM_SIGNATURE .emit REVISION;\n" @@ -309,7 +314,9 @@ " .if (fragment_program_shadow != 0x00) \"ARB_fragment_program_shadow\"\n" " .emit ARB_FRAGMENT_PROGRAM_SHADOW .load ARB_fragment_program_shadow 0x01 .or\n" " .if (draw_buffers != 0x00) \"ARB_draw_buffers\" .emit ARB_DRAW_BUFFERS\n" -" .load ARB_draw_buffers 0x01;\n" +" .load ARB_draw_buffers 0x01 .or\n" +" .if (texture_array != 0x00) \"MESA_texture_array\" .emit MESA_TEXTURE_ARRAY\n" +" .load MESA_texture_array 0x01;\n" "vp_optionString\n" " \"ARB_position_invariant\" .emit ARB_POSITION_INVARIANT .load ARB_position_invariant 0x01;\n" "fp_ARB_fog_exp\n" @@ -471,7 +478,9 @@ " \"3D\" .emit TEXTARGET_3D .or\n" " .if (texture_rectangle != 0x00) \"RECT\" .emit TEXTARGET_RECT .or\n" " \"CUBE\" .emit TEXTARGET_CUBE .or\n" -" .if (ARB_fragment_program_shadow != 0x00) shadowTarget;\n" +" .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or\n" +" .if (MESA_texture_array != 0x00) \"ARRAY1D\" .emit TEXTARGET_1D_ARRAY .or\n" +" .if (MESA_texture_array != 0x00) \"ARRAY2D\" .emit TEXTARGET_2D_ARRAY;\n" "shadowTarget\n" " \"SHADOW1D\" .emit TEXTARGET_SHADOW1D .or\n" " \"SHADOW2D\" .emit TEXTARGET_SHADOW2D .or\n" diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 86c9f30e143..d4ea12870fe 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -833,10 +833,11 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function .globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function .globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function - .globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function + .globl glFramebufferTextureLayerEXT ; .type glFramebufferTextureLayerEXT,#function .globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function .globl gl_dispatch_stub_770 ; .type gl_dispatch_stub_770,#function .globl gl_dispatch_stub_771 ; .type gl_dispatch_stub_771,#function + .globl gl_dispatch_stub_772 ; .type gl_dispatch_stub_772,#function .globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function _mesa_sparc_glapi_begin: @@ -1608,10 +1609,11 @@ _mesa_sparc_glapi_begin: GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT) GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT) GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767) - GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768) + GL_STUB(glFramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT) GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769) GL_STUB(gl_dispatch_stub_770, _gloffset__dispatch_stub_770) GL_STUB(gl_dispatch_stub_771, _gloffset__dispatch_stub_771) + GL_STUB(gl_dispatch_stub_772, _gloffset__dispatch_stub_772) .globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function _mesa_sparc_glapi_end: diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 5413fc04101..2c8e443daf9 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -2267,6 +2267,597 @@ sample_lambda_rect( GLcontext *ctx, +/**********************************************************************/ +/* 2D Texture Array Sampling Functions */ +/**********************************************************************/ + +/* + * Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter. + */ +static void +sample_2d_array_nearest(GLcontext *ctx, + const struct gl_texture_object *tObj, + const struct gl_texture_image *img, + const GLfloat texcoord[4], + GLchan rgba[4]) +{ + const GLint width = img->Width2; /* without border, power of two */ + const GLint height = img->Height2; /* without border, power of two */ + const GLint depth = img->Depth; + GLint i, j; + GLint array; + (void) ctx; + + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoord[1], height, j); + array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); + + if (i < 0 || i >= (GLint) img->Width || + j < 0 || j >= (GLint) img->Height || + array < 0 || array >= (GLint) img->Depth) { + /* Need this test for GL_CLAMP_TO_BORDER mode */ + COPY_CHAN4(rgba, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i, j, array, rgba); + } +} + + + +/* + * Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter. + */ +static void +sample_2d_array_linear(GLcontext *ctx, + const struct gl_texture_object *tObj, + const struct gl_texture_image *img, + const GLfloat texcoord[4], + GLchan rgba[4]) +{ + const GLint width = img->Width2; + const GLint height = img->Height2; + const GLint depth = img->Depth; + GLint i0, j0, i1, j1; + GLint array; + GLbitfield useBorderColor = 0x0; + GLfloat u, v; + GLfloat a, b; + GLchan t00[4], t01[4], t10[4], t11[4]; + + COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); + COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoord[1], v, height, j0, j1); + array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); + + if (array < 0 || array >= depth) { + COPY_CHAN4(rgba, tObj->_BorderChan); + } + else { + if (img->Border) { + i0 += img->Border; + i1 += img->Border; + j0 += img->Border; + j1 += img->Border; + } + else { + /* check if sampling texture border color */ + if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; + if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; + if (j0 < 0 || j0 >= height) useBorderColor |= J0BIT; + if (j1 < 0 || j1 >= height) useBorderColor |= J1BIT; + } + + /* Fetch texels */ + if (useBorderColor & (I0BIT | J0BIT)) { + COPY_CHAN4(t00, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i0, j0, array, t00); + } + if (useBorderColor & (I1BIT | J0BIT)) { + COPY_CHAN4(t10, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i1, j0, array, t10); + } + if (useBorderColor & (I0BIT | J1BIT)) { + COPY_CHAN4(t01, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i0, j1, array, t01); + } + if (useBorderColor & (I1BIT | J1BIT)) { + COPY_CHAN4(t11, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i1, j1, array, t11); + } + + /* trilinear interpolation of samples */ + a = FRAC(u); + b = FRAC(v); + lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11); + } +} + + + +static void +sample_2d_array_nearest_mipmap_nearest(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4] ) +{ + GLuint i; + for (i = 0; i < n; i++) { + GLint level = nearest_mipmap_level(tObj, lambda[i]); + sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], + rgba[i]); + } +} + + +static void +sample_2d_array_linear_mipmap_nearest(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4]) +{ + GLuint i; + ASSERT(lambda != NULL); + for (i = 0; i < n; i++) { + GLint level = nearest_mipmap_level(tObj, lambda[i]); + sample_2d_array_linear(ctx, tObj, tObj->Image[0][level], + texcoord[i], rgba[i]); + } +} + + +static void +sample_2d_array_nearest_mipmap_linear(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4]) +{ + GLuint i; + ASSERT(lambda != NULL); + for (i = 0; i < n; i++) { + GLint level = linear_mipmap_level(tObj, lambda[i]); + if (level >= tObj->_MaxLevel) { + sample_2d_array_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], + texcoord[i], rgba[i]); + } + else { + GLchan t0[4], t1[4]; /* texels */ + const GLfloat f = FRAC(lambda[i]); + sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); + sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); + lerp_rgba(rgba[i], f, t0, t1); + } + } +} + + +static void +sample_2d_array_linear_mipmap_linear(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4]) +{ + GLuint i; + ASSERT(lambda != NULL); + for (i = 0; i < n; i++) { + GLint level = linear_mipmap_level(tObj, lambda[i]); + if (level >= tObj->_MaxLevel) { + sample_2d_array_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], + texcoord[i], rgba[i]); + } + else { + GLchan t0[4], t1[4]; /* texels */ + const GLfloat f = FRAC(lambda[i]); + sample_2d_array_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); + sample_2d_array_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); + lerp_rgba(rgba[i], f, t0, t1); + } + } +} + + +static void +sample_nearest_2d_array(GLcontext *ctx, + const struct gl_texture_object *tObj, GLuint n, + const GLfloat texcoords[][4], const GLfloat lambda[], + GLchan rgba[][4]) +{ + GLuint i; + struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) lambda; + for (i=0;iImage[0][tObj->BaseLevel]; + (void) lambda; + for (i=0;iMinFilter) { + case GL_NEAREST: + for (i = minStart; i < minEnd; i++) + sample_2d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + case GL_LINEAR: + for (i = minStart; i < minEnd; i++) + sample_2d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + case GL_NEAREST_MIPMAP_NEAREST: + sample_2d_array_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart, + lambda + minStart, rgba + minStart); + break; + case GL_LINEAR_MIPMAP_NEAREST: + sample_2d_array_linear_mipmap_nearest(ctx, tObj, m, + texcoords + minStart, + lambda + minStart, + rgba + minStart); + break; + case GL_NEAREST_MIPMAP_LINEAR: + sample_2d_array_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart, + lambda + minStart, rgba + minStart); + break; + case GL_LINEAR_MIPMAP_LINEAR: + sample_2d_array_linear_mipmap_linear(ctx, tObj, m, + texcoords + minStart, + lambda + minStart, + rgba + minStart); + break; + default: + _mesa_problem(ctx, "Bad min filter in sample_2d_array_texture"); + return; + } + } + + if (magStart < magEnd) { + /* do the magnified texels */ + switch (tObj->MagFilter) { + case GL_NEAREST: + for (i = magStart; i < magEnd; i++) + sample_2d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + case GL_LINEAR: + for (i = magStart; i < magEnd; i++) + sample_2d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + default: + _mesa_problem(ctx, "Bad mag filter in sample_2d_array_texture"); + return; + } + } +} + + + + +/**********************************************************************/ +/* 1D Texture Array Sampling Functions */ +/**********************************************************************/ + +/* + * Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter. + */ +static void +sample_1d_array_nearest(GLcontext *ctx, + const struct gl_texture_object *tObj, + const struct gl_texture_image *img, + const GLfloat texcoord[4], + GLchan rgba[4]) +{ + const GLint width = img->Width2; /* without border, power of two */ + const GLint height = img->Height; + GLint i; + GLint array; + (void) ctx; + + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); + array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); + + if (i < 0 || i >= (GLint) img->Width || + array < 0 || array >= (GLint) img->Height) { + /* Need this test for GL_CLAMP_TO_BORDER mode */ + COPY_CHAN4(rgba, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i, array, 0, rgba); + } +} + + + +/* + * Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter. + */ +static void +sample_1d_array_linear(GLcontext *ctx, + const struct gl_texture_object *tObj, + const struct gl_texture_image *img, + const GLfloat texcoord[4], + GLchan rgba[4]) +{ + const GLint width = img->Width2; + const GLint height = img->Height; + GLint i0, i1; + GLint array; + GLbitfield useBorderColor = 0x0; + GLfloat u; + GLfloat a; + GLchan t0[4], t1[4]; + + COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); + array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); + + if (img->Border) { + i0 += img->Border; + i1 += img->Border; + } + else { + /* check if sampling texture border color */ + if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; + if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; + } + + if (array < 0 || array >= height) useBorderColor |= K0BIT; + + /* Fetch texels */ + if (useBorderColor & (I0BIT | K0BIT)) { + COPY_CHAN4(t0, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i0, array, 0, t0); + } + if (useBorderColor & (I1BIT | K0BIT)) { + COPY_CHAN4(t1, tObj->_BorderChan); + } + else { + img->FetchTexelc(img, i1, array, 0, t1); + } + + /* bilinear interpolation of samples */ + a = FRAC(u); + lerp_rgba(rgba, a, t0, t1); +} + + + +static void +sample_1d_array_nearest_mipmap_nearest(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4] ) +{ + GLuint i; + for (i = 0; i < n; i++) { + GLint level = nearest_mipmap_level(tObj, lambda[i]); + sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], + rgba[i]); + } +} + + +static void +sample_1d_array_linear_mipmap_nearest(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4]) +{ + GLuint i; + ASSERT(lambda != NULL); + for (i = 0; i < n; i++) { + GLint level = nearest_mipmap_level(tObj, lambda[i]); + sample_1d_array_linear(ctx, tObj, tObj->Image[0][level], + texcoord[i], rgba[i]); + } +} + + +static void +sample_1d_array_nearest_mipmap_linear(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4]) +{ + GLuint i; + ASSERT(lambda != NULL); + for (i = 0; i < n; i++) { + GLint level = linear_mipmap_level(tObj, lambda[i]); + if (level >= tObj->_MaxLevel) { + sample_1d_array_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], + texcoord[i], rgba[i]); + } + else { + GLchan t0[4], t1[4]; /* texels */ + const GLfloat f = FRAC(lambda[i]); + sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); + sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); + lerp_rgba(rgba[i], f, t0, t1); + } + } +} + + +static void +sample_1d_array_linear_mipmap_linear(GLcontext *ctx, + const struct gl_texture_object *tObj, + GLuint n, const GLfloat texcoord[][4], + const GLfloat lambda[], GLchan rgba[][4]) +{ + GLuint i; + ASSERT(lambda != NULL); + for (i = 0; i < n; i++) { + GLint level = linear_mipmap_level(tObj, lambda[i]); + if (level >= tObj->_MaxLevel) { + sample_1d_array_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], + texcoord[i], rgba[i]); + } + else { + GLchan t0[4], t1[4]; /* texels */ + const GLfloat f = FRAC(lambda[i]); + sample_1d_array_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); + sample_1d_array_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); + lerp_rgba(rgba[i], f, t0, t1); + } + } +} + + +static void +sample_nearest_1d_array(GLcontext *ctx, + const struct gl_texture_object *tObj, GLuint n, + const GLfloat texcoords[][4], const GLfloat lambda[], + GLchan rgba[][4]) +{ + GLuint i; + struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) lambda; + for (i=0;iImage[0][tObj->BaseLevel]; + (void) lambda; + for (i=0;iMinFilter) { + case GL_NEAREST: + for (i = minStart; i < minEnd; i++) + sample_1d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + case GL_LINEAR: + for (i = minStart; i < minEnd; i++) + sample_1d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + case GL_NEAREST_MIPMAP_NEAREST: + sample_1d_array_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart, + lambda + minStart, rgba + minStart); + break; + case GL_LINEAR_MIPMAP_NEAREST: + sample_1d_array_linear_mipmap_nearest(ctx, tObj, m, + texcoords + minStart, + lambda + minStart, + rgba + minStart); + break; + case GL_NEAREST_MIPMAP_LINEAR: + sample_1d_array_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart, + lambda + minStart, rgba + minStart); + break; + case GL_LINEAR_MIPMAP_LINEAR: + sample_1d_array_linear_mipmap_linear(ctx, tObj, m, + texcoords + minStart, + lambda + minStart, + rgba + minStart); + break; + default: + _mesa_problem(ctx, "Bad min filter in sample_1d_array_texture"); + return; + } + } + + if (magStart < magEnd) { + /* do the magnified texels */ + switch (tObj->MagFilter) { + case GL_NEAREST: + for (i = magStart; i < magEnd; i++) + sample_1d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + case GL_LINEAR: + for (i = magStart; i < magEnd; i++) + sample_1d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], + texcoords[i], rgba[i]); + break; + default: + _mesa_problem(ctx, "Bad mag filter in sample_1d_array_texture"); + return; + } + } +} + + + + /* * Sample a shadow/depth texture. */ @@ -2280,6 +2871,9 @@ sample_depth_texture( GLcontext *ctx, const struct gl_texture_image *img = tObj->Image[0][baseLevel]; const GLint width = img->Width; const GLint height = img->Height; + const GLint depth = img->Depth; + const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT) + ? 3 : 2; GLchan ambient; GLenum function; GLchan result; @@ -2291,7 +2885,9 @@ sample_depth_texture( GLcontext *ctx, ASSERT(tObj->Target == GL_TEXTURE_1D || tObj->Target == GL_TEXTURE_2D || - tObj->Target == GL_TEXTURE_RECTANGLE_NV); + tObj->Target == GL_TEXTURE_RECTANGLE_NV || + tObj->Target == GL_TEXTURE_1D_ARRAY_EXT || + tObj->Target == GL_TEXTURE_2D_ARRAY_EXT); UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient); @@ -2320,20 +2916,48 @@ sample_depth_texture( GLcontext *ctx, GLuint i; for (i = 0; i < n; i++) { GLfloat depthSample; - GLint col, row; + GLint col, row, slice; - if (tObj->Target == GL_TEXTURE_RECTANGLE_ARB) { + switch (tObj->Target) { + case GL_TEXTURE_RECTANGLE_ARB: col = clamp_rect_coord_nearest(tObj->WrapS, texcoords[i][0], width); row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - } - else { + slice = 0; + break; + + case GL_TEXTURE_1D: + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoords[i][0], + width, col); + row = 0; + slice = 0; + break; + + case GL_TEXTURE_2D: COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoords[i][0], width, col); COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoords[i][1], height, row); + slice = 0; + break; + + case GL_TEXTURE_1D_ARRAY_EXT: + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoords[i][0], + width, col); + row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); + slice = 0; + + case GL_TEXTURE_2D_ARRAY_EXT: + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoords[i][0], + width, col); + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoords[i][1], + height, row); + slice = clamp_rect_coord_nearest(tObj->WrapR, texcoords[i][2], depth); + break; } - if (col >= 0 && row >= 0 && col < width && row < height) { - img->FetchTexelf(img, col, row, 0, &depthSample); + + if (col >= 0 && row >= 0 && col < width && row < height && + slice >= 0 && slice < depth) { + img->FetchTexelf(img, col, row, slice, &depthSample); } else { depthSample = tObj->BorderColor[0]; @@ -2341,22 +2965,22 @@ sample_depth_texture( GLcontext *ctx, switch (function) { case GL_LEQUAL: - result = (texcoords[i][2] <= depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] <= depthSample) ? CHAN_MAX : ambient; break; case GL_GEQUAL: - result = (texcoords[i][2] >= depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] >= depthSample) ? CHAN_MAX : ambient; break; case GL_LESS: - result = (texcoords[i][2] < depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] < depthSample) ? CHAN_MAX : ambient; break; case GL_GREATER: - result = (texcoords[i][2] > depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] > depthSample) ? CHAN_MAX : ambient; break; case GL_EQUAL: - result = (texcoords[i][2] == depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] == depthSample) ? CHAN_MAX : ambient; break; case GL_NOTEQUAL: - result = (texcoords[i][2] != depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] != depthSample) ? CHAN_MAX : ambient; break; case GL_ALWAYS: result = CHAN_MAX; @@ -2402,28 +3026,52 @@ sample_depth_texture( GLcontext *ctx, for (i = 0; i < n; i++) { GLfloat depth00, depth01, depth10, depth11; GLint i0, i1, j0, j1; + GLint slice; GLfloat u, v; GLuint useBorderTexel; - if (tObj->Target == GL_TEXTURE_RECTANGLE_ARB) { + switch (tObj->Target) { + case GL_TEXTURE_RECTANGLE_ARB: clamp_rect_coord_linear(tObj->WrapS, texcoords[i][0], width, &i0, &i1); clamp_rect_coord_linear(tObj->WrapT, texcoords[i][1], height, &j0, &j1); - } - else { + slice = 0; + break; + + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoords[i][0], u, width, i0, i1); COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoords[i][1], v, height,j0, j1); + slice = 0; + break; + + case GL_TEXTURE_1D_ARRAY_EXT: + COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoords[i][0], + u, width, i0, i1); + j0 = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); + j1 = j0; + slice = 0; + + case GL_TEXTURE_2D_ARRAY_EXT: + COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoords[i][0], + u, width, i0, i1); + COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoords[i][1], + v, height,j0, j1); + slice = clamp_rect_coord_nearest(tObj->WrapR, texcoords[i][2], depth); + break; } useBorderTexel = 0; if (img->Border) { i0 += img->Border; i1 += img->Border; - j0 += img->Border; - j1 += img->Border; + if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) { + j0 += img->Border; + j1 += img->Border; + } } else { if (i0 < 0 || i0 >= (GLint) width) useBorderTexel |= I0BIT; @@ -2432,30 +3080,45 @@ sample_depth_texture( GLcontext *ctx, if (j1 < 0 || j1 >= (GLint) height) useBorderTexel |= J1BIT; } - /* get four depth samples from the texture */ - if (useBorderTexel & (I0BIT | J0BIT)) { + if (slice < 0 || slice >= (GLint) depth) { depth00 = tObj->BorderColor[0]; - } - else { - img->FetchTexelf(img, i0, j0, 0, &depth00); - } - if (useBorderTexel & (I1BIT | J0BIT)) { - depth10 = tObj->BorderColor[0]; - } - else { - img->FetchTexelf(img, i1, j0, 0, &depth10); - } - if (useBorderTexel & (I0BIT | J1BIT)) { depth01 = tObj->BorderColor[0]; - } - else { - img->FetchTexelf(img, i0, j1, 0, &depth01); - } - if (useBorderTexel & (I1BIT | J1BIT)) { + depth10 = tObj->BorderColor[0]; depth11 = tObj->BorderColor[0]; } else { - img->FetchTexelf(img, i1, j1, 0, &depth11); + /* get four depth samples from the texture */ + if (useBorderTexel & (I0BIT | J0BIT)) { + depth00 = tObj->BorderColor[0]; + } + else { + img->FetchTexelf(img, i0, j0, slice, &depth00); + } + if (useBorderTexel & (I1BIT | J0BIT)) { + depth10 = tObj->BorderColor[0]; + } + else { + img->FetchTexelf(img, i1, j0, slice, &depth10); + } + + if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) { + if (useBorderTexel & (I0BIT | J1BIT)) { + depth01 = tObj->BorderColor[0]; + } + else { + img->FetchTexelf(img, i0, j1, slice, &depth01); + } + if (useBorderTexel & (I1BIT | J1BIT)) { + depth11 = tObj->BorderColor[0]; + } + else { + img->FetchTexelf(img, i1, j1, slice, &depth11); + } + } + else { + depth01 = depth00; + depth11 = depth10; + } } if (0) { @@ -2464,8 +3127,8 @@ sample_depth_texture( GLcontext *ctx, const GLfloat b = FRAC(v + 1.0F); const GLfloat depthSample = lerp_2d(a, b, depth00, depth10, depth01, depth11); - if ((depthSample <= texcoords[i][2] && function == GL_LEQUAL) || - (depthSample >= texcoords[i][2] && function == GL_GEQUAL)) { + if ((depthSample <= texcoords[i][compare_coord] && function == GL_LEQUAL) || + (depthSample >= texcoords[i][compare_coord] && function == GL_GEQUAL)) { result = ambient; } else { @@ -2482,45 +3145,45 @@ sample_depth_texture( GLcontext *ctx, switch (function) { case GL_LEQUAL: - if (depth00 <= texcoords[i][2]) luminance -= d; - if (depth01 <= texcoords[i][2]) luminance -= d; - if (depth10 <= texcoords[i][2]) luminance -= d; - if (depth11 <= texcoords[i][2]) luminance -= d; + if (depth00 <= texcoords[i][compare_coord]) luminance -= d; + if (depth01 <= texcoords[i][compare_coord]) luminance -= d; + if (depth10 <= texcoords[i][compare_coord]) luminance -= d; + if (depth11 <= texcoords[i][compare_coord]) luminance -= d; result = (GLchan) luminance; break; case GL_GEQUAL: - if (depth00 >= texcoords[i][2]) luminance -= d; - if (depth01 >= texcoords[i][2]) luminance -= d; - if (depth10 >= texcoords[i][2]) luminance -= d; - if (depth11 >= texcoords[i][2]) luminance -= d; + if (depth00 >= texcoords[i][compare_coord]) luminance -= d; + if (depth01 >= texcoords[i][compare_coord]) luminance -= d; + if (depth10 >= texcoords[i][compare_coord]) luminance -= d; + if (depth11 >= texcoords[i][compare_coord]) luminance -= d; result = (GLchan) luminance; break; case GL_LESS: - if (depth00 < texcoords[i][2]) luminance -= d; - if (depth01 < texcoords[i][2]) luminance -= d; - if (depth10 < texcoords[i][2]) luminance -= d; - if (depth11 < texcoords[i][2]) luminance -= d; + if (depth00 < texcoords[i][compare_coord]) luminance -= d; + if (depth01 < texcoords[i][compare_coord]) luminance -= d; + if (depth10 < texcoords[i][compare_coord]) luminance -= d; + if (depth11 < texcoords[i][compare_coord]) luminance -= d; result = (GLchan) luminance; break; case GL_GREATER: - if (depth00 > texcoords[i][2]) luminance -= d; - if (depth01 > texcoords[i][2]) luminance -= d; - if (depth10 > texcoords[i][2]) luminance -= d; - if (depth11 > texcoords[i][2]) luminance -= d; + if (depth00 > texcoords[i][compare_coord]) luminance -= d; + if (depth01 > texcoords[i][compare_coord]) luminance -= d; + if (depth10 > texcoords[i][compare_coord]) luminance -= d; + if (depth11 > texcoords[i][compare_coord]) luminance -= d; result = (GLchan) luminance; break; case GL_EQUAL: - if (depth00 == texcoords[i][2]) luminance -= d; - if (depth01 == texcoords[i][2]) luminance -= d; - if (depth10 == texcoords[i][2]) luminance -= d; - if (depth11 == texcoords[i][2]) luminance -= d; + if (depth00 == texcoords[i][compare_coord]) luminance -= d; + if (depth01 == texcoords[i][compare_coord]) luminance -= d; + if (depth10 == texcoords[i][compare_coord]) luminance -= d; + if (depth11 == texcoords[i][compare_coord]) luminance -= d; result = (GLchan) luminance; break; case GL_NOTEQUAL: - if (depth00 != texcoords[i][2]) luminance -= d; - if (depth01 != texcoords[i][2]) luminance -= d; - if (depth10 != texcoords[i][2]) luminance -= d; - if (depth11 != texcoords[i][2]) luminance -= d; + if (depth00 != texcoords[i][compare_coord]) luminance -= d; + if (depth01 != texcoords[i][compare_coord]) luminance -= d; + if (depth10 != texcoords[i][compare_coord]) luminance -= d; + if (depth11 != texcoords[i][compare_coord]) luminance -= d; result = (GLchan) luminance; break; case GL_ALWAYS: @@ -2792,6 +3455,28 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, ASSERT(t->MinFilter == GL_NEAREST); return &sample_nearest_rect; } + case GL_TEXTURE_1D_ARRAY_EXT: + if (needLambda) { + return &sample_lambda_1d_array; + } + else if (t->MinFilter == GL_LINEAR) { + return &sample_linear_1d_array; + } + else { + ASSERT(t->MinFilter == GL_NEAREST); + return &sample_nearest_1d_array; + } + case GL_TEXTURE_2D_ARRAY_EXT: + if (needLambda) { + return &sample_lambda_2d_array; + } + else if (t->MinFilter == GL_LINEAR) { + return &sample_linear_2d_array; + } + else { + ASSERT(t->MinFilter == GL_NEAREST); + return &sample_nearest_2d_array; + } default: _mesa_problem(ctx, "invalid target in _swrast_choose_texture_sample_func"); diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index eb54ba4848f..e62dde8a2f7 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -29071,10 +29071,9 @@ GL_PREFIX(_dispatch_stub_767): .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767) .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(FramebufferTextureLayerEXT) + .type GL_PREFIX(FramebufferTextureLayerEXT), @function +GL_PREFIX(FramebufferTextureLayerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 6144(%rax), %r11 @@ -29084,9 +29083,9 @@ GL_PREFIX(_dispatch_stub_768): pushq %rsi pushq %rdx pushq %rcx - pushq %rbp + pushq %r8 call _x86_64_get_dispatch@PLT - popq %rbp + popq %r8 popq %rcx popq %rdx popq %rsi @@ -29104,9 +29103,9 @@ GL_PREFIX(_dispatch_stub_768): pushq %rsi pushq %rdx pushq %rcx - pushq %rbp + pushq %r8 call _glapi_get_dispatch - popq %rbp + popq %r8 popq %rcx popq %rdx popq %rsi @@ -29114,7 +29113,7 @@ GL_PREFIX(_dispatch_stub_768): movq 6144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768) + .size GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT) .p2align 4,,15 .globl GL_PREFIX(_dispatch_stub_769) @@ -29175,7 +29174,11 @@ GL_PREFIX(_dispatch_stub_770): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -29191,7 +29194,11 @@ GL_PREFIX(_dispatch_stub_770): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -29238,6 +29245,44 @@ GL_PREFIX(_dispatch_stub_771): #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(_dispatch_stub_771), .-GL_PREFIX(_dispatch_stub_771) + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_772) + .type GL_PREFIX(_dispatch_stub_772), @function + HIDDEN(GL_PREFIX(_dispatch_stub_772)) +GL_PREFIX(_dispatch_stub_772): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 6176(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rdx + call _x86_64_get_dispatch@PLT + popq %rdx + popq %rsi + popq %rdi + movq 6176(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 6176(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rdx + call _glapi_get_dispatch + popq %rdx + popq %rsi + popq %rdi + movq 6176(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_772), .-GL_PREFIX(_dispatch_stub_772) + .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement) .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture) .globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays) diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 1106eeede87..bdf42ac0887 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -938,14 +938,15 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16) GL_STUB(_dispatch_stub_767, _gloffset_BlitFramebufferEXT, _dispatch_stub_767@40) HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@40)) - GL_STUB(_dispatch_stub_768, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_768@16) - HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16)) - GL_STUB(_dispatch_stub_769, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_769@16) + GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) + GL_STUB(_dispatch_stub_769, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_769@16) HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16)) - GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_770@12) - HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12)) - GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_771@12) + GL_STUB(_dispatch_stub_770, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_770@16) + HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@16)) + GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_771@12) HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@12)) + GL_STUB(_dispatch_stub_772, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_772@12) + HIDDEN(GL_PREFIX(_dispatch_stub_772, _dispatch_stub_772@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) -- cgit v1.2.3 From 67f82731fcb87f789135e07f691d41ebd12f0015 Mon Sep 17 00:00:00 2001 From: Tommy Schultz Lassen Date: Thu, 17 May 2007 14:11:23 +0000 Subject: r300: Removed the radeon_vertex_buffer structure. --- src/mesa/drivers/dri/r300/r300_context.h | 23 ----- src/mesa/drivers/dri/r300/r300_emit.c | 151 +++++++++---------------------- src/mesa/drivers/dri/r300/r300_render.c | 72 +++------------ 3 files changed, 56 insertions(+), 190 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 13b943f75fc..dbcd5d04d6d 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -790,28 +790,6 @@ struct r300_fragment_program { #define REG_COLOR0 1 #define REG_TEX0 2 -struct dt { - GLint size; - GLenum type; - GLsizei stride; - void *data; -}; - -struct radeon_vertex_buffer { - int Count; - void *Elts; - int elt_size; - int elt_min, elt_max; /* debug */ - - struct dt AttribPtr[VERT_ATTRIB_MAX]; - - const struct _mesa_prim *Primitive; - GLuint PrimitiveCount; - GLint LockFirst; - GLsizei LockCount; - int lock_uptodate; -}; - struct r300_state { struct r300_depthbuffer_state depth; struct r300_texture_state texture; @@ -820,7 +798,6 @@ struct r300_state { struct r300_pfs_compile_state pfs_compile; struct r300_dma_region aos[R300_MAX_AOS_ARRAYS]; int aos_count; - struct radeon_vertex_buffer VB; GLuint *Elts; struct r300_dma_region elt_dma; diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 2c26069f9b3..9fb712f7b8f 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -223,86 +223,48 @@ static void r300EmitVec(GLcontext * ctx, } -static GLuint t_type(struct dt *dt) +#define R300_VIR0_AOS_SIZE_SHIFT 0 +#define R300_VIR0_AOS_INPUT_SHIFT 8 +#define R300_VIR0_AOS_STOP_SHIFT 13 +#define R300_VIR0_AOS_TYPE_SHIFT 14 +#define R300_VIR0_HIGH_SHIFT 16 + +// Pack 4 elemets in a 16 bit (aos_size first 8, input next 5, 1 stop bit(Whild gues), aos_type last 2); +static inline GLuint t_vir_pack(GLvector4f ** dt, int *inputs, int i) { - switch (dt->type) { - case GL_UNSIGNED_BYTE: - return AOS_FORMAT_UBYTE; - case GL_SHORT: - return AOS_FORMAT_USHORT; - case GL_FLOAT: - return AOS_FORMAT_FLOAT; - default: - assert(0); - break; - } - - return AOS_FORMAT_FLOAT; -} - -static GLuint t_vir0_size(struct dt *dt) -{ - switch (dt->type) { - case GL_UNSIGNED_BYTE: - return 4; - case GL_SHORT: - return 7; - case GL_FLOAT: - return dt->size - 1; - default: - assert(0); - break; - } - - return 0; + GLuint dw; + dw = (dt[i]->size - 1) << R300_VIR0_AOS_SIZE_SHIFT; + dw |= inputs[i] << R300_VIR0_AOS_INPUT_SHIFT; + //dw |= t_type(&dt[i]) << R300_VIR0_AOS_TYPE_SHIFT; + return dw; } -static GLuint t_aos_size(struct dt *dt) -{ - switch (dt->type) { - case GL_UNSIGNED_BYTE: - return 1; - case GL_SHORT: - return 2; - case GL_FLOAT: - return dt->size; - default: - assert(0); - break; - } - - return 0; -} - -static GLuint t_vir0(uint32_t * dst, struct dt *dt, int *inputs, +static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, GLint * tab, GLuint nr) { - GLuint i, dw; + GLuint i, dw, dwInternel; for (i = 0; i + 1 < nr; i += 2) { - dw = t_vir0_size(&dt[tab[i]]) | (inputs[tab[i]] << 8) | - (t_type(&dt[tab[i]]) << 14); - dw |= - (t_vir0_size(&dt[tab[i + 1]]) | - (inputs[tab[i + 1]] << 8) | (t_type(&dt[tab[i + 1]]) - << 14)) << 16; + dw = t_vir_pack(dt, inputs, tab[i]); + dwInternel = t_vir_pack(dt, inputs, tab[i + 1]); + dw |= dwInternel << R300_VIR0_HIGH_SHIFT; if (i + 2 == nr) { - dw |= (1 << (13 + 16)); + dw |= + (1 << + (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); } - dst[i >> 1] = dw; + dst[i >> 1] = dw; // Is the same as i/2 } if (nr & 1) { - dw = t_vir0_size(&dt[tab[nr - 1]]) | (inputs[tab[nr - 1]] - << 8) | - (t_type(&dt[tab[nr - 1]]) << 14); - dw |= 1 << 13; + dw = t_vir_pack(dt, inputs, tab[nr - 1]); + dw |= 1 << R300_VIR0_AOS_STOP_SHIFT; dst[nr >> 1] = dw; } - return (nr + 1) >> 1; + return (nr + 1) >> 1; // Is the same as (nr+1)/2 } static GLuint t_swizzle(int swizzle[4]) @@ -331,11 +293,6 @@ static GLuint t_vir1(uint32_t * dst, int swizzle[][4], GLuint nr) return (nr + 1) >> 1; } -static GLuint t_emit_size(struct dt *dt) -{ - return dt->size; -} - static GLuint t_vic(GLcontext * ctx, GLuint InputsRead) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -369,9 +326,10 @@ int r300EmitArrays(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); r300ContextPtr r300 = rmesa; - struct radeon_vertex_buffer *VB = &rmesa->state.VB; + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; GLuint nr; - GLuint count = VB->Count; + GLuint count = vb->Count; GLuint i; GLuint InputsRead = 0, OutputsWritten = 0; int *inputs = NULL; @@ -466,57 +424,38 @@ int r300EmitArrays(GLcontext * ctx) swizzle[i][2] = SWIZZLE_ZERO; swizzle[i][3] = SWIZZLE_ONE; - for (ci = 0; ci < VB->AttribPtr[tab[i]].size; ci++) + for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) swizzle[i][ci] = ci; -#if MESA_BIG_ENDIAN -#define SWAP_INT(a, b) do { \ - int __temp; \ - __temp = a;\ - a = b; \ - b = __temp; \ -} while (0) - - if (VB->AttribPtr[tab[i]].type == GL_UNSIGNED_BYTE) { - SWAP_INT(swizzle[i][0], swizzle[i][3]); - SWAP_INT(swizzle[i][1], swizzle[i][2]); - } -#endif /* MESA_BIG_ENDIAN */ - - if (r300IsGartMemory(rmesa, VB->AttribPtr[tab[i]].data, + if (r300IsGartMemory(rmesa, vb->AttribPtr[tab[i]]->data, /*(count-1)*stride */ 4)) { - if (VB->AttribPtr[tab[i]].stride % 4) + if (vb->AttribPtr[tab[i]]->stride % 4) return R300_FALLBACK_TCL; rmesa->state.aos[i].address = - VB->AttribPtr[tab[i]].data; + (void *)(vb->AttribPtr[tab[i]]->data); rmesa->state.aos[i].start = 0; rmesa->state.aos[i].aos_offset = r300GartOffsetFromVirtual(rmesa, - VB-> - AttribPtr[tab[i]].data); + vb-> + AttribPtr[tab[i]]->data); rmesa->state.aos[i].aos_stride = - VB->AttribPtr[tab[i]].stride / 4; + vb->AttribPtr[tab[i]]->stride / 4; rmesa->state.aos[i].aos_size = - t_emit_size(&VB->AttribPtr[tab[i]]); + vb->AttribPtr[tab[i]]->size; } else { - /* TODO: r300EmitVec can only handle 4 byte vectors */ - if (VB->AttribPtr[tab[i]].type != GL_FLOAT) - return R300_FALLBACK_TCL; - r300EmitVec(ctx, &rmesa->state.aos[i], - VB->AttribPtr[tab[i]].data, - t_emit_size(&VB->AttribPtr[tab[i]]), - VB->AttribPtr[tab[i]].stride, count); + vb->AttribPtr[tab[i]]->data, + vb->AttribPtr[tab[i]]->size, + vb->AttribPtr[tab[i]]->stride, count); } - rmesa->state.aos[i].aos_size = - t_aos_size(&VB->AttribPtr[tab[i]]); + rmesa->state.aos[i].aos_size = vb->AttribPtr[tab[i]]->size; - comp_size = _mesa_sizeof_type(VB->AttribPtr[tab[i]].type); + comp_size = _mesa_sizeof_type(GL_FLOAT); - for (fix = 0; fix <= 4 - VB->AttribPtr[tab[i]].size; fix++) { + for (fix = 0; fix <= 4 - vb->AttribPtr[tab[i]]->size; fix++) { if ((rmesa->state.aos[i].aos_offset - comp_size * fix) % 4) continue; @@ -532,14 +471,14 @@ int r300EmitArrays(GLcontext * ctx) rmesa->state.aos[i].aos_offset -= comp_size * fix; - for (ci = 0; ci < VB->AttribPtr[tab[i]].size; ci++) + for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) swizzle[i][ci] += fix; } else { WARN_ONCE ("Cannot handle offset %x with stride %d, comp %d\n", rmesa->state.aos[i].aos_offset, rmesa->state.aos[i].aos_stride, - VB->AttribPtr[tab[i]].size); + vb->AttribPtr[tab[i]]->size); return R300_FALLBACK_TCL; } } @@ -547,7 +486,7 @@ int r300EmitArrays(GLcontext * ctx) /* setup INPUT_ROUTE */ R300_STATECHANGE(r300, vir[0]); ((drm_r300_cmd_header_t *) r300->hw.vir[0].cmd)->packet0.count = - t_vir0(&r300->hw.vir[0].cmd[R300_VIR_CNTL_0], VB->AttribPtr, + t_vir0(&r300->hw.vir[0].cmd[R300_VIR_CNTL_0], vb->AttribPtr, inputs, tab, nr); R300_STATECHANGE(r300, vir[1]); diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index cc13e9a5304..6cec2bb1ea7 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -301,6 +301,8 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, int start, int end, int prim) { int type, num_verts; + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; type = r300PrimitiveType(rmesa, ctx, prim); num_verts = r300NumVerts(rmesa, end - start, prim); @@ -308,88 +310,36 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, if (type < 0 || num_verts <= 0) return; - if (rmesa->state.VB.Elts) { + if (vb->Elts) { r300EmitAOS(rmesa, rmesa->state.aos_count, start); if (num_verts > 65535) { /* not implemented yet */ WARN_ONCE("Too many elts\n"); return; } - r300EmitElts(ctx, rmesa->state.VB.Elts, num_verts, - rmesa->state.VB.elt_size); + r300EmitElts(ctx, vb->Elts, num_verts, 4); r300FireEB(rmesa, rmesa->state.elt_dma.aos_offset, - num_verts, type, rmesa->state.VB.elt_size); + num_verts, type, 4); } else { r300EmitAOS(rmesa, rmesa->state.aos_count, start); r300FireAOS(rmesa, num_verts, type); } } -#define CONV_VB(a, b) rvb->AttribPtr[(a)].size = vb->b->size, \ - rvb->AttribPtr[(a)].type = GL_FLOAT, \ - rvb->AttribPtr[(a)].stride = vb->b->stride, \ - rvb->AttribPtr[(a)].data = vb->b->data - -static void radeon_vb_to_rvb(r300ContextPtr rmesa, - struct radeon_vertex_buffer *rvb, - struct vertex_buffer *vb) -{ - int i; - GLcontext *ctx; - ctx = rmesa->radeon.glCtx; - - memset(rvb, 0, sizeof(*rvb)); - - rvb->Elts = vb->Elts; - rvb->elt_size = 4; - rvb->elt_min = 0; - rvb->elt_max = vb->Count; - - rvb->Count = vb->Count; - - if (hw_tcl_on) { - CONV_VB(VERT_ATTRIB_POS, ObjPtr); - } else { - assert(vb->ClipPtr); - CONV_VB(VERT_ATTRIB_POS, ClipPtr); - } - - CONV_VB(VERT_ATTRIB_NORMAL, NormalPtr); - CONV_VB(VERT_ATTRIB_COLOR0, ColorPtr[0]); - CONV_VB(VERT_ATTRIB_COLOR1, SecondaryColorPtr[0]); - CONV_VB(VERT_ATTRIB_FOG, FogCoordPtr); - - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) - CONV_VB(VERT_ATTRIB_TEX0 + i, TexCoordPtr[i]); - - for (i = 0; i < MAX_VERTEX_PROGRAM_ATTRIBS; i++) - CONV_VB(VERT_ATTRIB_GENERIC0 + i, - AttribPtr[VERT_ATTRIB_GENERIC0 + i]); - - rvb->Primitive = vb->Primitive; - rvb->PrimitiveCount = vb->PrimitiveCount; - rvb->LockFirst = rvb->LockCount = 0; - rvb->lock_uptodate = GL_FALSE; -} - static GLboolean r300RunRender(GLcontext * ctx, struct tnl_pipeline_stage *stage) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct radeon_vertex_buffer *VB = &rmesa->state.VB; int i; int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); - if (stage) { - TNLcontext *tnl = TNL_CONTEXT(ctx); - radeon_vb_to_rvb(rmesa, VB, &tnl->vb); - } - r300UpdateShaders(rmesa); if (r300EmitArrays(ctx)) return GL_TRUE; @@ -404,10 +354,10 @@ static GLboolean r300RunRender(GLcontext * ctx, r300EmitState(rmesa); - for (i = 0; i < VB->PrimitiveCount; i++) { - GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); - GLuint start = VB->Primitive[i].start; - GLuint end = VB->Primitive[i].start + VB->Primitive[i].count; + for (i = 0; i < vb->PrimitiveCount; i++) { + GLuint prim = _tnl_translate_prim(&vb->Primitive[i]); + GLuint start = vb->Primitive[i].start; + GLuint end = vb->Primitive[i].start + vb->Primitive[i].count; r300RunRenderPrimitive(rmesa, ctx, start, end, prim); } -- cgit v1.2.3 From b5bbe055e4eab8ba83ca3f1ce17aaee01a506c95 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 17 May 2007 08:56:46 -0600 Subject: make srcPtr param to make_1d_stack_mipmap() const --- src/mesa/main/mipmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 1dc51440c8e..9f3db22b75c 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -798,7 +798,7 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border, static void make_1d_stack_mipmap(const struct gl_texture_format *format, GLint border, - GLint srcWidth, GLubyte *srcPtr, + GLint srcWidth, const GLubyte *srcPtr, GLint dstWidth, GLint dstHeight, GLubyte *dstPtr) { const GLint bpt = format->TexelBytes; -- cgit v1.2.3 From 064cd7c78c3108012f5d15206c70470f7b500259 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 17 May 2007 11:13:41 -0700 Subject: Refactor determining whether a texture target can use compressed format --- src/mesa/main/teximage.c | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 8e528d9bbb8..1bcb9e851d4 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1386,6 +1386,20 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, } +/** + * Helper function to determine whether a target supports compressed textures + */ +static GLboolean +target_can_be_compressed(GLcontext *ctx, GLenum target) +{ + return (((target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D)) + || ((ctx->Extensions.ARB_texture_cube_map && + (target == GL_PROXY_TEXTURE_CUBE_MAP || + (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && + target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))))); +} + + /** * Test the glTexImage[123]D() parameters for errors. * @@ -1610,21 +1624,10 @@ texture_error_check( GLcontext *ctx, GLenum target, /* additional checks for compressed textures */ if (is_compressed_format(ctx, internalFormat)) { - if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) { - /* OK */ - } - else if (ctx->Extensions.ARB_texture_cube_map && - (target == GL_PROXY_TEXTURE_CUBE_MAP || - (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) { - /* OK */ - } - else { - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexImage%d(target)", dimensions); - return GL_TRUE; - } + if (!target_can_be_compressed(ctx, target) && !isProxy) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexImage%d(target)", dimensions); + return GL_TRUE; } if (border != 0) { if (!isProxy) { @@ -1811,16 +1814,7 @@ subtexture_error_check2( GLcontext *ctx, GLuint dimensions, #endif if (destTex->IsCompressed) { - if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) { - /* OK */ - } - else if (ctx->Extensions.ARB_texture_cube_map && - (target == GL_PROXY_TEXTURE_CUBE_MAP || - (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) { - /* OK */ - } - else { + if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%D(target)", dimensions); return GL_TRUE; -- cgit v1.2.3 From 817181ea5044b222f7612a425562bbc9313d5c75 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 17 May 2007 11:16:19 -0700 Subject: Add array texture targets to list that can use compressed formats. --- src/mesa/main/teximage.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 1bcb9e851d4..766dad4d5f7 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1396,7 +1396,10 @@ target_can_be_compressed(GLcontext *ctx, GLenum target) || ((ctx->Extensions.ARB_texture_cube_map && (target == GL_PROXY_TEXTURE_CUBE_MAP || (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))))); + target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)))) + || ((ctx->Extensions.MESA_texture_array && + ((target == GL_PROXY_TEXTURE_2D_ARRAY) || + (target == GL_TEXTURE_2D_ARRAY))))); } -- cgit v1.2.3 From d834a870e600684382b50d202a2bfc6d98cf6a0b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 17 May 2007 11:54:22 -0700 Subject: Add missing _EXT suffix to 2D_ARRAY target enums. --- src/mesa/main/teximage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 766dad4d5f7..1f4c9f4722c 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1398,8 +1398,8 @@ target_can_be_compressed(GLcontext *ctx, GLenum target) (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)))) || ((ctx->Extensions.MESA_texture_array && - ((target == GL_PROXY_TEXTURE_2D_ARRAY) || - (target == GL_TEXTURE_2D_ARRAY))))); + ((target == GL_PROXY_TEXTURE_2D_ARRAY_EXT) || + (target == GL_TEXTURE_2D_ARRAY_EXT))))); } -- cgit v1.2.3 From 0985e786cdd08bf900db889b69783be4bc467e5b Mon Sep 17 00:00:00 2001 From: Christoff Brill Date: Thu, 17 May 2007 17:16:37 -0600 Subject: remove CVS/XFree86 keywords --- src/mesa/drivers/dri/r200/r200_cmdbuf.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/r200/r200_context.h | 1 - src/mesa/drivers/dri/r200/r200_ioctl.c | 1 - src/mesa/drivers/dri/r200/r200_ioctl.h | 1 - src/mesa/drivers/dri/r200/r200_lock.c | 1 - src/mesa/drivers/dri/r200/r200_lock.h | 1 - src/mesa/drivers/dri/r200/r200_maos.h | 1 - src/mesa/drivers/dri/r200/r200_maos_arrays.c | 1 - src/mesa/drivers/dri/r200/r200_pixel.c | 1 - src/mesa/drivers/dri/r200/r200_pixel.h | 1 - src/mesa/drivers/dri/r200/r200_reg.h | 1 - src/mesa/drivers/dri/r200/r200_sanity.c | 1 - src/mesa/drivers/dri/r200/r200_span.c | 1 - src/mesa/drivers/dri/r200/r200_span.h | 1 - src/mesa/drivers/dri/r200/r200_state.c | 1 - src/mesa/drivers/dri/r200/r200_state.h | 1 - src/mesa/drivers/dri/r200/r200_state_init.c | 1 - src/mesa/drivers/dri/r200/r200_swtcl.c | 1 - src/mesa/drivers/dri/r200/r200_swtcl.h | 1 - src/mesa/drivers/dri/r200/r200_tcl.c | 1 - src/mesa/drivers/dri/r200/r200_tcl.h | 1 - src/mesa/drivers/dri/r200/r200_tex.c | 1 - src/mesa/drivers/dri/r200/r200_tex.h | 1 - src/mesa/drivers/dri/r200/r200_texmem.c | 1 - src/mesa/drivers/dri/r200/r200_texstate.c | 1 - 26 files changed, 26 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c index 2920ceafd30..c1d51e87001 100644 --- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c +++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c,v 1.1 2002/10/30 12:51:51 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 786a298cc3b..5a178442bdb 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.c,v 1.3 2003/05/06 23:52:08 daenzer Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index e840a502c0b..bec09e8ef6a 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index 463bd64415b..2366bde5250 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c,v 1.4 2002/12/17 00:32:56 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h index f53752739d2..5ed1555f6a3 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.h +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c index b050dd7802b..f89b526a312 100644 --- a/src/mesa/drivers/dri/r200/r200_lock.c +++ b/src/mesa/drivers/dri/r200/r200_lock.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_lock.h b/src/mesa/drivers/dri/r200/r200_lock.h index e4c3a7e9352..4ff98907fbf 100644 --- a/src/mesa/drivers/dri/r200/r200_lock.h +++ b/src/mesa/drivers/dri/r200/r200_lock.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_maos.h b/src/mesa/drivers/dri/r200/r200_maos.h index 4998f67445c..d3ed06d4021 100644 --- a/src/mesa/drivers/dri/r200/r200_maos.h +++ b/src/mesa/drivers/dri/r200/r200_maos.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index 3162b508c23..7bc05e2f0bd 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c,v 1.3 2003/02/23 23:59:01 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c index 7b060f9cf0d..2f5aab0744b 100644 --- a/src/mesa/drivers/dri/r200/r200_pixel.c +++ b/src/mesa/drivers/dri/r200/r200_pixel.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_pixel.c,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_pixel.h b/src/mesa/drivers/dri/r200/r200_pixel.h index 8f3923b6b16..e62aa05d749 100644 --- a/src/mesa/drivers/dri/r200/r200_pixel.h +++ b/src/mesa/drivers/dri/r200/r200_pixel.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_pixel.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_reg.h b/src/mesa/drivers/dri/r200/r200_reg.h index a88ea4cec26..5ce287f7a5f 100644 --- a/src/mesa/drivers/dri/r200/r200_reg.h +++ b/src/mesa/drivers/dri/r200/r200_reg.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_reg.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_sanity.c b/src/mesa/drivers/dri/r200/r200_sanity.c index 3f2a8665309..00d2f65c998 100644 --- a/src/mesa/drivers/dri/r200/r200_sanity.c +++ b/src/mesa/drivers/dri/r200/r200_sanity.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_sanity.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /************************************************************************** Copyright 2002 ATI Technologies Inc., Ontario, Canada, and diff --git a/src/mesa/drivers/dri/r200/r200_span.c b/src/mesa/drivers/dri/r200/r200_span.c index 6e99dfe159b..fe427bdcdec 100644 --- a/src/mesa/drivers/dri/r200/r200_span.c +++ b/src/mesa/drivers/dri/r200/r200_span.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_span.h b/src/mesa/drivers/dri/r200/r200_span.h index 5e7d3e4282c..bae56443092 100644 --- a/src/mesa/drivers/dri/r200/r200_span.h +++ b/src/mesa/drivers/dri/r200/r200_span.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index 16726d7d55a..2115799b9b6 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /************************************************************************** Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_state.h b/src/mesa/drivers/dri/r200/r200_state.h index f34090b619b..a917163a00a 100644 --- a/src/mesa/drivers/dri/r200/r200_state.h +++ b/src/mesa/drivers/dri/r200/r200_state.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state.h,v 1.2 2002/11/05 17:46:08 tsi Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index b40d0bdcb7c..0c36cefc161 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state_init.c,v 1.4 2003/02/22 06:21:11 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index 25d229d8ed6..a1ea0198bee 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c,v 1.5 2003/05/06 23:52:08 daenzer Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.h b/src/mesa/drivers/dri/r200/r200_swtcl.h index ccf817988c5..7458c549288 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.h +++ b/src/mesa/drivers/dri/r200/r200_swtcl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h,v 1.3 2003/05/06 23:52:08 daenzer Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index e0c32b26d92..2ad35d43906 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.c,v 1.2 2002/12/16 16:18:55 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_tcl.h b/src/mesa/drivers/dri/r200/r200_tcl.h index ac5bc119468..f191ddc7eb9 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.h +++ b/src/mesa/drivers/dri/r200/r200_tcl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.h,v 1.2 2002/12/16 16:18:55 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 6c6450c681f..85baff0b08a 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.c,v 1.2 2002/11/05 17:46:08 tsi Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_tex.h b/src/mesa/drivers/dri/r200/r200_tex.h index 4438cc02a82..e6c0e00eb07 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.h +++ b/src/mesa/drivers/dri/r200/r200_tex.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.h,v 1.1 2002/10/30 12:51:53 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_texmem.c b/src/mesa/drivers/dri/r200/r200_texmem.c index 28988c97556..d926313d576 100644 --- a/src/mesa/drivers/dri/r200/r200_texmem.c +++ b/src/mesa/drivers/dri/r200/r200_texmem.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texmem.c,v 1.5 2002/12/17 00:32:56 dawes Exp $ */ /************************************************************************** Copyright (C) Tungsten Graphics 2002. All Rights Reserved. diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 875d3bab73f..ae02ec4b638 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texstate.c,v 1.3 2003/02/15 22:18:47 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. -- cgit v1.2.3 From 63155ca2ca9fc935022a083278645bcf6d1ad3dc Mon Sep 17 00:00:00 2001 From: Christoff Brill Date: Thu, 17 May 2007 17:17:25 -0600 Subject: use R200_DEBUG for debug output --- src/mesa/drivers/dri/r200/r200_tex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 85baff0b08a..90166f197fe 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -482,7 +482,7 @@ r200ValidateClientStorage( GLcontext *ctx, GLenum target, { r200ContextPtr rmesa = R200_CONTEXT(ctx); - if (0) + if ( R200_DEBUG & DEBUG_TEXTURE ) fprintf(stderr, "intformat %s format %s type %s\n", _mesa_lookup_enum_by_nr( internalFormat ), _mesa_lookup_enum_by_nr( format ), @@ -548,7 +548,7 @@ r200ValidateClientStorage( GLcontext *ctx, GLenum target, format, type); - if (0) + if ( R200_DEBUG & DEBUG_TEXTURE ) fprintf(stderr, "%s: srcRowStride %d/%x\n", __FUNCTION__, srcRowStride, srcRowStride); -- cgit v1.2.3 From 8452814ec6f536fc4177e6c34ff5b8b6d3102a3a Mon Sep 17 00:00:00 2001 From: Christoff Brill Date: Thu, 17 May 2007 17:18:13 -0600 Subject: change max anisotropy test --- src/mesa/drivers/dri/r200/r200_tex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 90166f197fe..e7a37dd4c99 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -181,7 +181,7 @@ static void r200SetTexMaxAnisotropy( r200TexObjPtr t, GLfloat max ) { t->pp_txfilter &= ~R200_MAX_ANISO_MASK; - if ( max == 1.0 ) { + if ( max <= 1.0 ) { t->pp_txfilter |= R200_MAX_ANISO_1_TO_1; } else if ( max <= 2.0 ) { t->pp_txfilter |= R200_MAX_ANISO_2_TO_1; -- cgit v1.2.3 From 4fca6bfa5d211a093c54b0bbeadaa38081e8c141 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 18 May 2007 07:46:27 -0600 Subject: fix STATE_HALF_VECTOR value (bug 10987) --- src/mesa/shader/prog_statevars.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 953fbb9b9f7..975a617ac89 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.0 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -121,17 +121,17 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], return; case STATE_HALF_VECTOR: { - GLfloat eye_z[] = {0, 0, 1}; - + static const GLfloat eye_z[] = {0, 0, 1}; + GLfloat p[3]; /* Compute infinite half angle vector: - * half-vector = light_position + (0, 0, 1) - * and then normalize. w = 0 - * + * halfVector = normalize(normalize(lightPos) + (0, 0, 1)) * light.EyePosition.w should be 0 for infinite lights. */ - ADD_3V(value, eye_z, ctx->Light.Light[ln].EyePosition); + COPY_3V(p, ctx->Light.Light[ln].EyePosition); + NORMALIZE_3FV(p); + ADD_3V(value, p, eye_z); NORMALIZE_3FV(value); - value[3] = 0; + value[3] = 1.0; } return; case STATE_POSITION_NORMALIZED: -- cgit v1.2.3 From 3ad9c551b95c6fd8787f6f007bda34df446b53ab Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 19 May 2007 00:45:38 +0200 Subject: fix small s3tc mipmaps (#10968) make sure that always whole blocks are uploaded. (May still not work correctly if the top mip map is not at least a full block, that is 4 pixels wide - not sure, but probably doesn't happen in real world) --- src/mesa/drivers/dri/i915/i915_texstate.c | 8 ++----- src/mesa/drivers/dri/i915/intel_tex.c | 35 ++++++++++++++++--------------- 2 files changed, 20 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 3b639e71443..9f0c9491b22 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -172,12 +172,8 @@ static void i915LayoutTextureImages( i915ContextPtr i915, t->intel.image[0][i].offset = total_height * pitch; t->intel.image[0][i].internalFormat = baseImage->_BaseFormat; - if (t->intel.image[0][i].image->IsCompressed) - { - if (t->intel.image[0][i].image->Height > 4) - total_height += t->intel.image[0][i].image->Height/4; - else - total_height += 1; + if (t->intel.image[0][i].image->IsCompressed) { + total_height += (t->intel.image[0][i].image->Height + 3) / 4; } else total_height += MAX2(2, t->intel.image[0][i].image->Height); diff --git a/src/mesa/drivers/dri/i915/intel_tex.c b/src/mesa/drivers/dri/i915/intel_tex.c index 6012d3e7999..46f49e74e5a 100644 --- a/src/mesa/drivers/dri/i915/intel_tex.c +++ b/src/mesa/drivers/dri/i915/intel_tex.c @@ -634,18 +634,12 @@ static void intelUploadTexImage( intelContextPtr intel, image->Height); } else if (image->IsCompressed) { - GLuint row_len = image->Width * 2; + GLuint row_len = 0; GLubyte *dst = (GLubyte *)(t->BufAddr + offset); GLubyte *src = (GLubyte *)image->Data; GLuint j; - if (INTEL_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, - "Upload image %dx%dx%d offset %xm row_len %x " - "pitch %x depth_pitch %x\n", - image->Width, image->Height, image->Depth, offset, - row_len, t->Pitch, t->depth_pitch); - + /* must always copy whole blocks (8/16 bytes) */ switch (image->InternalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_RGBA_FXT1_3DFX: @@ -653,24 +647,31 @@ static void intelUploadTexImage( intelContextPtr intel, case GL_RGB4_S3TC: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) { - __memcpy(dst, src, row_len ); - src += row_len; - } + row_len = (image->Width * 2 + 7) & ~7; break; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) { - __memcpy(dst, src, (image->Width*4) ); - src += image->Width*4; - } + row_len = (image->Width * 4 + 15) & ~15; break; default: fprintf(stderr,"Internal Compressed format not supported %d\n", image->InternalFormat); break; } + + if (INTEL_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, + "Upload image %dx%dx%d offset %xm row_len %x " + "pitch %x depth_pitch %x\n", + image->Width, image->Height, image->Depth, offset, + row_len, t->Pitch, t->depth_pitch); + + if (row_len) { + for (j = 0 ; j < (image->Height + 3)/4 ; j++, dst += (t->Pitch)) { + __memcpy(dst, src, row_len ); + src += row_len; + } + } } /* Time for another vtbl entry: */ -- cgit v1.2.3 From 28f53ace336706912fda6cc6877f72bffdcae330 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 19 May 2007 00:59:06 +0200 Subject: fix miptree comparison with compressed textures TexelBytes is always 0 with compressed textures, thus would never match mt->cpp. This caused constant blitting around of textures, and it fixes at least the horrible performance of Q3 if compressed textures are enabled. --- src/mesa/drivers/dri/i915tex/intel_tex_validate.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c index 79d587a1744..0ae4fee1ba0 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c @@ -105,6 +105,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) { struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current; struct intel_texture_object *intelObj = intel_texture_object(tObj); + int comp_byte = 0; + int cpp; GLuint face, i; GLuint nr_faces = 0; @@ -148,6 +150,12 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) intel_miptree_reference(&intelObj->mt, firstImage->mt); } + if (firstImage->base.IsCompressed) { + comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat); + cpp = comp_byte; + } + else cpp = firstImage->base.TexFormat->TexelBytes; + /* Check tree can hold all active levels. Check tree matches * target, imageFormat, etc. * @@ -165,7 +173,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) intelObj->mt->width0 != firstImage->base.Width || intelObj->mt->height0 != firstImage->base.Height || intelObj->mt->depth0 != firstImage->base.Depth || - intelObj->mt->cpp != firstImage->base.TexFormat->TexelBytes || + intelObj->mt->cpp != cpp || intelObj->mt->compressed != firstImage->base.IsCompressed)) { intel_miptree_release(intel, &intelObj->mt); } @@ -174,10 +182,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* May need to create a new tree: */ if (!intelObj->mt) { - int comp_byte = 0; - - if (firstImage->base.IsCompressed) - comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat); intelObj->mt = intel_miptree_create(intel, intelObj->base.Target, firstImage->base.InternalFormat, @@ -186,8 +190,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) firstImage->base.Width, firstImage->base.Height, firstImage->base.Depth, - firstImage->base.TexFormat-> - TexelBytes, + cpp, comp_byte); } -- cgit v1.2.3 From 25551bdfad8541337a4e59e7e3764fa9b876cb19 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 19 May 2007 03:08:45 +0200 Subject: fix copy & paste bug of previous commit, breaking dxt5 formats --- src/mesa/drivers/dri/i915/intel_tex.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_tex.c b/src/mesa/drivers/dri/i915/intel_tex.c index 46f49e74e5a..98ddc796724 100644 --- a/src/mesa/drivers/dri/i915/intel_tex.c +++ b/src/mesa/drivers/dri/i915/intel_tex.c @@ -652,6 +652,7 @@ static void intelUploadTexImage( intelContextPtr intel, case GL_RGBA_S3TC: case GL_RGBA4_S3TC: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: row_len = (image->Width * 4 + 15) & ~15; break; default: -- cgit v1.2.3 From eb6418b8952f335b6cf58232b5f282fc3e325c7a Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 19 May 2007 04:38:55 +0200 Subject: fix miptree layout (i915) for small compressed mipmaps This seems to work now. Also fix i945 set_level_info, need to match i915 behaviour for storing mip height, as it's assumed to be the mip width (in texels) elsewhere and the division by 4 is done later (untested). --- src/mesa/drivers/dri/i915tex/i915_tex_layout.c | 4 +--- src/mesa/drivers/dri/intel/intel_tex_layout.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c index 2e1600cfdfa..9f40706c36a 100644 --- a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c @@ -161,11 +161,9 @@ i915_miptree_layout(struct intel_mipmap_tree * mt) if (mt->compressed) img_height = MAX2(1, height / 4); else - img_height = MAX2(2, height); + img_height = (MAX2(2, height) + 1) & ~1; mt->total_height += img_height; - mt->total_height += 1; - mt->total_height &= ~1; width = minify(width); height = minify(height); diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c index f3564802171..fcb5cc39068 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.c +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c @@ -74,7 +74,7 @@ void i945_miptree_layout_2d( struct intel_mipmap_tree *mt ) GLuint img_height; intel_miptree_set_level_info(mt, level, 1, x, y, width, - mt->compressed ? height/4 : height, 1); + height, 1); if (mt->compressed) img_height = MAX2(1, height/4); -- cgit v1.2.3 From fd54564f78d4aeae2c39ada7502ec659c14b3eca Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 19 May 2007 08:27:35 -0600 Subject: Implement GLX_EXT_texture_from_pixmap. Could be done more efficiently... but works. --- src/mesa/drivers/x11/fakeglx.c | 186 +++++++++++++++++++++++++++++-- src/mesa/drivers/x11/glxapi.c | 32 +++++- src/mesa/drivers/x11/glxapi.h | 5 + src/mesa/drivers/x11/xm_api.c | 247 +++++++++++++++++++++++++++++++++++++++-- src/mesa/drivers/x11/xmesaP.h | 9 +- 5 files changed, 454 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 86a4deabc67..ef22a3f03eb 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -78,6 +78,7 @@ "GLX_MESA_pixmap_colormap " \ "GLX_MESA_release_buffers " \ "GLX_ARB_get_proc_address " \ + "GLX_EXT_texture_from_pixmap " \ "GLX_EXT_visual_info " \ "GLX_EXT_visual_rating " \ /*"GLX_SGI_video_sync "*/ \ @@ -1223,6 +1224,30 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) /* ignore */ break; +#ifdef GLX_EXT_texture_from_pixmap + case GLX_BIND_TO_TEXTURE_RGB_EXT: + parselist++; /*skip*/ + break; + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + parselist++; /*skip*/ + break; + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + parselist++; /*skip*/ + break; + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + parselist++; + if (*parselist & ~(GLX_TEXTURE_1D_BIT_EXT | + GLX_TEXTURE_2D_BIT_EXT | + GLX_TEXTURE_RECTANGLE_BIT_EXT)) { + /* invalid bit */ + return NULL; + } + break; + case GLX_Y_INVERTED_EXT: + parselist++; /*skip*/ + break; +#endif + case None: /* end of list */ break; @@ -1878,6 +1903,27 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig ) *value = xmvis->visinfo->visualid; break; +#ifdef GLX_EXT_texture_from_pixmap + case GLX_BIND_TO_TEXTURE_RGB_EXT: + *value = True; /*XXX*/ + break; + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + /* XXX review */ + *value = xmvis->mesa_visual.alphaBits > 0 ? True : False; + break; + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + *value = True; /*XXX*/ + break; + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + *value = (GLX_TEXTURE_1D_BIT_EXT | + GLX_TEXTURE_2D_BIT_EXT | + GLX_TEXTURE_RECTANGLE_BIT_EXT); /*XXX*/ + break; + case GLX_Y_INVERTED_EXT: + *value = False; /*XXX*/ + break; +#endif + default: return GLX_BAD_ATTRIBUTE; } @@ -2145,16 +2191,102 @@ Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap, { XMesaVisual v = (XMesaVisual) config; XMesaBuffer b; - - (void) dpy; - (void) config; - (void) pixmap; - (void) attribList; /* Ignored in GLX 1.3 */ + const int *attr; + int target = 0, format = 0, mipmap = 0; + int value; if (!dpy || !config || !pixmap) return 0; - b = XMesaCreatePixmapBuffer( v, pixmap, 0 ); + for (attr = attribList; *attr; attr++) { + switch (*attr) { + case GLX_TEXTURE_FORMAT_EXT: + attr++; + switch (*attr) { + case GLX_TEXTURE_FORMAT_NONE_EXT: + case GLX_TEXTURE_FORMAT_RGB_EXT: + case GLX_TEXTURE_FORMAT_RGBA_EXT: + format = *attr; + break; + default: + /* error */ + return 0; + } + break; + case GLX_TEXTURE_TARGET_EXT: + attr++; + switch (*attr) { + case GLX_TEXTURE_1D_EXT: + case GLX_TEXTURE_2D_EXT: + case GLX_TEXTURE_RECTANGLE_EXT: + target = *attr; + break; + default: + /* error */ + return 0; + } + break; + case GLX_MIPMAP_TEXTURE_EXT: + attr++; + if (*attr) + mipmap = 1; + break; + default: + /* error */ + return 0; + } + } + + if (format == GLX_TEXTURE_FORMAT_RGB_EXT) { + if (get_config(v, GLX_BIND_TO_TEXTURE_RGB_EXT, + &value, GL_TRUE) != Success + || !value) { + return 0; /* error! */ + } + } + else if (format == GLX_TEXTURE_FORMAT_RGBA_EXT) { + if (get_config(v, GLX_BIND_TO_TEXTURE_RGBA_EXT, + &value, GL_TRUE) != Success + || !value) { + return 0; /* error! */ + } + } + if (mipmap) { + if (get_config(v, GLX_BIND_TO_MIPMAP_TEXTURE_EXT, + &value, GL_TRUE) != Success + || !value) { + return 0; /* error! */ + } + } + if (target == GLX_TEXTURE_1D_EXT) { + if (get_config(v, GLX_BIND_TO_TEXTURE_TARGETS_EXT, + &value, GL_TRUE) != Success + || (value & GLX_TEXTURE_1D_BIT_EXT) == 0) { + return 0; /* error! */ + } + } + else if (target == GLX_TEXTURE_2D_EXT) { + if (get_config(v, GLX_BIND_TO_TEXTURE_TARGETS_EXT, + &value, GL_TRUE) != Success + || (value & GLX_TEXTURE_2D_BIT_EXT) == 0) { + return 0; /* error! */ + } + } + if (target == GLX_TEXTURE_RECTANGLE_EXT) { + if (get_config(v, GLX_BIND_TO_TEXTURE_TARGETS_EXT, + &value, GL_TRUE) != Success + || (value & GLX_TEXTURE_RECTANGLE_BIT_EXT) == 0) { + return 0; /* error! */ + } + } + + if (format || target || mipmap) { + /* texture from pixmap */ + b = XMesaCreatePixmapTextureBuffer(v, pixmap, 0, format, target, mipmap); + } + else { + b = XMesaCreatePixmapBuffer( v, pixmap, 0 ); + } if (!b) { return 0; } @@ -2260,8 +2392,20 @@ Fake_glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, case GLX_FBCONFIG_ID: *value = xmbuf->xm_visual->visinfo->visualid; return; +#ifdef GLX_EXT_texture_from_pixmap + case GLX_TEXTURE_FORMAT_EXT: + *value = xmbuf->TextureFormat; + break; + case GLX_TEXTURE_TARGET_EXT: + *value = xmbuf->TextureTarget; + break; + case GLX_MIPMAP_TEXTURE_EXT: + *value = xmbuf->TextureMipmap; + break; +#endif + default: - return; /* GLX_BAD_ATTRIBUTE? */ + return; /* raise BadValue error */ } } @@ -2854,6 +2998,26 @@ Fake_glXGetAGPOffsetMESA( const GLvoid *pointer ) } +/*** GLX_EXT_texture_from_pixmap ***/ + +static void +Fake_glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, + const int *attrib_list) +{ + XMesaBuffer b = XMesaFindBuffer(dpy, drawable); + if (b) + XMesaBindTexImage(dpy, b, buffer, attrib_list); +} + +static void +Fake_glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer) +{ + XMesaBuffer b = XMesaFindBuffer(dpy, drawable); + if (b) + XMesaReleaseTexImage(dpy, b, buffer); +} + + /* silence warning */ extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void); @@ -3009,5 +3173,9 @@ _mesa_GetGLXDispatchTable(void) /*** GLX_MESA_agp_offset ***/ glx.GetAGPOffsetMESA = Fake_glXGetAGPOffsetMESA; + /*** GLX_EXT_texture_from_pixmap ***/ + glx.BindTexImageEXT = Fake_glXBindTexImageEXT; + glx.ReleaseTexImageEXT = Fake_glXReleaseTexImageEXT; + return &glx; } diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 973f3940451..5f11c90c13c 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -1104,6 +1104,27 @@ glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer) } +/*** GLX_EXT_texture_from_pixmap */ + +void +glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, + const int *attrib_list) +{ + struct _glxapi_table *t; + GET_DISPATCH(dpy, t); + if (t) + t->BindTexImageEXT(dpy, drawable, buffer, attrib_list); +} + +void +glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer) +{ + struct _glxapi_table *t; + GET_DISPATCH(dpy, t); + if (t) + t->ReleaseTexImageEXT(dpy, drawable, buffer); +} + /**********************************************************************/ /* GLX API management functions */ @@ -1147,6 +1168,9 @@ _glxapi_get_extensions(void) #endif #ifdef GLX_SGIX_pbuffer "GLX_SGIX_pbuffer", +#endif +#ifdef GLX_EXT_texture_from_pixmap, + "GLX_EXT_texture_from_pixmap", #endif NULL }; @@ -1333,6 +1357,10 @@ static struct name_address_pair GLX_functions[] = { { "glXFreeMemoryMESA", (__GLXextFuncPtr) glXFreeMemoryMESA }, { "glXGetMemoryOffsetMESA", (__GLXextFuncPtr) glXGetMemoryOffsetMESA }, + /*** GLX_EXT_texture_from_pixmap ***/ + { "glXBindTexImageEXT", (__GLXextFuncPtr) glXBindTexImageEXT }, + { "glXReleaseTexImageEXT", (__GLXextFuncPtr) glXReleaseTexImageEXT }, + { NULL, NULL } /* end of list */ }; diff --git a/src/mesa/drivers/x11/glxapi.h b/src/mesa/drivers/x11/glxapi.h index 3187534c9a3..37de81e55ac 100644 --- a/src/mesa/drivers/x11/glxapi.h +++ b/src/mesa/drivers/x11/glxapi.h @@ -196,6 +196,11 @@ struct _glxapi_table { /*** GLX_MESA_agp_offset ***/ GLuint (*GetAGPOffsetMESA)( const GLvoid *pointer ); + + /*** GLX_EXT_texture_from_pixmap ***/ + void (*BindTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer, + const int *attrib_list); + void (*ReleaseTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer); }; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index a07d0a90cf3..edaa71508fc 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -72,6 +72,7 @@ #include "imports.h" #include "macros.h" #include "renderbuffer.h" +#include "teximage.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" @@ -295,6 +296,19 @@ static GLboolean window_exists( XMesaDisplay *dpy, Window win ) #endif +static Status +get_drawable_size(Display *dpy, Drawable d, GLuint *width, GLuint *height) +{ + Window root; + Status stat; + int xpos, ypos; + unsigned int w, h, bw, depth; + stat = XGetGeometry(dpy, d, &root, &xpos, &ypos, &w, &h, &bw, &depth); + *width = w; + *height = h; + return stat; +} + /** * Return the size of the window (or pixmap) that corresponds to the @@ -310,22 +324,14 @@ xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b, *width = MIN2(b->frontxrb->drawable->width, MAX_WIDTH); *height = MIN2(b->frontxrb->drawable->height, MAX_HEIGHT); #else - Window root; Status stat; - int xpos, ypos; - unsigned int w, h, bw, depth; _glthread_LOCK_MUTEX(_xmesa_lock); XSync(b->xm_visual->display, 0); /* added for Chromium */ - stat = XGetGeometry(dpy, b->frontxrb->pixmap, &root, &xpos, &ypos, - &w, &h, &bw, &depth); + stat = get_drawable_size(dpy, b->frontxrb->pixmap, width, height); _glthread_UNLOCK_MUTEX(_xmesa_lock); - if (stat) { - *width = w; - *height = h; - } - else { + if (!stat) { /* probably querying a window that's recently been destroyed */ _mesa_warning(NULL, "XGetGeometry failed!\n"); *width = *height = 1; @@ -431,6 +437,11 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, b->swAlpha, vis->mesa_visual.numAuxBuffers > 0 ); + /* GLX_EXT_texture_from_pixmap */ + b->TextureTarget = 0; + b->TextureFormat = GLX_TEXTURE_FORMAT_NONE_EXT; + b->TextureMipmap = 0; + /* insert buffer into linked list */ b->Next = XMesaBufferList; XMesaBufferList = b; @@ -1673,6 +1684,67 @@ XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap) } +/** + * For GLX_EXT_texture_from_pixmap + */ +XMesaBuffer +XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p, + XMesaColormap cmap, + int format, int target, int mipmap) +{ + GET_CURRENT_CONTEXT(ctx); + XMesaBuffer b; + GLuint width, height; + + assert(v); + + b = create_xmesa_buffer((XMesaDrawable) p, PIXMAP, v, cmap); + if (!b) + return NULL; + + /* get pixmap size, update framebuffer/renderbuffer dims */ + get_drawable_size(v->display, p, &width, &height); + _mesa_resize_framebuffer(NULL, &(b->mesa_buffer), width, height); + + if (target == 0) { + /* examine dims */ + if (ctx->Extensions.ARB_texture_non_power_of_two) { + target = GLX_TEXTURE_2D_EXT; + } + else if ( _mesa_bitcount(width) == 1 + && _mesa_bitcount(height) == 1) { + /* power of two size */ + if (height == 1) { + target = GLX_TEXTURE_1D_EXT; + } + else { + target = GLX_TEXTURE_2D_EXT; + } + } + else if (ctx->Extensions.NV_texture_rectangle) { + target = GLX_TEXTURE_RECTANGLE_EXT; + } + else { + /* non power of two textures not supported */ + XMesaDestroyBuffer(b); + return 0; + } + } + + b->TextureTarget = target; + b->TextureFormat = format; + b->TextureMipmap = mipmap; + + if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode, + (XMesaDrawable) p, cmap)) { + xmesa_free_buffer(b); + return NULL; + } + + return b; +} + + XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, @@ -2254,3 +2326,154 @@ XMesaResizeBuffers( XMesaBuffer b ) xmesa_check_and_update_buffer_size(xmctx, b); } + +static GLint +xbuffer_to_renderbuffer(int buffer) +{ + assert(MAX_AUX_BUFFERS <= 4); + + switch (buffer) { + case GLX_FRONT_LEFT_EXT: + return BUFFER_FRONT_LEFT; + case GLX_FRONT_RIGHT_EXT: + return BUFFER_FRONT_RIGHT; + case GLX_BACK_LEFT_EXT: + return BUFFER_BACK_LEFT; + case GLX_BACK_RIGHT_EXT: + return BUFFER_BACK_RIGHT; + case GLX_AUX0_EXT: + return BUFFER_AUX0; + case GLX_AUX1_EXT: + return BUFFER_AUX1; + case GLX_AUX2_EXT: + return BUFFER_AUX2; + case GLX_AUX3_EXT: + return BUFFER_AUX3; + case GLX_AUX4_EXT: + case GLX_AUX5_EXT: + case GLX_AUX6_EXT: + case GLX_AUX7_EXT: + case GLX_AUX8_EXT: + case GLX_AUX9_EXT: + default: + /* BadValue error */ + return -1; + } +} + + +PUBLIC void +XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer, + const int *attrib_list) +{ +#if 0 + GET_CURRENT_CONTEXT(ctx); + const GLuint unit = ctx->Texture.CurrentUnit; + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *texObj; +#endif + struct gl_renderbuffer *rb; + struct xmesa_renderbuffer *xrb; + GLint b; + XMesaImage *img; + GLboolean freeImg = GL_FALSE; + + b = xbuffer_to_renderbuffer(buffer); + if (b < 0) + return; + + if (drawable->TextureFormat == GLX_TEXTURE_FORMAT_NONE_EXT) + return; /* BadMatch error */ + + rb = drawable->mesa_buffer.Attachment[b].Renderbuffer; + if (!rb) { + /* invalid buffer */ + return; + } + xrb = xmesa_renderbuffer(rb); + +#if 0 + switch (drawable->TextureTarget) { + case GLX_TEXTURE_1D_EXT: + texObj = texUnit->Current1D; + break; + case GLX_TEXTURE_2D_EXT: + texObj = texUnit->Current2D; + break; + case GLX_TEXTURE_RECTANGLE_EXT: + texObj = texUnit->CurrentRect; + break; + default: + return; /* BadMatch error */ + } +#endif + + /* + * The following is a quick and simple way to implement + * BindTexImage. The better way is to write some new FetchTexel() + * functions which would extract texels from XImages. We'd still + * need to use XGetImage when texturing from a Pixmap (front buffer) + * but texturing from a back buffer (XImage) would avoid an image + * copy. + */ + + /* get XImage */ + if (xrb->pixmap) { + img = XGetImage(dpy, xrb->pixmap, 0, 0, rb->Width, rb->Height, + AllPlanes, ZPixmap ); + freeImg = GL_TRUE; + } + else if (xrb->ximage) { + img = xrb->ximage; + } + + /* store the XImage as a new texture image */ + if (img) { + GLenum format, type, intFormat; + if (img->bits_per_pixel == 32) { + format = GL_BGRA; + type = GL_UNSIGNED_BYTE; + intFormat = GL_RGBA; + } + else if (img->bits_per_pixel == 24) { + format = GL_BGR; + type = GL_UNSIGNED_BYTE; + intFormat = GL_RGB; + } + else if (img->bits_per_pixel == 16) { + format = GL_BGR; + type = GL_UNSIGNED_SHORT_5_6_5; + intFormat = GL_RGB; + } + else { + _mesa_problem(NULL, "Unexpected XImage format in XMesaBindTexImage"); + return; + } + if (drawable->TextureFormat == GLX_TEXTURE_FORMAT_RGBA_EXT) { + intFormat = GL_RGBA; + } + else if (drawable->TextureFormat == GLX_TEXTURE_FORMAT_RGB_EXT) { + intFormat = GL_RGB; + } + + _mesa_TexImage2D(GL_TEXTURE_2D, 0, intFormat, rb->Width, rb->Height, 0, + format, type, img->data); + + if (freeImg) { + XMesaDestroyImage(img); + } + } +} + + + +PUBLIC void +XMesaReleaseTexImage(Display *dpy, XMesaBuffer drawable, int buffer) +{ + const GLint b = xbuffer_to_renderbuffer(buffer); + if (b < 0) + return; + + /* no-op for now */ +} + diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 01988867476..e3d7cf381f7 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -267,6 +267,11 @@ struct xmesa_buffer { fxMesaContext FXctx; #endif + /* GLX_EXT_texture_from_pixmap */ + GLint TextureTarget; /** GLX_TEXTURE_1D_EXT, for example */ + GLint TextureFormat; /** GLX_TEXTURE_FORMAT_RGB_EXT, for example */ + GLint TextureMipmap; /** 0 or 1 */ + struct xmesa_buffer *Next; /* Linked list pointer: */ }; -- cgit v1.2.3 From a2305ebfa213adb16e72d1a819895a68991c9462 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 19 May 2007 09:10:44 -0600 Subject: need to copy new 1D/2D array texture objects in _mesa_PushAttrib() --- src/mesa/main/attrib.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 4654704afd1..46995462629 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -363,6 +363,10 @@ _mesa_PushAttrib(GLbitfield mask) attr->Unit[u].CurrentCubeMap); _mesa_copy_texture_object(&attr->Unit[u].SavedRect, attr->Unit[u].CurrentRect); + _mesa_copy_texture_object(&attr->Unit[u].Saved1DArray, + attr->Unit[u].Current1DArray); + _mesa_copy_texture_object(&attr->Unit[u].Saved2DArray, + attr->Unit[u].Current2DArray); } _mesa_unlock_context_textures(ctx); -- cgit v1.2.3 From 62b6eef0d72f42fa73210a67f2afc37547e7b8b5 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 19 May 2007 05:41:55 +0000 Subject: r300: Just use "inline" rather than "__inline__". --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 6 +++--- src/mesa/drivers/dri/r300/r300_context.h | 4 ++-- src/mesa/drivers/dri/r300/r300_emit.h | 12 ++++++------ src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index d13649ddc0d..0351989b2e4 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -148,7 +148,7 @@ static void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *stat * The caller must have ensured that there is enough space in the command * buffer. */ -static __inline__ void r300EmitAtoms(r300ContextPtr r300, GLboolean dirty) +static inline void r300EmitAtoms(r300ContextPtr r300, GLboolean dirty) { struct r300_state_atom *atom; uint32_t *dest; diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index bfb2eda26fe..acb6e38c6df 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -52,7 +52,7 @@ extern void r300DestroyCmdBuf(r300ContextPtr r300); * * \param dwords The number of dwords we need to be free on the command buffer */ -static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300, +static inline void r300EnsureCmdBufSpace(r300ContextPtr r300, int dwords, const char *caller) { assert(dwords < r300->cmdbuf.size); @@ -68,7 +68,7 @@ static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300, * causes state reemission after a flush. This is necessary to ensure * correct hardware state after an unlock. */ -static __inline__ uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, +static inline uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, int dwords, const char *caller) { uint32_t *ptr; @@ -80,7 +80,7 @@ static __inline__ uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, return ptr; } -static __inline__ uint32_t *r300AllocCmdBuf(r300ContextPtr r300, +static inline uint32_t *r300AllocCmdBuf(r300ContextPtr r300, int dwords, const char *caller) { uint32_t *ptr; diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index dbcd5d04d6d..261c87f2f0b 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -80,7 +80,7 @@ typedef struct r300_context *r300ContextPtr; /** * This function takes a float and packs it into a uint32_t */ -static __inline__ uint32_t r300PackFloat32(float fl) +static inline uint32_t r300PackFloat32(float fl) { union { float fl; @@ -97,7 +97,7 @@ static __inline__ uint32_t r300PackFloat32(float fl) * But it works for most things. I'll fix it later if someone * else with a better clue doesn't */ -static __inline__ uint32_t r300PackFloat24(float f) +static inline uint32_t r300PackFloat24(float f) { float mantissa; int exponent; diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 7be098f743c..4f841a54139 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -59,7 +59,7 @@ #define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2)) -static __inline__ uint32_t cmdpacket0(int reg, int count) +static inline uint32_t cmdpacket0(int reg, int count) { drm_r300_cmd_header_t cmd; @@ -71,7 +71,7 @@ static __inline__ uint32_t cmdpacket0(int reg, int count) return cmd.u; } -static __inline__ uint32_t cmdvpu(int addr, int count) +static inline uint32_t cmdvpu(int addr, int count) { drm_r300_cmd_header_t cmd; @@ -83,7 +83,7 @@ static __inline__ uint32_t cmdvpu(int addr, int count) return cmd.u; } -static __inline__ uint32_t cmdpacket3(int packet) +static inline uint32_t cmdpacket3(int packet) { drm_r300_cmd_header_t cmd; @@ -93,7 +93,7 @@ static __inline__ uint32_t cmdpacket3(int packet) return cmd.u; } -static __inline__ uint32_t cmdcpdelay(unsigned short count) +static inline uint32_t cmdcpdelay(unsigned short count) { drm_r300_cmd_header_t cmd; @@ -103,7 +103,7 @@ static __inline__ uint32_t cmdcpdelay(unsigned short count) return cmd.u; } -static __inline__ uint32_t cmdwait(unsigned char flags) +static inline uint32_t cmdwait(unsigned char flags) { drm_r300_cmd_header_t cmd; @@ -113,7 +113,7 @@ static __inline__ uint32_t cmdwait(unsigned char flags) return cmd.u; } -static __inline__ uint32_t cmdpacify(void) +static inline uint32_t cmdpacify(void) { drm_r300_cmd_header_t cmd; diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 1d90ade2ed1..16dddf6557d 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -222,7 +222,7 @@ static unsigned long t_src_class(enum register_file file) } } -static __inline unsigned long t_swizzle(GLubyte swizzle) +static inline unsigned long t_swizzle(GLubyte swizzle) { /* this is in fact a NOP as the Mesa SWIZZLE_* are all identical to VSF_IN_COMPONENT_* */ return swizzle; -- cgit v1.2.3 From 9df4f842d593b5ea0cdc3d9a515afbe638b9051e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 20 May 2007 17:20:10 +0000 Subject: r300: Added TODO comment regarding immediate mode implementation. --- src/mesa/drivers/dri/r300/r300_render.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 6cec2bb1ea7..143fe9fd35d 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -45,6 +45,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * obviously this does work... Further investigation is needed. * * \author Nicolai Haehnle + * + * \todo Add immediate implementation back? Perhaps this is useful if there are + * no bugs... */ #include "glheader.h" -- cgit v1.2.3 From aa133a9dae53bc6aa50b88ee43deb8b34e8d0029 Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 20 May 2007 12:17:21 -0600 Subject: add missing right-paren --- src/mesa/drivers/dri/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile index 4abcc16c1bc..f466ce6c3cc 100644 --- a/src/mesa/drivers/dri/Makefile +++ b/src/mesa/drivers/dri/Makefile @@ -32,7 +32,7 @@ install: clean: @for dir in $(DRI_DIRS) ; do \ if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) clean ; \ + (cd $$dir && $(MAKE) clean) ; \ fi \ done -rm -f common/*.o -- cgit v1.2.3 From 9e8a961dd7d7b717a9fb4ecdea1c1b60ea355efe Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 20 May 2007 12:27:39 -0600 Subject: Overhaul/simplify SWvertex and SWspan attribute handling. Instead of separate fog/specular/texcoord/varying code, just treat all of them as generic attributes. Simplifies the point/line/triangle functions. --- src/mesa/drivers/dri/ffb/ffb_tris.c | 8 +- src/mesa/drivers/dri/mach64/mach64_native_vb.c | 18 +- src/mesa/drivers/dri/s3v/s3v_tritmp.h | 46 +- src/mesa/drivers/dri/tdfx/tdfx_tris.c | 16 +- src/mesa/drivers/x11/xm_line.c | 8 +- src/mesa/swrast/s_aaline.c | 39 +- src/mesa/swrast/s_aalinetemp.h | 107 ++-- src/mesa/swrast/s_aatriangle.c | 89 +-- src/mesa/swrast/s_aatritemp.h | 249 +++------ src/mesa/swrast/s_alpha.c | 4 +- src/mesa/swrast/s_bitmap.c | 19 +- src/mesa/swrast/s_context.c | 114 ++-- src/mesa/swrast/s_context.h | 5 + src/mesa/swrast/s_copypix.c | 29 +- src/mesa/swrast/s_drawpix.c | 43 +- src/mesa/swrast/s_feedback.c | 23 +- src/mesa/swrast/s_fog.c | 335 +++++------- src/mesa/swrast/s_lines.c | 112 ++-- src/mesa/swrast/s_linetemp.h | 128 ++--- src/mesa/swrast/s_logic.c | 4 +- src/mesa/swrast/s_masking.c | 4 +- src/mesa/swrast/s_points.c | 39 +- src/mesa/swrast/s_pointtemp.h | 115 ++-- src/mesa/swrast/s_span.c | 725 +++++++++---------------- src/mesa/swrast/s_span.h | 98 +--- src/mesa/swrast/s_texcombine.c | 1 - src/mesa/swrast/s_triangle.c | 111 ++-- src/mesa/swrast/s_tritemp.h | 630 ++++++--------------- src/mesa/swrast/s_zoom.c | 32 +- src/mesa/swrast/swrast.h | 23 +- src/mesa/swrast_setup/ss_context.c | 42 +- src/mesa/swrast_setup/ss_triangle.c | 52 +- src/mesa/swrast_setup/ss_tritmp.h | 88 +-- src/mesa/tnl_dd/t_dd_vb.c | 48 +- 34 files changed, 1273 insertions(+), 2131 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/ffb/ffb_tris.c b/src/mesa/drivers/dri/ffb/ffb_tris.c index ca0e514dc0e..9fae8c8283e 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tris.c +++ b/src/mesa/drivers/dri/ffb/ffb_tris.c @@ -138,10 +138,10 @@ static void ffb_translate_vertex(GLcontext *ctx, const ffb_vertex *src, const GLfloat ty = m[13]; const GLfloat tz = m[14]; - dst->win[0] = sx * src->x + tx; - dst->win[1] = sy * src->y + ty; - dst->win[2] = sz * src->z + tz; - dst->win[3] = 1.0; + dst->attrib[FRAG_ATTRIB_WPOS][0] = sx * src->x + tx; + dst->attrib[FRAG_ATTRIB_WPOS][1] = sy * src->y + ty; + dst->attrib[FRAG_ATTRIB_WPOS][2] = sz * src->z + tz; + dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; dst->color[0] = FFB_UBYTE_FROM_COLOR(src->color[0].red); dst->color[1] = FFB_UBYTE_FROM_COLOR(src->color[0].green); diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c index 81bcf802c71..75cf0e2ed2d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c @@ -44,7 +44,7 @@ void TAG(translate_vertex)(GLcontext *ctx, UNVIEWPORT_VARS; CARD32 *p = (CARD32 *)src + 10 - mmesa->vertex_size; - dst->win[3] = 1.0; + dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; switch ( format ) { case TEX1_VERTEX_FORMAT: @@ -75,17 +75,17 @@ void TAG(translate_vertex)(GLcontext *ctx, dst->attrib[FRAG_ATTRIB_TEX0][1] = LE32_IN_FLOAT( p++ ); #endif dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0; - dst->win[3] = LE32_IN_FLOAT( p++ ); + dst->attrib[FRAG_ATTRIB_WPOS][3] = LE32_IN_FLOAT( p++ ); case NOTEX_VERTEX_FORMAT: - dst->specular[2] = ((GLubyte *)p)[0]; - dst->specular[1] = ((GLubyte *)p)[1]; - dst->specular[0] = ((GLubyte *)p)[2]; - dst->attrib[FRAG_ATTRIB_FOGC][0] = ((GLubyte *)p)[3]; + dst->attrib[FRAG_ATTRIB_COL1][2] = UBYTE_TO_FLOAT(((GLubyte *)p)[0]); + dst->attrib[FRAG_ATTRIB_COL1][1] = UBYTE_TO_FLOAT(((GLubyte *)p)[1]); + dst->attrib[FRAG_ATTRIB_COL1][0] = UBYTE_TO_FLOAT(((GLubyte *)p)[2]); + dst->attrib[FRAG_ATTRIB_FOGC][0] = ((GLubyte *)p)[3]; /*XXX int->float?*/ p++; case TINY_VERTEX_FORMAT: - dst->win[2] = UNVIEWPORT_Z( LE32_IN( p++ ) ); + dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( LE32_IN( p++ ) ); dst->color[2] = ((GLubyte *)p)[0]; dst->color[1] = ((GLubyte *)p)[1]; @@ -96,8 +96,8 @@ void TAG(translate_vertex)(GLcontext *ctx, { GLuint xy = LE32_IN( p ); - dst->win[0] = UNVIEWPORT_X( (GLfloat)(GLshort)( xy >> 16 ) ); - dst->win[1] = UNVIEWPORT_Y( (GLfloat)(GLshort)( xy & 0xffff ) ); + dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( (GLfloat)(GLshort)( xy >> 16 ) ); + dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( (GLfloat)(GLshort)( xy & 0xffff ) ); } } diff --git a/src/mesa/drivers/dri/s3v/s3v_tritmp.h b/src/mesa/drivers/dri/s3v/s3v_tritmp.h index 696fc02250f..2321bd414ff 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tritmp.h +++ b/src/mesa/drivers/dri/s3v/s3v_tritmp.h @@ -43,12 +43,12 @@ #define SORT_LINE_VERT() \ do { \ - if(v[0].win[1] <= v[1].win[1]) { \ + if(v[0].attrib[FRAG_ATTRIB_WPOS][1] <= v[1].attrib[FRAG_ATTRIB_WPOS][1]) { \ \ idx[0] = 0; \ idx[1] = 1; \ \ - } else if (v[0].win[1] > v[1].win[1]) { \ + } else if (v[0].attrib[FRAG_ATTRIB_WPOS][1] > v[1].attrib[FRAG_ATTRIB_WPOS][1]) { \ \ idx[0] = 1; \ idx[1] = 0; \ @@ -58,19 +58,19 @@ do { \ #define SET_LINE_VERT() \ do { \ - x[0] = (v[idx[0]].win[0] * 1024.0f * 1024.0f); /* 0x100000 */ \ - y[0] = fy[0] = dPriv->h - v[idx[0]].win[1]; \ - z[0] = (v[idx[0]].win[2]) * 1024.0f * 32.0f; /* 0x8000; */ \ + x[0] = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][0] * 1024.0f * 1024.0f); /* 0x100000 */ \ + y[0] = fy[0] = dPriv->h - v[idx[0]].attrib[FRAG_ATTRIB_WPOS][1]; \ + z[0] = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][2]) * 1024.0f * 32.0f; /* 0x8000; */ \ \ - x[1] = (v[idx[1]].win[0] * 1024.0f * 1024.0f); /* 0x100000 */ \ - y[1] = dPriv->h - v[idx[1]].win[1]; \ - z[1] = (v[idx[1]].win[2]) * 1024.0f * 32.0f; /* 0x8000 */ \ + x[1] = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][0] * 1024.0f * 1024.0f); /* 0x100000 */ \ + y[1] = dPriv->h - v[idx[1]].attrib[FRAG_ATTRIB_WPOS][1]; \ + z[1] = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][2]) * 1024.0f * 32.0f; /* 0x8000 */ \ } while(0) #define SET_LINE_XY() \ do { \ - tmp = v[idx[0]].win[0]; \ - tmp2 = v[idx[1]].win[0]; \ + tmp = v[idx[0]].attrib[FRAG_ATTRIB_WPOS][0]; \ + tmp2 = v[idx[1]].attrib[FRAG_ATTRIB_WPOS][0]; \ \ dx01 = x[0] - x[1]; \ dy01 = y[0] - y[1]; \ @@ -265,7 +265,7 @@ do { \ #define SORT_VERT() \ do { \ for (i=0; i<3; i++) \ - fy[i] = v[i].win[1]; \ + fy[i] = v[i].attrib[FRAG_ATTRIB_WPOS][1]; \ \ if (fy[1] > fy[0]) { /* (fy[1] > fy[0]) */ \ \ @@ -305,9 +305,9 @@ do { \ do { \ for (i=0; i<3; i++) \ { \ - x[i] = ((v[idx[i]].win[0]) * /* 0x100000*/ 1024.0 * 1024.0); \ - y[i] = fy[i] = (dPriv->h - v[idx[i]].win[1]); \ - z[i] = ((v[idx[i]].win[2]) * /* 0x8000 */ 1024.0 * 32.0); \ + x[i] = ((v[idx[i]].attrib[FRAG_ATTRIB_WPOS][0]) * /* 0x100000*/ 1024.0 * 1024.0); \ + y[i] = fy[i] = (dPriv->h - v[idx[i]].attrib[FRAG_ATTRIB_WPOS][1]); \ + z[i] = ((v[idx[i]].attrib[FRAG_ATTRIB_WPOS][2]) * /* 0x8000 */ 1024.0 * 32.0); \ } \ \ ydiff = fy[0] - (float)y[0]; \ @@ -420,9 +420,9 @@ do { \ v2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1] \ * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ \ - w0 = (v[idx[0]].win[3]); \ - w1 = (v[idx[1]].win[3]); \ - w2 = (v[idx[2]].win[3]); \ + w0 = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][3]); \ + w1 = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][3]); \ + w2 = (v[idx[2]].attrib[FRAG_ATTRIB_WPOS][3]); \ } while (0) #define SET_BASEUV() \ @@ -732,8 +732,8 @@ DEBUG(("***\n")); #if (IND & S3V_RAST_CULL_BIT) cull = vmesa->backface_sign * - ((v[1].win[0] - v[0].win[0]) * (v[0].win[1] - v[2].win[1]) + - (v[1].win[1] - v[0].win[1]) * (v[2].win[0] - v[0].win[0])); + ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + + (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); if (cull < vmesa->cull_zero /* -0.02f */) return; #endif @@ -842,8 +842,8 @@ static void TAG(s3v_quad)( s3vContextPtr vmesa, #if (IND & S3V_RAST_CULL_BIT) cull = vmesa->backface_sign * - ((v[1].win[0] - v[0].win[0]) * (v[0].win[1] - v[2].win[1]) + - (v[1].win[1] - v[0].win[1]) * (v[2].win[0] - v[0].win[0])); + ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + + (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); if (cull < vmesa->cull_zero /* -0.02f */) goto second; /* return; */ /* (a) */ #endif @@ -897,8 +897,8 @@ second: #if (IND & S3V_RAST_CULL_BIT) cull = vmesa->backface_sign * - ((v[1].win[0] - v[0].win[0]) * (v[0].win[1] - v[2].win[1]) + - (v[1].win[1] - v[0].win[1]) * (v[2].win[0] - v[0].win[0])); + ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + + (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); if (cull < /* -0.02f */ vmesa->cull_zero) return; #endif diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tris.c b/src/mesa/drivers/dri/tdfx/tdfx_tris.c index 4ba2f40b9e8..96f9ae27fc1 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tris.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tris.c @@ -142,10 +142,10 @@ tdfx_translate_vertex( GLcontext *ctx, const tdfxVertex *src, SWvertex *dst) tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); if (fxMesa->vertexFormat == TDFX_LAYOUT_TINY) { - dst->win[0] = src->x - fxMesa->x_offset; - dst->win[1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset); - dst->win[2] = src->z; - dst->win[3] = 1.0; + dst->attrib[FRAG_ATTRIB_WPOS][0] = src->x - fxMesa->x_offset; + dst->attrib[FRAG_ATTRIB_WPOS][1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset); + dst->attrib[FRAG_ATTRIB_WPOS][2] = src->z; + dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; dst->color[0] = src->color[2]; dst->color[1] = src->color[1]; @@ -155,10 +155,10 @@ tdfx_translate_vertex( GLcontext *ctx, const tdfxVertex *src, SWvertex *dst) else { GLfloat w = 1.0 / src->rhw; - dst->win[0] = src->x - fxMesa->x_offset; - dst->win[1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset); - dst->win[2] = src->z; - dst->win[3] = src->rhw; + dst->attrib[FRAG_ATTRIB_WPOS][0] = src->x - fxMesa->x_offset; + dst->attrib[FRAG_ATTRIB_WPOS][1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset); + dst->attrib[FRAG_ATTRIB_WPOS][2] = src->z; + dst->attrib[FRAG_ATTRIB_WPOS][3] = src->rhw; dst->color[0] = src->color[2]; dst->color[1] = src->color[1]; diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index 8537256d2e2..deeae5019c4 100644 --- a/src/mesa/drivers/x11/xm_line.c +++ b/src/mesa/drivers/x11/xm_line.c @@ -556,10 +556,10 @@ xor_line(GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1) vert1->color[0], vert1->color[1], vert1->color[2], vert1->color[3], xmesa->pixelformat); - int x0 = (int) vert0->win[0]; - int y0 = YFLIP(xrb, (GLint) vert0->win[1]); - int x1 = (int) vert1->win[0]; - int y1 = YFLIP(xrb, (GLint) vert1->win[1]); + int x0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][0]; + int y0 = YFLIP(xrb, (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][1]); + int x1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][0]; + int y1 = YFLIP(xrb, (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][1]); XMesaSetForeground(dpy, gc, pixel); XMesaSetFunction(dpy, gc, GXxor); XSetLineAttributes(dpy, gc, (int) ctx->Line.Width, diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 3bb53dc2d7f..d6a9afb4212 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -59,19 +59,13 @@ struct LineInfo /* DO_Z */ GLfloat zPlane[4]; - /* DO_FOG */ - GLfloat fPlane[4]; /* DO_RGBA */ GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; /* DO_INDEX */ GLfloat iPlane[4]; - /* DO_SPEC */ - GLfloat srPlane[4], sgPlane[4], sbPlane[4]; /* DO_ATTRIBS */ - GLfloat sPlane[FRAG_ATTRIB_MAX][4]; - GLfloat tPlane[FRAG_ATTRIB_MAX][4]; - GLfloat uPlane[FRAG_ATTRIB_MAX][4]; - GLfloat vPlane[FRAG_ATTRIB_MAX][4]; + GLfloat wPlane[4]; + GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; GLfloat lambda[FRAG_ATTRIB_MAX]; GLfloat texWidth[FRAG_ATTRIB_MAX]; GLfloat texHeight[FRAG_ATTRIB_MAX]; @@ -483,35 +477,24 @@ segment(GLcontext *ctx, #define NAME(x) aa_ci_##x #define DO_Z -#define DO_FOG +#define DO_ATTRIBS /* for fog */ #define DO_INDEX #include "s_aalinetemp.h" #define NAME(x) aa_rgba_##x #define DO_Z -#define DO_FOG #define DO_RGBA #include "s_aalinetemp.h" -#define NAME(x) aa_tex_rgba_##x +#define NAME(x) aa_general_rgba_##x #define DO_Z -#define DO_FOG #define DO_RGBA #define DO_ATTRIBS #include "s_aalinetemp.h" -#define NAME(x) aa_multitex_spec_##x -#define DO_Z -#define DO_FOG -#define DO_RGBA -#define DO_ATTRIBS -#define DO_SPEC -#include "s_aalinetemp.h" - - void _swrast_choose_aa_line_function(GLcontext *ctx) @@ -523,14 +506,12 @@ _swrast_choose_aa_line_function(GLcontext *ctx) if (ctx->Visual.rgbMode) { /* RGBA */ if (ctx->Texture._EnabledCoordUnits != 0 - || ctx->FragmentProgram._Current) { - - if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || - ctx->Fog.ColorSumEnabled) - swrast->Line = aa_multitex_spec_line; - else - swrast->Line = aa_tex_rgba_line; - + || ctx->FragmentProgram._Current + || (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) + || ctx->Fog.ColorSumEnabled + || swrast->_FogEnabled) { + swrast->Line = aa_general_rgba_line; } else { swrast->Line = aa_rgba_line; diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 80cec0b31d4..8756f122d09 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -63,9 +63,6 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) #ifdef DO_Z line->span.array->z[i] = (GLuint) solve_plane(fx, fy, line->zPlane); #endif -#ifdef DO_FOG - line->span.array->attribs[FRAG_ATTRIB_FOGC][i][0] = solve_plane(fx, fy, line->fPlane); -#endif #ifdef DO_RGBA line->span.array->rgba[i][RCOMP] = solve_plane_chan(fx, fy, line->rPlane); line->span.array->rgba[i][GCOMP] = solve_plane_chan(fx, fy, line->gPlane); @@ -75,31 +72,31 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) #ifdef DO_INDEX line->span.array->index[i] = (GLint) solve_plane(fx, fy, line->iPlane); #endif -#ifdef DO_SPEC - line->span.array->spec[i][RCOMP] = solve_plane_chan(fx, fy, line->srPlane); - line->span.array->spec[i][GCOMP] = solve_plane_chan(fx, fy, line->sgPlane); - line->span.array->spec[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane); -#endif #if defined(DO_ATTRIBS) ATTRIB_LOOP_BEGIN GLfloat (*attribArray)[4] = line->span.array->attribs[attr]; - GLfloat invQ; - if (ctx->FragmentProgram._Active) { - invQ = 1.0F; - } - else { - invQ = solve_plane_recip(fx, fy, line->vPlane[attr]); - } - attribArray[i][0] = solve_plane(fx, fy, line->sPlane[attr]) * invQ; - attribArray[i][1] = solve_plane(fx, fy, line->tPlane[attr]) * invQ; - attribArray[i][2] = solve_plane(fx, fy, line->uPlane[attr]) * invQ; - if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { + if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0 + && !ctx->FragmentProgram._Active) { + /* texcoord w/ divide by Q */ const GLuint unit = attr - FRAG_ATTRIB_TEX0; + const GLfloat invQ = solve_plane_recip(fx, fy, line->attrPlane[attr][3]); + GLuint c; + for (c = 0; c < 3; c++) { + attribArray[i][c] = solve_plane(fx, fy, line->attrPlane[attr][c]) * invQ; + } line->span.array->lambda[unit][i] - = compute_lambda(line->sPlane[attr], - line->tPlane[attr], invQ, + = compute_lambda(line->attrPlane[attr][0], + line->attrPlane[attr][1], invQ, line->texWidth[attr], line->texHeight[attr]); } + else { + /* non-texture attrib */ + const GLfloat invW = solve_plane_recip(fx, fy, line->wPlane); + GLuint c; + for (c = 0; c < 4; c++) { + attribArray[i][c] = solve_plane(fx, fy, line->attrPlane[attr][c]) * invW; + } + } ATTRIB_LOOP_END #endif @@ -128,10 +125,10 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) /* Init the LineInfo struct */ struct LineInfo line; - line.x0 = v0->win[0]; - line.y0 = v0->win[1]; - line.x1 = v1->win[0]; - line.y1 = v1->win[1]; + line.x0 = v0->attrib[FRAG_ATTRIB_WPOS][0]; + line.y0 = v0->attrib[FRAG_ATTRIB_WPOS][1]; + line.x1 = v1->attrib[FRAG_ATTRIB_WPOS][0]; + line.y1 = v1->attrib[FRAG_ATTRIB_WPOS][1]; line.dx = line.x1 - line.x0; line.dy = line.y1 - line.y0; line.len = SQRTF(line.dx * line.dx + line.dy * line.dy); @@ -148,14 +145,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) #ifdef DO_Z line.span.arrayMask |= SPAN_Z; compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->win[2], v1->win[2], line.zPlane); -#endif -#ifdef DO_FOG - line.span.arrayMask |= SPAN_FOG; - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->attrib[FRAG_ATTRIB_FOGC][0], - v1->attrib[FRAG_ATTRIB_FOGC][0], - line.fPlane); + v0->attrib[FRAG_ATTRIB_WPOS][2], v1->attrib[FRAG_ATTRIB_WPOS][2], line.zPlane); #endif #ifdef DO_RGBA line.span.arrayMask |= SPAN_RGBA; @@ -176,51 +166,32 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) constant_plane(v1->color[ACOMP], line.aPlane); } #endif -#ifdef DO_SPEC - line.span.arrayMask |= SPAN_SPEC; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->specular[RCOMP], v1->specular[RCOMP], line.srPlane); - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->specular[GCOMP], v1->specular[GCOMP], line.sgPlane); - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->specular[BCOMP], v1->specular[BCOMP], line.sbPlane); - } - else { - constant_plane(v1->specular[RCOMP], line.srPlane); - constant_plane(v1->specular[GCOMP], line.sgPlane); - constant_plane(v1->specular[BCOMP], line.sbPlane); - } -#endif #ifdef DO_INDEX line.span.arrayMask |= SPAN_INDEX; if (ctx->Light.ShadeModel == GL_SMOOTH) { compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->index, v1->index, line.iPlane); + v0->attrib[FRAG_ATTRIB_CI][0], + v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane); } else { - constant_plane(v1->index, line.iPlane); + constant_plane(v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane); } #endif #if defined(DO_ATTRIBS) { - const GLfloat invW0 = v0->win[3]; - const GLfloat invW1 = v1->win[3]; - line.span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA | SPAN_VARYING); + const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; + const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3]; + line.span.arrayMask |= SPAN_LAMBDA; + compute_plane(line.x0, line.y0, line.x1, line.y1, invW0, invW1, line.wPlane); ATTRIB_LOOP_BEGIN - const GLfloat s0 = v0->attrib[attr][0] * invW0; - const GLfloat s1 = v1->attrib[attr][0] * invW1; - const GLfloat t0 = v0->attrib[attr][1] * invW0; - const GLfloat t1 = v1->attrib[attr][1] * invW1; - const GLfloat r0 = v0->attrib[attr][2] * invW0; - const GLfloat r1 = v1->attrib[attr][2] * invW1; - const GLfloat q0 = v0->attrib[attr][3] * invW0; - const GLfloat q1 = v1->attrib[attr][3] * invW1; - compute_plane(line.x0, line.y0, line.x1, line.y1, s0, s1, line.sPlane[attr]); - compute_plane(line.x0, line.y0, line.x1, line.y1, t0, t1, line.tPlane[attr]); - compute_plane(line.x0, line.y0, line.x1, line.y1, r0, r1, line.uPlane[attr]); - compute_plane(line.x0, line.y0, line.x1, line.y1, q0, q1, line.vPlane[attr]); - if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { + GLuint c; + for (c = 0; c < 4; c++) { + const GLfloat a0 = v0->attrib[attr][c] * invW0; + const GLfloat a1 = v1->attrib[attr][c] * invW1; + compute_plane(line.x0, line.y0, line.x1, line.y1, a0, a1, line.attrPlane[attr][c]); + } + line.span.arrayAttribs |= (1 << attr); + if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) { const GLuint u = attr - FRAG_ATTRIB_TEX0; const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel]; @@ -286,9 +257,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) #undef DO_Z -#undef DO_FOG #undef DO_RGBA #undef DO_INDEX -#undef DO_SPEC #undef DO_ATTRIBS #undef NAME diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 0d95f06a9de..66891f9fec8 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -144,6 +144,19 @@ solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4]) } +static INLINE GLfloat +plane_dx(const GLfloat plane[4]) +{ + return -plane[0] / plane[2]; +} + +static INLINE GLfloat +plane_dy(const GLfloat plane[4]) +{ + return -plane[1] / plane[2]; +} + + /* * Compute how much (area) of the given pixel is inside the triangle. @@ -337,7 +350,6 @@ compute_coveragei(const GLfloat v0[3], const GLfloat v1[3], } - static void rgba_aa_tri(GLcontext *ctx, const SWvertex *v0, @@ -345,7 +357,6 @@ rgba_aa_tri(GLcontext *ctx, const SWvertex *v2) { #define DO_Z -#define DO_FOG #define DO_RGBA #include "s_aatritemp.h" } @@ -358,72 +369,21 @@ index_aa_tri(GLcontext *ctx, const SWvertex *v2) { #define DO_Z -#define DO_FOG -#define DO_INDEX -#include "s_aatritemp.h" -} - - -/* - * Compute mipmap level of detail. - * XXX we should really include the R coordinate in this computation - * in order to do 3-D texture mipmapping. - */ -static INLINE GLfloat -compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4], - const GLfloat qPlane[4], GLfloat cx, GLfloat cy, - GLfloat invQ, GLfloat texWidth, GLfloat texHeight) -{ - const GLfloat s = solve_plane(cx, cy, sPlane); - const GLfloat t = solve_plane(cx, cy, tPlane); - const GLfloat invQ_x1 = solve_plane_recip(cx+1.0F, cy, qPlane); - const GLfloat invQ_y1 = solve_plane_recip(cx, cy+1.0F, qPlane); - const GLfloat s_x1 = s - sPlane[0] / sPlane[2]; - const GLfloat s_y1 = s - sPlane[1] / sPlane[2]; - const GLfloat t_x1 = t - tPlane[0] / tPlane[2]; - const GLfloat t_y1 = t - tPlane[1] / tPlane[2]; - GLfloat dsdx = s_x1 * invQ_x1 - s * invQ; - GLfloat dsdy = s_y1 * invQ_y1 - s * invQ; - GLfloat dtdx = t_x1 * invQ_x1 - t * invQ; - GLfloat dtdy = t_y1 * invQ_y1 - t * invQ; - GLfloat maxU, maxV, rho, lambda; - dsdx = FABSF(dsdx); - dsdy = FABSF(dsdy); - dtdx = FABSF(dtdx); - dtdy = FABSF(dtdy); - maxU = MAX2(dsdx, dsdy) * texWidth; - maxV = MAX2(dtdx, dtdy) * texHeight; - rho = MAX2(maxU, maxV); - lambda = LOG2(rho); - return lambda; -} - - -static void -tex_aa_tri(GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ -#define DO_Z -#define DO_FOG -#define DO_RGBA #define DO_ATTRIBS +#define DO_INDEX #include "s_aatritemp.h" } static void -spec_tex_aa_tri(GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) +general_aa_tri(GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) { #define DO_Z -#define DO_FOG #define DO_RGBA #define DO_ATTRIBS -#define DO_SPEC #include "s_aatritemp.h" } @@ -436,16 +396,15 @@ spec_tex_aa_tri(GLcontext *ctx, void _swrast_set_aa_triangle_function(GLcontext *ctx) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); + ASSERT(ctx->Polygon.SmoothFlag); if (ctx->Texture._EnabledCoordUnits != 0 - || ctx->FragmentProgram._Current) { - if (NEED_SECONDARY_COLOR(ctx)) { - SWRAST_CONTEXT(ctx)->Triangle = spec_tex_aa_tri; - } - else { - SWRAST_CONTEXT(ctx)->Triangle = tex_aa_tri; - } + || ctx->FragmentProgram._Current + || swrast->_FogEnabled + || NEED_SECONDARY_COLOR(ctx)) { + SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri; } else if (ctx->Visual.rgbMode) { SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri; diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 4162ed68532..34a2305b393 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -35,16 +35,15 @@ * DO_Z - if defined, compute Z values * DO_RGBA - if defined, compute RGBA values * DO_INDEX - if defined, compute color index values - * DO_SPEC - if defined, compute specular RGB values * DO_ATTRIBS - if defined, compute texcoords, varying, etc. */ /*void triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/ { const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLfloat *p0 = v0->win; - const GLfloat *p1 = v1->win; - const GLfloat *p2 = v2->win; + const GLfloat *p0 = v0->attrib[FRAG_ATTRIB_WPOS]; + const GLfloat *p1 = v1->attrib[FRAG_ATTRIB_WPOS]; + const GLfloat *p2 = v2->attrib[FRAG_ATTRIB_WPOS]; const SWvertex *vMin, *vMid, *vMax; GLint iyMin, iyMax; GLfloat yMin, yMax; @@ -56,27 +55,15 @@ #ifdef DO_Z GLfloat zPlane[4]; #endif -#ifdef DO_FOG - GLfloat fogPlane[4]; -#else - GLfloat *fog = NULL; -#endif #ifdef DO_RGBA GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; #endif #ifdef DO_INDEX GLfloat iPlane[4]; #endif -#ifdef DO_SPEC - GLfloat srPlane[4], sgPlane[4], sbPlane[4]; -#endif #if defined(DO_ATTRIBS) - GLfloat sPlane[FRAG_ATTRIB_MAX][4]; /* texture S */ - GLfloat tPlane[FRAG_ATTRIB_MAX][4]; /* texture T */ - GLfloat uPlane[FRAG_ATTRIB_MAX][4]; /* texture R */ - GLfloat vPlane[FRAG_ATTRIB_MAX][4]; /* texture Q */ - GLfloat texWidth[FRAG_ATTRIB_MAX]; - GLfloat texHeight[FRAG_ATTRIB_MAX]; + GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; + GLfloat wPlane[4]; /* win[3] */ #endif GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign; @@ -86,9 +73,9 @@ /* determine bottom to top order of vertices */ { - GLfloat y0 = v0->win[1]; - GLfloat y1 = v1->win[1]; - GLfloat y2 = v2->win[1]; + GLfloat y0 = v0->attrib[FRAG_ATTRIB_WPOS][1]; + GLfloat y1 = v1->attrib[FRAG_ATTRIB_WPOS][1]; + GLfloat y2 = v2->attrib[FRAG_ATTRIB_WPOS][1]; if (y0 <= y1) { if (y1 <= y2) { vMin = v0; vMid = v1; vMax = v2; /* y0<=y1<=y2 */ @@ -113,12 +100,12 @@ } } - majDx = vMax->win[0] - vMin->win[0]; - majDy = vMax->win[1] - vMin->win[1]; + majDx = vMax->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0]; + majDy = vMax->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1]; { - const GLfloat botDx = vMid->win[0] - vMin->win[0]; - const GLfloat botDy = vMid->win[1] - vMin->win[1]; + const GLfloat botDx = vMid->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0]; + const GLfloat botDy = vMid->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1]; const GLfloat area = majDx * botDy - botDx * majDy; /* Do backface culling */ if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area)) @@ -135,14 +122,6 @@ compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane); span.arrayMask |= SPAN_Z; #endif -#ifdef DO_FOG - compute_plane(p0, p1, p2, - v0->attrib[FRAG_ATTRIB_FOGC][0], - v1->attrib[FRAG_ATTRIB_FOGC][0], - v2->attrib[FRAG_ATTRIB_FOGC][0], - fogPlane); - span.arrayMask |= SPAN_FOG; -#endif #ifdef DO_RGBA if (ctx->Light.ShadeModel == GL_SMOOTH) { compute_plane(p0, p1, p2, v0->color[RCOMP], v1->color[RCOMP], v2->color[RCOMP], rPlane); @@ -160,62 +139,43 @@ #endif #ifdef DO_INDEX if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(p0, p1, p2, (GLfloat) v0->index, - v1->index, v2->index, iPlane); + compute_plane(p0, p1, p2, (GLfloat) v0->attrib[FRAG_ATTRIB_CI][0], + v1->attrib[FRAG_ATTRIB_CI][0], v2->attrib[FRAG_ATTRIB_CI][0], iPlane); } else { - constant_plane(v2->index, iPlane); + constant_plane(v2->attrib[FRAG_ATTRIB_CI][0], iPlane); } span.arrayMask |= SPAN_INDEX; #endif -#ifdef DO_SPEC - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(p0, p1, p2, v0->specular[RCOMP], v1->specular[RCOMP], v2->specular[RCOMP], srPlane); - compute_plane(p0, p1, p2, v0->specular[GCOMP], v1->specular[GCOMP], v2->specular[GCOMP], sgPlane); - compute_plane(p0, p1, p2, v0->specular[BCOMP], v1->specular[BCOMP], v2->specular[BCOMP], sbPlane); - } - else { - constant_plane(v2->specular[RCOMP], srPlane); - constant_plane(v2->specular[GCOMP], sgPlane); - constant_plane(v2->specular[BCOMP], sbPlane); - } - span.arrayMask |= SPAN_SPEC; -#endif #if defined(DO_ATTRIBS) { - const GLfloat invW0 = v0->win[3]; - const GLfloat invW1 = v1->win[3]; - const GLfloat invW2 = v2->win[3]; + const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; + const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3]; + const GLfloat invW2 = v2->attrib[FRAG_ATTRIB_WPOS][3]; + compute_plane(p0, p1, p2, invW0, invW1, invW2, wPlane); + span.attrStepX[FRAG_ATTRIB_WPOS][3] = plane_dx(wPlane); + span.attrStepY[FRAG_ATTRIB_WPOS][3] = plane_dy(wPlane); ATTRIB_LOOP_BEGIN - const GLfloat s0 = v0->attrib[attr][0] * invW0; - const GLfloat s1 = v1->attrib[attr][0] * invW1; - const GLfloat s2 = v2->attrib[attr][0] * invW2; - const GLfloat t0 = v0->attrib[attr][1] * invW0; - const GLfloat t1 = v1->attrib[attr][1] * invW1; - const GLfloat t2 = v2->attrib[attr][1] * invW2; - const GLfloat r0 = v0->attrib[attr][2] * invW0; - const GLfloat r1 = v1->attrib[attr][2] * invW1; - const GLfloat r2 = v2->attrib[attr][2] * invW2; - const GLfloat q0 = v0->attrib[attr][3] * invW0; - const GLfloat q1 = v1->attrib[attr][3] * invW1; - const GLfloat q2 = v2->attrib[attr][3] * invW2; - compute_plane(p0, p1, p2, s0, s1, s2, sPlane[attr]); - compute_plane(p0, p1, p2, t0, t1, t2, tPlane[attr]); - compute_plane(p0, p1, p2, r0, r1, r2, uPlane[attr]); - compute_plane(p0, p1, p2, q0, q1, q2, vPlane[attr]); - if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { - const GLuint u = attr - FRAG_ATTRIB_TEX0; - const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; - const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel]; - texWidth[attr] = (GLfloat) texImage->Width; - texHeight[attr] = (GLfloat) texImage->Height; + GLuint c; + if (swrast->_InterpMode[attr] == GL_FLAT) { + for (c = 0; c < 4; c++) { + constant_plane(v2->attrib[attr][c] * invW2, attrPlane[attr][c]); + } } else { - texWidth[attr] = texHeight[attr] = 1.0; + for (c = 0; c < 4; c++) { + const GLfloat a0 = v0->attrib[attr][c] * invW0; + const GLfloat a1 = v1->attrib[attr][c] * invW1; + const GLfloat a2 = v2->attrib[attr][c] * invW2; + compute_plane(p0, p1, p2, a0, a1, a2, attrPlane[attr][c]); + } + } + for (c = 0; c < 4; c++) { + span.attrStepX[attr][c] = plane_dx(attrPlane[attr][c]); + span.attrStepY[attr][c] = plane_dy(attrPlane[attr][c]); } ATTRIB_LOOP_END } - span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA | SPAN_VARYING); #endif /* Begin bottom-to-top scan over the triangle. @@ -224,16 +184,16 @@ * edges, stopping when we find that coverage = 0. If the long edge * is on the left we scan left-to-right. Else, we scan right-to-left. */ - yMin = vMin->win[1]; - yMax = vMax->win[1]; + yMin = vMin->attrib[FRAG_ATTRIB_WPOS][1]; + yMax = vMax->attrib[FRAG_ATTRIB_WPOS][1]; iyMin = (GLint) yMin; iyMax = (GLint) yMax + 1; if (ltor) { /* scan left to right */ - const GLfloat *pMin = vMin->win; - const GLfloat *pMid = vMid->win; - const GLfloat *pMax = vMax->win; + const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS]; + const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS]; + const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS]; const GLfloat dxdy = majDx / majDy; const GLfloat xAdj = dxdy < 0.0F ? -dxdy : 0.0F; GLfloat x = pMin[0] - (yMin - iyMin) * dxdy; @@ -253,6 +213,18 @@ /* enter interior of triangle */ ix = startX; + +#if defined(DO_ATTRIBS) + /* compute attributes at left-most fragment */ + span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5, iy + 0.5, wPlane); + ATTRIB_LOOP_BEGIN + GLuint c; + for (c = 0; c < 4; c++) { + span.attrStart[attr][c] = solve_plane(ix + 0.5, iy + 0.5, attrPlane[attr][c]); + } + ATTRIB_LOOP_END +#endif + count = 0; while (coverage > 0.0F) { /* (cx,cy) = center of fragment */ @@ -266,9 +238,6 @@ #ifdef DO_Z array->z[count] = (GLuint) solve_plane(cx, cy, zPlane); #endif -#ifdef DO_FOG - array->attribs[FRAG_ATTRIB_FOGC][count][0] = solve_plane(cx, cy, fogPlane); -#endif #ifdef DO_RGBA array->rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane); array->rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane); @@ -277,25 +246,6 @@ #endif #ifdef DO_INDEX array->index[count] = (GLint) solve_plane(cx, cy, iPlane); -#endif -#ifdef DO_SPEC - array->spec[count][RCOMP] = solve_plane_chan(cx, cy, srPlane); - array->spec[count][GCOMP] = solve_plane_chan(cx, cy, sgPlane); - array->spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane); -#endif -#if defined(DO_ATTRIBS) - ATTRIB_LOOP_BEGIN - GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]); - array->attribs[attr][count][0] = solve_plane(cx, cy, sPlane[attr]) * invQ; - array->attribs[attr][count][1] = solve_plane(cx, cy, tPlane[attr]) * invQ; - array->attribs[attr][count][2] = solve_plane(cx, cy, uPlane[attr]) * invQ; - if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { - const GLuint unit = attr - FRAG_ATTRIB_TEX0; - array->lambda[unit][count] = compute_lambda(sPlane[attr], tPlane[attr], - vPlane[attr], cx, cy, invQ, - texWidth[attr], texHeight[attr]); - } - ATTRIB_LOOP_END #endif ix++; count++; @@ -308,7 +258,6 @@ span.x = startX; span.y = iy; span.end = (GLuint) ix - (GLuint) startX; - ASSERT(span.interpMask == 0); #if defined(DO_RGBA) _swrast_write_rgba_span(ctx, &span); #else @@ -318,9 +267,9 @@ } else { /* scan right to left */ - const GLfloat *pMin = vMin->win; - const GLfloat *pMid = vMid->win; - const GLfloat *pMax = vMax->win; + const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS]; + const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS]; + const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS]; const GLfloat dxdy = majDx / majDy; const GLfloat xAdj = dxdy > 0 ? dxdy : 0.0F; GLfloat x = pMin[0] - (yMin - iyMin) * dxdy; @@ -358,9 +307,6 @@ #ifdef DO_Z array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane); #endif -#ifdef DO_FOG - array->attribs[FRAG_ATTRIB_FOGC][ix][0] = solve_plane(cx, cy, fogPlane); -#endif #ifdef DO_RGBA array->rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane); array->rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane); @@ -369,34 +315,23 @@ #endif #ifdef DO_INDEX array->index[ix] = (GLint) solve_plane(cx, cy, iPlane); -#endif -#ifdef DO_SPEC - array->spec[ix][RCOMP] = solve_plane_chan(cx, cy, srPlane); - array->spec[ix][GCOMP] = solve_plane_chan(cx, cy, sgPlane); - array->spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane); -#endif -#if defined(DO_ATTRIBS) - ATTRIB_LOOP_BEGIN - GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]); - array->attribs[attr][ix][0] = solve_plane(cx, cy, sPlane[attr]) * invQ; - array->attribs[attr][ix][1] = solve_plane(cx, cy, tPlane[attr]) * invQ; - array->attribs[attr][ix][2] = solve_plane(cx, cy, uPlane[attr]) * invQ; - if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { - const GLuint unit = attr - FRAG_ATTRIB_TEX0; - array->lambda[unit][ix] = compute_lambda(sPlane[attr], - tPlane[attr], - vPlane[attr], - cx, cy, invQ, - texWidth[attr], - texHeight[attr]); - } - ATTRIB_LOOP_END #endif ix--; count++; coverage = compute_coveragef(pMin, pMax, pMid, ix, iy); } +#if defined(DO_ATTRIBS) + /* compute attributes at left-most fragment */ + span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5, iy + 0.5, wPlane); + ATTRIB_LOOP_BEGIN + GLuint c; + for (c = 0; c < 4; c++) { + span.attrStart[attr][c] = solve_plane(ix + 1.5, iy + 0.5, attrPlane[attr][c]); + } + ATTRIB_LOOP_END +#endif + if (startX <= ix) continue; @@ -410,48 +345,22 @@ SWspanarrays *array = span.array; GLint j; for (j = 0; j < (GLint) n; j++) { + array->coverage[j] = array->coverage[j + left]; #ifdef DO_RGBA COPY_CHAN4(array->rgba[j], array->rgba[j + left]); #endif -#ifdef DO_SPEC - COPY_CHAN4(array->spec[j], array->spec[j + left]); -#endif #ifdef DO_INDEX array->index[j] = array->index[j + left]; #endif #ifdef DO_Z array->z[j] = array->z[j + left]; #endif -#ifdef DO_FOG - array->attribs[FRAG_ATTRIB_FOGC][j][0] - = array->attribs[FRAG_ATTRIB_FOGC][j + left][0]; -#endif -#if defined(DO_ATTRIBS) - array->lambda[0][j] = array->lambda[0][j + left]; -#endif - array->coverage[j] = array->coverage[j + left]; } } -#ifdef DO_ATTRIBS - /* shift texcoords, varying */ - { - SWspanarrays *array = span.array; - ATTRIB_LOOP_BEGIN - GLint j; - for (j = 0; j < (GLint) n; j++) { - array->attribs[attr][j][0] = array->attribs[attr][j + left][0]; - array->attribs[attr][j][1] = array->attribs[attr][j + left][1]; - array->attribs[attr][j][2] = array->attribs[attr][j + left][2]; - /*array->lambda[unit][j] = array->lambda[unit][j + left];*/ - } - ATTRIB_LOOP_END - } -#endif span.x = left; span.y = iy; span.end = n; - ASSERT(span.interpMask == 0); #if defined(DO_RGBA) _swrast_write_rgba_span(ctx, &span); #else @@ -462,30 +371,8 @@ } -#ifdef DO_Z #undef DO_Z -#endif - -#ifdef DO_FOG -#undef DO_FOG -#endif - -#ifdef DO_RGBA #undef DO_RGBA -#endif - -#ifdef DO_INDEX #undef DO_INDEX -#endif - -#ifdef DO_SPEC -#undef DO_SPEC -#endif - -#ifdef DO_ATTRIBS #undef DO_ATTRIBS -#endif - -#ifdef DO_OCCLUSION_TEST #undef DO_OCCLUSION_TEST -#endif diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c index af8a6baddc2..3c55d3e9e33 100644 --- a/src/mesa/swrast/s_alpha.c +++ b/src/mesa/swrast/s_alpha.c @@ -111,13 +111,13 @@ _swrast_alpha_test(const GLcontext *ctx, SWspan *span) if (span->arrayMask & SPAN_RGBA) { /* Use array's alpha values */ if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + GLubyte (*rgba)[4] = span->array->rgba8; GLubyte ref; CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef); ALPHA_TEST(rgba[i][ACOMP], ;); } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; + GLushort (*rgba)[4] = span->array->rgba16; GLushort ref; CLAMPED_FLOAT_TO_USHORT(ref, ctx->Color.AlphaRef); ALPHA_TEST(rgba[i][ACOMP], ;); diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 4c237052457..563b5fe602c 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -83,15 +83,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, _swrast_validate_derived( ctx ); INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY); - - _swrast_span_default_color(ctx, &span); - _swrast_span_default_secondary_color(ctx, &span); - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (ctx->Texture._EnabledCoordUnits) - _swrast_span_default_texcoords(ctx, &span); + _swrast_span_default_attribs(ctx, &span); for (row = 0; row < height; row++) { const GLubyte *src = (const GLubyte *) _mesa_image_address2d(unpack, @@ -189,20 +181,13 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, _swrast_validate_derived( ctx ); INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_MASK); + _swrast_span_default_attribs(ctx, &span); /*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */ span.x = px; span.y = py; /*span.end = width;*/ - _swrast_span_default_color(ctx, &span); - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (ctx->Texture._EnabledCoordUnits) - _swrast_span_default_texcoords(ctx, &span); - for (row=0; rowColor.AlphaEnabled) { + /* alpha test depends on post-texture/shader colors */ + swrast->_DeferredTexture = GL_FALSE; + } + else { + const struct gl_fragment_program *fprog + = ctx->FragmentProgram._Current; + if (fprog && (fprog->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR))) { + /* Z comes from fragment program/shader */ + swrast->_DeferredTexture = GL_FALSE; + } + else if (ctx->Query.CurrentOcclusionObject) { + /* occlusion query depends on shader discard/kill results */ + swrast->_DeferredTexture = GL_FALSE; + } + else { + swrast->_DeferredTexture = GL_TRUE; + } + } +} + + /** * Update swrast->_FogColor and swrast->_FogEnable values. */ @@ -324,7 +355,6 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) swrast->Line = _swrast_add_spec_terms_line; } - swrast->Line( ctx, v0, v1 ); } @@ -505,50 +535,58 @@ _swrast_update_texture_samplers(GLcontext *ctx) /** - * Update swrast->_ActiveAttribs and swrast->_NumActiveAttribs + * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs, swrast->_ActiveAtttribMask. */ static void _swrast_update_fragment_attribs(GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint attribsMask; - + + /* + * Compute _ActiveAttribsMask = which fragment attributes are needed. + */ if (ctx->FragmentProgram._Current) { + /* fragment program/shader */ attribsMask = ctx->FragmentProgram._Current->Base.InputsRead; } + else if (ctx->ATIFragmentShader._Enabled) { + attribsMask = ~0; /* XXX fix me */ + } else { - GLuint u; + /* fixed function */ attribsMask = 0x0; -#if 0 /* not yet */ - if (ctx->Depth.Test) - attribsMask |= FRAG_BIT_WPOS; - if (NEED_SECONDARY_COLOR(ctx)) - attribsMask |= FRAG_BIT_COL1; +#if CHAN_TYPE == GL_FLOAT + attribsMask |= FRAG_BIT_COL0; #endif + + if (ctx->Fog.ColorSumEnabled || + (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { + attribsMask |= FRAG_BIT_COL1; + } + if (swrast->_FogEnabled) attribsMask |= FRAG_BIT_FOGC; - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - if (ctx->Texture.Unit[u]._ReallyEnabled) { - attribsMask |= FRAG_BIT_TEX(u); - } - } + attribsMask |= (ctx->Texture._EnabledUnits << FRAG_ATTRIB_TEX0); } - /* don't want to interpolate these generic attribs just yet */ - /* XXX temporary */ - attribsMask &= ~(FRAG_BIT_WPOS | - FRAG_BIT_COL0 | - FRAG_BIT_COL1 | - FRAG_BIT_FOGC); + swrast->_ActiveAttribMask = attribsMask; /* Update _ActiveAttribs[] list */ { GLuint i, num = 0; for (i = 0; i < FRAG_ATTRIB_MAX; i++) { - if (attribsMask & (1 << i)) + if (attribsMask & (1 << i)) { swrast->_ActiveAttribs[num++] = i; + /* how should this attribute be interpolated? */ + if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1) + swrast->_InterpMode[i] = ctx->Light.ShadeModel; + else + swrast->_InterpMode[i] = GL_SMOOTH; + } } swrast->_NumActiveAttribs = num; } @@ -627,14 +665,19 @@ _swrast_validate_derived( GLcontext *ctx ) if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) _swrast_update_texture_samplers( ctx ); - if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) - _swrast_validate_texture_images( ctx ); + if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) { + _swrast_validate_texture_images(ctx); + if (swrast->NewState & (_NEW_COLOR)) { + _swrast_update_deferred_texture(ctx); + } + } if (swrast->NewState & _SWRAST_NEW_RASTERMASK) _swrast_update_rasterflags( ctx ); if (swrast->NewState & (_NEW_DEPTH | _NEW_FOG | + _NEW_LIGHT | _NEW_PROGRAM | _NEW_TEXTURE)) _swrast_update_fragment_attribs(ctx); @@ -787,14 +830,11 @@ _swrast_CreateContext( GLcontext *ctx ) } swrast->SpanArrays->ChanType = CHAN_TYPE; #if CHAN_TYPE == GL_UNSIGNED_BYTE - swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz1.rgba; - swrast->SpanArrays->spec = swrast->SpanArrays->color.sz1.spec; + swrast->SpanArrays->rgba = swrast->SpanArrays->rgba8; #elif CHAN_TYPE == GL_UNSIGNED_SHORT - swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz2.rgba; - swrast->SpanArrays->spec = swrast->SpanArrays->color.sz2.spec; + swrast->SpanArrays->rgba = swrast->SpanArrays->rgba16; #else swrast->SpanArrays->rgba = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0]; - swrast->SpanArrays->spec = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL1]; #endif /* init point span buffer */ @@ -896,7 +936,10 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ) if (SWRAST_DEBUG_VERTICES) { _mesa_debug(ctx, "win %f %f %f %f\n", - v->win[0], v->win[1], v->win[2], v->win[3]); + v->attrib[FRAG_ATTRIB_WPOS][0], + v->attrib[FRAG_ATTRIB_WPOS][1], + v->attrib[FRAG_ATTRIB_WPOS][2], + v->attrib[FRAG_ATTRIB_WPOS][3]); for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) if (ctx->Texture.Unit[i]._ReallyEnabled) @@ -909,18 +952,17 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ) #if CHAN_TYPE == GL_FLOAT _mesa_debug(ctx, "color %f %f %f %f\n", v->color[0], v->color[1], v->color[2], v->color[3]); - _mesa_debug(ctx, "spec %f %f %f %f\n", - v->specular[0], v->specular[1], - v->specular[2], v->specular[3]); #else _mesa_debug(ctx, "color %d %d %d %d\n", v->color[0], v->color[1], v->color[2], v->color[3]); - _mesa_debug(ctx, "spec %d %d %d %d\n", - v->specular[0], v->specular[1], - v->specular[2], v->specular[3]); #endif + _mesa_debug(ctx, "spec %g %g %g %g\n", + v->attrib[FRAG_ATTRIB_COL1][0], + v->attrib[FRAG_ATTRIB_COL1][1], + v->attrib[FRAG_ATTRIB_COL1][2], + v->attrib[FRAG_ATTRIB_COL1][3]); _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]); - _mesa_debug(ctx, "index %d\n", v->index); + _mesa_debug(ctx, "index %d\n", v->attrib[FRAG_ATTRIB_CI][0]); _mesa_debug(ctx, "pointsize %f\n", v->pointSize); _mesa_debug(ctx, "\n"); } diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index c8333b8e0a1..f118eb92ca4 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -132,6 +132,7 @@ typedef struct GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ GLboolean _AnyTextureCombine; GLboolean _FogEnabled; + GLboolean _DeferredTexture; GLenum _FogMode; /* either GL_FOG_MODE or fragment program's fog mode */ /** Multiple render targets */ @@ -140,8 +141,12 @@ typedef struct /** List/array of the fragment attributes to interpolate */ GLuint _ActiveAttribs[FRAG_ATTRIB_MAX]; + /** Same info, but as a bitmask */ + GLbitfield _ActiveAttribMask; /** Number of fragment attributes to interpolate */ GLuint _NumActiveAttribs; + /** Indicates how each attrib is to be interpolated (lines/tris) */ + GLenum _InterpMode[FRAG_ATTRIB_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */ /* Accum buffer temporaries. */ diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 012839cb88a..53e584b3b6b 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -94,7 +94,6 @@ static void copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLint row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; const GLbitfield transferOps = ctx->_ImageTransferState; @@ -104,12 +103,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, SWspan span; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_attribs(ctx, &span); /* allocate space for GLfloat image */ tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); @@ -194,7 +188,6 @@ static void copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLfloat *tmpImage, *p; GLint sy, dy, stepy, row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; @@ -240,11 +233,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_attribs(ctx, &span); if (overlapping) { tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); @@ -313,7 +302,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint *tmpImage,*p; GLint sy, dy, stepy; GLint j; @@ -327,6 +315,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX); + _swrast_span_default_attribs(ctx, &span); if (ctx->DrawBuffer == ctx->ReadBuffer) { overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, @@ -350,11 +339,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, stepy = 1; } - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (overlapping) { GLint ssy = sy; tmpImage = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); @@ -450,7 +434,6 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_framebuffer *fb = ctx->ReadBuffer; struct gl_renderbuffer *readRb = fb->_DepthBuffer; GLfloat *p, *tmpImage; @@ -466,6 +449,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); + _swrast_span_default_attribs(ctx, &span); if (ctx->DrawBuffer == ctx->ReadBuffer) { overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, @@ -489,11 +473,6 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, stepy = 1; } - _swrast_span_default_color(ctx, &span); - _swrast_span_default_secondary_color(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (overlapping) { GLint ssy = sy; tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index cd5b7bc2935..d971d90fb9a 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -71,13 +71,7 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, } INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - _swrast_span_default_secondary_color(ctx, &span); - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (ctx->Texture._EnabledCoordUnits) - _swrast_span_default_texcoords(ctx, &span); + _swrast_span_default_attribs(ctx, &span); /* copy input params since clipping may change them */ unpack = *userUnpack; @@ -274,9 +268,9 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, for (row = 0; row < drawHeight; row++) { ASSERT(drawWidth <= MAX_WIDTH); _mesa_map_ci8_to_rgba8(ctx, drawWidth, src, - span.array->color.sz1.rgba); + span.array->rgba8); rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->color.sz1.rgba, NULL); + span.array->rgba8, NULL); src += unpack.RowLength; destY += yStep; } @@ -287,12 +281,12 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, for (row = 0; row < drawHeight; row++) { ASSERT(drawWidth <= MAX_WIDTH); _mesa_map_ci8_to_rgba8(ctx, drawWidth, src, - span.array->color.sz1.rgba); + span.array->rgba8); span.x = destX; span.y = destY; span.end = drawWidth; _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, - span.array->color.sz1.rgba); + span.array->rgba8); src += unpack.RowLength; destY++; } @@ -333,18 +327,13 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLint imgX = x, imgY = y; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLint row, skipPixels; SWspan span; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX); - - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); + _swrast_span_default_attribs(ctx, &span); /* * General solution @@ -433,20 +422,13 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLboolean scaleOrBias = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; SWspan span; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); - - _swrast_span_default_color(ctx, &span); - _swrast_span_default_secondary_color(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (ctx->Texture._EnabledCoordUnits) - _swrast_span_default_texcoords(ctx, &span); + _swrast_span_default_attribs(ctx, &span); if (type == GL_UNSIGNED_SHORT && ctx->DrawBuffer->Visual.depthBits == 16 @@ -550,7 +532,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLint imgX = x, imgY = y; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLfloat *convImage = NULL; @@ -562,14 +543,8 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, unpack, pixels)) return; - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - _swrast_span_default_secondary_color(ctx, &span); - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (ctx->Texture._EnabledCoordUnits) - _swrast_span_default_texcoords(ctx, &span); + INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA); + _swrast_span_default_attribs(ctx, &span); if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { /* Convolution has to be handled specially. We'll create an diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 3a15d0c3675..606afc63ba9 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -42,17 +42,17 @@ feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv) GLfloat color[4]; const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0]; - win[0] = v->win[0]; - win[1] = v->win[1]; - win[2] = v->win[2] / ctx->DrawBuffer->_DepthMaxF; - win[3] = 1.0F / v->win[3]; + win[0] = v->attrib[FRAG_ATTRIB_WPOS][0]; + win[1] = v->attrib[FRAG_ATTRIB_WPOS][1]; + win[2] = v->attrib[FRAG_ATTRIB_WPOS][2] / ctx->DrawBuffer->_DepthMaxF; + win[3] = 1.0F / v->attrib[FRAG_ATTRIB_WPOS][3]; color[0] = CHAN_TO_FLOAT(pv->color[0]); color[1] = CHAN_TO_FLOAT(pv->color[1]); color[2] = CHAN_TO_FLOAT(pv->color[2]); color[3] = CHAN_TO_FLOAT(pv->color[3]); - _mesa_feedback_vertex(ctx, win, color, (GLfloat) v->index, vtc); + _mesa_feedback_vertex(ctx, win, color, v->attrib[FRAG_ATTRIB_CI][0], vtc); } @@ -120,9 +120,10 @@ _swrast_select_triangle(GLcontext *ctx, const SWvertex *v0, { if (_swrast_culltriangle(ctx, v0, v1, v2)) { const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; - _mesa_update_hitflag(ctx, v0->win[2] * zs); - _mesa_update_hitflag(ctx, v1->win[2] * zs); - _mesa_update_hitflag(ctx, v2->win[2] * zs); + + _mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs ); + _mesa_update_hitflag( ctx, v1->attrib[FRAG_ATTRIB_WPOS][2] * zs ); + _mesa_update_hitflag( ctx, v2->attrib[FRAG_ATTRIB_WPOS][2] * zs ); } } @@ -131,8 +132,8 @@ void _swrast_select_line(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) { const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; - _mesa_update_hitflag(ctx, v0->win[2] * zs); - _mesa_update_hitflag(ctx, v1->win[2] * zs); + _mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs ); + _mesa_update_hitflag( ctx, v1->attrib[FRAG_ATTRIB_WPOS][2] * zs ); } @@ -140,5 +141,5 @@ void _swrast_select_point(GLcontext *ctx, const SWvertex *v) { const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; - _mesa_update_hitflag(ctx, v->win[2] * zs); + _mesa_update_hitflag( ctx, v->attrib[FRAG_ATTRIB_WPOS][2] * zs ); } diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 433fc4a4d0c..ed47964a66a 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -65,30 +65,92 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z) } +#define LINEAR_FOG(f, coord) f = (fogEnd - coord) * fogScale + +#define EXP_FOG(f, coord) f = EXPF(density * coord) + +#define EXP2_FOG(f, coord) \ +do { \ + GLfloat tmp = negDensitySquared * coord * coord; \ + if (tmp < FLT_MIN_10_EXP) \ + tmp = FLT_MIN_10_EXP; \ + f = EXPF(tmp); \ + } while(0) + + +#define BLEND_FOG(f, coord) f = coord + + + /** * Template code for computing fog blend factor and applying it to colors. * \param TYPE either GLubyte, GLushort or GLfloat. * \param COMPUTE_F code to compute the fog blend factor, f. */ -#define FOG_LOOP(TYPE, COMPUTE_F) \ -do { \ - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \ - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \ - const GLfloat wStep = haveW ? span->attrStepX[FRAG_ATTRIB_WPOS][3] : 0.0F;\ - GLfloat w = haveW ? span->attrStart[FRAG_ATTRIB_WPOS][3] : 1.0F; \ - GLuint i; \ - for (i = 0; i < span->end; i++) { \ - GLfloat f, oneMinusF; \ - COMPUTE_F; \ - f = CLAMP(f, 0.0F, 1.0F); \ - oneMinusF = 1.0F - f; \ - rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \ - rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \ - rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \ - fogCoord += fogStep; \ - w += wStep; \ - } \ -} while (0) +#define FOG_LOOP(TYPE, FOG_FUNC) \ +if (span->arrayAttribs & FRAG_BIT_FOGC) { \ + GLuint i; \ + for (i = 0; i < span->end; i++) { \ + const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \ + const GLfloat c = FABSF(fogCoord); \ + GLfloat f, oneMinusF; \ + FOG_FUNC(f, c); \ + f = CLAMP(f, 0.0F, 1.0F); \ + oneMinusF = 1.0F - f; \ + rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \ + rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \ + rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \ + } \ +} \ +else { \ + const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \ + GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \ + const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \ + GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \ + GLuint i; \ + for (i = 0; i < span->end; i++) { \ + const GLfloat c = FABSF(fogCoord) / w; \ + GLfloat f, oneMinusF; \ + FOG_FUNC(f, c); \ + f = CLAMP(f, 0.0F, 1.0F); \ + oneMinusF = 1.0F - f; \ + rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \ + rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \ + rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \ + fogCoord += fogStep; \ + w += wStep; \ + } \ +} + +/* As above, but CI mode (XXX try to merge someday) */ +#define FOG_LOOP_CI(FOG_FUNC) \ +if (span->arrayAttribs & FRAG_BIT_FOGC) { \ + GLuint i; \ + for (i = 0; i < span->end; i++) { \ + const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \ + const GLfloat c = FABSF(fogCoord); \ + GLfloat f; \ + FOG_FUNC(f, c); \ + f = CLAMP(f, 0.0F, 1.0F); \ + index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); \ + } \ +} \ +else { \ + const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \ + GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \ + const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \ + GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \ + GLuint i; \ + for (i = 0; i < span->end; i++) { \ + const GLfloat c = FABSF(fogCoord) / w; \ + GLfloat f; \ + FOG_FUNC(f, c); \ + f = CLAMP(f, 0.0F, 1.0F); \ + index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); \ + fogCoord += fogStep; \ + w += wStep; \ + } \ +} @@ -104,12 +166,12 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); GLfloat rFog, gFog, bFog; - const GLuint haveW = (span->interpMask & SPAN_W); ASSERT(swrast->_FogEnabled); - ASSERT((span->interpMask | span->arrayMask) & SPAN_FOG); + ASSERT(swrast->_ActiveAttribMask & FRAG_BIT_FOGC); ASSERT(span->arrayMask & SPAN_RGBA); + /* compute (scaled) fog color */ if (span->array->ChanType == GL_UNSIGNED_BYTE) { rFog = ctx->Fog.Color[RCOMP] * 255.0; gFog = ctx->Fog.Color[GCOMP] * 255.0; @@ -126,79 +188,68 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) bFog = ctx->Fog.Color[BCOMP]; } - - /* NOTE: if haveW is true, that means the fog start/step values are - * perspective-corrected and we have to divide each fog coord by W. - */ - - /* we need to compute fog blend factors */ if (swrast->_PreferPixelFog) { /* The span's fog values are fog coordinates, now compute blend factors * and blend the fragment colors with the fog color. */ - const GLfloat fogEnd = ctx->Fog.End; - const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) - ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); - const GLfloat density = -ctx->Fog.Density; - const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; - switch (swrast->_FogMode) { case GL_LINEAR: -#define COMPUTE_F f = (fogEnd - FABSF(fogCoord) / w) * fogScale; - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; - FOG_LOOP(GLubyte, COMPUTE_F); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; - FOG_LOOP(GLushort, COMPUTE_F); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, COMPUTE_F); + { + const GLfloat fogEnd = ctx->Fog.End; + const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) + ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->rgba8; + FOG_LOOP(GLubyte, LINEAR_FOG); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->rgba16; + FOG_LOOP(GLushort, LINEAR_FOG); + } + else { + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + ASSERT(span->array->ChanType == GL_FLOAT); + FOG_LOOP(GLfloat, LINEAR_FOG); + } } -#undef COMPUTE_F break; case GL_EXP: -#define COMPUTE_F f = EXPF(density * FABSF(fogCoord) / w); - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; - FOG_LOOP(GLubyte, COMPUTE_F); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; - FOG_LOOP(GLushort, COMPUTE_F); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, COMPUTE_F); + { + const GLfloat density = -ctx->Fog.Density; + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->rgba8; + FOG_LOOP(GLubyte, EXP_FOG); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->rgba16; + FOG_LOOP(GLushort, EXP_FOG); + } + else { + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + ASSERT(span->array->ChanType == GL_FLOAT); + FOG_LOOP(GLfloat, EXP_FOG); + } } -#undef COMPUTE_F break; case GL_EXP2: -#define COMPUTE_F const GLfloat coord = fogCoord / w; \ - GLfloat tmp = negDensitySquared * coord * coord; \ - if (tmp < FLT_MIN_10_EXP) \ - tmp = FLT_MIN_10_EXP; \ - f = EXPF(tmp); - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; - FOG_LOOP(GLubyte, COMPUTE_F); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; - FOG_LOOP(GLushort, COMPUTE_F); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, COMPUTE_F); + { + const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->rgba8; + FOG_LOOP(GLubyte, EXP2_FOG); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->rgba16; + FOG_LOOP(GLushort, EXP2_FOG); + } + else { + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + ASSERT(span->array->ChanType == GL_FLOAT); + FOG_LOOP(GLfloat, EXP2_FOG); + } } -#undef COMPUTE_F break; default: @@ -206,63 +257,23 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) return; } } - else if (span->arrayMask & SPAN_FOG) { - /* The span's fog array values are blend factors. - * They were previously computed per-vertex. - */ - GLuint i; - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; - for (i = 0; i < span->end; i++) { - const GLfloat f = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; - const GLfloat oneMinusF = 1.0F - f; - rgba[i][RCOMP] = (GLubyte) (f * rgba[i][RCOMP] + oneMinusF * rFog); - rgba[i][GCOMP] = (GLubyte) (f * rgba[i][GCOMP] + oneMinusF * gFog); - rgba[i][BCOMP] = (GLubyte) (f * rgba[i][BCOMP] + oneMinusF * bFog); - } - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; - for (i = 0; i < span->end; i++) { - const GLfloat f = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; - const GLfloat oneMinusF = 1.0F - f; - rgba[i][RCOMP] = (GLushort) (f * rgba[i][RCOMP] + oneMinusF * rFog); - rgba[i][GCOMP] = (GLushort) (f * rgba[i][GCOMP] + oneMinusF * gFog); - rgba[i][BCOMP] = (GLushort) (f * rgba[i][BCOMP] + oneMinusF * bFog); - } - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - for (i = 0; i < span->end; i++) { - const GLfloat f = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; - const GLfloat oneMinusF = 1.0F - f; - rgba[i][RCOMP] = f * rgba[i][RCOMP] + oneMinusF * rFog; - rgba[i][GCOMP] = f * rgba[i][GCOMP] + oneMinusF * gFog; - rgba[i][BCOMP] = f * rgba[i][BCOMP] + oneMinusF * bFog; - } - } - - } else { - /* The span's fog start/step values are blend factors. + /* The span's fog start/step/array values are blend factors in [0,1]. * They were previously computed per-vertex. */ -#define COMPUTE_F f = fogCoord / w; if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; - FOG_LOOP(GLubyte, COMPUTE_F); + GLubyte (*rgba)[4] = span->array->rgba8; + FOG_LOOP(GLubyte, BLEND_FOG); } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; - FOG_LOOP(GLushort, COMPUTE_F); + GLushort (*rgba)[4] = span->array->rgba16; + FOG_LOOP(GLushort, BLEND_FOG); } else { GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, COMPUTE_F); + FOG_LOOP(GLfloat, BLEND_FOG); } -#undef COMPUTE_F } } @@ -274,13 +285,11 @@ void _swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLuint haveW = (span->interpMask & SPAN_W); const GLuint fogIndex = (GLuint) ctx->Fog.Index; GLuint *index = span->array->index; ASSERT(swrast->_FogEnabled); ASSERT(span->arrayMask & SPAN_INDEX); - ASSERT((span->interpMask | span->arrayMask) & SPAN_FOG); /* we need to compute fog blend factors */ if (swrast->_PreferPixelFog) { @@ -293,60 +302,19 @@ _swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ) const GLfloat fogEnd = ctx->Fog.End; const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; - const GLfloat wStep = haveW ? span->attrStepX[FRAG_ATTRIB_WPOS][3] : 0.0F; - GLfloat w = haveW ? span->attrStart[FRAG_ATTRIB_WPOS][3] : 1.0F; - GLuint i; - for (i = 0; i < span->end; i++) { - GLfloat f = (fogEnd - fogCoord / w) * fogScale; - f = CLAMP(f, 0.0F, 1.0F); - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); - fogCoord += fogStep; - w += wStep; - } + FOG_LOOP_CI(LINEAR_FOG); } break; case GL_EXP: { const GLfloat density = -ctx->Fog.Density; - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; - const GLfloat wStep = haveW ? span->attrStepX[FRAG_ATTRIB_WPOS][3] : 0.0F; - GLfloat w = haveW ? span->attrStart[FRAG_ATTRIB_WPOS][3] : 1.0F; - GLuint i; - for (i = 0; i < span->end; i++) { - GLfloat f = EXPF(density * fogCoord / w); - f = CLAMP(f, 0.0F, 1.0F); - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); - fogCoord += fogStep; - w += wStep; - } + FOG_LOOP_CI(EXP_FOG); } break; case GL_EXP2: { const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; - const GLfloat wStep = haveW ? span->attrStepX[FRAG_ATTRIB_WPOS][3] : 0.0F; - GLfloat w = haveW ? span->attrStart[FRAG_ATTRIB_WPOS][3] : 1.0F; - GLuint i; - for (i = 0; i < span->end; i++) { - const GLfloat coord = fogCoord / w; - GLfloat tmp = negDensitySquared * coord * coord; - GLfloat f; -#if defined(__alpha__) || defined(__alpha) - /* XXX this underflow check may be needed for other systems*/ - if (tmp < FLT_MIN_10_EXP) - tmp = FLT_MIN_10_EXP; -#endif - f = EXPF(tmp); - f = CLAMP(f, 0.0F, 1.0F); - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); - fogCoord += fogStep; - w += wStep; - } + FOG_LOOP_CI(EXP2_FOG); } break; default: @@ -354,31 +322,10 @@ _swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ) return; } } - else if (span->arrayMask & SPAN_FOG) { - /* The span's fog array values are blend factors. - * They were previously computed per-vertex. - */ - GLuint i; - for (i = 0; i < span->end; i++) { - const GLfloat f = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); - } - } else { - /* The span's fog start/step values are blend factors. + /* The span's fog start/step/array values are blend factors in [0,1]. * They were previously computed per-vertex. */ - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; - GLfloat fog = span->attrStart[FRAG_ATTRIB_FOGC][0]; - const GLfloat wStep = haveW ? span->attrStepX[FRAG_ATTRIB_WPOS][3] : 0.0F; - GLfloat w = haveW ? span->attrStart[FRAG_ATTRIB_WPOS][3] : 1.0F; - GLuint i; - ASSERT(span->interpMask & SPAN_FOG); - for (i = 0; i < span->end; i++) { - const GLfloat f = fog / w; - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); - fog += fogStep; - w += wStep; - } + FOG_LOOP_CI(BLEND_FOG); } } diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 80702e41a3c..781146e67f9 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -121,29 +121,29 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) /**********************************************************************/ /* Simple color index line (no stipple, width=1, no Z, no fog, no tex)*/ -#define NAME simple_ci_line +#define NAME simple_no_z_ci_line #define INTERP_INDEX #define RENDER_SPAN(span) _swrast_write_index_span(ctx, &span) #include "s_linetemp.h" /* Simple RGBA index line (no stipple, width=1, no Z, no fog, no tex)*/ -#define NAME simple_rgba_line +#define NAME simple_no_z_rgba_line #define INTERP_RGBA #define RENDER_SPAN(span) _swrast_write_rgba_span(ctx, &span); #include "s_linetemp.h" /* Z, fog, wide, stipple color index line */ -#define NAME general_ci_line +#define NAME ci_line #define INTERP_INDEX #define INTERP_Z -#define INTERP_FOG +#define INTERP_ATTRIBS /* for fog */ #define RENDER_SPAN(span) \ if (ctx->Line.StippleFlag) { \ span.arrayMask |= SPAN_MASK; \ compute_stipple_mask(ctx, span.end, span.array->mask); \ } \ - if (ctx->Line._Width > 1.0) { \ + if (ctx->Line._Width > 1.0) { \ draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ } \ else { \ @@ -153,16 +153,15 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) /* Z, fog, wide, stipple RGBA line */ -#define NAME general_rgba_line +#define NAME rgba_line #define INTERP_RGBA #define INTERP_Z -#define INTERP_FOG #define RENDER_SPAN(span) \ if (ctx->Line.StippleFlag) { \ span.arrayMask |= SPAN_MASK; \ compute_stipple_mask(ctx, span.end, span.array->mask); \ } \ - if (ctx->Line._Width > 1.0) { \ + if (ctx->Line._Width > 1.0) { \ draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ } \ else { \ @@ -171,19 +170,17 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) #include "s_linetemp.h" -/* General-purpose textured line (any/all features). */ -#define NAME textured_line +/* General-purpose line (any/all features). */ +#define NAME general_line #define INTERP_RGBA -#define INTERP_SPEC #define INTERP_Z -#define INTERP_FOG #define INTERP_ATTRIBS #define RENDER_SPAN(span) \ if (ctx->Line.StippleFlag) { \ span.arrayMask |= SPAN_MASK; \ compute_stipple_mask(ctx, span.end, span.array->mask); \ } \ - if (ctx->Line._Width > 1.0) { \ + if (ctx->Line._Width > 1.0) { \ draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ } \ else { \ @@ -194,48 +191,39 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) void -_swrast_add_spec_terms_line( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1 ) +_swrast_add_spec_terms_line(GLcontext *ctx, + const SWvertex *v0, const SWvertex *v1) { SWvertex *ncv0 = (SWvertex *)v0; SWvertex *ncv1 = (SWvertex *)v1; - GLchan c[2][4]; - COPY_CHAN4( c[0], ncv0->color ); - COPY_CHAN4( c[1], ncv1->color ); - ACC_3V( ncv0->color, ncv0->specular ); - ACC_3V( ncv1->color, ncv1->specular ); + GLfloat rSum, gSum, bSum; + GLchan cSave[2][4]; + + /* save original colors */ + COPY_CHAN4(cSave[0], ncv0->color); + COPY_CHAN4(cSave[1], ncv1->color); + /* sum v0 */ + rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; + gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; + bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); + /* sum v1 */ + rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; + gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; + bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; + UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); + /* draw */ SWRAST_CONTEXT(ctx)->SpecLine( ctx, ncv0, ncv1 ); - COPY_CHAN4( ncv0->color, c[0] ); - COPY_CHAN4( ncv1->color, c[1] ); + /* restore original colors */ + COPY_CHAN4( ncv0->attrib[FRAG_ATTRIB_COL0], cSave[0] ); + COPY_CHAN4( ncv1->attrib[FRAG_ATTRIB_COL0], cSave[1] ); } -#ifdef DEBUG -extern void -_mesa_print_line_function(GLcontext *ctx); /* silence compiler warning */ -void -_mesa_print_line_function(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - _mesa_printf("Line Func == "); - if (swrast->Line == simple_ci_line) - _mesa_printf("simple_ci_line\n"); - else if (swrast->Line == simple_rgba_line) - _mesa_printf("simple_rgba_line\n"); - else if (swrast->Line == general_ci_line) - _mesa_printf("general_ci_line\n"); - else if (swrast->Line == general_rgba_line) - _mesa_printf("general_rgba_line\n"); - else if (swrast->Line == textured_line) - _mesa_printf("textured_line\n"); - else - _mesa_printf("Driver func %p\n", (void *(*)()) swrast->Line); -} -#endif - - #ifdef DEBUG @@ -257,7 +245,7 @@ do { \ -/* +/** * Determine which line drawing function to use given the current * rendering context. * @@ -269,6 +257,9 @@ _swrast_choose_line( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLboolean rgbmode = ctx->Visual.rgbMode; + GLboolean specular = (ctx->Fog.ColorSumEnabled || + (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); if (ctx->RenderMode == GL_RENDER) { if (ctx->Line.SmoothFlag) { @@ -277,24 +268,27 @@ _swrast_choose_line( GLcontext *ctx ) ASSERT(swrast->Line); } else if (ctx->Texture._EnabledCoordUnits - || ctx->FragmentProgram._Current) { - /* textured lines */ - USE(textured_line); + || ctx->FragmentProgram._Current + || swrast->_FogEnabled + || specular) { + USE(general_line); } - else if (ctx->Depth.Test || swrast->_FogEnabled || ctx->Line._Width != 1.0 + else if (ctx->Depth.Test + || ctx->Line._Width != 1.0 || ctx->Line.StippleFlag) { /* no texture, but Z, fog, width>1, stipple, etc. */ if (rgbmode) - USE(general_rgba_line); + USE(rgba_line); else - USE(general_ci_line); + USE(ci_line); } else { - /* simplest lines */ + ASSERT(!ctx->Depth.Test); + /* simple lines */ if (rgbmode) - USE(simple_rgba_line); + USE(simple_no_z_rgba_line); else - USE(simple_ci_line); + USE(simple_no_z_ci_line); } } else if (ctx->RenderMode == GL_FEEDBACK) { @@ -304,6 +298,4 @@ _swrast_choose_line( GLcontext *ctx ) ASSERT(ctx->RenderMode == GL_SELECT); USE(_swrast_select_line); } - - /*_mesa_print_line_function(ctx);*/ } diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index b6e8f287f45..55548f27b08 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.0 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -31,9 +31,7 @@ * The following macros may be defined to indicate what auxillary information * must be interplated along the line: * INTERP_Z - if defined, interpolate Z values - * INTERP_FOG - if defined, interpolate FOG values * INTERP_RGBA - if defined, interpolate RGBA values - * INTERP_SPEC - if defined, interpolate specular RGB values * INTERP_INDEX - if defined, interpolate color index values * INTERP_ATTRIBS - if defined, interpolate attribs (texcoords, varying, etc) * @@ -72,10 +70,10 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) const SWcontext *swrast = SWRAST_CONTEXT(ctx); SWspan span; GLuint interpFlags = 0; - GLint x0 = (GLint) vert0->win[0]; - GLint x1 = (GLint) vert1->win[0]; - GLint y0 = (GLint) vert0->win[1]; - GLint y1 = (GLint) vert1->win[1]; + GLint x0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][0]; + GLint x1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][0]; + GLint y0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][1]; + GLint y1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][1]; GLint dx, dy; GLint numPixels; GLint xstep, ystep; @@ -104,8 +102,8 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) /* Cull primitives with malformed coordinates. */ { - GLfloat tmp = vert0->win[0] + vert0->win[1] - + vert1->win[0] + vert1->win[1]; + GLfloat tmp = vert0->attrib[FRAG_ATTRIB_WPOS][0] + vert0->attrib[FRAG_ATTRIB_WPOS][1] + + vert1->attrib[FRAG_ATTRIB_WPOS][0] + vert1->attrib[FRAG_ATTRIB_WPOS][1]; if (IS_INF_OR_NAN(tmp)) return; } @@ -113,8 +111,12 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) /* printf("%s():\n", __FUNCTION__); printf(" (%f, %f, %f) -> (%f, %f, %f)\n", - vert0->win[0], vert0->win[1], vert0->win[2], - vert1->win[0], vert1->win[1], vert1->win[2]); + vert0->attrib[FRAG_ATTRIB_WPOS][0], + vert0->attrib[FRAG_ATTRIB_WPOS][1], + vert0->attrib[FRAG_ATTRIB_WPOS][2], + vert1->attrib[FRAG_ATTRIB_WPOS][0], + vert1->attrib[FRAG_ATTRIB_WPOS][1], + vert1->attrib[FRAG_ATTRIB_WPOS][2]); printf(" (%d, %d, %d) -> (%d, %d, %d)\n", vert0->color[0], vert0->color[1], vert0->color[2], vert1->color[0], vert1->color[1], vert1->color[2]); @@ -154,6 +156,18 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) if (dx == 0 && dy == 0) return; + /* + printf("%s %d,%d %g %g %g %g %g %g %g %g\n", __FUNCTION__, dx, dy, + vert0->attrib[FRAG_ATTRIB_COL1][0], + vert0->attrib[FRAG_ATTRIB_COL1][1], + vert0->attrib[FRAG_ATTRIB_COL1][2], + vert0->attrib[FRAG_ATTRIB_COL1][3], + vert1->attrib[FRAG_ATTRIB_COL1][0], + vert1->attrib[FRAG_ATTRIB_COL1][1], + vert1->attrib[FRAG_ATTRIB_COL1][2], + vert1->attrib[FRAG_ATTRIB_COL1][3]); + */ + #ifdef DEPTH_TYPE zPtr = (DEPTH_TYPE *) zrb->GetPointer(ctx, zrb, x0, y0); #endif @@ -232,33 +246,15 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) span.alphaStep = 0; } #endif -#ifdef INTERP_SPEC - interpFlags |= SPAN_SPEC; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - span.specRed = ChanToFixed(vert0->specular[0]); - span.specGreen = ChanToFixed(vert0->specular[1]); - span.specBlue = ChanToFixed(vert0->specular[2]); - span.specRedStep = (ChanToFixed(vert1->specular[0]) - span.specRed) / numPixels; - span.specGreenStep = (ChanToFixed(vert1->specular[1]) - span.specBlue) / numPixels; - span.specBlueStep = (ChanToFixed(vert1->specular[2]) - span.specGreen) / numPixels; - } - else { - span.specRed = ChanToFixed(vert1->specular[0]); - span.specGreen = ChanToFixed(vert1->specular[1]); - span.specBlue = ChanToFixed(vert1->specular[2]); - span.specRedStep = 0; - span.specGreenStep = 0; - span.specBlueStep = 0; - } -#endif #ifdef INTERP_INDEX interpFlags |= SPAN_INDEX; if (ctx->Light.ShadeModel == GL_SMOOTH) { - span.index = FloatToFixed(vert0->index); - span.indexStep = FloatToFixed(vert1->index - vert0->index) / numPixels; + span.index = FloatToFixed(vert0->attrib[FRAG_ATTRIB_CI][0]); + span.indexStep = FloatToFixed( vert1->attrib[FRAG_ATTRIB_CI][0] + - vert0->attrib[FRAG_ATTRIB_CI][0]) / numPixels; } else { - span.index = FloatToFixed(vert1->index); + span.index = FloatToFixed(vert1->attrib[FRAG_ATTRIB_CI][0]); span.indexStep = 0; } #endif @@ -266,57 +262,49 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) interpFlags |= SPAN_Z; { if (depthBits <= 16) { - span.z = FloatToFixed(vert0->win[2]) + FIXED_HALF; - span.zStep = FloatToFixed(vert1->win[2] - vert0->win[2]) / numPixels; + span.z = FloatToFixed(vert0->attrib[FRAG_ATTRIB_WPOS][2]) + FIXED_HALF; + span.zStep = FloatToFixed( vert1->attrib[FRAG_ATTRIB_WPOS][2] + - vert0->attrib[FRAG_ATTRIB_WPOS][2]) / numPixels; } else { /* don't use fixed point */ - span.z = (GLuint) vert0->win[2]; - span.zStep = (GLint) ((vert1->win[2] - vert0->win[2]) / numPixels); + span.z = (GLuint) vert0->attrib[FRAG_ATTRIB_WPOS][2]; + span.zStep = (GLint) (( vert1->attrib[FRAG_ATTRIB_WPOS][2] + - vert0->attrib[FRAG_ATTRIB_WPOS][2]) / numPixels); } } #endif -#ifdef INTERP_FOG - interpFlags |= SPAN_FOG; - span.attrStart[FRAG_ATTRIB_FOGC][0] = vert0->attrib[FRAG_ATTRIB_FOGC][0]; - span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->attrib[FRAG_ATTRIB_FOGC][0] - - vert0->attrib[FRAG_ATTRIB_FOGC][0]) / numPixels; -#endif #if defined(INTERP_ATTRIBS) - interpFlags |= (SPAN_TEXTURE | SPAN_VARYING); { const GLfloat invLen = 1.0F / numPixels; - const GLfloat invw0 = vert0->win[3]; - const GLfloat invw1 = vert1->win[3]; + const GLfloat invw0 = vert0->attrib[FRAG_ATTRIB_WPOS][3]; + const GLfloat invw1 = vert1->attrib[FRAG_ATTRIB_WPOS][3]; + + span.attrStart[FRAG_ATTRIB_WPOS][3] = invw0; + span.attrStepX[FRAG_ATTRIB_WPOS][3] = (invw1 - invw0) * invLen; + span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; + ATTRIB_LOOP_BEGIN - GLfloat ds, dt, dr, dq; - span.attrStart[attr][0] = invw0 * vert0->attrib[attr][0]; - span.attrStart[attr][1] = invw0 * vert0->attrib[attr][1]; - span.attrStart[attr][2] = invw0 * vert0->attrib[attr][2]; - span.attrStart[attr][3] = invw0 * vert0->attrib[attr][3]; - ds = (invw1 * vert1->attrib[attr][0]) - span.attrStart[attr][0]; - dt = (invw1 * vert1->attrib[attr][1]) - span.attrStart[attr][1]; - dr = (invw1 * vert1->attrib[attr][2]) - span.attrStart[attr][2]; - dq = (invw1 * vert1->attrib[attr][3]) - span.attrStart[attr][3]; - span.attrStepX[attr][0] = ds * invLen; - span.attrStepX[attr][1] = dt * invLen; - span.attrStepX[attr][2] = dr * invLen; - span.attrStepX[attr][3] = dq * invLen; - span.attrStepY[attr][0] = 0.0F; - span.attrStepY[attr][1] = 0.0F; - span.attrStepY[attr][2] = 0.0F; - span.attrStepY[attr][3] = 0.0F; + if (swrast->_InterpMode[attr] == GL_FLAT) { + COPY_4V(span.attrStart[attr], vert1->attrib[attr]); + ASSIGN_4V(span.attrStepX[attr], 0.0, 0.0, 0.0, 0.0); + } + else { + GLuint c; + for (c = 0; c < 4; c++) { + float da; + span.attrStart[attr][c] = invw0 * vert0->attrib[attr][c]; + da = (invw1 * vert1->attrib[attr][c]) - span.attrStart[attr][c]; + span.attrStepX[attr][c] = da * invLen; + } + } + ASSIGN_4V(span.attrStepY[attr], 0.0, 0.0, 0.0, 0.0); ATTRIB_LOOP_END } #endif INIT_SPAN(span, GL_LINE, numPixels, interpFlags, SPAN_XY); - /* Need these for fragment prog texcoord interpolation */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; - span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; - span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; - /* * Draw */ @@ -346,7 +334,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) #ifdef PIXEL_ADDRESS pixelPtr = (PIXEL_TYPE*) ((GLubyte*) pixelPtr + pixelXstep); #endif - if (error<0) { + if (error < 0) { error += errorInc; } else { @@ -413,9 +401,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) #undef NAME #undef INTERP_Z -#undef INTERP_FOG #undef INTERP_RGBA -#undef INTERP_SPEC #undef INTERP_ATTRIBS #undef INTERP_INDEX #undef PIXEL_ADDRESS diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index e680732beed..0af9063968a 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -229,13 +229,13 @@ _swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, if (span->array->ChanType == GL_UNSIGNED_BYTE) { /* treat 4*GLubyte as GLuint */ logicop_uint1(ctx, span->end, - (GLuint *) span->array->color.sz1.rgba, + (GLuint *) span->array->rgba8, (const GLuint *) rbPixels, span->array->mask); } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { /* treat 2*GLushort as GLuint */ logicop_uint2(ctx, 2 * span->end, - (GLuint *) span->array->color.sz2.rgba, + (GLuint *) span->array->rgba16, (const GLuint *) rbPixels, span->array->mask); } else { diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index 8800f7d8e34..a69720e83ae 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -61,7 +61,7 @@ _swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, const GLuint srcMask = *((GLuint *) ctx->Color.ColorMask); const GLuint dstMask = ~srcMask; const GLuint *dst = (const GLuint *) rbPixels; - GLuint *src = (GLuint *) span->array->color.sz1.rgba; + GLuint *src = (GLuint *) span->array->rgba8; GLuint i; for (i = 0; i < n; i++) { src[i] = (src[i] & srcMask) | (dst[i] & dstMask); @@ -75,7 +75,7 @@ _swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, const GLushort bMask = ctx->Color.ColorMask[BCOMP] ? 0xffff : 0x0; const GLushort aMask = ctx->Color.ColorMask[ACOMP] ? 0xffff : 0x0; const GLushort (*dst)[4] = (const GLushort (*)[4]) rbPixels; - GLushort (*src)[4] = span->array->color.sz2.rgba; + GLushort (*src)[4] = span->array->rgba16; GLuint i; for (i = 0; i < n; i++) { src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask); diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 1401b772caf..02c9d9b4251 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -34,7 +34,6 @@ #include "s_span.h" - #define RGBA 0x1 #define INDEX 0x2 #define SMOOTH 0x4 @@ -154,16 +153,26 @@ #include "s_pointtemp.h" - -void _swrast_add_spec_terms_point( GLcontext *ctx, - const SWvertex *v0 ) +void +_swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0) { - SWvertex *ncv0 = (SWvertex *)v0; - GLchan c[1][4]; - COPY_CHAN4( c[0], ncv0->color ); - ACC_3V( ncv0->color, ncv0->specular ); - SWRAST_CONTEXT(ctx)->SpecPoint( ctx, ncv0 ); - COPY_CHAN4( ncv0->color, c[0] ); + SWvertex *ncv0 = (SWvertex *) v0; + GLfloat rSum, gSum, bSum; + GLchan cSave[4]; + + /* save */ + COPY_CHAN4( cSave, ncv0->color ); + /* sum */ + rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; + gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; + bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); + /* draw */ + SWRAST_CONTEXT(ctx)->SpecPoint(ctx, ncv0); + /* restore */ + COPY_CHAN4(ncv0->color, cSave); } @@ -196,6 +205,9 @@ _swrast_choose_point( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLboolean rgbMode = ctx->Visual.rgbMode; + GLboolean specular = (ctx->Fog.ColorSumEnabled || + (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); if (ctx->RenderMode==GL_RENDER) { if (ctx->Point.PointSprite) { @@ -242,8 +254,10 @@ _swrast_choose_point( GLcontext *ctx ) USE(atten_general_ci_point); } } - else if (ctx->Texture._EnabledCoordUnits && rgbMode) { - /* textured */ + else if ((ctx->Texture._EnabledCoordUnits + || specular + || swrast->_FogEnabled) && rgbMode) { + /* textured, fogged */ USE(textured_rgba_point); } else if (ctx->Point._Size != 1.0) { @@ -258,6 +272,7 @@ _swrast_choose_point( GLcontext *ctx ) else { /* single pixel points */ if (rgbMode) { + assert((swrast->_ActiveAttribMask & FRAG_BIT_COL1) == 0); USE(size1_rgba_point); } else { diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index dddc2f7f40c..206085b5b87 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -40,7 +40,6 @@ * RGBA = do rgba instead of color index * SMOOTH = do antialiasing * ATTRIBS = general attributes (texcoords, etc) - * SPECULAR = do separate specular color * LARGE = do points with diameter > 1 pixel * ATTENUATE = compute point size attenuation * SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite @@ -78,13 +77,8 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) const GLchan blue = vert->color[2]; const GLchan alpha = vert->color[3]; #endif -#if FLAGS & SPECULAR - const GLchan specRed = vert->specular[0]; - const GLchan specGreen = vert->specular[1]; - const GLchan specBlue = vert->specular[2]; -#endif #if FLAGS & INDEX - const GLuint colorIndex = (GLuint) vert->index; /* XXX round? */ + const GLuint colorIndex = (GLuint) vert->attrib[FRAG_ATTRIB_CI][0]; /* XXX round? */ #endif #if FLAGS & ATTRIBS GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */ @@ -92,10 +86,22 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) SWcontext *swrast = SWRAST_CONTEXT(ctx); SWspan *span = &(swrast->PointSpan); + /* + printf("%s %g %g %g %g\n", __FUNCTION__, + vert->attrib[FRAG_ATTRIB_COL1][0], + vert->attrib[FRAG_ATTRIB_COL1][1], + vert->attrib[FRAG_ATTRIB_COL1][2], + vert->attrib[FRAG_ATTRIB_COL1][3]); + if ( vert->attrib[FRAG_ATTRIB_COL1][0] == 0.0 && + vert->attrib[FRAG_ATTRIB_COL1][1] == 1.0 && + vert->attrib[FRAG_ATTRIB_COL1][2] == 0.0) + foo(); + */ + /* Cull primitives with malformed coordinates. */ { - float tmp = vert->win[0] + vert->win[1]; + float tmp = vert->attrib[FRAG_ATTRIB_WPOS][0] + vert->attrib[FRAG_ATTRIB_WPOS][1]; if (IS_INF_OR_NAN(tmp)) return; } @@ -103,49 +109,37 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) /* * Span init */ - span->interpMask = SPAN_FOG; + span->interpMask = 0; span->arrayMask = SPAN_XY | SPAN_Z; - span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->attrib[FRAG_ATTRIB_FOGC][0]; - span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0; - span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0; #if FLAGS & RGBA span->arrayMask |= SPAN_RGBA; #endif -#if FLAGS & SPECULAR - span->arrayMask |= SPAN_SPEC; -#endif #if FLAGS & INDEX span->arrayMask |= SPAN_INDEX; #endif #if FLAGS & ATTRIBS - span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA); - if (ctx->FragmentProgram._Active) { - /* Don't divide texture s,t,r by q (use TXP to do that) */ - ATTRIB_LOOP_BEGIN - COPY_4V(attrib[attr], vert->attrib[attr]); - ATTRIB_LOOP_END - } - else { - /* Divide texture s,t,r by q here */ - ATTRIB_LOOP_BEGIN - const GLfloat q = vert->attrib[attr][3]; - const GLfloat invQ = (q == 0.0F || q == 1.0F) ? 1.0F : (1.0F / q); - attrib[attr][0] = vert->attrib[attr][0] * invQ; - attrib[attr][1] = vert->attrib[attr][1] * invQ; - attrib[attr][2] = vert->attrib[attr][2] * invQ; - attrib[attr][3] = q; - ATTRIB_LOOP_END - } + span->arrayMask |= SPAN_LAMBDA; + + /* we're filling in the attrib arrays: */ + span->arrayAttribs = swrast->_ActiveAttribMask; + + ATTRIB_LOOP_BEGIN + COPY_4V(attrib[attr], vert->attrib[attr]); + ATTRIB_LOOP_END + /* need these for fragment programs */ span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; +#else + assert((swrast->_ActiveAttribMask & FRAG_BIT_COL1) == 0); #endif + #if FLAGS & SMOOTH span->arrayMask |= SPAN_COVERAGE; #endif #if FLAGS & SPRITE - span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA); + span->arrayMask |= SPAN_LAMBDA; #endif /* Compute point size if not known to be one */ @@ -189,7 +183,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) {{ GLint x, y; const GLfloat radius = 0.5F * size; - const GLuint z = (GLuint) (vert->win[2] + 0.5F); + const GLuint z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); GLuint count; #if FLAGS & SMOOTH const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */ @@ -197,10 +191,10 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) const GLfloat rmin2 = MAX2(0.0F, rmin * rmin); const GLfloat rmax2 = rmax * rmax; const GLfloat cscale = 1.0F / (rmax2 - rmin2); - const GLint xmin = (GLint) (vert->win[0] - radius); - const GLint xmax = (GLint) (vert->win[0] + radius); - const GLint ymin = (GLint) (vert->win[1] - radius); - const GLint ymax = (GLint) (vert->win[1] + radius); + const GLint xmin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] - radius); + const GLint xmax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] + radius); + const GLint ymin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] - radius); + const GLint ymax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] + radius); #else /* non-smooth */ GLint xmin, xmax, ymin, ymax; @@ -210,16 +204,16 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) iRadius = iSize / 2; if (iSize & 1) { /* odd size */ - xmin = (GLint) (vert->win[0] - iRadius); - xmax = (GLint) (vert->win[0] + iRadius); - ymin = (GLint) (vert->win[1] - iRadius); - ymax = (GLint) (vert->win[1] + iRadius); + xmin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] - iRadius); + xmax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] + iRadius); + ymin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] - iRadius); + ymax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] + iRadius); } else { /* even size */ - xmin = (GLint) vert->win[0] - iRadius + 1; + xmin = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0] - iRadius + 1; xmax = xmin + iSize - 1; - ymin = (GLint) vert->win[1] - iRadius + 1; + ymin = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1] - iRadius + 1; ymax = ymin + iSize - 1; } #endif /*SMOOTH*/ @@ -264,29 +258,26 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->array->rgba[count][BCOMP] = blue; span->array->rgba[count][ACOMP] = alpha; #endif -#if FLAGS & SPECULAR - span->array->spec[count][RCOMP] = specRed; - span->array->spec[count][GCOMP] = specGreen; - span->array->spec[count][BCOMP] = specBlue; -#endif #if FLAGS & INDEX span->array->index[count] = colorIndex; #endif #if FLAGS & ATTRIBS ATTRIB_LOOP_BEGIN COPY_4V(span->array->attribs[attr][count], attrib[attr]); - if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { + /** + if (attr < FRAG_ATTRIB_VAR0) { const GLuint u = attr - FRAG_ATTRIB_TEX0; span->array->lambda[u][count] = 0.0; } + **/ ATTRIB_LOOP_END #endif #if FLAGS & SMOOTH /* compute coverage */ { - const GLfloat dx = x - vert->win[0] + 0.5F; - const GLfloat dy = y - vert->win[1] + 0.5F; + const GLfloat dx = x - vert->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F; + const GLfloat dy = y - vert->attrib[FRAG_ATTRIB_WPOS][1] + 0.5F; const GLfloat dist2 = dx * dx + dy * dy; if (dist2 < rmax2) { if (dist2 >= rmin2) { @@ -327,12 +318,12 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) GLuint attr = FRAG_ATTRIB_TEX0 + u; if (ctx->Texture.Unit[u]._ReallyEnabled) { if (ctx->Point.CoordReplace[u]) { - GLfloat s = 0.5F + (x + 0.5F - vert->win[0]) / size; + GLfloat s = 0.5F + (x + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][0]) / size; GLfloat t, r; if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) - t = 0.5F + (y + 0.5F - vert->win[1]) / size; + t = 0.5F + (y + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][1]) / size; else /* GL_UPPER_LEFT */ - t = 0.5F - (y + 0.5F - vert->win[1]) / size; + t = 0.5F - (y + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][1]) / size; if (ctx->Point.SpriteRMode == GL_ZERO) r = 0.0F; else if (ctx->Point.SpriteRMode == GL_S) @@ -389,11 +380,6 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->array->rgba[count][BCOMP] = blue; span->array->rgba[count][ACOMP] = alpha; #endif -#if FLAGS & SPECULAR - span->array->spec[count][RCOMP] = specRed; - span->array->spec[count][GCOMP] = specGreen; - span->array->spec[count][BCOMP] = specBlue; -#endif #if FLAGS & INDEX span->array->index[count] = colorIndex; #endif @@ -403,9 +389,10 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) ATTRIB_LOOP_END #endif - span->array->x[count] = (GLint) vert->win[0]; - span->array->y[count] = (GLint) vert->win[1]; - span->array->z[count] = (GLint) (vert->win[2] + 0.5F); + span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0]; + span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1]; + span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); + span->end = count + 1; }} diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 097d2c7b51c..90a3d5545f8 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -52,53 +52,30 @@ /** - * Init span's Z interpolation values to the RasterPos Z. - * Used during setup for glDraw/CopyPixels. + * Set default fragment attributes for the span using the + * current raster values. Used prior to glDraw/CopyPixels + * and glBitmap. */ void -_swrast_span_default_z( GLcontext *ctx, SWspan *span ) +_swrast_span_default_attribs(GLcontext *ctx, SWspan *span) { - const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; - if (ctx->DrawBuffer->Visual.depthBits <= 16) - span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F); - else - span->z = (GLint) (ctx->Current.RasterPos[2] * depthMax + 0.5F); - span->zStep = 0; - span->interpMask |= SPAN_Z; -} - - -/** - * Init span's fogcoord interpolation values to the RasterPos fog. - * Used during setup for glDraw/CopyPixels. - */ -void -_swrast_span_default_fog( GLcontext *ctx, SWspan *span ) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLfloat fogVal; /* a coord or a blend factor */ - if (swrast->_PreferPixelFog) { - /* fog blend factors will be computed from fog coordinates per pixel */ - fogVal = ctx->Current.RasterDistance; - } - else { - /* fog blend factor should be computed from fogcoord now */ - fogVal = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); + /* Z*/ + { + const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; + if (ctx->DrawBuffer->Visual.depthBits <= 16) + span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F); + else + span->z = (GLint) (ctx->Current.RasterPos[2] * depthMax + 0.5F); + span->zStep = 0; + span->interpMask |= SPAN_Z; } - span->attrStart[FRAG_ATTRIB_FOGC][0] = fogVal; - span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0; - span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0; - span->interpMask |= SPAN_FOG; -} + /* W (for perspective correction) */ + span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0; + span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0; + span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; -/** - * Init span's rgba or index interpolation values to the RasterPos color. - * Used during setup for glDraw/CopyPixels. - */ -void -_swrast_span_default_color( GLcontext *ctx, SWspan *span ) -{ + /* primary color, or color index */ if (ctx->Visual.rgbMode) { GLchan r, g, b, a; UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); @@ -121,97 +98,129 @@ _swrast_span_default_color( GLcontext *ctx, SWspan *span ) span->blueStep = 0; span->alphaStep = 0; span->interpMask |= SPAN_RGBA; + + COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); + ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); + ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); } else { span->index = FloatToFixed(ctx->Current.RasterIndex); span->indexStep = 0; span->interpMask |= SPAN_INDEX; } -} - -/** - * Set the span's secondary color info to the current raster position's - * secondary color, when needed (lighting enabled or colorsum enabled). - */ -void -_swrast_span_default_secondary_color(GLcontext *ctx, SWspan *span) -{ + /* Secondary color */ if (ctx->Visual.rgbMode && (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled)) { - GLchan r, g, b, a; - UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterSecondaryColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterSecondaryColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterSecondaryColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterSecondaryColor[3]); -#if CHAN_TYPE == GL_FLOAT - span->specRed = r; - span->specGreen = g; - span->specBlue = b; - /*span->specAlpha = a;*/ -#else - span->specRed = IntToFixed(r); - span->specGreen = IntToFixed(g); - span->specBlue = IntToFixed(b); - /*span->specAlpha = IntToFixed(a);*/ -#endif - span->specRedStep = 0; - span->specGreenStep = 0; - span->specBlueStep = 0; - /*span->specAlphaStep = 0;*/ - span->interpMask |= SPAN_SPEC; + COPY_4V(span->attrStart[FRAG_ATTRIB_COL1], ctx->Current.RasterSecondaryColor); + ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); + ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); + } + + /* fog */ + { + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLfloat fogVal; /* a coord or a blend factor */ + if (swrast->_PreferPixelFog) { + /* fog blend factors will be computed from fog coordinates per pixel */ + fogVal = ctx->Current.RasterDistance; + } + else { + /* fog blend factor should be computed from fogcoord now */ + fogVal = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); + } + span->attrStart[FRAG_ATTRIB_FOGC][0] = fogVal; + span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0; + span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0; + } + + /* texcoords */ + { + GLuint i; + for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { + const GLuint attr = FRAG_ATTRIB_TEX0 + i; + const GLfloat *tc = ctx->Current.RasterTexCoords[i]; + if (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { + COPY_4V(span->attrStart[attr], tc); + } + else if (tc[3] > 0.0F) { + /* use (s/q, t/q, r/q, 1) */ + span->attrStart[attr][0] = tc[0] / tc[3]; + span->attrStart[attr][1] = tc[1] / tc[3]; + span->attrStart[attr][2] = tc[2] / tc[3]; + span->attrStart[attr][3] = 1.0; + } + else { + ASSIGN_4V(span->attrStart[attr], 0.0F, 0.0F, 0.0F, 1.0F); + } + ASSIGN_4V(span->attrStepX[attr], 0.0F, 0.0F, 0.0F, 0.0F); + ASSIGN_4V(span->attrStepY[attr], 0.0F, 0.0F, 0.0F, 0.0F); + } } } /** - * Init span's texcoord interpolation values to the RasterPos texcoords. - * Used during setup for glDraw/CopyPixels. + * Interpolate the active attributes (and'd with attrMask) to + * fill in span->array->attribs[]. + * Perspective correction will be done. The point/line/triangle function + * should have computed attrStart/Step values for FRAG_ATTRIB_WPOS[3]! */ -void -_swrast_span_default_texcoords( GLcontext *ctx, SWspan *span ) +static INLINE void +interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask) { - GLuint i; - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - const GLuint attr = FRAG_ATTRIB_TEX0 + i; - const GLfloat *tc = ctx->Current.RasterTexCoords[i]; - if (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { - COPY_4V(span->attrStart[attr], tc); - } - else if (tc[3] > 0.0F) { - /* use (s/q, t/q, r/q, 1) */ - span->attrStart[attr][0] = tc[0] / tc[3]; - span->attrStart[attr][1] = tc[1] / tc[3]; - span->attrStart[attr][2] = tc[2] / tc[3]; - span->attrStart[attr][3] = 1.0; - } - else { - ASSIGN_4V(span->attrStart[attr], 0.0F, 0.0F, 0.0F, 1.0F); + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + + ATTRIB_LOOP_BEGIN + if (attrMask & (1 << attr)) { + const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; + GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; + const GLfloat dv0dx = span->attrStepX[attr][0]; + const GLfloat dv1dx = span->attrStepX[attr][1]; + const GLfloat dv2dx = span->attrStepX[attr][2]; + const GLfloat dv3dx = span->attrStepX[attr][3]; + GLfloat v0 = span->attrStart[attr][0]; + GLfloat v1 = span->attrStart[attr][1]; + GLfloat v2 = span->attrStart[attr][2]; + GLfloat v3 = span->attrStart[attr][3]; + GLuint k; + for (k = 0; k < span->end; k++) { + const GLfloat invW = 1.0f / w; + span->array->attribs[attr][k][0] = v0 * invW; + span->array->attribs[attr][k][1] = v1 * invW; + span->array->attribs[attr][k][2] = v2 * invW; + span->array->attribs[attr][k][3] = v3 * invW; + v0 += dv0dx; + v1 += dv1dx; + v2 += dv2dx; + v3 += dv3dx; + w += dwdx; + } + span->arrayAttribs |= (1 << attr); } - ASSIGN_4V(span->attrStepX[attr], 0.0F, 0.0F, 0.0F, 0.0F); - ASSIGN_4V(span->attrStepY[attr], 0.0F, 0.0F, 0.0F, 0.0F); - } - span->interpMask |= SPAN_TEXTURE; + ATTRIB_LOOP_END } /** - * Interpolate primary colors to fill in the span->array->color array. + * Interpolate primary colors to fill in the span->array->rgba8 (or rgb16) + * color array. */ static INLINE void -interpolate_colors(SWspan *span) +interpolate_int_colors(GLcontext *ctx, SWspan *span) { const GLuint n = span->end; GLuint i; - ASSERT((span->interpMask & SPAN_RGBA) && - !(span->arrayMask & SPAN_RGBA)); +#if CHAN_BITS != 32 + ASSERT(!(span->arrayMask & SPAN_RGBA)); +#endif switch (span->array->ChanType) { #if CHAN_BITS != 32 case GL_UNSIGNED_BYTE: { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + GLubyte (*rgba)[4] = span->array->rgba8; if (span->interpMask & SPAN_FLAT) { GLubyte color[4]; color[RCOMP] = FixedToInt(span->red); @@ -246,7 +255,7 @@ interpolate_colors(SWspan *span) break; case GL_UNSIGNED_SHORT: { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; + GLushort (*rgba)[4] = span->array->rgba16; if (span->interpMask & SPAN_FLAT) { GLushort color[4]; color[RCOMP] = FixedToInt(span->red); @@ -258,7 +267,7 @@ interpolate_colors(SWspan *span) } } else { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; + GLushort (*rgba)[4] = span->array->rgba16; GLfixed r, g, b, a; GLint dr, dg, db, da; r = span->red; @@ -284,162 +293,76 @@ interpolate_colors(SWspan *span) break; #endif case GL_FLOAT: - { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - GLfloat r, g, b, a, dr, dg, db, da; - r = span->red; - g = span->green; - b = span->blue; - a = span->alpha; - if (span->interpMask & SPAN_FLAT) { - dr = dg = db = da = 0.0; - } - else { - dr = span->redStep; - dg = span->greenStep; - db = span->blueStep; - da = span->alphaStep; - } - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = r; - rgba[i][GCOMP] = g; - rgba[i][BCOMP] = b; - rgba[i][ACOMP] = a; - r += dr; - g += dg; - b += db; - a += da; - } - } + interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); break; default: - _mesa_problem(NULL, "bad datatype in interpolate_colors"); + _mesa_problem(NULL, "bad datatype in interpolate_int_colors"); } span->arrayMask |= SPAN_RGBA; } /** - * Interpolate specular/secondary colors. + * Populate the FRAG_ATTRIB_COL0 array. */ static INLINE void -interpolate_specular(SWspan *span) +interpolate_float_colors(SWspan *span) { + GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; const GLuint n = span->end; GLuint i; - switch (span->array->ChanType) { -#if CHAN_BITS != 32 - case GL_UNSIGNED_BYTE: - { - GLubyte (*spec)[4] = span->array->color.sz1.spec; - if (span->interpMask & SPAN_FLAT) { - GLubyte color[4]; - color[RCOMP] = FixedToInt(span->specRed); - color[GCOMP] = FixedToInt(span->specGreen); - color[BCOMP] = FixedToInt(span->specBlue); - color[ACOMP] = 0; - for (i = 0; i < n; i++) { - COPY_4UBV(spec[i], color); - } - } - else { - GLfixed r = span->specRed; - GLfixed g = span->specGreen; - GLfixed b = span->specBlue; - GLint dr = span->specRedStep; - GLint dg = span->specGreenStep; - GLint db = span->specBlueStep; - for (i = 0; i < n; i++) { - spec[i][RCOMP] = CLAMP(FixedToChan(r), 0, 255); - spec[i][GCOMP] = CLAMP(FixedToChan(g), 0, 255); - spec[i][BCOMP] = CLAMP(FixedToChan(b), 0, 255); - spec[i][ACOMP] = 0; - r += dr; - g += dg; - b += db; - } - } + assert(!(span->arrayAttribs & FRAG_BIT_COL0)); + + if (span->arrayMask & SPAN_RGBA) { + /* convert array of int colors */ + for (i = 0; i < n; i++) { + col0[i][0] = UBYTE_TO_FLOAT(span->array->rgba8[i][0]); + col0[i][1] = UBYTE_TO_FLOAT(span->array->rgba8[i][1]); + col0[i][2] = UBYTE_TO_FLOAT(span->array->rgba8[i][2]); + col0[i][3] = UBYTE_TO_FLOAT(span->array->rgba8[i][3]); } - break; - case GL_UNSIGNED_SHORT: - { - GLushort (*spec)[4] = span->array->color.sz2.spec; - if (span->interpMask & SPAN_FLAT) { - GLushort color[4]; - color[RCOMP] = FixedToInt(span->specRed); - color[GCOMP] = FixedToInt(span->specGreen); - color[BCOMP] = FixedToInt(span->specBlue); - color[ACOMP] = 0; - for (i = 0; i < n; i++) { - COPY_4V(spec[i], color); - } - } - else { - GLfixed r = FloatToFixed(span->specRed); - GLfixed g = FloatToFixed(span->specGreen); - GLfixed b = FloatToFixed(span->specBlue); - GLint dr = FloatToFixed(span->specRedStep); - GLint dg = FloatToFixed(span->specGreenStep); - GLint db = FloatToFixed(span->specBlueStep); - for (i = 0; i < n; i++) { - spec[i][RCOMP] = FixedToInt(r); - spec[i][GCOMP] = FixedToInt(g); - spec[i][BCOMP] = FixedToInt(b); - spec[i][ACOMP] = 0; - r += dr; - g += dg; - b += db; - } + } + else { + /* interpolate red/green/blue/alpha to get float colors */ + ASSERT(span->interpMask & SPAN_RGBA); + if (span->interpMask & SPAN_FLAT) { + GLfloat r = FixedToFloat(span->red); + GLfloat g = FixedToFloat(span->green); + GLfloat b = FixedToFloat(span->blue); + GLfloat a = FixedToFloat(span->alpha); + for (i = 0; i < n; i++) { + ASSIGN_4V(col0[i], r, g, b, a); } } - break; -#endif - case GL_FLOAT: - { - GLfloat (*spec)[4] = span->array->attribs[FRAG_ATTRIB_COL1]; -#if CHAN_BITS <= 16 - GLfloat r = CHAN_TO_FLOAT(FixedToChan(span->specRed)); - GLfloat g = CHAN_TO_FLOAT(FixedToChan(span->specGreen)); - GLfloat b = CHAN_TO_FLOAT(FixedToChan(span->specBlue)); -#else - GLfloat r = span->specRed; - GLfloat g = span->specGreen; - GLfloat b = span->specBlue; -#endif - GLfloat dr, dg, db; - if (span->interpMask & SPAN_FLAT) { - dr = dg = db = 0.0; - } - else { -#if CHAN_BITS <= 16 - dr = CHAN_TO_FLOAT(FixedToChan(span->specRedStep)); - dg = CHAN_TO_FLOAT(FixedToChan(span->specGreenStep)); - db = CHAN_TO_FLOAT(FixedToChan(span->specBlueStep)); -#else - dr = span->specRedStep; - dg = span->specGreenStep; - db = span->specBlueStep; -#endif - } + else { + GLfloat r = FixedToFloat(span->red); + GLfloat g = FixedToFloat(span->green); + GLfloat b = FixedToFloat(span->blue); + GLfloat a = FixedToFloat(span->alpha); + GLfloat dr = FixedToFloat(span->redStep); + GLfloat dg = FixedToFloat(span->greenStep); + GLfloat db = FixedToFloat(span->blueStep); + GLfloat da = FixedToFloat(span->alphaStep); for (i = 0; i < n; i++) { - spec[i][RCOMP] = r; - spec[i][GCOMP] = g; - spec[i][BCOMP] = b; - spec[i][ACOMP] = 0.0F; + col0[i][0] = r; + col0[i][1] = g; + col0[i][2] = b; + col0[i][3] = a; r += dr; g += dg; b += db; + a += da; } } - break; - default: - _mesa_problem(NULL, "bad datatype in interpolate_specular"); } - span->arrayMask |= SPAN_SPEC; + + span->arrayAttribs |= FRAG_BIT_COL0; + span->array->ChanType = GL_FLOAT; } + /* Fill in the span.color.index array from the interpolation values */ static INLINE void interpolate_indexes(GLcontext *ctx, SWspan *span) @@ -450,8 +373,8 @@ interpolate_indexes(GLcontext *ctx, SWspan *span) GLuint *indexes = span->array->index; GLuint i; (void) ctx; - ASSERT((span->interpMask & SPAN_INDEX) && - !(span->arrayMask & SPAN_INDEX)); + + ASSERT(!(span->arrayMask & SPAN_INDEX)); if ((span->interpMask & SPAN_FLAT) || (indexStep == 0)) { /* constant color */ @@ -472,35 +395,16 @@ interpolate_indexes(GLcontext *ctx, SWspan *span) } -/* Fill in the span.array.fog values from the interpolation values */ -static INLINE void -interpolate_fog(const GLcontext *ctx, SWspan *span) -{ - GLfloat (*fog)[4] = span->array->attribs[FRAG_ATTRIB_FOGC]; - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; - const GLuint haveW = (span->interpMask & SPAN_W); - const GLfloat wStep = haveW ? span->attrStepX[FRAG_ATTRIB_WPOS][3] : 0.0F; - GLfloat w = haveW ? span->attrStart[FRAG_ATTRIB_WPOS][3] : 1.0F; - GLuint i; - for (i = 0; i < span->end; i++) { - fog[i][0] = fogCoord / w; - fogCoord += fogStep; - w += wStep; - } - span->arrayMask |= SPAN_FOG; -} - - -/* Fill in the span.zArray array from the interpolation values */ +/** + * Fill in the span.zArray array from the span->z, zStep values. + */ void _swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ) { const GLuint n = span->end; GLuint i; - ASSERT((span->interpMask & SPAN_Z) && - !(span->arrayMask & SPAN_Z)); + ASSERT(!(span->arrayMask & SPAN_Z)); if (ctx->DrawBuffer->Visual.depthBits <= 16) { GLfixed zval = span->z; @@ -524,7 +428,8 @@ _swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ) } -/* +/** + * Compute mipmap LOD from partial derivatives. * This the ideal solution, as given in the OpenGL spec. */ #if 0 @@ -546,8 +451,9 @@ compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, #endif -/* - * This is a faster approximation +/** + * Compute mipmap LOD from partial derivatives. + * This is a faster approximation than above function. */ GLfloat _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, @@ -572,14 +478,15 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, /** - * Fill in the span.texcoords array from the interpolation values. + * Fill in the span.array->attrib[FRAG_ATTRIB_TEXn] arrays from the + * using the attrStart/Step values. + * + * This function only used during fixed-function fragment processing. + * * Note: in the places where we divide by Q (or mult by invQ) we're * really doing two things: perspective correction and texcoord * projection. Remember, for texcoord (s,t,r,q) we need to index * texels with (s/q, t/q, r/q). - * If we're using a fragment program, we never do the division - * for texcoord projection. That's done by the TXP instruction - * or user-written code. */ static void interpolate_texcoords(GLcontext *ctx, SWspan *span) @@ -588,11 +495,6 @@ interpolate_texcoords(GLcontext *ctx, SWspan *span) = (ctx->Texture._EnabledCoordUnits > 1) ? ctx->Const.MaxTextureUnits : 1; GLuint u; - ASSERT(span->interpMask & SPAN_TEXTURE); - ASSERT(!(span->arrayMask & SPAN_TEXTURE)); - - span->arrayMask |= SPAN_TEXTURE; - /* XXX CoordUnits vs. ImageUnits */ for (u = 0; u < maxUnit; u++) { if (ctx->Texture._EnabledCoordUnits & (1 << u)) { @@ -724,55 +626,6 @@ interpolate_texcoords(GLcontext *ctx, SWspan *span) } - -/** - * Fill in the arrays->attribs[FRAG_ATTRIB_VARx] arrays from the - * interpolation values. - * XXX since interpolants/arrays are getting uniformed, we might merge - * this with interpolate_texcoords(), interpolate_Fog(), etc. someday. - */ -static INLINE void -interpolate_varying(GLcontext *ctx, SWspan *span) -{ - GLuint var; - const GLbitfield inputsUsed = ctx->FragmentProgram._Current->Base.InputsRead; - - ASSERT(span->interpMask & SPAN_VARYING); - ASSERT(!(span->arrayMask & SPAN_VARYING)); - - span->arrayMask |= SPAN_VARYING; - - for (var = 0; var < MAX_VARYING; var++) { - if (inputsUsed & FRAG_BIT_VAR(var)) { - const GLuint attr = FRAG_ATTRIB_VAR0 + var; - const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; - GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; - const GLfloat dv0dx = span->attrStepX[attr][0]; - const GLfloat dv1dx = span->attrStepX[attr][1]; - const GLfloat dv2dx = span->attrStepX[attr][2]; - const GLfloat dv3dx = span->attrStepX[attr][3]; - GLfloat v0 = span->attrStart[attr][0]; - GLfloat v1 = span->attrStart[attr][1]; - GLfloat v2 = span->attrStart[attr][2]; - GLfloat v3 = span->attrStart[attr][3]; - GLuint k; - for (k = 0; k < span->end; k++) { - GLfloat invW = 1.0f / w; - span->array->attribs[attr][k][0] = v0 * invW; - span->array->attribs[attr][k][1] = v1 * invW; - span->array->attribs[attr][k][2] = v2 * invW; - span->array->attribs[attr][k][3] = v3 * invW; - v0 += dv0dx; - v1 += dv1dx; - v2 += dv2dx; - v3 += dv3dx; - w += dwdx; - } - } - } -} - - /** * Fill in the arrays->attribs[FRAG_ATTRIB_WPOS] array. */ @@ -934,7 +787,9 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || span->primitive == GL_POLYGON || span->primitive == GL_BITMAP); ASSERT((span->interpMask | span->arrayMask) & SPAN_INDEX); + /* ASSERT((span->interpMask & span->arrayMask) == 0); + */ if (span->arrayMask & SPAN_MASK) { /* mask was initialized by caller, probably glBitmap */ @@ -981,7 +836,7 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) /* Stencil and Z testing */ if (ctx->Depth.Test || ctx->Stencil.Enabled) { - if (span->interpMask & SPAN_Z) + if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); if (ctx->Stencil.Enabled) { @@ -1022,7 +877,7 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) ctx->Color.IndexLogicOpEnabled || ctx->Color.IndexMask != 0xffffffff || (span->arrayMask & SPAN_COVERAGE)) { - if (span->interpMask & SPAN_INDEX) { + if (!(span->arrayMask & SPAN_INDEX) /*span->interpMask & SPAN_INDEX*/) { interpolate_indexes(ctx, span); } } @@ -1071,7 +926,7 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) _swrast_mask_ci_span(ctx, rb, span); } - if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) { + if (!(span->arrayMask & SPAN_INDEX) && span->indexStep == 0) { /* all fragments have same color index */ GLubyte index8; GLushort index16; @@ -1151,63 +1006,52 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) /** - * Add specular color to base color. This is used only when - * GL_LIGHT_MODEL_COLOR_CONTROL = GL_SEPARATE_SPECULAR_COLOR. + * Add specular colors to primary colors. + * Only called during fixed-function operation. + * Result is float color array (FRAG_ATTRIB_COL0). */ static INLINE void add_specular(GLcontext *ctx, SWspan *span) { - switch (span->array->ChanType) { - case GL_UNSIGNED_BYTE: - { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; - GLubyte (*spec)[4] = span->array->color.sz1.spec; - GLuint i; - for (i = 0; i < span->end; i++) { - GLint r = rgba[i][RCOMP] + spec[i][RCOMP]; - GLint g = rgba[i][GCOMP] + spec[i][GCOMP]; - GLint b = rgba[i][BCOMP] + spec[i][BCOMP]; - GLint a = rgba[i][ACOMP] + spec[i][ACOMP]; - rgba[i][RCOMP] = MIN2(r, 255); - rgba[i][GCOMP] = MIN2(g, 255); - rgba[i][BCOMP] = MIN2(b, 255); - rgba[i][ACOMP] = MIN2(a, 255); - } + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLubyte *mask = span->array->mask; + GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*col1)[4] = span->array->attribs[FRAG_ATTRIB_COL1]; + GLuint i; + + ASSERT(!ctx->FragmentProgram._Current); + ASSERT(span->arrayMask & SPAN_RGBA); + ASSERT(swrast->_ActiveAttribMask & FRAG_BIT_COL1); + + if (span->array->ChanType == GL_FLOAT) { + if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { + interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); } - break; - case GL_UNSIGNED_SHORT: - { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; - GLushort (*spec)[4] = span->array->color.sz2.spec; - GLuint i; - for (i = 0; i < span->end; i++) { - GLint r = rgba[i][RCOMP] + spec[i][RCOMP]; - GLint g = rgba[i][GCOMP] + spec[i][GCOMP]; - GLint b = rgba[i][BCOMP] + spec[i][BCOMP]; - GLint a = rgba[i][ACOMP] + spec[i][ACOMP]; - rgba[i][RCOMP] = MIN2(r, 65535); - rgba[i][GCOMP] = MIN2(g, 65535); - rgba[i][BCOMP] = MIN2(b, 65535); - rgba[i][ACOMP] = MIN2(a, 65535); - } + } + else { + /* need float colors */ + if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { + interpolate_float_colors(span); } - break; - case GL_FLOAT: - { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - GLfloat (*spec)[4] = span->array->attribs[FRAG_ATTRIB_COL1]; - GLuint i; - for (i = 0; i < span->end; i++) { - rgba[i][RCOMP] += spec[i][RCOMP]; - rgba[i][GCOMP] += spec[i][GCOMP]; - rgba[i][BCOMP] += spec[i][BCOMP]; - rgba[i][ACOMP] += spec[i][ACOMP]; - } + } + + if ((span->arrayAttribs & FRAG_BIT_COL1) == 0) { + /* XXX could avoid this and interpolate COL1 in the loop below */ + interpolate_active_attribs(ctx, span, FRAG_BIT_COL1); + } + + ASSERT(span->arrayAttribs & FRAG_BIT_COL0); + ASSERT(span->arrayAttribs & FRAG_BIT_COL1); + + for (i = 0; i < span->end; i++) { + if (mask[i]) { + col0[i][0] += col1[i][0]; + col0[i][1] += col1[i][1]; + col0[i][2] += col1[i][2]; } - break; - default: - _mesa_problem(ctx, "Invalid datatype in add_specular"); } + + span->array->ChanType = GL_FLOAT; } @@ -1220,7 +1064,7 @@ apply_aa_coverage(SWspan *span) const GLfloat *coverage = span->array->coverage; GLuint i; if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + GLubyte (*rgba)[4] = span->array->rgba8; for (i = 0; i < span->end; i++) { const GLfloat a = rgba[i][ACOMP] * coverage[i]; rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0, 255.0); @@ -1229,7 +1073,7 @@ apply_aa_coverage(SWspan *span) } } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->color.sz2.rgba; + GLushort (*rgba)[4] = span->array->rgba16; for (i = 0; i < span->end; i++) { const GLfloat a = rgba[i][ACOMP] * coverage[i]; rgba[i][ACOMP] = (GLushort) CLAMP(a, 0.0, 65535.0); @@ -1239,6 +1083,7 @@ apply_aa_coverage(SWspan *span) GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; for (i = 0; i < span->end; i++) { rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i]; + /* clamp later */ } } } @@ -1278,18 +1123,18 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output) span->array->ChanType = GL_FLOAT; } else if (span->array->ChanType == GL_UNSIGNED_BYTE) { - src = span->array->color.sz1.rgba; + src = span->array->rgba8; } else { ASSERT(span->array->ChanType == GL_UNSIGNED_SHORT); - src = span->array->color.sz2.rgba; + src = span->array->rgba16; } if (newType == GL_UNSIGNED_BYTE) { - dst = span->array->color.sz1.rgba; + dst = span->array->rgba8; } else if (newType == GL_UNSIGNED_SHORT) { - dst = span->array->color.sz2.rgba; + dst = span->array->rgba16; } else { dst = span->array->attribs[FRAG_ATTRIB_COL0]; @@ -1321,42 +1166,16 @@ shade_texture_span(GLcontext *ctx, SWspan *span) inputsRead = ~0; } - if ((inputsRead & FRAG_BIT_COL0) && (span->interpMask & SPAN_RGBA)) - interpolate_colors(span); - - if (ctx->Texture._EnabledCoordUnits && (span->interpMask & SPAN_TEXTURE)) - interpolate_texcoords(ctx, span); - if (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { - /* use float colors if running a fragment program or shader */ - const GLenum oldType = span->array->ChanType; - const GLenum newType = GL_FLOAT; - - if ((inputsRead & FRAG_BIT_COL0) && (oldType != newType)) { - GLvoid *src = (oldType == GL_UNSIGNED_BYTE) - ? (GLvoid *) span->array->color.sz1.rgba - : (GLvoid *) span->array->color.sz2.rgba; - assert(span->arrayMask & SPAN_RGBA); - _mesa_convert_colors(oldType, src, - newType, span->array->attribs[FRAG_ATTRIB_COL0], - span->end, span->array->mask); - } - span->array->ChanType = newType; - - /* fragment programs/shaders may need specular, fog and Z coords */ - if ((inputsRead & FRAG_BIT_COL1) && (span->interpMask & SPAN_SPEC)) - interpolate_specular(span); + /* programmable shading */ + span->array->ChanType = GL_FLOAT; - if ((inputsRead & FRAG_BIT_FOGC) && (span->interpMask & SPAN_FOG)) - interpolate_fog(ctx, span); + interpolate_active_attribs(ctx, span, ~0); - if (span->interpMask & SPAN_Z) + if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z (ctx, span); - if ((inputsRead >= FRAG_BIT_VAR0) && (span->interpMask & SPAN_VARYING)) - interpolate_varying(ctx, span); - #if 0 if (inputsRead & FRAG_BIT_WPOS) #else @@ -1373,8 +1192,20 @@ shade_texture_span(GLcontext *ctx, SWspan *span) _swrast_exec_fragment_shader(ctx, span); } } - else if (ctx->Texture._EnabledUnits && (span->arrayMask & SPAN_TEXTURE)) { + else if (ctx->Texture._EnabledUnits) { /* conventional texturing */ + +#if CHAN_BITS == 32 + if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { + interpolate_int_colors(ctx, span); + } +#else + if (!(span->arrayMask & SPAN_RGBA)) + interpolate_int_colors(ctx, span); +#endif + if ((span->arrayAttribs & FRAG_BITS_TEX_ANY) == 0x0) + interpolate_texcoords(ctx, span); + _swrast_texture_span(ctx, span); } } @@ -1395,13 +1226,13 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); const GLbitfield origInterpMask = span->interpMask; const GLbitfield origArrayMask = span->arrayMask; + const GLbitfield origArrayAttribs = span->arrayAttribs; const GLenum chanType = span->array->ChanType; const GLboolean shader = (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled); const GLboolean shaderOrTexture = shader || ctx->Texture._EnabledUnits; struct gl_framebuffer *fb = ctx->DrawBuffer; GLuint output; - GLboolean deferredTexture; /* printf("%s() interp 0x%x array 0x%x\n", __FUNCTION__, @@ -1413,41 +1244,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) span->primitive == GL_POLYGON || span->primitive == GL_BITMAP); ASSERT(span->end <= MAX_WIDTH); - ASSERT((span->interpMask & span->arrayMask) == 0); - ASSERT((span->interpMask & SPAN_RGBA) ^ (span->arrayMask & SPAN_RGBA)); - - /* check for conditions that prevent deferred shading (doing shading - * after stencil/ztest). - * XXX move this code into state validation. - */ - if (ctx->Color.AlphaEnabled) { - /* alpha test depends on post-texture/shader colors */ - deferredTexture = GL_FALSE; - } - else if (shaderOrTexture) { - if (ctx->FragmentProgram._Current) { - if (ctx->FragmentProgram._Current->Base.OutputsWritten - & (1 << FRAG_RESULT_DEPR)) { - /* Z comes from fragment program/shader */ - deferredTexture = GL_FALSE; - } - else if (ctx->Query.CurrentOcclusionObject) { - /* occlusion query depends on shader discard/kill results */ - deferredTexture = GL_FALSE; - } - else { - deferredTexture = GL_TRUE; - } - } - else { - /* ATI frag shader or conventional texturing */ - deferredTexture = GL_TRUE; - } - } - else { - /* no texturing or shadering */ - deferredTexture = GL_FALSE; - } /* Fragment write masks */ if (span->arrayMask & SPAN_MASK) { @@ -1486,12 +1282,10 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) stipple_polygon_span(ctx, span); } - /* This is the normal place to compute the resulting fragment color/Z. - * As an optimization, we try to defer this until after Z/stencil - * testing in order to try to avoid computing colors that we won't - * actually need. + /* This is the normal place to compute the fragment color/Z + * from texturing or shading. */ - if (shaderOrTexture && !deferredTexture) { + if (shaderOrTexture && !swrast->_DeferredTexture) { shade_texture_span(ctx, span); } @@ -1504,7 +1298,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) /* Stencil and Z testing */ if (ctx->Stencil.Enabled || ctx->Depth.Test) { - if (span->interpMask & SPAN_Z) + if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); if (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0) { @@ -1544,14 +1338,19 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) * a good chance that many fragments will have already been killed by * Z/stencil testing. */ - if (deferredTexture) { - ASSERT(shaderOrTexture); + if (shaderOrTexture && swrast->_DeferredTexture) { shade_texture_span(ctx, span); } +#if CHAN_BITS == 32 + if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { + interpolate_int_colors(ctx, span); + } +#else if ((span->arrayMask & SPAN_RGBA) == 0) { - interpolate_colors(span); + interpolate_int_colors(ctx, span); } +#endif ASSERT(span->arrayMask & SPAN_RGBA); @@ -1560,17 +1359,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (ctx->Fog.ColorSumEnabled || (ctx->Light.Enabled && ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { - if (span->interpMask & SPAN_SPEC) { - interpolate_specular(span); - } - if (span->arrayMask & SPAN_SPEC) { - add_specular(ctx, span); - } - else { - /* We probably added the base/specular colors during the - * vertex stage! - */ - } + add_specular(ctx, span); } } @@ -1659,6 +1448,7 @@ end: /* restore these values before returning */ span->interpMask = origInterpMask; span->arrayMask = origArrayMask; + span->arrayAttribs = origArrayAttribs; span->array->ChanType = chanType; } @@ -1921,18 +1711,9 @@ _swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, void *rbPixels; /* - * Determine pixel size (in bytes). * Point rbPixels to a temporary space (use specular color arrays). */ - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - rbPixels = span->array->color.sz1.spec; - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - rbPixels = span->array->color.sz2.spec; - } - else { - rbPixels = span->array->attribs[FRAG_ATTRIB_COL1]; - } + rbPixels = span->array->attribs[FRAG_ATTRIB_COL1]; /* Get destination values from renderbuffer */ if (span->arrayMask & SPAN_XY) { diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index f650a27d665..585cce91ee9 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -33,45 +33,24 @@ /** * \defgroup SpanFlags - * Bitflags used for interpMask and arrayMask fields below to indicate - * which interpolant values and fragment arrays are in use, respectively. + * Special bitflags to describe span data. * - * XXX We should replace these flags with the FRAG_BIT_ values someday... + * In general, the point/line/triangle functions interpolate/emit the + * attributes specified by swrast->_ActiveAttribs (i.e. FRAT_BIT_* values). + * Some things don't fit into that, though, so we have these flags. */ /*@{*/ -#define SPAN_RGBA 0x001 -#define SPAN_SPEC 0x002 -#define SPAN_INDEX 0x004 -#define SPAN_Z 0x008 -#define SPAN_W 0x010 -#define SPAN_FOG 0x020 -#define SPAN_TEXTURE 0x040 -#define SPAN_INT_TEXTURE 0x080 -#define SPAN_LAMBDA 0x100 -#define SPAN_COVERAGE 0x200 -#define SPAN_FLAT 0x400 /**< flat shading? */ -#define SPAN_XY 0x800 -#define SPAN_MASK 0x1000 -#define SPAN_VARYING 0x2000 +#define SPAN_RGBA 0x01 /**< interpMask and arrayMask */ +#define SPAN_INDEX 0x02 /**< interpMask and arrayMask */ +#define SPAN_Z 0x04 /**< interpMask and arrayMask */ +#define SPAN_FLAT 0x08 /**< interpMask: flat shading? */ +#define SPAN_XY 0x10 /**< array.x[], y[] valid? */ +#define SPAN_MASK 0x20 /**< was array.mask[] filled in by caller? */ +#define SPAN_LAMBDA 0x40 /**< array.lambda[] valid? */ +#define SPAN_COVERAGE 0x80 /**< array.coverage[] valid? */ /*@}*/ -#if 0 -/* alternate arrangement for code below */ -struct arrays2 { - union { - GLubyte sz1[MAX_WIDTH][4]; /* primary color */ - GLushort sz2[MAX_WIDTH][4]; - } rgba; - union { - GLubyte sz1[MAX_WIDTH][4]; /* specular color and temp storage */ - GLushort sz2[MAX_WIDTH][4]; - } spec; -}; -#endif - - - /** * \sw_span_arrays * \brief Arrays of fragment values. @@ -92,26 +71,19 @@ typedef struct sw_span_arrays GLubyte mask[MAX_WIDTH]; GLenum ChanType; /**< Color channel type, GL_UNSIGNED_BYTE, GL_FLOAT */ - union { - struct { - GLubyte rgba[MAX_WIDTH][4]; /**< primary color */ - GLubyte spec[MAX_WIDTH][4]; /**< specular color and temp storage */ - } sz1; - struct { - GLushort rgba[MAX_WIDTH][4]; - GLushort spec[MAX_WIDTH][4]; - } sz2; - } color; - /** XXX these are temporary fields, pointing into above color arrays */ - GLchan (*rgba)[4]; - GLchan (*spec)[4]; + /** Attribute arrays that don't fit into attribs[] array above */ + /*@{*/ + GLubyte rgba8[MAX_WIDTH][4]; + GLushort rgba16[MAX_WIDTH][4]; + GLchan (*rgba)[4]; /** either == rgba8 or rgba16 */ GLint x[MAX_WIDTH]; /**< fragment X coords */ GLint y[MAX_WIDTH]; /**< fragment Y coords */ GLuint z[MAX_WIDTH]; /**< fragment Z coords */ GLuint index[MAX_WIDTH]; /**< Color indexes */ GLfloat lambda[MAX_TEXTURE_COORD_UNITS][MAX_WIDTH]; /**< Texture LOD */ GLfloat coverage[MAX_WIDTH]; /**< Fragment coverage for AA/smoothing */ + /*@}*/ } SWspanarrays; @@ -160,26 +132,13 @@ typedef struct sw_span /* For horizontal spans, step is the partial derivative wrt X. * For lines, step is the delta from one fragment to the next. */ -#if CHAN_TYPE == GL_FLOAT - GLfloat red, redStep; - GLfloat green, greenStep; - GLfloat blue, blueStep; - GLfloat alpha, alphaStep; - GLfloat specRed, specRedStep; - GLfloat specGreen, specGreenStep; - GLfloat specBlue, specBlueStep; -#else /* CHAN_TYPE == GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT */ GLfixed red, redStep; GLfixed green, greenStep; GLfixed blue, blueStep; GLfixed alpha, alphaStep; - GLfixed specRed, specRedStep; - GLfixed specGreen, specGreenStep; - GLfixed specBlue, specBlueStep; -#endif GLfixed index, indexStep; - GLfixed z, zStep; /* XXX z should probably be GLuint */ - GLfixed intTex[2], intTexStep[2]; /* s, t only */ + GLfixed z, zStep; /**< XXX z should probably be GLuint */ + GLfixed intTex[2], intTexStep[2]; /**< (s,t) for unit[0] only */ /** * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates @@ -187,6 +146,8 @@ typedef struct sw_span */ GLbitfield arrayMask; + GLbitfield arrayAttribs; + /** * We store the arrays of fragment values in a separate struct so * that we can allocate sw_span structs on the stack without using @@ -203,6 +164,7 @@ do { \ (S).primitive = (PRIMITIVE); \ (S).interpMask = (INTERP_MASK); \ (S).arrayMask = (ARRAY_MASK); \ + (S).arrayAttribs = 0x0; \ (S).end = (END); \ (S).facing = 0; \ (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \ @@ -211,23 +173,11 @@ do { \ extern void -_swrast_span_default_z( GLcontext *ctx, SWspan *span ); +_swrast_span_default_attribs(GLcontext *ctx, SWspan *span); extern void _swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ); -extern void -_swrast_span_default_fog( GLcontext *ctx, SWspan *span ); - -extern void -_swrast_span_default_color( GLcontext *ctx, SWspan *span ); - -extern void -_swrast_span_default_secondary_color(GLcontext *ctx, SWspan *span); - -extern void -_swrast_span_default_texcoords( GLcontext *ctx, SWspan *span ); - extern GLfloat _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH, diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index ebb4c0d936d..4ac7222daa5 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -1080,7 +1080,6 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) GLuint unit; ASSERT(span->end < MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_TEXTURE); /* * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR) diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index fc9d29bbf7f..c2555452173 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -52,10 +52,10 @@ _swrast_culltriangle( GLcontext *ctx, const SWvertex *v1, const SWvertex *v2 ) { - GLfloat ex = v1->win[0] - v0->win[0]; - GLfloat ey = v1->win[1] - v0->win[1]; - GLfloat fx = v2->win[0] - v0->win[0]; - GLfloat fy = v2->win[1] - v0->win[1]; + GLfloat ex = v1->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0]; + GLfloat ey = v1->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1]; + GLfloat fx = v2->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0]; + GLfloat fy = v2->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat c = ex*fy-ey*fx; if (c * SWRAST_CONTEXT(ctx)->_BackfaceSign > 0) @@ -71,7 +71,7 @@ _swrast_culltriangle( GLcontext *ctx, */ #define NAME ci_triangle #define INTERP_Z 1 -#define INTERP_FOG 1 +#define INTERP_ATTRIBS 1 /* just for fog */ #define INTERP_INDEX 1 #define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span); #include "s_tritemp.h" @@ -83,7 +83,6 @@ _swrast_culltriangle( GLcontext *ctx, */ #define NAME flat_rgba_triangle #define INTERP_Z 1 -#define INTERP_FOG 1 #define SETUP_CODE \ ASSERT(ctx->Texture._EnabledCoordUnits == 0);\ ASSERT(ctx->Light.ShadeModel==GL_FLAT); \ @@ -106,7 +105,6 @@ _swrast_culltriangle( GLcontext *ctx, */ #define NAME smooth_rgba_triangle #define INTERP_Z 1 -#define INTERP_FOG 1 #define INTERP_RGB 1 #define INTERP_ALPHA 1 #define SETUP_CODE \ @@ -228,7 +226,6 @@ _swrast_culltriangle( GLcontext *ctx, #include "s_tritemp.h" - #if CHAN_TYPE != GL_FLOAT struct affine_info @@ -511,7 +508,6 @@ affine_span(GLcontext *ctx, SWspan *span, */ #define NAME affine_textured_triangle #define INTERP_Z 1 -#define INTERP_FOG 1 #define INTERP_RGB 1 #define INTERP_ALPHA 1 #define INTERP_INT_TEX 1 @@ -784,8 +780,6 @@ fast_persp_span(GLcontext *ctx, SWspan *span, */ #define NAME persp_textured_triangle #define INTERP_Z 1 -#define INTERP_W 1 -#define INTERP_FOG 1 #define INTERP_RGB 1 #define INTERP_ALPHA 1 #define INTERP_ATTRIBS 1 @@ -843,10 +837,8 @@ fast_persp_span(GLcontext *ctx, SWspan *span, #include "s_tritemp.h" +#endif /*CHAN_TYPE != GL_FLOAT*/ -#endif /* CHAN_BITS != GL_FLOAT */ - - /* @@ -854,10 +846,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, */ #define NAME general_triangle #define INTERP_Z 1 -#define INTERP_W 1 -#define INTERP_FOG 1 #define INTERP_RGB 1 -#define INTERP_SPEC 1 #define INTERP_ALPHA 1 #define INTERP_ATTRIBS 1 #define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span); @@ -924,51 +913,47 @@ nodraw_triangle( GLcontext *ctx, * draw the triangle, then restore the original primary color. * Inefficient, but seldom needed. */ -void _swrast_add_spec_terms_triangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2 ) +void +_swrast_add_spec_terms_triangle(GLcontext *ctx, const SWvertex *v0, + const SWvertex *v1, const SWvertex *v2) { SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */ SWvertex *ncv1 = (SWvertex *)v1; SWvertex *ncv2 = (SWvertex *)v2; -#if CHAN_TYPE == GL_FLOAT GLfloat rSum, gSum, bSum; -#else - GLint rSum, gSum, bSum; -#endif - GLchan c[3][4]; + GLchan cSave[3][4]; + /* save original colors */ - COPY_CHAN4( c[0], ncv0->color ); - COPY_CHAN4( c[1], ncv1->color ); - COPY_CHAN4( c[2], ncv2->color ); + COPY_CHAN4( cSave[0], ncv0->color ); + COPY_CHAN4( cSave[1], ncv1->color ); + COPY_CHAN4( cSave[2], ncv2->color ); /* sum v0 */ - rSum = ncv0->color[0] + ncv0->specular[0]; - gSum = ncv0->color[1] + ncv0->specular[1]; - bSum = ncv0->color[2] + ncv0->specular[2]; - ncv0->color[0] = MIN2(rSum, CHAN_MAX); - ncv0->color[1] = MIN2(gSum, CHAN_MAX); - ncv0->color[2] = MIN2(bSum, CHAN_MAX); + rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; + gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; + bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); /* sum v1 */ - rSum = ncv1->color[0] + ncv1->specular[0]; - gSum = ncv1->color[1] + ncv1->specular[1]; - bSum = ncv1->color[2] + ncv1->specular[2]; - ncv1->color[0] = MIN2(rSum, CHAN_MAX); - ncv1->color[1] = MIN2(gSum, CHAN_MAX); - ncv1->color[2] = MIN2(bSum, CHAN_MAX); + rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; + gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; + bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; + UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); /* sum v2 */ - rSum = ncv2->color[0] + ncv2->specular[0]; - gSum = ncv2->color[1] + ncv2->specular[1]; - bSum = ncv2->color[2] + ncv2->specular[2]; - ncv2->color[0] = MIN2(rSum, CHAN_MAX); - ncv2->color[1] = MIN2(gSum, CHAN_MAX); - ncv2->color[2] = MIN2(bSum, CHAN_MAX); + rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[FRAG_ATTRIB_COL1][0]; + gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[FRAG_ATTRIB_COL1][1]; + bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[FRAG_ATTRIB_COL1][2]; + UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum); + UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum); /* draw */ SWRAST_CONTEXT(ctx)->SpecTriangle( ctx, ncv0, ncv1, ncv2 ); /* restore original colors */ - COPY_CHAN4( ncv0->color, c[0] ); - COPY_CHAN4( ncv1->color, c[1] ); - COPY_CHAN4( ncv2->color, c[2] ); + COPY_CHAN4( ncv0->color, cSave[0] ); + COPY_CHAN4( ncv1->color, cSave[1] ); + COPY_CHAN4( ncv2->color, cSave[2] ); } @@ -1044,9 +1029,15 @@ _swrast_choose_triangle( GLcontext *ctx ) return; } + /* + * XXX should examine swrast->_ActiveAttribMask to determine what + * needs to be interpolated. + */ if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Current || - ctx->ATIFragmentShader._Enabled) { + ctx->ATIFragmentShader._Enabled || + NEED_SECONDARY_COLOR(ctx) || + swrast->_FogEnabled) { /* Ugh, we do a _lot_ of tests to pick the best textured tri func */ const struct gl_texture_object *texObj2D; const struct gl_texture_image *texImg; @@ -1072,6 +1063,7 @@ _swrast_choose_triangle( GLcontext *ctx ) && (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA) && minFilter == magFilter && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR + && !swrast->_FogEnabled && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT) { if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) { if (minFilter == GL_NEAREST @@ -1091,7 +1083,7 @@ _swrast_choose_triangle( GLcontext *ctx ) } } else { -#if (CHAN_BITS == 16 || CHAN_BITS == 32) +#if CHAN_BITS != 8 USE(general_triangle); #else USE(affine_textured_triangle); @@ -1099,7 +1091,7 @@ _swrast_choose_triangle( GLcontext *ctx ) } } else { -#if (CHAN_BITS == 16 || CHAN_BITS == 32) +#if CHAN_BITS != 8 USE(general_triangle); #else USE(persp_textured_triangle); @@ -1112,14 +1104,23 @@ _swrast_choose_triangle( GLcontext *ctx ) } } else { - ASSERT(!ctx->Texture._EnabledCoordUnits); + ASSERT(!swrast->_FogEnabled); + ASSERT(!NEED_SECONDARY_COLOR(ctx)); if (ctx->Light.ShadeModel==GL_SMOOTH) { /* smooth shaded, no texturing, stippled or some raster ops */ - USE(smooth_rgba_triangle); +#if CHAN_BITS != 8 + USE(general_triangle); +#else + USE(smooth_rgba_triangle); +#endif } else { /* flat shaded, no texturing, stippled or some raster ops */ +#if CHAN_BITS != 8 + USE(general_triangle); +#else USE(flat_rgba_triangle); +#endif } } } diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index dcc3e958cb1..2a90ffd85f8 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -29,18 +29,16 @@ * * The following macros may be defined to indicate what auxillary information * must be interpolated across the triangle: - * INTERP_Z - if defined, interpolate vertex Z values - * INTERP_W - if defined, interpolate vertex W values - * INTERP_FOG - if defined, interpolate fog values - * INTERP_RGB - if defined, interpolate RGB values - * INTERP_ALPHA - if defined, interpolate Alpha values (req's INTERP_RGB) - * INTERP_SPEC - if defined, interpolate specular RGB values + * INTERP_Z - if defined, interpolate integer Z values + * INTERP_RGB - if defined, interpolate integer RGB values + * INTERP_ALPHA - if defined, interpolate integer Alpha values * INTERP_INDEX - if defined, interpolate color index values * INTERP_INT_TEX - if defined, interpolate integer ST texcoords - * (fast, simple 2-D texture mapping) + * (fast, simple 2-D texture mapping, without + * perspective correction) * INTERP_ATTRIBS - if defined, interpolate arbitrary attribs (texcoords, - * varying vars, etc) - * NOTE: OpenGL STRQ = Mesa STUV (R was taken for red) + * varying vars, etc) This also causes W to be + * computed for perspective correction). * * When one can directly address pixels in the color buffer the following * macros can be defined and used to compute pixel addresses during @@ -51,12 +49,11 @@ * Y==0 at bottom of screen and increases upward. * * Similarly, for direct depth buffer access, this type is used for depth - * buffer addressing: + * buffer addressing (see zRow): * DEPTH_TYPE - either GLushort or GLuint * * Optionally, one may provide one-time setup code per triangle: * SETUP_CODE - code which is to be executed once per triangle - * CLEANUP_CODE - code to execute at end of triangle * * The following macro MUST be defined: * RENDER_SPAN(span) - code to write a span of pixels. @@ -94,29 +91,6 @@ * SUB_PIXEL_BITS. */ -/* - * ColorTemp is used for intermediate color values. - */ -#if CHAN_TYPE == GL_FLOAT -#define ColorTemp GLfloat -#else -#define ColorTemp GLint /* same as GLfixed */ -#endif - - -/* - * Walk triangle edges with GLfixed or GLdouble - */ -#if TRIANGLE_WALK_DOUBLE -#define GLinterp GLdouble -#define InterpToInt(X) ((GLint) (X)) -#define INTERP_ONE 1.0 -#else -#define GLinterp GLfixed -#define InterpToInt(X) FixedToInt(X) -#define INTERP_ONE FIXED_ONE -#endif - /* * Some code we unfortunately need to prevent negative interpolated colors. @@ -141,15 +115,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, { typedef struct { const SWvertex *v0, *v1; /* Y(v0) < Y(v1) */ -#if TRIANGLE_WALK_DOUBLE - GLdouble dx; /* X(v1) - X(v0) */ - GLdouble dy; /* Y(v1) - Y(v0) */ - GLdouble dxdy; /* dx/dy */ - GLdouble adjy; /* adjust from v[0]->fy to fsy, scaled */ - GLdouble fsx; /* first sample point x coord */ - GLdouble fsy; - GLdouble fx0; /*X of lower endpoint */ -#else GLfloat dx; /* X(v1) - X(v0) */ GLfloat dy; /* Y(v1) - Y(v0) */ GLfloat dxdy; /* dx/dy */ @@ -158,7 +123,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, GLfixed fsx; /* first sample point x coord */ GLfixed fsy; GLfixed fx0; /* fixed pt X of lower endpoint */ -#endif GLint lines; /* number of lines to be sampled on this edge */ } EdgeT; @@ -173,10 +137,8 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, GLfloat oneOverArea; const SWvertex *vMin, *vMid, *vMax; /* Y(vMin)<=Y(vMid)<=Y(vMax) */ GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign; -#if !TRIANGLE_WALK_DOUBLE const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); /* for x/y coord snapping */ -#endif - GLinterp vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy; + GLfixed vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy; SWspan span; @@ -191,28 +153,27 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, /* printf("%s()\n", __FUNCTION__); - printf(" %g, %g, %g\n", v0->win[0], v0->win[1], v0->win[2]); - printf(" %g, %g, %g\n", v1->win[0], v1->win[1], v1->win[2]); - printf(" %g, %g, %g\n", v2->win[0], v2->win[1], v2->win[2]); - */ - /* - ASSERT(v0->win[2] >= 0.0); - ASSERT(v1->win[2] >= 0.0); - ASSERT(v2->win[2] >= 0.0); + printf(" %g, %g, %g\n", + v0->attrib[FRAG_ATTRIB_WPOS][0], + v0->attrib[FRAG_ATTRIB_WPOS][1], + v0->attrib[FRAG_ATTRIB_WPOS][2]); + printf(" %g, %g, %g\n", + v1->attrib[FRAG_ATTRIB_WPOS][0], + v1->attrib[FRAG_ATTRIB_WPOS][1], + v1->attrib[FRAG_ATTRIB_WPOS][2]); + printf(" %g, %g, %g\n", + v2->attrib[FRAG_ATTRIB_WPOS][0], + v2->attrib[FRAG_ATTRIB_WPOS][1], + v2->attrib[FRAG_ATTRIB_WPOS][2]); */ + /* Compute fixed point x,y coords w/ half-pixel offsets and snapping. * And find the order of the 3 vertices along the Y axis. */ { -#if TRIANGLE_WALK_DOUBLE - const GLdouble fy0 = v0->win[1] - 0.5; - const GLdouble fy1 = v1->win[1] - 0.5; - const GLdouble fy2 = v2->win[1] - 0.5; -#else - const GLfixed fy0 = FloatToFixed(v0->win[1] - 0.5F) & snapMask; - const GLfixed fy1 = FloatToFixed(v1->win[1] - 0.5F) & snapMask; - const GLfixed fy2 = FloatToFixed(v2->win[1] - 0.5F) & snapMask; -#endif + const GLfixed fy0 = FloatToFixed(v0->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; + const GLfixed fy1 = FloatToFixed(v1->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; + const GLfixed fy2 = FloatToFixed(v2->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; if (fy0 <= fy1) { if (fy1 <= fy2) { /* y0 <= y1 <= y2 */ @@ -252,15 +213,9 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, } /* fixed point X coords */ -#if TRIANGLE_WALK_DOUBLE - vMin_fx = vMin->win[0] + 0.5; - vMid_fx = vMid->win[0] + 0.5; - vMax_fx = vMax->win[0] + 0.5; -#else - vMin_fx = FloatToFixed(vMin->win[0] + 0.5F) & snapMask; - vMid_fx = FloatToFixed(vMid->win[0] + 0.5F) & snapMask; - vMax_fx = FloatToFixed(vMax->win[0] + 0.5F) & snapMask; -#endif + vMin_fx = FloatToFixed(vMin->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; + vMid_fx = FloatToFixed(vMid->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; + vMax_fx = FloatToFixed(vMax->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; } /* vertex/edge relationship */ @@ -269,29 +224,16 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, eBot.v0 = vMin; eBot.v1 = vMid; /* compute deltas for each edge: vertex[upper] - vertex[lower] */ -#if TRIANGLE_WALK_DOUBLE - eMaj.dx = vMax_fx - vMin_fx; - eMaj.dy = vMax_fy - vMin_fy; - eTop.dx = vMax_fx - vMid_fx; - eTop.dy = vMax_fy - vMid_fy; - eBot.dx = vMid_fx - vMin_fx; - eBot.dy = vMid_fy - vMin_fy; -#else eMaj.dx = FixedToFloat(vMax_fx - vMin_fx); eMaj.dy = FixedToFloat(vMax_fy - vMin_fy); eTop.dx = FixedToFloat(vMax_fx - vMid_fx); eTop.dy = FixedToFloat(vMax_fy - vMid_fy); eBot.dx = FixedToFloat(vMid_fx - vMin_fx); eBot.dy = FixedToFloat(vMid_fy - vMin_fy); -#endif /* compute area, oneOverArea and perform backface culling */ { -#if TRIANGLE_WALK_DOUBLE - const GLdouble area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy; -#else const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy; -#endif /* Do backface culling */ if (area * bf < 0.0) return; @@ -307,70 +249,37 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, /* Edge setup. For a triangle strip these could be reused... */ { -#if TRIANGLE_WALK_DOUBLE - eMaj.fsy = CEILF(vMin_fy); - eMaj.lines = (GLint) CEILF(vMax_fy - eMaj.fsy); -#else eMaj.fsy = FixedCeil(vMin_fy); eMaj.lines = FixedToInt(FixedCeil(vMax_fy - eMaj.fsy)); -#endif if (eMaj.lines > 0) { eMaj.dxdy = eMaj.dx / eMaj.dy; -#if TRIANGLE_WALK_DOUBLE - eMaj.adjy = (eMaj.fsy - vMin_fy) * FIXED_SCALE; /* SCALED! */ - eMaj.fx0 = vMin_fx; - eMaj.fsx = eMaj.fx0 + (eMaj.adjy * eMaj.dxdy) / (GLdouble) FIXED_SCALE; -#else eMaj.fdxdy = SignedFloatToFixed(eMaj.dxdy); eMaj.adjy = (GLfloat) (eMaj.fsy - vMin_fy); /* SCALED! */ eMaj.fx0 = vMin_fx; eMaj.fsx = eMaj.fx0 + (GLfixed) (eMaj.adjy * eMaj.dxdy); -#endif } else { return; /*CULLED*/ } -#if TRIANGLE_WALK_DOUBLE - eTop.fsy = CEILF(vMid_fy); - eTop.lines = (GLint) CEILF(vMax_fy - eTop.fsy); -#else eTop.fsy = FixedCeil(vMid_fy); eTop.lines = FixedToInt(FixedCeil(vMax_fy - eTop.fsy)); -#endif if (eTop.lines > 0) { eTop.dxdy = eTop.dx / eTop.dy; -#if TRIANGLE_WALK_DOUBLE - eTop.adjy = (eTop.fsy - vMid_fy) * FIXED_SCALE; /* SCALED! */ - eTop.fx0 = vMid_fx; - eTop.fsx = eTop.fx0 + (eTop.adjy * eTop.dxdy) / (GLdouble) FIXED_SCALE; -#else eTop.fdxdy = SignedFloatToFixed(eTop.dxdy); eTop.adjy = (GLfloat) (eTop.fsy - vMid_fy); /* SCALED! */ eTop.fx0 = vMid_fx; eTop.fsx = eTop.fx0 + (GLfixed) (eTop.adjy * eTop.dxdy); -#endif } -#if TRIANGLE_WALK_DOUBLE - eBot.fsy = CEILF(vMin_fy); - eBot.lines = (GLint) CEILF(vMid_fy - eBot.fsy); -#else eBot.fsy = FixedCeil(vMin_fy); eBot.lines = FixedToInt(FixedCeil(vMid_fy - eBot.fsy)); -#endif if (eBot.lines > 0) { eBot.dxdy = eBot.dx / eBot.dy; -#if TRIANGLE_WALK_DOUBLE - eBot.adjy = (eBot.fsy - vMin_fy) * FIXED_SCALE; /* SCALED! */ - eBot.fx0 = vMin_fx; - eBot.fsx = eBot.fx0 + (eBot.adjy * eBot.dxdy) / (GLdouble) FIXED_SCALE; -#else eBot.fdxdy = SignedFloatToFixed(eBot.dxdy); eBot.adjy = (GLfloat) (eBot.fsy - vMin_fy); /* SCALED! */ eBot.fx0 = vMin_fx; eBot.fsx = eBot.fx0 + (GLfixed) (eBot.adjy * eBot.dxdy); -#endif } } @@ -428,10 +337,11 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_Z span.interpMask |= SPAN_Z; { - GLfloat eMaj_dz = vMax->win[2] - vMin->win[2]; - GLfloat eBot_dz = vMid->win[2] - vMin->win[2]; + GLfloat eMaj_dz = vMax->attrib[FRAG_ATTRIB_WPOS][2] - vMin->attrib[FRAG_ATTRIB_WPOS][2]; + GLfloat eBot_dz = vMid->attrib[FRAG_ATTRIB_WPOS][2] - vMin->attrib[FRAG_ATTRIB_WPOS][2]; span.attrStepX[FRAG_ATTRIB_WPOS][2] = oneOverArea * (eMaj_dz * eBot.dy - eMaj.dy * eBot_dz); - if (span.attrStepX[FRAG_ATTRIB_WPOS][2] > maxDepth || span.attrStepX[FRAG_ATTRIB_WPOS][2] < -maxDepth) { + if (span.attrStepX[FRAG_ATTRIB_WPOS][2] > maxDepth || + span.attrStepX[FRAG_ATTRIB_WPOS][2] < -maxDepth) { /* probably a sliver triangle */ span.attrStepX[FRAG_ATTRIB_WPOS][2] = 0.0; span.attrStepY[FRAG_ATTRIB_WPOS][2] = 0.0; @@ -445,42 +355,18 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, span.zStep = (GLint) span.attrStepX[FRAG_ATTRIB_WPOS][2]; } #endif -#ifdef INTERP_W - span.interpMask |= SPAN_W; - { - const GLfloat eMaj_dw = vMax->win[3] - vMin->win[3]; - const GLfloat eBot_dw = vMid->win[3] - vMin->win[3]; - span.attrStepX[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj_dw * eBot.dy - eMaj.dy * eBot_dw); - span.attrStepY[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj.dx * eBot_dw - eMaj_dw * eBot.dx); - } -#endif -#ifdef INTERP_FOG - span.interpMask |= SPAN_FOG; - { -# ifdef INTERP_W - const GLfloat wMax = vMax->win[3], wMin = vMin->win[3], wMid = vMid->win[3]; - const GLfloat eMaj_dfog = vMax->attrib[FRAG_ATTRIB_FOGC][0] * wMax - vMin->attrib[FRAG_ATTRIB_FOGC][0] * wMin; - const GLfloat eBot_dfog = vMid->attrib[FRAG_ATTRIB_FOGC][0] * wMid - vMin->attrib[FRAG_ATTRIB_FOGC][0] * wMin; -# else - const GLfloat eMaj_dfog = vMax->attrib[FRAG_ATTRIB_FOGC][0] - vMin->attrib[FRAG_ATTRIB_FOGC][0]; - const GLfloat eBot_dfog = vMid->attrib[FRAG_ATTRIB_FOGC][0] - vMin->attrib[FRAG_ATTRIB_FOGC][0]; -# endif - span.attrStepX[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj_dfog * eBot.dy - eMaj.dy * eBot_dfog); - span.attrStepY[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj.dx * eBot_dfog - eMaj_dfog * eBot.dx); - } -#endif #ifdef INTERP_RGB span.interpMask |= SPAN_RGBA; if (ctx->Light.ShadeModel == GL_SMOOTH) { - GLfloat eMaj_dr = (GLfloat) ((ColorTemp) vMax->color[RCOMP] - (ColorTemp) vMin->color[RCOMP]); - GLfloat eBot_dr = (GLfloat) ((ColorTemp) vMid->color[RCOMP] - (ColorTemp) vMin->color[RCOMP]); - GLfloat eMaj_dg = (GLfloat) ((ColorTemp) vMax->color[GCOMP] - (ColorTemp) vMin->color[GCOMP]); - GLfloat eBot_dg = (GLfloat) ((ColorTemp) vMid->color[GCOMP] - (ColorTemp) vMin->color[GCOMP]); - GLfloat eMaj_db = (GLfloat) ((ColorTemp) vMax->color[BCOMP] - (ColorTemp) vMin->color[BCOMP]); - GLfloat eBot_db = (GLfloat) ((ColorTemp) vMid->color[BCOMP] - (ColorTemp) vMin->color[BCOMP]); + GLfloat eMaj_dr = (GLfloat) (vMax->color[RCOMP] - vMin->color[RCOMP]); + GLfloat eBot_dr = (GLfloat) (vMid->color[RCOMP] - vMin->color[RCOMP]); + GLfloat eMaj_dg = (GLfloat) (vMax->color[GCOMP] - vMin->color[GCOMP]); + GLfloat eBot_dg = (GLfloat) (vMid->color[GCOMP] - vMin->color[GCOMP]); + GLfloat eMaj_db = (GLfloat) (vMax->color[BCOMP] - vMin->color[BCOMP]); + GLfloat eBot_db = (GLfloat) (vMid->color[BCOMP] - vMin->color[BCOMP]); # ifdef INTERP_ALPHA - GLfloat eMaj_da = (GLfloat) ((ColorTemp) vMax->color[ACOMP] - (ColorTemp) vMin->color[ACOMP]); - GLfloat eBot_da = (GLfloat) ((ColorTemp) vMid->color[ACOMP] - (ColorTemp) vMin->color[ACOMP]); + GLfloat eMaj_da = (GLfloat) (vMax->color[ACOMP] - vMin->color[ACOMP]); + GLfloat eBot_da = (GLfloat) (vMid->color[ACOMP] - vMin->color[ACOMP]); # endif span.attrStepX[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr); span.attrStepY[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx); @@ -488,23 +374,13 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, span.attrStepY[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx); span.attrStepX[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db); span.attrStepY[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx); -# if CHAN_TYPE == GL_FLOAT - span.redStep = span.attrStepX[FRAG_ATTRIB_COL0][0]; - span.greenStep = span.attrStepX[FRAG_ATTRIB_COL0][1]; - span.blueStep = span.attrStepX[FRAG_ATTRIB_COL0][2]; -# else span.redStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][0]); span.greenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][1]); span.blueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][2]); -# endif /* GL_FLOAT */ # ifdef INTERP_ALPHA span.attrStepX[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); span.attrStepY[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); -# if CHAN_TYPE == GL_FLOAT - span.alphaStep = span.attrStepX[FRAG_ATTRIB_COL0][3]; -# else span.alphaStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][3]); -# endif /* GL_FLOAT */ # endif /* INTERP_ALPHA */ } else { @@ -513,70 +389,20 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, span.attrStepX[FRAG_ATTRIB_COL0][0] = span.attrStepY[FRAG_ATTRIB_COL0][0] = 0.0F; span.attrStepX[FRAG_ATTRIB_COL0][1] = span.attrStepY[FRAG_ATTRIB_COL0][1] = 0.0F; span.attrStepX[FRAG_ATTRIB_COL0][2] = span.attrStepY[FRAG_ATTRIB_COL0][2] = 0.0F; -# if CHAN_TYPE == GL_FLOAT - span.redStep = 0.0F; - span.greenStep = 0.0F; - span.blueStep = 0.0F; -# else span.redStep = 0; span.greenStep = 0; span.blueStep = 0; -# endif /* GL_FLOAT */ # ifdef INTERP_ALPHA - span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepY[FRAG_ATTRIB_COL0][3] = 0.0F; -# if CHAN_TYPE == GL_FLOAT - span.alphaStep = 0.0F; -# else + span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepX[FRAG_ATTRIB_COL0][3] = 0.0F; span.alphaStep = 0; -# endif /* GL_FLOAT */ # endif } #endif /* INTERP_RGB */ -#ifdef INTERP_SPEC - span.interpMask |= SPAN_SPEC; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - GLfloat eMaj_dsr = (GLfloat) ((ColorTemp) vMax->specular[RCOMP] - (ColorTemp) vMin->specular[RCOMP]); - GLfloat eBot_dsr = (GLfloat) ((ColorTemp) vMid->specular[RCOMP] - (ColorTemp) vMin->specular[RCOMP]); - GLfloat eMaj_dsg = (GLfloat) ((ColorTemp) vMax->specular[GCOMP] - (ColorTemp) vMin->specular[GCOMP]); - GLfloat eBot_dsg = (GLfloat) ((ColorTemp) vMid->specular[GCOMP] - (ColorTemp) vMin->specular[GCOMP]); - GLfloat eMaj_dsb = (GLfloat) ((ColorTemp) vMax->specular[BCOMP] - (ColorTemp) vMin->specular[BCOMP]); - GLfloat eBot_dsb = (GLfloat) ((ColorTemp) vMid->specular[BCOMP] - (ColorTemp) vMin->specular[BCOMP]); - span.attrStepX[FRAG_ATTRIB_COL1][0] = oneOverArea * (eMaj_dsr * eBot.dy - eMaj.dy * eBot_dsr); - span.attrStepY[FRAG_ATTRIB_COL1][0] = oneOverArea * (eMaj.dx * eBot_dsr - eMaj_dsr * eBot.dx); - span.attrStepX[FRAG_ATTRIB_COL1][1] = oneOverArea * (eMaj_dsg * eBot.dy - eMaj.dy * eBot_dsg); - span.attrStepY[FRAG_ATTRIB_COL1][1] = oneOverArea * (eMaj.dx * eBot_dsg - eMaj_dsg * eBot.dx); - span.attrStepX[FRAG_ATTRIB_COL1][2] = oneOverArea * (eMaj_dsb * eBot.dy - eMaj.dy * eBot_dsb); - span.attrStepY[FRAG_ATTRIB_COL1][2] = oneOverArea * (eMaj.dx * eBot_dsb - eMaj_dsb * eBot.dx); -# if CHAN_TYPE == GL_FLOAT - span.specRedStep = span.attrStepX[FRAG_ATTRIB_COL1][0]; - span.specGreenStep = span.attrStepX[FRAG_ATTRIB_COL1][1]; - span.specBlueStep = span.attrStepX[FRAG_ATTRIB_COL1][2]; -# else - span.specRedStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL1][0]); - span.specGreenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL1][1]); - span.specBlueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL1][2]); -# endif - } - else { - span.attrStepX[FRAG_ATTRIB_COL1][0] = span.attrStepY[FRAG_ATTRIB_COL1][0] = 0.0F; - span.attrStepX[FRAG_ATTRIB_COL1][1] = span.attrStepY[FRAG_ATTRIB_COL1][1] = 0.0F; - span.attrStepX[FRAG_ATTRIB_COL1][2] = span.attrStepY[FRAG_ATTRIB_COL1][2] = 0.0F; -# if CHAN_TYPE == GL_FLOAT - span.specRedStep = 0.0F; - span.specGreenStep = 0.0F; - span.specBlueStep = 0.0F; -# else - span.specRedStep = 0; - span.specGreenStep = 0; - span.specBlueStep = 0; -# endif - } -#endif /* INTERP_SPEC */ #ifdef INTERP_INDEX span.interpMask |= SPAN_INDEX; if (ctx->Light.ShadeModel == GL_SMOOTH) { - GLfloat eMaj_di = vMax->index - vMin->index; - GLfloat eBot_di = vMid->index - vMin->index; + GLfloat eMaj_di = vMax->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0]; + GLfloat eBot_di = vMid->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0]; didx = oneOverArea * (eMaj_di * eBot.dy - eMaj.dy * eBot_di); didy = oneOverArea * (eMaj.dx * eBot_di - eMaj_di * eBot.dx); span.indexStep = SignedFloatToFixed(didx); @@ -588,7 +414,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, } #endif #ifdef INTERP_INT_TEX - span.interpMask |= SPAN_INT_TEXTURE; { GLfloat eMaj_ds = (vMax->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE; GLfloat eBot_ds = (vMid->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE; @@ -603,27 +428,31 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, } #endif #ifdef INTERP_ATTRIBS - span.interpMask |= (SPAN_TEXTURE | SPAN_VARYING); { - /* win[3] is 1/W */ - const GLfloat wMax = vMax->win[3], wMin = vMin->win[3], wMid = vMid->win[3]; + /* attrib[FRAG_ATTRIB_WPOS][3] is 1/W */ + const GLfloat wMax = vMax->attrib[FRAG_ATTRIB_WPOS][3]; + const GLfloat wMin = vMin->attrib[FRAG_ATTRIB_WPOS][3]; + const GLfloat wMid = vMid->attrib[FRAG_ATTRIB_WPOS][3]; + { + const GLfloat eMaj_dw = wMax - wMin; + const GLfloat eBot_dw = wMid - wMin; + span.attrStepX[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj_dw * eBot.dy - eMaj.dy * eBot_dw); + span.attrStepY[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj.dx * eBot_dw - eMaj_dw * eBot.dx); + } ATTRIB_LOOP_BEGIN - GLfloat eMaj_ds = vMax->attrib[attr][0] * wMax - vMin->attrib[attr][0] * wMin; - GLfloat eBot_ds = vMid->attrib[attr][0] * wMid - vMin->attrib[attr][0] * wMin; - GLfloat eMaj_dt = vMax->attrib[attr][1] * wMax - vMin->attrib[attr][1] * wMin; - GLfloat eBot_dt = vMid->attrib[attr][1] * wMid - vMin->attrib[attr][1] * wMin; - GLfloat eMaj_du = vMax->attrib[attr][2] * wMax - vMin->attrib[attr][2] * wMin; - GLfloat eBot_du = vMid->attrib[attr][2] * wMid - vMin->attrib[attr][2] * wMin; - GLfloat eMaj_dv = vMax->attrib[attr][3] * wMax - vMin->attrib[attr][3] * wMin; - GLfloat eBot_dv = vMid->attrib[attr][3] * wMid - vMin->attrib[attr][3] * wMin; - span.attrStepX[attr][0] = oneOverArea * (eMaj_ds * eBot.dy - eMaj.dy * eBot_ds); - span.attrStepY[attr][0] = oneOverArea * (eMaj.dx * eBot_ds - eMaj_ds * eBot.dx); - span.attrStepX[attr][1] = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt); - span.attrStepY[attr][1] = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx); - span.attrStepX[attr][2] = oneOverArea * (eMaj_du * eBot.dy - eMaj.dy * eBot_du); - span.attrStepY[attr][2] = oneOverArea * (eMaj.dx * eBot_du - eMaj_du * eBot.dx); - span.attrStepX[attr][3] = oneOverArea * (eMaj_dv * eBot.dy - eMaj.dy * eBot_dv); - span.attrStepY[attr][3] = oneOverArea * (eMaj.dx * eBot_dv - eMaj_dv * eBot.dx); + if (swrast->_InterpMode[attr] == GL_FLAT) { + ASSIGN_4V(span.attrStepX[attr], 0.0, 0.0, 0.0, 0.0); + ASSIGN_4V(span.attrStepY[attr], 0.0, 0.0, 0.0, 0.0); + } + else { + GLuint c; + for (c = 0; c < 4; c++) { + GLfloat eMaj_da = vMax->attrib[attr][c] * wMax - vMin->attrib[attr][c] * wMin; + GLfloat eBot_da = vMid->attrib[attr][c] * wMid - vMin->attrib[attr][c] * wMin; + span.attrStepX[attr][c] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); + span.attrStepY[attr][c] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); + } + } ATTRIB_LOOP_END } #endif @@ -677,9 +506,9 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, { GLint subTriangle; - GLinterp fxLeftEdge = 0, fxRightEdge = 0; - GLinterp fdxLeftEdge = 0, fdxRightEdge = 0; - GLinterp fError = 0, fdError = 0; + GLfixed fxLeftEdge = 0, fxRightEdge = 0; + GLfixed fdxLeftEdge = 0, fdxRightEdge = 0; + GLfixed fError = 0, fdError = 0; #ifdef PIXEL_ADDRESS PIXEL_TYPE *pRow = NULL; GLint dPRowOuter = 0, dPRowInner; /* offset in bytes */ @@ -694,24 +523,13 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, GLuint zLeft = 0; GLfixed fdzOuter = 0, fdzInner; #endif -#ifdef INTERP_W - GLfloat wLeft = 0, dwOuter = 0, dwInner; -#endif -#ifdef INTERP_FOG - GLfloat fogLeft = 0, dfogOuter = 0, dfogInner; -#endif #ifdef INTERP_RGB - ColorTemp rLeft = 0, fdrOuter = 0, fdrInner; - ColorTemp gLeft = 0, fdgOuter = 0, fdgInner; - ColorTemp bLeft = 0, fdbOuter = 0, fdbInner; + GLint rLeft = 0, fdrOuter = 0, fdrInner; + GLint gLeft = 0, fdgOuter = 0, fdgInner; + GLint bLeft = 0, fdbOuter = 0, fdbInner; #endif #ifdef INTERP_ALPHA - ColorTemp aLeft = 0, fdaOuter = 0, fdaInner; -#endif -#ifdef INTERP_SPEC - ColorTemp srLeft=0, dsrOuter=0, dsrInner; - ColorTemp sgLeft=0, dsgOuter=0, dsgInner; - ColorTemp sbLeft=0, dsbOuter=0, dsbInner; + GLint aLeft = 0, fdaOuter = 0, fdaInner; #endif #ifdef INTERP_INDEX GLfixed iLeft=0, diOuter=0, diInner; @@ -721,14 +539,9 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, GLfixed tLeft=0, dtOuter=0, dtInner; #endif #ifdef INTERP_ATTRIBS - GLfloat sLeft[FRAG_ATTRIB_MAX]; - GLfloat tLeft[FRAG_ATTRIB_MAX]; - GLfloat uLeft[FRAG_ATTRIB_MAX]; - GLfloat vLeft[FRAG_ATTRIB_MAX]; - GLfloat dsOuter[FRAG_ATTRIB_MAX], dsInner[FRAG_ATTRIB_MAX]; - GLfloat dtOuter[FRAG_ATTRIB_MAX], dtInner[FRAG_ATTRIB_MAX]; - GLfloat duOuter[FRAG_ATTRIB_MAX], duInner[FRAG_ATTRIB_MAX]; - GLfloat dvOuter[FRAG_ATTRIB_MAX], dvInner[FRAG_ATTRIB_MAX]; + GLfloat wLeft = 0, dwOuter = 0, dwInner; + GLfloat attrLeft[FRAG_ATTRIB_MAX][4]; + GLfloat daOuter[FRAG_ATTRIB_MAX][4], daInner[FRAG_ATTRIB_MAX][4]; #endif for (subTriangle=0; subTriangle<=1; subTriangle++) { @@ -775,30 +588,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, if (setupLeft && eLeft->lines > 0) { const SWvertex *vLower = eLeft->v0; -#if TRIANGLE_WALK_DOUBLE - const GLdouble fsy = eLeft->fsy; - const GLdouble fsx = eLeft->fsx; - const GLdouble fx = CEILF(fsx); - const GLdouble adjx = (fx - eLeft->fx0) * FIXED_SCALE; /* SCALED! */ -#else const GLfixed fsy = eLeft->fsy; const GLfixed fsx = eLeft->fsx; /* no fractional part */ const GLfixed fx = FixedCeil(fsx); /* no fractional part */ - const GLfixed adjx = (GLinterp) (fx - eLeft->fx0); /* SCALED! */ -#endif - const GLinterp adjy = (GLinterp) eLeft->adjy; /* SCALED! */ + const GLfixed adjx = (GLfixed) (fx - eLeft->fx0); /* SCALED! */ + const GLfixed adjy = (GLfixed) eLeft->adjy; /* SCALED! */ GLint idxOuter; -#if TRIANGLE_WALK_DOUBLE - GLdouble dxOuter; - - fError = fx - fsx - 1.0; - fxLeftEdge = fsx; - fdxLeftEdge = eLeft->dxdy; - dxOuter = FLOORF(fdxLeftEdge); - fdError = dxOuter - fdxLeftEdge + 1.0; - idxOuter = (GLint) dxOuter; - span.y = (GLint) fsy; -#else GLfloat dxOuter; GLfixed fdxOuter; @@ -810,7 +605,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, idxOuter = FixedToInt(fdxOuter); dxOuter = (GLfloat) idxOuter; span.y = FixedToInt(fsy); -#endif /* silence warnings on some compilers */ (void) dxOuter; @@ -820,7 +614,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef PIXEL_ADDRESS { - pRow = (PIXEL_TYPE *) PIXEL_ADDRESS(InterpToInt(fxLeftEdge), span.y); + pRow = (PIXEL_TYPE *) PIXEL_ADDRESS(FixedToInt(fxLeftEdge), span.y); dPRowOuter = -((int)BYTES_PER_ROW) + idxOuter * sizeof(PIXEL_TYPE); /* negative because Y=0 at bottom and increases upward */ } @@ -837,7 +631,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_Z { - GLfloat z0 = vLower->win[2]; + GLfloat z0 = vLower->attrib[FRAG_ATTRIB_WPOS][2]; if (depthBits <= 16) { /* interpolate fixed-pt values */ GLfloat tmp = (z0 * FIXED_SCALE @@ -847,129 +641,71 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, zLeft = (GLfixed) tmp; else zLeft = MAX_GLUINT / 2; - fdzOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_WPOS][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); + fdzOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_WPOS][2] + + dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); } else { /* interpolate depth values w/out scaling */ zLeft = (GLuint) (z0 + span.attrStepX[FRAG_ATTRIB_WPOS][2] * FixedToFloat(adjx) + span.attrStepY[FRAG_ATTRIB_WPOS][2] * FixedToFloat(adjy)); - fdzOuter = (GLint) (span.attrStepY[FRAG_ATTRIB_WPOS][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); + fdzOuter = (GLint) (span.attrStepY[FRAG_ATTRIB_WPOS][2] + + dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); } # ifdef DEPTH_TYPE zRow = (DEPTH_TYPE *) - zrb->GetPointer(ctx, zrb, InterpToInt(fxLeftEdge), span.y); + zrb->GetPointer(ctx, zrb, FixedToInt(fxLeftEdge), span.y); dZRowOuter = (ctx->DrawBuffer->Width + idxOuter) * sizeof(DEPTH_TYPE); # endif } #endif -#ifdef INTERP_W - wLeft = vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_WPOS][3] * adjx + span.attrStepY[FRAG_ATTRIB_WPOS][3] * adjy) * (1.0F/FIXED_SCALE); - dwOuter = span.attrStepY[FRAG_ATTRIB_WPOS][3] + dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][3]; -#endif -#ifdef INTERP_FOG -# ifdef INTERP_W - fogLeft = vLower->attrib[FRAG_ATTRIB_FOGC][0] * vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE); -# else - fogLeft = vLower->attrib[FRAG_ATTRIB_FOGC][0] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE); -# endif - dfogOuter = span.attrStepY[FRAG_ATTRIB_FOGC][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_FOGC][0]; -#endif #ifdef INTERP_RGB if (ctx->Light.ShadeModel == GL_SMOOTH) { -# if CHAN_TYPE == GL_FLOAT - rLeft = vLower->color[RCOMP] + (span.attrStepX[FRAG_ATTRIB_COL0][0] * adjx + span.attrStepY[FRAG_ATTRIB_COL0][0] * adjy) * (1.0F / FIXED_SCALE); - gLeft = vLower->color[GCOMP] + (span.attrStepX[FRAG_ATTRIB_COL0][1] * adjx + span.attrStepY[FRAG_ATTRIB_COL0][1] * adjy) * (1.0F / FIXED_SCALE); - bLeft = vLower->color[BCOMP] + (span.attrStepX[FRAG_ATTRIB_COL0][2] * adjx + span.attrStepY[FRAG_ATTRIB_COL0][2] * adjy) * (1.0F / FIXED_SCALE); - fdrOuter = span.attrStepY[FRAG_ATTRIB_COL0][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][0]; - fdgOuter = span.attrStepY[FRAG_ATTRIB_COL0][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][1]; - fdbOuter = span.attrStepY[FRAG_ATTRIB_COL0][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][2]; -# else - rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP]) + span.attrStepX[FRAG_ATTRIB_COL0][0] * adjx + span.attrStepY[FRAG_ATTRIB_COL0][0] * adjy) + FIXED_HALF; - gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP]) + span.attrStepX[FRAG_ATTRIB_COL0][1] * adjx + span.attrStepY[FRAG_ATTRIB_COL0][1] * adjy) + FIXED_HALF; - bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP]) + span.attrStepX[FRAG_ATTRIB_COL0][2] * adjx + span.attrStepY[FRAG_ATTRIB_COL0][2] * adjy) + FIXED_HALF; - fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][0]); - fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][1]); - fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][2]); -# endif + rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP]) + + span.attrStepX[FRAG_ATTRIB_COL0][0] * adjx + + span.attrStepY[FRAG_ATTRIB_COL0][0] * adjy) + FIXED_HALF; + gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP]) + + span.attrStepX[FRAG_ATTRIB_COL0][1] * adjx + + span.attrStepY[FRAG_ATTRIB_COL0][1] * adjy) + FIXED_HALF; + bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP]) + + span.attrStepX[FRAG_ATTRIB_COL0][2] * adjx + + span.attrStepY[FRAG_ATTRIB_COL0][2] * adjy) + FIXED_HALF; + fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][0] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][0]); + fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][1] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][1]); + fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][2] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][2]); # ifdef INTERP_ALPHA -# if CHAN_TYPE == GL_FLOAT - aLeft = vLower->color[ACOMP] + (span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx + span.attrStepY[FRAG_ATTRIB_COL0][3] * adjy) * (1.0F / FIXED_SCALE); - fdaOuter = span.attrStepY[FRAG_ATTRIB_COL0][3] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]; -# else - aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP]) + span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx + span.attrStepX[FRAG_ATTRIB_COL0][3] * adjy) + FIXED_HALF; - fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][3] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]); -# endif + aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP]) + + span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx + + span.attrStepY[FRAG_ATTRIB_COL0][3] * adjy) + FIXED_HALF; + fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][3] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]); # endif } else { ASSERT(ctx->Light.ShadeModel == GL_FLAT); -# if CHAN_TYPE == GL_FLOAT - rLeft = v2->color[RCOMP]; - gLeft = v2->color[GCOMP]; - bLeft = v2->color[BCOMP]; - fdrOuter = fdgOuter = fdbOuter = 0.0F; -# else rLeft = ChanToFixed(v2->color[RCOMP]); gLeft = ChanToFixed(v2->color[GCOMP]); bLeft = ChanToFixed(v2->color[BCOMP]); fdrOuter = fdgOuter = fdbOuter = 0; -# endif # ifdef INTERP_ALPHA -# if CHAN_TYPE == GL_FLOAT - aLeft = v2->color[ACOMP]; - fdaOuter = 0.0F; -# else aLeft = ChanToFixed(v2->color[ACOMP]); fdaOuter = 0; -# endif # endif } #endif /* INTERP_RGB */ -#ifdef INTERP_SPEC - if (ctx->Light.ShadeModel == GL_SMOOTH) { -# if CHAN_TYPE == GL_FLOAT - srLeft = vLower->specular[RCOMP] + (span.attrStepX[FRAG_ATTRIB_COL1][0] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][0] * adjy) * (1.0F / FIXED_SCALE); - sgLeft = vLower->specular[GCOMP] + (span.attrStepX[FRAG_ATTRIB_COL1][1] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][1] * adjy) * (1.0F / FIXED_SCALE); - sbLeft = vLower->specular[BCOMP] + (span.attrStepX[FRAG_ATTRIB_COL1][2] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][2] * adjy) * (1.0F / FIXED_SCALE); - dsrOuter = span.attrStepY[FRAG_ATTRIB_COL1][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][0]; - dsgOuter = span.attrStepY[FRAG_ATTRIB_COL1][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][1]; - dsbOuter = span.attrStepY[FRAG_ATTRIB_COL1][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][2]; -# else - srLeft = (GLfixed) (ChanToFixed(vLower->specular[RCOMP]) + span.attrStepX[FRAG_ATTRIB_COL1][0] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][0] * adjy) + FIXED_HALF; - sgLeft = (GLfixed) (ChanToFixed(vLower->specular[GCOMP]) + span.attrStepX[FRAG_ATTRIB_COL1][1] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][1] * adjy) + FIXED_HALF; - sbLeft = (GLfixed) (ChanToFixed(vLower->specular[BCOMP]) + span.attrStepX[FRAG_ATTRIB_COL1][2] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][2] * adjy) + FIXED_HALF; - dsrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL1][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][0]); - dsgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL1][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][1]); - dsbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL1][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][2]); -# endif - } - else { - ASSERT(ctx->Light.ShadeModel == GL_FLAT); -#if CHAN_TYPE == GL_FLOAT - srLeft = v2->specular[RCOMP]; - sgLeft = v2->specular[GCOMP]; - sbLeft = v2->specular[BCOMP]; - dsrOuter = dsgOuter = dsbOuter = 0.0F; -# else - srLeft = ChanToFixed(v2->specular[RCOMP]); - sgLeft = ChanToFixed(v2->specular[GCOMP]); - sbLeft = ChanToFixed(v2->specular[BCOMP]); - dsrOuter = dsgOuter = dsbOuter = 0; -# endif - } -#endif - #ifdef INTERP_INDEX if (ctx->Light.ShadeModel == GL_SMOOTH) { - iLeft = (GLfixed)(vLower->index * FIXED_SCALE + iLeft = (GLfixed)(vLower->attrib[FRAG_ATTRIB_CI][0] * FIXED_SCALE + didx * adjx + didy * adjy) + FIXED_HALF; diOuter = SignedFloatToFixed(didy + dxOuter * didx); } else { ASSERT(ctx->Light.ShadeModel == GL_FLAT); - iLeft = FloatToFixed(v2->index); + iLeft = FloatToFixed(v2->attrib[FRAG_ATTRIB_CI][0]); diOuter = 0; } #endif @@ -979,42 +715,50 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, s0 = vLower->attrib[FRAG_ATTRIB_TEX0][0] * S_SCALE; sLeft = (GLfixed)(s0 * FIXED_SCALE + span.attrStepX[FRAG_ATTRIB_TEX0][0] * adjx + span.attrStepY[FRAG_ATTRIB_TEX0][0] * adjy) + FIXED_HALF; - dsOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][0]); + dsOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][0] + + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][0]); t0 = vLower->attrib[FRAG_ATTRIB_TEX0][1] * T_SCALE; tLeft = (GLfixed)(t0 * FIXED_SCALE + span.attrStepX[FRAG_ATTRIB_TEX0][1] * adjx + span.attrStepY[FRAG_ATTRIB_TEX0][1] * adjy) + FIXED_HALF; - dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]); + dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] + + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]); } #endif #ifdef INTERP_ATTRIBS + { + const GLuint attr = FRAG_ATTRIB_WPOS; + wLeft = vLower->attrib[FRAG_ATTRIB_WPOS][3] + + (span.attrStepX[attr][3] * adjx + + span.attrStepY[attr][3] * adjy) * (1.0F/FIXED_SCALE); + dwOuter = span.attrStepY[attr][3] + dxOuter * span.attrStepX[attr][3]; + } ATTRIB_LOOP_BEGIN - const GLfloat invW = vLower->win[3]; - const GLfloat s0 = vLower->attrib[attr][0] * invW; - const GLfloat t0 = vLower->attrib[attr][1] * invW; - const GLfloat u0 = vLower->attrib[attr][2] * invW; - const GLfloat v0 = vLower->attrib[attr][3] * invW; - sLeft[attr] = s0 + (span.attrStepX[attr][0] * adjx + span.attrStepY[attr][0] * adjy) * (1.0F/FIXED_SCALE); - tLeft[attr] = t0 + (span.attrStepX[attr][1] * adjx + span.attrStepY[attr][1] * adjy) * (1.0F/FIXED_SCALE); - uLeft[attr] = u0 + (span.attrStepX[attr][2] * adjx + span.attrStepY[attr][2] * adjy) * (1.0F/FIXED_SCALE); - vLeft[attr] = v0 + (span.attrStepX[attr][3] * adjx + span.attrStepY[attr][3] * adjy) * (1.0F/FIXED_SCALE); - dsOuter[attr] = span.attrStepY[attr][0] + dxOuter * span.attrStepX[attr][0]; - dtOuter[attr] = span.attrStepY[attr][1] + dxOuter * span.attrStepX[attr][1]; - duOuter[attr] = span.attrStepY[attr][2] + dxOuter * span.attrStepX[attr][2]; - dvOuter[attr] = span.attrStepY[attr][3] + dxOuter * span.attrStepX[attr][3]; + const GLfloat invW = vLower->attrib[FRAG_ATTRIB_WPOS][3]; + if (swrast->_InterpMode[attr] == GL_FLAT) { + GLuint c; + for (c = 0; c < 4; c++) { + attrLeft[attr][c] = v2->attrib[attr][c] * invW; + daOuter[attr][c] = 0.0; + } + } + else { + GLuint c; + for (c = 0; c < 4; c++) { + const GLfloat a = vLower->attrib[attr][c] * invW; + attrLeft[attr][c] = a + ( span.attrStepX[attr][c] * adjx + + span.attrStepY[attr][c] * adjy) * (1.0F/FIXED_SCALE); + daOuter[attr][c] = span.attrStepY[attr][c] + dxOuter * span.attrStepX[attr][c]; + } + } ATTRIB_LOOP_END #endif } /*if setupLeft*/ if (setupRight && eRight->lines>0) { -#if TRIANGLE_WALK_DOUBLE - fxRightEdge = eRight->fsx; - fdxRightEdge = eRight->dxdy; -#else fxRightEdge = eRight->fsx - FIXED_EPSILON; fdxRightEdge = eRight->fdxdy; -#endif } if (lines==0) { @@ -1032,12 +776,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, # endif fdzInner = fdzOuter + span.zStep; #endif -#ifdef INTERP_W - dwInner = dwOuter + span.attrStepX[FRAG_ATTRIB_WPOS][3]; -#endif -#ifdef INTERP_FOG - dfogInner = dfogOuter + span.attrStepX[FRAG_ATTRIB_FOGC][0]; -#endif #ifdef INTERP_RGB fdrInner = fdrOuter + span.redStep; fdgInner = fdgOuter + span.greenStep; @@ -1046,11 +784,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA fdaInner = fdaOuter + span.alphaStep; #endif -#ifdef INTERP_SPEC - dsrInner = dsrOuter + span.specRedStep; - dsgInner = dsgOuter + span.specGreenStep; - dsbInner = dsbOuter + span.specBlueStep; -#endif #ifdef INTERP_INDEX diInner = diOuter + span.indexStep; #endif @@ -1059,19 +792,20 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, dtInner = dtOuter + span.intTexStep[1]; #endif #ifdef INTERP_ATTRIBS + dwInner = dwOuter + span.attrStepX[FRAG_ATTRIB_WPOS][3]; ATTRIB_LOOP_BEGIN - dsInner[attr] = dsOuter[attr] + span.attrStepX[attr][0]; - dtInner[attr] = dtOuter[attr] + span.attrStepX[attr][1]; - duInner[attr] = duOuter[attr] + span.attrStepX[attr][2]; - dvInner[attr] = dvOuter[attr] + span.attrStepX[attr][3]; + GLuint c; + for (c = 0; c < 4; c++) { + daInner[attr][c] = daOuter[attr][c] + span.attrStepX[attr][c]; + } ATTRIB_LOOP_END #endif while (lines > 0) { /* initialize the span interpolants to the leftmost value */ /* ff = fixed-pt fragment */ - const GLint right = InterpToInt(fxRightEdge); - span.x = InterpToInt(fxLeftEdge); + const GLint right = FixedToInt(fxRightEdge); + span.x = FixedToInt(fxLeftEdge); if (right <= span.x) span.end = 0; else @@ -1080,12 +814,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_Z span.z = zLeft; #endif -#ifdef INTERP_W - span.attrStart[FRAG_ATTRIB_WPOS][3] = wLeft; -#endif -#ifdef INTERP_FOG - span.attrStart[FRAG_ATTRIB_FOGC][0] = fogLeft; -#endif #ifdef INTERP_RGB span.red = rLeft; span.green = gLeft; @@ -1094,11 +822,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA span.alpha = aLeft; #endif -#ifdef INTERP_SPEC - span.specRed = srLeft; - span.specGreen = sgLeft; - span.specBlue = sbLeft; -#endif #ifdef INTERP_INDEX span.index = iLeft; #endif @@ -1108,11 +831,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #endif #ifdef INTERP_ATTRIBS + span.attrStart[FRAG_ATTRIB_WPOS][3] = wLeft; ATTRIB_LOOP_BEGIN - span.attrStart[attr][0] = sLeft[attr]; - span.attrStart[attr][1] = tLeft[attr]; - span.attrStart[attr][2] = uLeft[attr]; - span.attrStart[attr][3] = vLeft[attr]; + GLuint c; + for (c = 0; c < 4; c++) { + span.attrStart[attr][c] = attrLeft[attr][c]; + } ATTRIB_LOOP_END #endif @@ -1131,11 +855,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA CLAMP_INTERPOLANT(alpha, alphaStep, len); #endif -#ifdef INTERP_SPEC - CLAMP_INTERPOLANT(specRed, specRedStep, len); - CLAMP_INTERPOLANT(specGreen, specGreenStep, len); - CLAMP_INTERPOLANT(specBlue, specBlueStep, len); -#endif #ifdef INTERP_INDEX CLAMP_INTERPOLANT(index, indexStep, len); #endif @@ -1158,7 +877,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, fError += fdError; if (fError >= 0) { - fError -= INTERP_ONE; + fError -= FIXED_ONE; #ifdef PIXEL_ADDRESS pRow = (PIXEL_TYPE *) ((GLubyte *) pRow + dPRowOuter); @@ -1169,12 +888,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, # endif zLeft += fdzOuter; #endif -#ifdef INTERP_W - wLeft += dwOuter; -#endif -#ifdef INTERP_FOG - fogLeft += dfogOuter; -#endif #ifdef INTERP_RGB rLeft += fdrOuter; gLeft += fdgOuter; @@ -1183,11 +896,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA aLeft += fdaOuter; #endif -#ifdef INTERP_SPEC - srLeft += dsrOuter; - sgLeft += dsgOuter; - sbLeft += dsbOuter; -#endif #ifdef INTERP_INDEX iLeft += diOuter; #endif @@ -1196,11 +904,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, tLeft += dtOuter; #endif #ifdef INTERP_ATTRIBS + wLeft += dwOuter; ATTRIB_LOOP_BEGIN - sLeft[attr] += dsOuter[attr]; - tLeft[attr] += dtOuter[attr]; - uLeft[attr] += duOuter[attr]; - vLeft[attr] += dvOuter[attr]; + GLuint c; + for (c = 0; c < 4; c++) { + attrLeft[attr][c] += daOuter[attr][c]; + } ATTRIB_LOOP_END #endif } @@ -1214,12 +923,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, # endif zLeft += fdzInner; #endif -#ifdef INTERP_W - wLeft += dwInner; -#endif -#ifdef INTERP_FOG - fogLeft += dfogInner; -#endif #ifdef INTERP_RGB rLeft += fdrInner; gLeft += fdgInner; @@ -1228,11 +931,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA aLeft += fdaInner; #endif -#ifdef INTERP_SPEC - srLeft += dsrInner; - sgLeft += dsgInner; - sbLeft += dsbInner; -#endif #ifdef INTERP_INDEX iLeft += diInner; #endif @@ -1241,11 +939,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, tLeft += dtInner; #endif #ifdef INTERP_ATTRIBS + wLeft += dwInner; ATTRIB_LOOP_BEGIN - sLeft[attr] += dsInner[attr]; - tLeft[attr] += dtInner[attr]; - uLeft[attr] += duInner[attr]; - vLeft[attr] += dvInner[attr]; + GLuint c; + for (c = 0; c < 4; c++) { + attrLeft[attr][c] += daInner[attr][c]; + } ATTRIB_LOOP_END #endif } @@ -1254,14 +953,10 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, } /* for subTriangle */ } -#ifdef CLEANUP_CODE - CLEANUP_CODE -#endif } } #undef SETUP_CODE -#undef CLEANUP_CODE #undef RENDER_SPAN #undef PIXEL_TYPE @@ -1270,24 +965,15 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #undef DEPTH_TYPE #undef INTERP_Z -#undef INTERP_W -#undef INTERP_FOG #undef INTERP_RGB #undef INTERP_ALPHA -#undef INTERP_SPEC #undef INTERP_INDEX #undef INTERP_INT_TEX #undef INTERP_ATTRIBS -#undef TEX_UNIT_LOOP -#undef VARYING_LOOP #undef S_SCALE #undef T_SCALE #undef FixedToDepth -#undef ColorTemp -#undef GLinterp -#undef InterpToInt -#undef INTERP_ONE #undef NAME diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 0908265fe9d..78fa137d3fd 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -155,14 +155,11 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, zoomed_arrays.ChanType = span->array->ChanType; /* XXX temporary */ #if CHAN_TYPE == GL_UNSIGNED_BYTE - zoomed_arrays.rgba = zoomed_arrays.color.sz1.rgba; - zoomed_arrays.spec = zoomed_arrays.color.sz1.spec; + zoomed_arrays.rgba = zoomed_arrays.rgba8; #elif CHAN_TYPE == GL_UNSIGNED_SHORT - zoomed_arrays.rgba = zoomed_arrays.color.sz2.rgba; - zoomed_arrays.spec = zoomed_arrays.color.sz2.spec; + zoomed_arrays.rgba = zoomed_arrays.rgba16; #else zoomed_arrays.rgba = zoomed_arrays.attribs[FRAG_ATTRIB_COL0]; - zoomed_arrays.spec = zoomed_arrays.attribs[FRAG_ATTRIB_COL1]; #endif @@ -219,7 +216,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; ASSERT(j >= 0); ASSERT(j < (GLint) span->end); - COPY_4UBV(zoomed.array->color.sz1.rgba[i], rgba[j]); + COPY_4UBV(zoomed.array->rgba8[i], rgba[j]); } } else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) { @@ -229,7 +226,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; ASSERT(j >= 0); ASSERT(j < (GLint) span->end); - COPY_4V(zoomed.array->color.sz2.rgba[i], rgba[j]); + COPY_4V(zoomed.array->rgba16[i], rgba[j]); } } else { @@ -251,10 +248,10 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; ASSERT(j >= 0); ASSERT(j < (GLint) span->end); - zoomed.array->color.sz1.rgba[i][0] = rgb[j][0]; - zoomed.array->color.sz1.rgba[i][1] = rgb[j][1]; - zoomed.array->color.sz1.rgba[i][2] = rgb[j][2]; - zoomed.array->color.sz1.rgba[i][3] = 0xff; + zoomed.array->rgba8[i][0] = rgb[j][0]; + zoomed.array->rgba8[i][1] = rgb[j][1]; + zoomed.array->rgba8[i][2] = rgb[j][2]; + zoomed.array->rgba8[i][3] = 0xff; } } else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) { @@ -264,10 +261,10 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; ASSERT(j >= 0); ASSERT(j < (GLint) span->end); - zoomed.array->color.sz2.rgba[i][0] = rgb[j][0]; - zoomed.array->color.sz2.rgba[i][1] = rgb[j][1]; - zoomed.array->color.sz2.rgba[i][2] = rgb[j][2]; - zoomed.array->color.sz2.rgba[i][3] = 0xffff; + zoomed.array->rgba16[i][0] = rgb[j][0]; + zoomed.array->rgba16[i][1] = rgb[j][1]; + zoomed.array->rgba16[i][2] = rgb[j][2]; + zoomed.array->rgba16[i][3] = 0xffff; } } else { @@ -314,8 +311,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, * Also, clipping may change the span end value, so store it as well. */ const GLint end = zoomed.end; /* save */ - /* use specular color array for temp storage */ - void *rgbaSave = zoomed.array->spec; + GLuint rgbaSave[MAX_WIDTH][4]; const GLint pixelSize = (zoomed.array->ChanType == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) @@ -334,7 +330,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, } else if (format == GL_COLOR_INDEX) { /* use specular color array for temp storage */ - GLuint *indexSave = (GLuint *) zoomed.array->spec; + GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC]; const GLint end = zoomed.end; /* save */ if (y1 - y0 > 1) { MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index 12264a159ad..d101a9e2ae2 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -45,6 +45,14 @@ * improve its usefulness as a fallback mechanism for hardware * drivers. * + * wpos = attr[FRAG_ATTRIB_WPOS] and MUST BE THE FIRST values in the + * vertex because of the tnl clipping code. + + * wpos[0] and [1] are the screen-coords of SWvertex. + * wpos[2] is the z-buffer coord (if 16-bit Z buffer, in range [0,65535]). + * wpos[3] is 1/w where w is the clip-space W coord. This is the value + * that clip{XYZ} were multiplied by to get ndc{XYZ}. + * * Full software drivers: * - Register the rastersetup and triangle functions from * utils/software_helper. @@ -61,20 +69,15 @@ * primitives unaccelerated), hook in swrast_setup instead. */ typedef struct { - /** win[0], win[1] are the screen-coords of SWvertex. - * win[2] is the z-buffer coord (if 16-bit Z buffer, in range [0,65535]). - * win[3] is 1/w where w is the clip-space W coord. This is the value - * that clip{XYZ} were multiplied by to get ndc{XYZ}. - */ - GLfloat win[4]; - GLchan color[4]; - GLchan specular[4]; - GLfloat index; + GLfloat attrib[FRAG_ATTRIB_MAX][4]; + GLchan color[4]; /** integer color */ GLfloat pointSize; - GLfloat attrib[FRAG_ATTRIB_MAX][4]; /**< texcoords & varying, more to come */ } SWvertex; +#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL0 + + struct swrast_device_driver; diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 3f6d29403cc..9f83fde1f56 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -120,16 +120,25 @@ setup_vertex_format(GLcontext *ctx) RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, win ); - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] ); + + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) { + if (ctx->FragmentProgram._Current + || ctx->ATIFragmentShader._Enabled + || CHAN_TYPE == GL_FLOAT) + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]); + else + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); + } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4CHAN_4F_RGBA, specular); + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]); + } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR_INDEX )) - EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, index ); + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR_INDEX )) { + EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, + attrib[FRAG_ATTRIB_CI][0] ); + } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F; @@ -184,6 +193,10 @@ _swsetup_RenderStart( GLcontext *ctx ) _swsetup_choose_trifuncs(ctx); } + if (swsetup->NewState & _NEW_PROGRAM) { + RENDERINPUTS_ZERO( swsetup->last_index_bitset ); + } + swsetup->NewState = 0; _swrast_render_start(ctx); @@ -258,10 +271,10 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, tmp ); - dest->win[0] = m[0] * tmp[0] + m[12]; - dest->win[1] = m[5] * tmp[1] + m[13]; - dest->win[2] = m[10] * tmp[2] + m[14]; - dest->win[3] = tmp[3]; + dest->attrib[FRAG_ATTRIB_WPOS][0] = m[0] * tmp[0] + m[12]; + dest->attrib[FRAG_ATTRIB_WPOS][1] = m[5] * tmp[1] + m[13]; + dest->attrib[FRAG_ATTRIB_WPOS][2] = m[10] * tmp[2] + m[14]; + dest->attrib[FRAG_ATTRIB_WPOS][3] = tmp[3]; /** XXX try to limit these loops someday */ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) @@ -276,13 +289,16 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, tmp ); + COPY_4V(dest->attrib[FRAG_ATTRIB_COL1], tmp); + /* UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->specular, tmp ); + */ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp ); dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0]; _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp ); - dest->index = tmp[0]; + dest->attrib[FRAG_ATTRIB_CI][0] = tmp[0]; /* XXX See _tnl_get_attr about pointsize ... */ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp ); diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index 628e9288e87..b4207f2c64a 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -57,7 +57,7 @@ static void _swsetup_render_line_tri( GLcontext *ctx, SWvertex *v1 = &verts[e1]; SWvertex *v2 = &verts[e2]; GLchan c[2][4]; - GLchan s[2][4]; + GLfloat s[2][4]; GLfloat i[2]; /* cull testing */ @@ -71,17 +71,17 @@ static void _swsetup_render_line_tri( GLcontext *ctx, if (ctx->Light.ShadeModel == GL_FLAT) { COPY_CHAN4(c[0], v0->color); COPY_CHAN4(c[1], v1->color); - COPY_CHAN4(s[0], v0->specular); - COPY_CHAN4(s[1], v1->specular); - i[0] = v0->index; - i[1] = v1->index; + COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]); + i[0] = v0->attrib[FRAG_ATTRIB_CI][0]; + i[1] = v1->attrib[FRAG_ATTRIB_CI][0]; COPY_CHAN4(v0->color, v2->color); COPY_CHAN4(v1->color, v2->color); - COPY_CHAN4(v0->specular, v2->specular); - COPY_CHAN4(v1->specular, v2->specular); - v0->index = v2->index; - v1->index = v2->index; + COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); + v0->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; + v1->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; } if (swsetup->render_prim == GL_POLYGON) { @@ -97,10 +97,10 @@ static void _swsetup_render_line_tri( GLcontext *ctx, if (ctx->Light.ShadeModel == GL_FLAT) { COPY_CHAN4(v0->color, c[0]); COPY_CHAN4(v1->color, c[1]); - COPY_CHAN4(v0->specular, s[0]); - COPY_CHAN4(v1->specular, s[1]); - v0->index = i[0]; - v1->index = i[1]; + COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]); + COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]); + v0->attrib[FRAG_ATTRIB_CI][0] = i[0]; + v1->attrib[FRAG_ATTRIB_CI][0] = i[1]; } } @@ -116,7 +116,7 @@ static void _swsetup_render_point_tri( GLcontext *ctx, SWvertex *v1 = &verts[e1]; SWvertex *v2 = &verts[e2]; GLchan c[2][4]; - GLchan s[2][4]; + GLfloat s[2][4]; GLfloat i[2]; /* cull testing */ @@ -131,18 +131,18 @@ static void _swsetup_render_point_tri( GLcontext *ctx, /* save colors/indexes for v0, v1 vertices */ COPY_CHAN4(c[0], v0->color); COPY_CHAN4(c[1], v1->color); - COPY_CHAN4(s[0], v0->specular); - COPY_CHAN4(s[1], v1->specular); - i[0] = v0->index; - i[1] = v1->index; + COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]); + i[0] = v0->attrib[FRAG_ATTRIB_CI][0]; + i[1] = v1->attrib[FRAG_ATTRIB_CI][0]; /* copy v2 color/indexes to v0, v1 indexes */ COPY_CHAN4(v0->color, v2->color); COPY_CHAN4(v1->color, v2->color); - COPY_CHAN4(v0->specular, v2->specular); - COPY_CHAN4(v1->specular, v2->specular); - v0->index = v2->index; - v1->index = v2->index; + COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); + v0->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; + v1->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; } if (ef[e0]) _swrast_Point( ctx, v0 ); @@ -153,10 +153,10 @@ static void _swsetup_render_point_tri( GLcontext *ctx, /* restore v0, v1 colores/indexes */ COPY_CHAN4(v0->color, c[0]); COPY_CHAN4(v1->color, c[1]); - COPY_CHAN4(v0->specular, s[0]); - COPY_CHAN4(v1->specular, s[1]); - v0->index = i[0]; - v1->index = i[1]; + COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]); + COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]); + v0->attrib[FRAG_ATTRIB_CI][0] = i[0]; + v1->attrib[FRAG_ATTRIB_CI][0] = i[1]; } _swrast_flush(ctx); } diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 1fdf0cb5999..9fcde31644d 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -36,7 +36,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) GLenum mode = GL_FILL; GLuint facing = 0; GLchan saved_color[3][4]; - GLchan saved_spec[3][4]; + GLfloat saved_spec[3][4]; GLfloat saved_index[3]; v[0] = &verts[e0]; @@ -46,10 +46,10 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT)) { - GLfloat ex = v[0]->win[0] - v[2]->win[0]; - GLfloat ey = v[0]->win[1] - v[2]->win[1]; - GLfloat fx = v[1]->win[0] - v[2]->win[0]; - GLfloat fy = v[1]->win[1] - v[2]->win[1]; + GLfloat ex = v[0]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0]; + GLfloat ey = v[0]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1]; + GLfloat fx = v[1]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0]; + GLfloat fy = v[1]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat cc = ex*fy - ey*fx; if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT)) @@ -85,30 +85,30 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (VB->SecondaryColorPtr[1]) { GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; - COPY_CHAN4(saved_spec[0], v[0]->specular); - COPY_CHAN4(saved_spec[1], v[1]->specular); - COPY_CHAN4(saved_spec[2], v[2]->specular); + COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]); if (VB->SecondaryColorPtr[1]->stride) { - SS_SPEC(v[0]->specular, vbspec[e0]); - SS_SPEC(v[1]->specular, vbspec[e1]); - SS_SPEC(v[2]->specular, vbspec[e2]); + SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]); + SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); + SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); } else { - SS_SPEC(v[0]->specular, vbspec[0]); - SS_SPEC(v[1]->specular, vbspec[0]); - SS_SPEC(v[2]->specular, vbspec[0]); + SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); + SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); + SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); } } } else { GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; - saved_index[0] = v[0]->index; - saved_index[1] = v[1]->index; - saved_index[2] = v[2]->index; + saved_index[0] = v[0]->attrib[FRAG_ATTRIB_CI][0]; + saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0]; + saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0]; - SS_IND(v[0]->index, (GLuint) vbindex[e0]); - SS_IND(v[1]->index, (GLuint) vbindex[e1]); - SS_IND(v[2]->index, (GLuint) vbindex[e2]); + SS_IND(v[0]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e0]); + SS_IND(v[1]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e1]); + SS_IND(v[2]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e2]); } } } @@ -117,9 +117,9 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & SS_OFFSET_BIT) { offset = ctx->Polygon.OffsetUnits * ctx->DrawBuffer->_MRD; - z[0] = v[0]->win[2]; - z[1] = v[1]->win[2]; - z[2] = v[2]->win[2]; + z[0] = v[0]->attrib[FRAG_ATTRIB_WPOS][2]; + z[1] = v[1]->attrib[FRAG_ATTRIB_WPOS][2]; + z[2] = v[2]->attrib[FRAG_ATTRIB_WPOS][2]; if (cc * cc > 1e-16) { const GLfloat ez = z[0] - z[2]; const GLfloat fz = z[1] - z[2]; @@ -130,40 +130,40 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) /* Unfortunately, we need to clamp to prevent negative Zs below. * Technically, we should do the clamping per-fragment. */ - offset = MAX2(offset, -v[0]->win[2]); - offset = MAX2(offset, -v[1]->win[2]); - offset = MAX2(offset, -v[2]->win[2]); + offset = MAX2(offset, -v[0]->attrib[FRAG_ATTRIB_WPOS][2]); + offset = MAX2(offset, -v[1]->attrib[FRAG_ATTRIB_WPOS][2]); + offset = MAX2(offset, -v[2]->attrib[FRAG_ATTRIB_WPOS][2]); } } } if (mode == GL_POINT) { if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetPoint) { - v[0]->win[2] += offset; - v[1]->win[2] += offset; - v[2]->win[2] += offset; + v[0]->attrib[FRAG_ATTRIB_WPOS][2] += offset; + v[1]->attrib[FRAG_ATTRIB_WPOS][2] += offset; + v[2]->attrib[FRAG_ATTRIB_WPOS][2] += offset; } _swsetup_render_point_tri( ctx, e0, e1, e2, facing ); } else if (mode == GL_LINE) { if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) { - v[0]->win[2] += offset; - v[1]->win[2] += offset; - v[2]->win[2] += offset; + v[0]->attrib[FRAG_ATTRIB_WPOS][2] += offset; + v[1]->attrib[FRAG_ATTRIB_WPOS][2] += offset; + v[2]->attrib[FRAG_ATTRIB_WPOS][2] += offset; } _swsetup_render_line_tri( ctx, e0, e1, e2, facing ); } else { if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) { - v[0]->win[2] += offset; - v[1]->win[2] += offset; - v[2]->win[2] += offset; + v[0]->attrib[FRAG_ATTRIB_WPOS][2] += offset; + v[1]->attrib[FRAG_ATTRIB_WPOS][2] += offset; + v[2]->attrib[FRAG_ATTRIB_WPOS][2] += offset; } _swrast_Triangle( ctx, v[0], v[1], v[2] ); } if (IND & SS_OFFSET_BIT) { - v[0]->win[2] = z[0]; - v[1]->win[2] = z[1]; - v[2]->win[2] = z[2]; + v[0]->attrib[FRAG_ATTRIB_WPOS][2] = z[0]; + v[1]->attrib[FRAG_ATTRIB_WPOS][2] = z[1]; + v[2]->attrib[FRAG_ATTRIB_WPOS][2] = z[2]; } if (IND & SS_TWOSIDE_BIT) { @@ -176,14 +176,14 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } if (VB->SecondaryColorPtr[1]) { - COPY_CHAN4(v[0]->specular, saved_spec[0]); - COPY_CHAN4(v[1]->specular, saved_spec[1]); - COPY_CHAN4(v[2]->specular, saved_spec[2]); + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); } } else { - v[0]->index = saved_index[0]; - v[1]->index = saved_index[1]; - v[2]->index = saved_index[2]; + v[0]->attrib[FRAG_ATTRIB_CI][0] = saved_index[0]; + v[1]->attrib[FRAG_ATTRIB_CI][0] = saved_index[1]; + v[2]->attrib[FRAG_ATTRIB_CI][0] = saved_index[2]; } } } diff --git a/src/mesa/tnl_dd/t_dd_vb.c b/src/mesa/tnl_dd/t_dd_vb.c index 6cdd1bc0313..ab3bb37631b 100644 --- a/src/mesa/tnl_dd/t_dd_vb.c +++ b/src/mesa/tnl_dd/t_dd_vb.c @@ -89,15 +89,15 @@ void TAG(translate_vertex)(GLcontext *ctx, if (format == TINY_VERTEX_FORMAT) { if (HAVE_HW_VIEWPORT) { - dst->win[0] = s[0] * src->v.x + s[12]; - dst->win[1] = s[5] * src->v.y + s[13]; - dst->win[2] = s[10] * src->v.z + s[14]; - dst->win[3] = 1.0; + dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; + dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; + dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; + dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; } else { - dst->win[0] = UNVIEWPORT_X( src->v.x ); - dst->win[1] = UNVIEWPORT_Y( src->v.y ); - dst->win[2] = UNVIEWPORT_Z( src->v.z ); - dst->win[3] = 1.0; + dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); + dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); + dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); + dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; } dst->color[0] = src->tv.color.red; @@ -109,21 +109,21 @@ void TAG(translate_vertex)(GLcontext *ctx, if (HAVE_HW_VIEWPORT) { if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { GLfloat oow = 1.0 / src->v.w; - dst->win[0] = s[0] * src->v.x * oow + s[12]; - dst->win[1] = s[5] * src->v.y * oow + s[13]; - dst->win[2] = s[10] * src->v.z * oow + s[14]; - dst->win[3] = oow; + dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x * oow + s[12]; + dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y * oow + s[13]; + dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z * oow + s[14]; + dst->attrib[FRAG_ATTRIB_WPOS][3] = oow; } else { - dst->win[0] = s[0] * src->v.x + s[12]; - dst->win[1] = s[5] * src->v.y + s[13]; - dst->win[2] = s[10] * src->v.z + s[14]; - dst->win[3] = src->v.w; + dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; + dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; + dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; + dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; } } else { - dst->win[0] = UNVIEWPORT_X( src->v.x ); - dst->win[1] = UNVIEWPORT_Y( src->v.y ); - dst->win[2] = UNVIEWPORT_Z( src->v.z ); - dst->win[3] = src->v.w; + dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); + dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); + dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); + dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; } dst->color[0] = src->v.color.red; @@ -131,11 +131,11 @@ void TAG(translate_vertex)(GLcontext *ctx, dst->color[2] = src->v.color.blue; dst->color[3] = src->v.color.alpha; - dst->specular[0] = src->v.specular.red; - dst->specular[1] = src->v.specular.green; - dst->specular[2] = src->v.specular.blue; + dst->attrib[FRAG_ATTRIB_COL1][0] = UBYTE_TO_FLOAT(src->v.specular.red); + dst->attrib[FRAG_ATTRIB_COL1][1] = UBYTE_TO_FLOAT(src->v.specular.green); + dst->attrib[FRAG_ATTRIB_COL1][2] = UBYTE_TO_FLOAT(src->v.specular.blue); - dst->attrib[FRAG_ATTRIB_FOGC][0] = src->v.specular.alpha/255.0; + dst->attrib[FRAG_ATTRIB_FOGC][0] = UBYTE_TO_FLOAT(src->v.specular.alpha); if (HAVE_PTEX_VERTICES && ((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) || -- cgit v1.2.3 From a8676c45ccab52117c70f2e90fd820d745261f51 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 21 May 2007 08:57:18 -0600 Subject: if light position is local, treat it as a homogeneous coord and divide by W (see bug 11009) --- src/mesa/main/light.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 92d8a0ae0d4..6e057614bad 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.0 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -1117,6 +1117,13 @@ compute_light_positions( GLcontext *ctx ) } light->_VP_inf_spot_attenuation = 1.0; } + else { + /* positional light w/ homogeneous coordinate, divide by W */ + GLfloat wInv = 1.0 / light->_Position[3]; + light->_Position[0] *= wInv; + light->_Position[1] *= wInv; + light->_Position[2] *= wInv; + } if (light->_Flags & LIGHT_SPOT) { if (ctx->_NeedEyeCoords) { -- cgit v1.2.3 From b1c640deda326078b1b2b335646f32b52120be3c Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 21 May 2007 11:38:25 +0200 Subject: unbreak 3d textures (typo when setting tex layout) --- src/mesa/drivers/dri/i915tex/i915_tex_layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c index 9f40706c36a..7b761a7b221 100644 --- a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c @@ -113,7 +113,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt) */ for (level = mt->first_level; level <= MAX2(8, mt->last_level); level++) { - intel_miptree_set_level_info(mt, level, 1, 0, mt->total_height, + intel_miptree_set_level_info(mt, level, depth, 0, mt->total_height, width, height, depth); -- cgit v1.2.3 From 1078ef83eb3458363bf9709a7c697b39020266ea Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 22 May 2007 02:50:08 +0200 Subject: i915/i915tex: minor cleanup (remove unneeded function call --- src/mesa/drivers/dri/i915/i915_fragprog.c | 8 -------- src/mesa/drivers/dri/i915tex/i915_fragprog.c | 8 -------- 2 files changed, 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index a28c8bb6fc2..702b8788282 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -857,11 +857,6 @@ static void i915BindProgram( GLcontext *ctx, assert(p->on_hardware == 0); assert(p->params_uptodate == 0); - /* Hack: make sure fog is correctly enabled according to this - * fragment program's fog options. - */ - ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB, - ctx->FragmentProgram.Enabled ); } } @@ -935,9 +930,6 @@ static void i915ProgramStringNotify( GLcontext *ctx, /* Hack: make sure fog is correctly enabled according to this * fragment program's fog options. */ - ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB, - ctx->FragmentProgram.Enabled ); - if (p->FragProg.FogOption) { /* add extra instructions to do fog, then turn off FogOption field */ _mesa_append_fog_code(ctx, &p->FragProg); diff --git a/src/mesa/drivers/dri/i915tex/i915_fragprog.c b/src/mesa/drivers/dri/i915tex/i915_fragprog.c index cbea6092a81..a4b22a0c32c 100644 --- a/src/mesa/drivers/dri/i915tex/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915tex/i915_fragprog.c @@ -849,11 +849,6 @@ i915BindProgram(GLcontext * ctx, GLenum target, struct gl_program *prog) assert(p->on_hardware == 0); assert(p->params_uptodate == 0); - /* Hack: make sure fog is correctly enabled according to this - * fragment program's fog options. - */ - ctx->Driver.Enable(ctx, GL_FRAGMENT_PROGRAM_ARB, - ctx->FragmentProgram.Enabled); } } @@ -926,9 +921,6 @@ i915ProgramStringNotify(GLcontext * ctx, /* Hack: make sure fog is correctly enabled according to this * fragment program's fog options. */ - ctx->Driver.Enable(ctx, GL_FRAGMENT_PROGRAM_ARB, - ctx->FragmentProgram.Enabled); - if (p->FragProg.FogOption) { /* add extra instructions to do fog, then turn off FogOption field */ _mesa_append_fog_code(ctx, &p->FragProg); -- cgit v1.2.3 From 7f1879d4e137f9b98d7430976adf9c28c4bf9fcf Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 22 May 2007 02:52:39 +0200 Subject: make sure optimized fog params get updated --- src/mesa/shader/prog_statevars.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 975a617ac89..d37d7fb9bf4 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -507,6 +507,8 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) switch (state[1]) { case STATE_TEXRECT_SCALE: return _NEW_TEXTURE; + case STATE_FOG_PARAMS_OPTIMIZED: + return _NEW_FOG; default: /* unknown state indexes are silently ignored and * no flag set, since it is handled by the driver. -- cgit v1.2.3 From 3e21a014c308a87e1dd7bdabba255aad02d3ad1b Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 22 May 2007 03:29:59 +0200 Subject: fog: fix issues with negative fog coords (may fix #10529) Rework tnl fog a bit. Make sure we always use ABS(eyez) when fog coord source is depth, OTOH it does not seem to be necessary to use it (as was done before in some cases) if fog coord source is fogcoord (just to save some work). This fixes tests/fog (the first 2 cases) with i915/i915tex. --- src/mesa/tnl/t_vb_fog.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index 5440ff7894d..f6518500d80 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -114,7 +114,7 @@ compute_fog_blend_factors(GLcontext *ctx, GLvector4f *out, const GLvector4f *in) else d = 1.0F / (ctx->Fog.End - ctx->Fog.Start); for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) { - const GLfloat z = FABSF(*v); + const GLfloat z = *v; GLfloat f = (end - z) * d; data[i][0] = CLAMP(f, 0.0F, 1.0F); } @@ -122,14 +122,14 @@ compute_fog_blend_factors(GLcontext *ctx, GLvector4f *out, const GLvector4f *in) case GL_EXP: d = ctx->Fog.Density; for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride)) { - const GLfloat z = FABSF(*v); + const GLfloat z = *v; NEG_EXP( data[i][0], d * z ); } break; case GL_EXP2: d = ctx->Fog.Density*ctx->Fog.Density; for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) { - const GLfloat z = FABSF(*v); + const GLfloat z = *v; NEG_EXP( data[i][0], d * z * z ); } break; @@ -153,6 +153,8 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) { + GLuint i; + GLfloat *coord; /* Fog is computed from vertex or fragment Z values */ /* source = VB->ObjPtr or VB->EyePtr coords */ /* dest = VB->AttribPtr[_TNL_ATTRIB_FOG] = fog stage private storage */ @@ -168,6 +170,8 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) input = &store->fogcoord; /* NOTE: negate plane here so we get positive fog coords! */ + /* NOTE2: this doesn't always work (tests/fog - all frag depth fog + coords will be negative). */ plane[0] = -m[2]; plane[1] = -m[6]; plane[2] = -m[10]; @@ -180,18 +184,29 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) VB->ObjPtr, plane ); input->count = VB->ObjPtr->count; + + /* make sure coords are really positive + NOTE should avoid going through array twice */ + coord = input->start; + for (i = 0; i < input->count; i++) { + input->data[i][0] = FABSF(*coord); + STRIDE_F(coord, input->stride); + } } else { /* fog coordinates = eye Z coordinates (use ABS later) */ - input = &store->input; + input = &store->fogcoord; if (VB->EyePtr->size < 2) _mesa_vector4f_clean_elem( VB->EyePtr, VB->Count, 2 ); - input->data = (GLfloat (*)[4]) &(VB->EyePtr->data[0][2]); - input->start = VB->EyePtr->start+2; - input->stride = VB->EyePtr->stride; + input->stride = 4 * sizeof(GLfloat); input->count = VB->EyePtr->count; + coord = VB->EyePtr->start; + for (i = 0 ; i < VB->EyePtr->count; i++) { + input->data[i][0] = FABSF(coord[2]); + STRIDE_F(coord, VB->EyePtr->stride); + } } } else { -- cgit v1.2.3 From 74a30c351fe98f41150dfe81a6aba05087997206 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 22 May 2007 03:30:09 +0200 Subject: fog: fix potential issues with generated vp using fog Change the generated vertex programs (tnl/brw) to follow the same logic as the tnl fog wrt using absolute value, and sync them up a bit (untested). --- src/mesa/drivers/dri/i965/brw_vs_tnl.c | 22 ++++++++++++++-------- src/mesa/tnl/t_vp_build.c | 23 +++++++++++++++-------- 2 files changed, 29 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c index 35adc4846a0..b69be350a92 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c +++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c @@ -1154,7 +1154,9 @@ static void build_fog( struct tnl_program *p ) { struct ureg fog = register_output(p, VERT_RESULT_FOGC); struct ureg input; - + GLuint useabs = p->state->fog_source_is_depth && p->state->fog_option && + (p->state->fog_option != FOG_EXP2); + if (p->state->fog_source_is_depth) { input = swizzle1(get_eye_position(p), Z); } @@ -1171,26 +1173,30 @@ static void build_fog( struct tnl_program *p ) emit_op1(p, OPCODE_MOV, fog, 0, id); + if (useabs) { + emit_op1(p, OPCODE_ABS, tmp, 0, input); + } + switch (p->state->fog_option) { case FOG_LINEAR: { - emit_op1(p, OPCODE_ABS, tmp, 0, input); - emit_op3(p, OPCODE_MAD, tmp, 0, tmp, swizzle1(params,X), swizzle1(params,Y)); + emit_op3(p, OPCODE_MAD, tmp, 0, useabs ? tmp : input, + swizzle1(params,X), swizzle1(params,Y)); emit_op2(p, OPCODE_MAX, tmp, 0, tmp, swizzle1(id,X)); /* saturate */ emit_op2(p, OPCODE_MIN, fog, WRITEMASK_X, tmp, swizzle1(id,W)); break; } case FOG_EXP: - emit_op1(p, OPCODE_ABS, tmp, 0, input); - emit_op2(p, OPCODE_MUL, tmp, 0, tmp, swizzle1(params,Z)); + emit_op2(p, OPCODE_MUL, tmp, 0, useabs ? tmp : input, + swizzle1(params,Z)); emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, ureg_negate(tmp)); break; case FOG_EXP2: emit_op2(p, OPCODE_MUL, tmp, 0, input, swizzle1(params,W)); - emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp); + emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp); emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, ureg_negate(tmp)); break; } - + release_temp(p, tmp); } else { @@ -1198,7 +1204,7 @@ static void build_fog( struct tnl_program *p ) * * KW: Is it really necessary to do anything in this case? */ - emit_op1(p, OPCODE_MOV, fog, 0, input); + emit_op1(p, useabs ? OPCODE_ABS : OPCODE_MOV, fog, 0, input); } } diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index dff062a417c..2a1cae77f29 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -1103,7 +1103,9 @@ static void build_fog( struct tnl_program *p ) { struct ureg fog = register_output(p, VERT_RESULT_FOGC); struct ureg input; - + GLuint useabs = p->state->fog_source_is_depth && p->state->fog_mode && + (p->state->fog_mode != FOG_EXP2); + if (p->state->fog_source_is_depth) { input = swizzle1(get_eye_position(p), Z); } @@ -1111,31 +1113,36 @@ static void build_fog( struct tnl_program *p ) input = swizzle1(register_input(p, VERT_ATTRIB_FOG), X); } - if (p->state->tnl_do_vertex_fog) { + if (p->state->fog_mode && p->state->tnl_do_vertex_fog) { struct ureg params = register_param2(p, STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED); struct ureg tmp = get_temp(p); + if (useabs) { + emit_op1(p, OPCODE_ABS, tmp, 0, input); + } + switch (p->state->fog_mode) { case FOG_LINEAR: { struct ureg id = get_identity_param(p); - emit_op3(p, OPCODE_MAD, tmp, 0, input, swizzle1(params,X), swizzle1(params,Y)); + emit_op3(p, OPCODE_MAD, tmp, 0, useabs ? tmp : input, + swizzle1(params,X), swizzle1(params,Y)); emit_op2(p, OPCODE_MAX, tmp, 0, tmp, swizzle1(id,X)); /* saturate */ emit_op2(p, OPCODE_MIN, fog, WRITEMASK_X, tmp, swizzle1(id,W)); break; } case FOG_EXP: - emit_op1(p, OPCODE_ABS, tmp, 0, input); - emit_op2(p, OPCODE_MUL, tmp, 0, tmp, swizzle1(params,Z)); + emit_op2(p, OPCODE_MUL, tmp, 0, useabs ? tmp : input, + swizzle1(params,Z)); emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); break; case FOG_EXP2: emit_op2(p, OPCODE_MUL, tmp, 0, input, swizzle1(params,W)); - emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp); + emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp); emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); break; } - + release_temp(p, tmp); } else { @@ -1143,7 +1150,7 @@ static void build_fog( struct tnl_program *p ) * * KW: Is it really necessary to do anything in this case? */ - emit_op1(p, OPCODE_MOV, fog, WRITEMASK_X, input); + emit_op1(p, useabs ? OPCODE_ABS : OPCODE_MOV, fog, WRITEMASK_X, input); } } -- cgit v1.2.3 From a10ba38df7ac80e36db15aaae9f78e7223b2bfae Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 21 May 2007 20:56:35 -0600 Subject: return True for GLX_Y_INVERTED_EXT query --- src/mesa/drivers/x11/fakeglx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index ef22a3f03eb..1587df66bcd 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1920,7 +1920,7 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig ) GLX_TEXTURE_RECTANGLE_BIT_EXT); /*XXX*/ break; case GLX_Y_INVERTED_EXT: - *value = False; /*XXX*/ + *value = True; /*XXX*/ break; #endif -- cgit v1.2.3 From 3898e67f49b375bd0127fb2931468653cc29d5f9 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 21 May 2007 21:48:08 -0600 Subject: remove some whitespace --- src/mesa/main/dlist.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index c8c68214ce8..91ddcbf9ed6 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -6596,9 +6596,6 @@ execute_list(GLcontext *ctx, GLuint list) CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i)); break; - - - case OPCODE_CONTINUE: n = (Node *) n[1].next; break; @@ -8407,8 +8404,6 @@ print_list(GLcontext *ctx, GLuint list) _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i); break; - - /* * meta opcodes/commands */ -- cgit v1.2.3 From a01ee8ff0bdc9b80907f2fe48ebf1618ce2ded92 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 21 May 2007 21:48:33 -0600 Subject: improve some comments, clean-up formatting --- src/mesa/main/teximage.h | 11 ++++++----- src/mesa/main/texobj.c | 16 ++++++++++++---- src/mesa/main/texobj.h | 7 +++++-- 3 files changed, 23 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 68457f4728c..f2cad7eb2da 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -107,18 +107,19 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, GLint width, GLint height, GLint depth, GLint border); -/* Lock a texture for updating. See also _mesa_lock_context_textures(). +/** + * Lock a texture for updating. See also _mesa_lock_context_textures(). */ -static INLINE void _mesa_lock_texture(GLcontext *ctx, - struct gl_texture_object *texObj) +static INLINE void +_mesa_lock_texture(GLcontext *ctx, struct gl_texture_object *texObj) { _glthread_LOCK_MUTEX(ctx->Shared->TexMutex); ctx->Shared->TextureStateStamp++; (void) texObj; } -static INLINE void _mesa_unlock_texture(GLcontext *ctx, - struct gl_texture_object *texObj) +static INLINE void +_mesa_unlock_texture(GLcontext *ctx, struct gl_texture_object *texObj) { _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex); } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index bd447ac0688..65e1bc1357d 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1097,14 +1097,21 @@ _mesa_IsTexture( GLuint texture ) return t && t->Target; } -/* Simplest implementation of texture locking: Grab the a new mutex in + +/** + * Simplest implementation of texture locking: Grab the a new mutex in * the shared context. Examine the shared context state timestamp and * if there has been a change, set the appropriate bits in * ctx->NewState. * - * See also _mesa_lock/unlock_texture in texobj.h + * This is used to deal with synchronizing things when a texture object + * is used/modified by different contexts (or threads) which are sharing + * the texture. + * + * See also _mesa_lock/unlock_texture() in teximage.h */ -void _mesa_lock_context_textures( GLcontext *ctx ) +void +_mesa_lock_context_textures( GLcontext *ctx ) { _glthread_LOCK_MUTEX(ctx->Shared->TexMutex); @@ -1115,7 +1122,8 @@ void _mesa_lock_context_textures( GLcontext *ctx ) } -void _mesa_unlock_context_textures( GLcontext *ctx ) +void +_mesa_unlock_context_textures( GLcontext *ctx ) { assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp); _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex); diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h index ec7cf8cd86e..2a2bde36017 100644 --- a/src/mesa/main/texobj.h +++ b/src/mesa/main/texobj.h @@ -61,8 +61,11 @@ extern void _mesa_test_texobj_completeness( const GLcontext *ctx, struct gl_texture_object *obj ); -extern void _mesa_unlock_context_textures( GLcontext *ctx ); -extern void _mesa_lock_context_textures( GLcontext *ctx ); +extern void +_mesa_unlock_context_textures( GLcontext *ctx ); + +extern void +_mesa_lock_context_textures( GLcontext *ctx ); /*@}*/ -- cgit v1.2.3 From 5c5ab90c762614ef1db898e1984137d65fb96b7e Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 21 May 2007 21:49:34 -0600 Subject: remove a VMS-ism that doesn't seem needed elsewhere --- src/mesa/main/texobj.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 65e1bc1357d..47d9dd5dcb2 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -42,10 +42,6 @@ #include "mtypes.h" -#ifdef __VMS -#define _mesa_sprintf sprintf -#endif - /**********************************************************************/ /** \name Internal functions */ /*@{*/ -- cgit v1.2.3 From c62da91f44c230b6476b5d7409d2c11e88f1620b Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 21 May 2007 21:59:20 -0600 Subject: remove the unused texobj Mutex field --- src/mesa/main/mtypes.h | 1 - src/mesa/main/texobj.c | 5 ----- 2 files changed, 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 894b9edb36f..fc712def576 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1397,7 +1397,6 @@ struct gl_texture_image */ struct gl_texture_object { - _glthread_Mutex Mutex; /**< for thread safety */ GLint RefCount; /**< reference count */ GLuint Name; /**< the user-visible texture object ID */ GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 47d9dd5dcb2..55dce60d675 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -106,7 +106,6 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, _mesa_bzero(obj, sizeof(*obj)); /* init the non-zero fields */ - _glthread_INIT_MUTEX(obj->Mutex); obj->RefCount = 1; obj->Name = name; obj->Target = target; @@ -136,7 +135,6 @@ _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 */ - _mesa_init_colortable(&obj->Palette); } @@ -165,9 +163,6 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) } } - /* destroy the mutex -- it may have allocated memory (eg on bsd) */ - _glthread_DESTROY_MUTEX(texObj->Mutex); - /* free this object */ _mesa_free(texObj); } -- cgit v1.2.3 From 9e3e3883fa42ffee82e8e8ecbf75c153a2215acb Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 21 May 2007 22:10:06 -0600 Subject: get rid of GenTexturesLock, used ctx->Shared->Mutex --- src/mesa/main/texobj.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 55dce60d675..0d2946e95a7 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -141,6 +141,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, /** * Deallocate a texture object struct. It should have already been * removed from the texture object pool. + * Called via ctx->Driver.DeleteTexture() if not overriden by a driver. * * \param shared the shared GL state to which the object belongs. * \param texOjb the texture object to delete. @@ -523,13 +524,6 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /** \name API functions */ /*@{*/ -/** - * Texture name generation lock. - * - * Used by _mesa_GenTextures() to guarantee that the generation and allocation - * of texture IDs is atomic. - */ -_glthread_DECLARE_STATIC_MUTEX(GenTexturesLock); /** * Generate texture names. @@ -539,9 +533,9 @@ _glthread_DECLARE_STATIC_MUTEX(GenTexturesLock); * * \sa glGenTextures(). * - * While holding the GenTexturesLock lock, calls _mesa_HashFindFreeKeyBlock() - * to find a block of free texture IDs which are stored in \p textures. - * Corresponding empty texture objects are also generated. + * Calls _mesa_HashFindFreeKeyBlock() to find a block of free texture + * IDs which are stored in \p textures. Corresponding empty texture + * objects are also generated. */ void GLAPIENTRY _mesa_GenTextures( GLsizei n, GLuint *textures ) @@ -562,7 +556,7 @@ _mesa_GenTextures( GLsizei n, GLuint *textures ) /* * This must be atomic (generation and allocation of texture IDs) */ - _glthread_LOCK_MUTEX(GenTexturesLock); + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n); @@ -573,20 +567,18 @@ _mesa_GenTextures( GLsizei n, GLuint *textures ) GLenum target = 0; texObj = (*ctx->Driver.NewTextureObject)( ctx, name, target); if (!texObj) { - _glthread_UNLOCK_MUTEX(GenTexturesLock); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenTextures"); return; } /* insert into hash table */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); _mesa_HashInsert(ctx->Shared->TexObjects, texObj->Name, texObj); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); textures[i] = name; } - _glthread_UNLOCK_MUTEX(GenTexturesLock); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); } -- cgit v1.2.3 From 24d965fab52f790188e5de6e67e7387809b1f145 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 22 May 2007 13:56:30 +0200 Subject: Fix xserver build after recent XMesa changes. Only build tested. --- include/GL/xmesa.h | 4 ++-- include/GL/xmesa_x.h | 1 + include/GL/xmesa_xf86.h | 29 ++++++++++++++++++++++++++++- src/mesa/drivers/x11/xm_api.c | 20 ++++++++++---------- src/mesa/drivers/x11/xm_image.h | 7 ------- 5 files changed, 41 insertions(+), 20 deletions(-) (limited to 'src/mesa') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 2199b08cf0f..98139af8336 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -402,11 +402,11 @@ extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, * New in Mesa 7.1 */ extern void -XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer, +XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer, const int *attrib_list); extern void -XMesaReleaseTexImage(Display *dpy, XMesaBuffer drawable, int buffer); +XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer); extern XMesaBuffer diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h index 721d8b51070..865bab4313b 100644 --- a/include/GL/xmesa_x.h +++ b/include/GL/xmesa_x.h @@ -66,6 +66,7 @@ typedef XColor XMesaColor; #define XMesaDrawPoints XDrawPoints #define XMesaDrawLine XDrawLine #define XMesaFillRectangle XFillRectangle +#define XMesaGetImage XGetImage #define XMesaPutImage XPutImage #define XMesaCopyArea XCopyArea diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 0a15110f651..18908a133fa 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -42,8 +42,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "scrnintstr.h" #include "pixmapstr.h" #include "gcstruct.h" +#include "servermd.h" -typedef struct _XMesaImageRec XMesaImage; + +typedef struct _XMesaImageRec { + int width, height; + char *data; + int bytes_per_line; /* Padded to 32 bits */ + int bits_per_pixel; +} XMesaImage; typedef ScreenRec XMesaDisplay; typedef PixmapPtr XMesaPixmap; @@ -120,6 +127,26 @@ do { \ (*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \ } while (0) +static _X_INLINE XMesaImage *XMesaGetImage(XMesaDisplay *dpy, PixmapPtr p, int x, + int y, unsigned int width, + unsigned int height, + unsigned long plane_mask, int format) +{ + XMesaImage *img = Xcalloc(sizeof(*img)); + + img->width = p->drawable.width; + img->height = p->drawable.height; + img->bits_per_pixel = p->drawable.bitsPerPixel; + img->bytes_per_line = PixmapBytePad(width, p->drawable.depth); + img->data = malloc(height * img->bytes_per_line); + + /* Assumes: Images are always in ZPixmap format */ + (*p->drawable.pScreen->GetImage)(&p->drawable, x, y, width, height, + plane_mask, ZPixmap, img->data); + + return img; +} + #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ do { \ /* Assumes: Images are always in ZPixmap format */ \ diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index edaa71508fc..cff64d17ade 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -63,6 +63,7 @@ #endif #include "glxheader.h" +#include "GL/glxtokens.h" #include "GL/xmesa.h" #include "xmesaP.h" #include "context.h" @@ -293,11 +294,9 @@ static GLboolean window_exists( XMesaDisplay *dpy, Window win ) XSetErrorHandler(old_handler); return WindowExistsFlag; } -#endif - static Status -get_drawable_size(Display *dpy, Drawable d, GLuint *width, GLuint *height) +get_drawable_size( XMesaDisplay *dpy, Drawable d, GLuint *width, GLuint *height ) { Window root; Status stat; @@ -308,6 +307,7 @@ get_drawable_size(Display *dpy, Drawable d, GLuint *width, GLuint *height) *height = h; return stat; } +#endif /** @@ -1703,7 +1703,7 @@ XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p, return NULL; /* get pixmap size, update framebuffer/renderbuffer dims */ - get_drawable_size(v->display, p, &width, &height); + xmesa_get_window_size(v->display, b, &width, &height); _mesa_resize_framebuffer(NULL, &(b->mesa_buffer), width, height); if (target == 0) { @@ -2363,7 +2363,7 @@ xbuffer_to_renderbuffer(int buffer) PUBLIC void -XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer, +XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer, const int *attrib_list) { #if 0 @@ -2375,7 +2375,7 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer, struct gl_renderbuffer *rb; struct xmesa_renderbuffer *xrb; GLint b; - XMesaImage *img; + XMesaImage *img = NULL; GLboolean freeImg = GL_FALSE; b = xbuffer_to_renderbuffer(buffer); @@ -2412,15 +2412,15 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer, * The following is a quick and simple way to implement * BindTexImage. The better way is to write some new FetchTexel() * functions which would extract texels from XImages. We'd still - * need to use XGetImage when texturing from a Pixmap (front buffer) + * need to use GetImage when texturing from a Pixmap (front buffer) * but texturing from a back buffer (XImage) would avoid an image * copy. */ /* get XImage */ if (xrb->pixmap) { - img = XGetImage(dpy, xrb->pixmap, 0, 0, rb->Width, rb->Height, - AllPlanes, ZPixmap ); + img = XMesaGetImage(dpy, xrb->pixmap, 0, 0, rb->Width, rb->Height, ~0L, + ZPixmap); freeImg = GL_TRUE; } else if (xrb->ximage) { @@ -2468,7 +2468,7 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer, PUBLIC void -XMesaReleaseTexImage(Display *dpy, XMesaBuffer drawable, int buffer) +XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer) { const GLint b = xbuffer_to_renderbuffer(buffer); if (b < 0) diff --git a/src/mesa/drivers/x11/xm_image.h b/src/mesa/drivers/x11/xm_image.h index 240ccee1af5..2a5e0f37779 100644 --- a/src/mesa/drivers/x11/xm_image.h +++ b/src/mesa/drivers/x11/xm_image.h @@ -36,13 +36,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define XMESA_USE_PUTPIXEL_MACRO -struct _XMesaImageRec { - int width, height; - char *data; - int bytes_per_line; /* Padded to 32 bits */ - int bits_per_pixel; -}; - extern XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data); extern void XMesaDestroyImage(XMesaImage *image); -- cgit v1.2.3 From 043d219b6da0636886f739613380cf44e334f268 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 22 May 2007 14:08:10 +0200 Subject: Add interfaces for overriding texture images with driver specific 'offsets'. To be used by AIGLX for GLX_EXT_texture_from_pixmap without several additional data copies. --- include/GL/internal/dri_interface.h | 12 ++++++++++++ src/mesa/drivers/dri/common/dri_util.c | 3 +++ src/mesa/drivers/dri/common/dri_util.h | 6 ++++++ 3 files changed, 21 insertions(+) (limited to 'src/mesa') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index a3de2c6aab3..8d24e311f84 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -361,6 +361,18 @@ struct __DRIscreenRec { void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes, int render_type, void *sharedPrivate, __DRIcontext *pctx); + + /** + * Method to override base texture image with a driver specific 'offset'. + * The depth passed in allows e.g. to ignore the alpha channel of texture + * images where the non-alpha components don't occupy a whole texel. + * + * For GLX_EXT_texture_from_pixmap with AIGLX. + * + * \since Internal API version 20070121. + */ + void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname, + unsigned long long offset, GLint depth, GLuint pitch); }; /** diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 07ac4c7cd5f..dd52f7e9151 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -995,6 +995,9 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, psc->getMSC = driGetMSC; psc->createNewContext = driCreateNewContext; + if (internal_api_version >= 20070121) + psc->setTexOffset = psp->DriverAPI.setTexOffset; + if ( (psp->DriverAPI.InitDriver != NULL) && !(*psp->DriverAPI.InitDriver)(psp) ) { _mesa_free( psp ); diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 8639535abb2..539d28d1149 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -189,6 +189,12 @@ struct __DriverAPIRec { /*@}*/ void (*CopySubBuffer)(__DRIdrawablePrivate *driDrawPriv, int x, int y, int w, int h); + + /** + * See corresponding field in \c __DRIscreenRec. + */ + void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname, + unsigned long long offset, GLint depth, GLuint pitch); }; -- cgit v1.2.3 From 59a08923f51d4ed83effbfcd91473c9ee86465f1 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 22 May 2007 14:08:11 +0200 Subject: r300: Implement SetTexOffset hook. --- src/mesa/drivers/dri/r300/r300_context.h | 2 + src/mesa/drivers/dri/r300/r300_tex.h | 4 ++ src/mesa/drivers/dri/r300/r300_texmem.c | 3 ++ src/mesa/drivers/dri/r300/r300_texstate.c | 73 ++++++++++++++++++++++++----- src/mesa/drivers/dri/radeon/radeon_screen.c | 4 ++ 5 files changed, 74 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 261c87f2f0b..01caa617667 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -191,6 +191,8 @@ struct r300_tex_obj { drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS]; /* Six, for the cube faces */ + GLboolean image_override; /* Image overridden by GLX_EXT_tfp */ + GLuint pitch; /* this isn't sent to hardware just used in calculations */ /* hardware register values */ /* Note that R200 has 8 registers per texture and R300 only 7 */ diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h index 74fa08e97d9..f67a8e6ba65 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.h +++ b/src/mesa/drivers/dri/r300/r300_tex.h @@ -35,6 +35,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __r300_TEX_H__ #define __r300_TEX_H__ +extern void r300SetTexOffset(__DRIcontext *pDRICtx, GLint texname, + unsigned long long offset, GLint depth, + GLuint pitch); + extern void r300UpdateTextureState(GLcontext * ctx); extern int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t, diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 60e7dc967b1..e2e8355d275 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -508,6 +508,9 @@ int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t, GLuint face) { const int numLevels = t->base.lastLevel - t->base.firstLevel + 1; + if (t->image_override) + return 0; + if (RADEON_DEBUG & (DEBUG_TEXTURE | DEBUG_IOCTL)) { fprintf(stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__, (void *)rmesa->radeon.glCtx, (void *)t->base.tObj, diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 705502ebf2b..8203189b7f4 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -40,6 +40,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "context.h" #include "macros.h" #include "texformat.h" +#include "teximage.h" +#include "texobj.h" #include "enums.h" #include "r300_context.h" @@ -66,7 +68,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * identically. -- paulus */ -static const struct { +static const struct tx_table { GLuint format, filter, flag; } tx_table_be[] = { /* *INDENT-OFF* */ @@ -109,15 +111,13 @@ static const struct { /* *INDENT-ON* */ }; -static const struct { - GLuint format, filter, flag; -} tx_table_le[] = { +static const struct tx_table tx_table_le[] = { /* *INDENT-OFF* */ _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), - _ASSIGN(RGB888, 0xffffffff), + _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), _ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), @@ -178,7 +178,7 @@ static void r300SetTexImages(r300ContextPtr rmesa, /* Set the hardware texture format */ - if (VALID_FORMAT(baseImage->TexFormat->MesaFormat)) { + if (!t->image_override && VALID_FORMAT(baseImage->TexFormat->MesaFormat)) { if (_mesa_little_endian()) { t->format = tx_table_le[baseImage->TexFormat->MesaFormat]. @@ -194,7 +194,7 @@ static void r300SetTexImages(r300ContextPtr rmesa, tx_table_be[baseImage->TexFormat->MesaFormat]. filter; } - } else { + } else if (!t->image_override) { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); return; @@ -382,9 +382,10 @@ static void r300SetTexImages(r300ContextPtr rmesa, t->pitch = ((tObj->Image[0][t->base.firstLevel]->Width * texelBytes) + 63) & ~(63); t->size |= R300_TX_SIZE_TXPITCH_EN; - t->pitch_reg = - (((tObj->Image[0][t->base.firstLevel]->Width) + - align) & ~align) - 1; + if (!t->image_override) + t->pitch_reg = + (((tObj->Image[0][t->base.firstLevel]->Width) + + align) & ~align) - 1; } else { t->pitch = ((tObj->Image[0][t->base.firstLevel]->Width * @@ -411,9 +412,10 @@ static GLboolean r300EnableTexture2D(GLcontext * ctx, int unit) if (t->base.dirty_images[0]) { R300_FIREVERTICES(rmesa); + r300SetTexImages(rmesa, tObj); r300UploadTexImages(rmesa, (r300TexObjPtr) tObj->DriverData, 0); - if (!t->base.memBlock) + if (!t->base.memBlock && !t->image_override) return GL_FALSE; } @@ -492,9 +494,11 @@ static GLboolean r300EnableTextureRect(GLcontext * ctx, int unit) if (t->base.dirty_images[0]) { R300_FIREVERTICES(rmesa); + r300SetTexImages(rmesa, tObj); r300UploadTexImages(rmesa, (r300TexObjPtr) tObj->DriverData, 0); - if (!t->base.memBlock && !rmesa->prefer_gart_client_texturing) + if (!t->base.memBlock && !t->image_override && + !rmesa->prefer_gart_client_texturing) return GL_FALSE; } @@ -534,6 +538,51 @@ static GLboolean r300UpdateTexture(GLcontext * ctx, int unit) return !t->border_fallback; } +void r300SetTexOffset(__DRIcontext *pDRICtx, GLint texname, + unsigned long long offset, GLint depth, GLuint pitch) +{ + r300ContextPtr rmesa = + (r300ContextPtr)((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate; + struct gl_texture_object *tObj = + _mesa_lookup_texture(rmesa->radeon.glCtx, texname); + r300TexObjPtr t; + int idx; + + if (!tObj) + return; + + t = (r300TexObjPtr) tObj->DriverData; + + t->image_override = GL_TRUE; + + if (!offset) + return; + + t->offset = offset; + t->pitch_reg = pitch; + + switch (depth) { + case 32: + idx = 2; + t->pitch_reg /= 4; + break; + case 24: + default: + idx = 4; + t->pitch_reg /= 4; + break; + case 16: + idx = 5; + t->pitch_reg /= 2; + break; + } + + t->pitch_reg--; + + t->format = tx_table_le[idx].format; + t->filter |= tx_table_le[idx].filter; +} + static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit) { struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index b476864d035..aa7fb633dd1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -56,6 +56,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) #include "r300_context.h" #include "r300_fragprog.h" +#include "r300_tex.h" #include "radeon_span.h" #endif @@ -952,6 +953,9 @@ static struct __DriverAPIRec radeonAPI = { .WaitForSBC = NULL, .SwapBuffersMSC = NULL, .CopySubBuffer = radeonCopySubBuffer, +#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) + .setTexOffset = r300SetTexOffset, +#endif }; #else static const struct __DriverAPIRec r200API = { -- cgit v1.2.3 From e0885b84a0e10d6a3c976c8dc52a5fdc175635bb Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 22 May 2007 14:08:11 +0200 Subject: i915tex: Implement SetTexOffset hook. Only build tested for I830 generation. --- src/mesa/drivers/dri/i915tex/i830_reg.h | 1 + src/mesa/drivers/dri/i915tex/i830_texstate.c | 41 +++++++++++++++------ src/mesa/drivers/dri/i915tex/i915_texstate.c | 49 ++++++++++++++++++-------- src/mesa/drivers/dri/i915tex/i915_vtbl.c | 6 ++-- src/mesa/drivers/dri/i915tex/intel_context.h | 4 +++ src/mesa/drivers/dri/i915tex/intel_screen.c | 3 +- src/mesa/drivers/dri/i915tex/intel_tex.h | 3 ++ src/mesa/drivers/dri/i915tex/intel_tex_image.c | 24 ++++++++++++- 8 files changed, 103 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/i830_reg.h b/src/mesa/drivers/dri/i915tex/i830_reg.h index 24ac5245005..41280bca7ce 100644 --- a/src/mesa/drivers/dri/i915tex/i830_reg.h +++ b/src/mesa/drivers/dri/i915tex/i830_reg.h @@ -575,6 +575,7 @@ #define MT_16BIT_DIB_RGB565_8888 (7<<3) #define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */ #define MT_32BIT_ABGR8888 (1<<3) +#define MT_32BIT_XRGB8888 (2<<3) /* XXX: Guess from i915_reg.h */ #define MT_32BIT_BUMP_XLDVDU_8888 (6<<3) #define MT_32BIT_DIB_8888 (7<<3) #define MT_411_YUV411 (0<<3) /* SURFACE_411 */ diff --git a/src/mesa/drivers/dri/i915tex/i830_texstate.c b/src/mesa/drivers/dri/i915tex/i830_texstate.c index e3f34e3944a..0d3f053226f 100644 --- a/src/mesa/drivers/dri/i915tex/i830_texstate.c +++ b/src/mesa/drivers/dri/i915tex/i830_texstate.c @@ -117,7 +117,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; struct intel_texture_object *intelObj = intel_texture_object(tObj); struct gl_texture_image *firstImage; - GLuint *state = i830->state.Tex[unit]; + GLuint *state = i830->state.Tex[unit], format, pitch; memset(state, 0, sizeof(state)); @@ -128,7 +128,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) i830->state.tex_buffer[unit] = NULL; } - if (!intel_finalize_mipmap_tree(intel, unit)) + if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit)) return GL_FALSE; /* Get first image here, since intelObj->firstLevel will get set in @@ -136,11 +136,34 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) */ firstImage = tObj->Image[0][intelObj->firstLevel]; - i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer); - i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0, - intelObj-> - firstLevel); + if (intelObj->imageOverride) { + i830->state.tex_buffer[unit] = NULL; + i830->state.tex_offset[unit] = intelObj->textureOffset; + switch (intelObj->depthOverride) { + case 32: + format = MAPSURF_32BIT | MT_32BIT_ARGB8888; + break; + case 24: + default: + format = MAPSURF_32BIT | MT_32BIT_XRGB8888; + break; + case 16: + format = MAPSURF_16BIT | MT_16BIT_RGB565; + break; + } + + pitch = intelObj->pitchOverride; + } else { + i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region-> + buffer); + i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, + 0, intelObj-> + firstLevel); + + format = translate_texture_format(firstImage->TexFormat->MesaFormat); + pitch = intelObj->mt->pitch * intelObj->mt->cpp; + } state[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 | (LOAD_TEXTURE_MAP0 << unit) | 4); @@ -151,12 +174,10 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) state[I830_TEXREG_TM0S1] = (((firstImage->Height - 1) << TM0S1_HEIGHT_SHIFT) | - ((firstImage->Width - 1) << TM0S1_WIDTH_SHIFT) | - translate_texture_format(firstImage->TexFormat->MesaFormat)); + ((firstImage->Width - 1) << TM0S1_WIDTH_SHIFT) | format); state[I830_TEXREG_TM0S2] = - (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) - - 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK); + ((((pitch / 4) - 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK); { if (tObj->Target == GL_TEXTURE_CUBE_MAP) diff --git a/src/mesa/drivers/dri/i915tex/i915_texstate.c b/src/mesa/drivers/dri/i915tex/i915_texstate.c index e0ecdfde24a..3d68187cf88 100644 --- a/src/mesa/drivers/dri/i915tex/i915_texstate.c +++ b/src/mesa/drivers/dri/i915tex/i915_texstate.c @@ -122,7 +122,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; struct intel_texture_object *intelObj = intel_texture_object(tObj); struct gl_texture_image *firstImage; - GLuint *state = i915->state.Tex[unit]; + GLuint *state = i915->state.Tex[unit], format, pitch; memset(state, 0, sizeof(state)); @@ -133,7 +133,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) i915->state.tex_buffer[unit] = NULL; } - if (!intel_finalize_mipmap_tree(intel, unit)) + if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit)) return GL_FALSE; /* Get first image here, since intelObj->firstLevel will get set in @@ -141,24 +141,45 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) */ firstImage = tObj->Image[0][intelObj->firstLevel]; - i915->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer); - i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0, - intelObj-> - firstLevel); + if (intelObj->imageOverride) { + i915->state.tex_buffer[unit] = NULL; + i915->state.tex_offset[unit] = intelObj->textureOffset; + + switch (intelObj->depthOverride) { + case 32: + format = MAPSURF_32BIT | MT_32BIT_ARGB8888; + break; + case 24: + default: + format = MAPSURF_32BIT | MT_32BIT_XRGB8888; + break; + case 16: + format = MAPSURF_16BIT | MT_16BIT_RGB565; + break; + } + + pitch = intelObj->pitchOverride; + } else { + i915->state.tex_buffer[unit] = driBOReference(intelObj->mt->region-> + buffer); + i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, + 0, intelObj-> + firstLevel); + + format = translate_texture_format(firstImage->TexFormat->MesaFormat); + pitch = intelObj->mt->pitch * intelObj->mt->cpp; + } state[I915_TEXREG_MS3] = (((firstImage->Height - 1) << MS3_HEIGHT_SHIFT) | - ((firstImage->Width - 1) << MS3_WIDTH_SHIFT) | - translate_texture_format(firstImage->TexFormat->MesaFormat) | + ((firstImage->Width - 1) << MS3_WIDTH_SHIFT) | format | MS3_USE_FENCE_REGS); state[I915_TEXREG_MS4] = - (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) - - 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK | - ((((intelObj->lastLevel - - intelObj->firstLevel) * - 4)) << MS4_MAX_LOD_SHIFT) | ((firstImage->Depth - - 1) << MS4_VOLUME_DEPTH_SHIFT)); + ((((pitch / 4) - 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK | + ((((intelObj->lastLevel - intelObj->firstLevel) * 4)) << + MS4_MAX_LOD_SHIFT) | ((firstImage->Depth - 1) << + MS4_VOLUME_DEPTH_SHIFT)); { diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c index 52db9a95e6b..f80e8d6327f 100644 --- a/src/mesa/drivers/dri/i915tex/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c @@ -381,11 +381,13 @@ i915_emit_state(struct intel_context *intel) DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, state->tex_offset[i]); } - else { + else if (state == &i915->meta) { assert(i == 0); - assert(state == &i915->meta); OUT_BATCH(0); } + else { + OUT_BATCH(state->tex_offset[i]); + } OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]); OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]); diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h index 44c20af7f80..bcbbb127b12 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.h +++ b/src/mesa/drivers/dri/i915tex/intel_context.h @@ -92,6 +92,10 @@ struct intel_texture_object * regions will be copied to this region and the old storage freed. */ struct intel_mipmap_tree *mt; + + GLboolean imageOverride; + GLint depthOverride; + GLuint pitchOverride; }; diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c index dd01161b5bb..5e6df81950b 100644 --- a/src/mesa/drivers/dri/i915tex/intel_screen.c +++ b/src/mesa/drivers/dri/i915tex/intel_screen.c @@ -776,7 +776,8 @@ static const struct __DriverAPIRec intelAPI = { .WaitForMSC = driWaitForMSC32, .WaitForSBC = NULL, .SwapBuffersMSC = NULL, - .CopySubBuffer = intelCopySubBuffer + .CopySubBuffer = intelCopySubBuffer, + .setTexOffset = intelSetTexOffset, }; diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.h b/src/mesa/drivers/dri/i915tex/intel_tex.h index 6e9938fe534..b77d7a1d8af 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex.h +++ b/src/mesa/drivers/dri/i915tex/intel_tex.h @@ -135,6 +135,9 @@ void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, const struct gl_texture_object *texObj, const struct gl_texture_image *texImage); +void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, + unsigned long long offset, GLint depth, GLuint pitch); + GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit); void intel_tex_map_images(struct intel_context *intel, diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c index 42679ef9db7..abab90cc066 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_image.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c @@ -378,6 +378,9 @@ intelTexImage(GLcontext * ctx, assert(!intelObj->mt); } + if (!pixels) + return; + if (!intelObj->mt) { guess_and_alloc_mipmap_tree(intel, intelObj, intelImage); if (!intelObj->mt) { @@ -385,7 +388,6 @@ intelTexImage(GLcontext * ctx, } } - assert(!intelImage->mt); if (intelObj->mt && @@ -667,3 +669,23 @@ intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, texObj, texImage, 1); } + +void +intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, + unsigned long long offset, GLint depth, GLuint pitch) +{ + struct intel_context *intel = (struct intel_context*) + ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate; + struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname); + struct intel_texture_object *intelObj = intel_texture_object(tObj); + + if (!intelObj) + return; + + intelObj->imageOverride = GL_TRUE; + intelObj->depthOverride = depth; + intelObj->pitchOverride = pitch; + + if (offset) + intelObj->textureOffset = offset; +} -- cgit v1.2.3 From 04255489617f6eeb9604daba14efed8376d1d824 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 22 May 2007 10:07:49 -0600 Subject: don't treat FRAG_BIT_WPOS as a generic attribute (fixes depth peel regression) --- src/mesa/swrast/s_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index d4321194a06..f373fde781b 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -549,6 +549,7 @@ _swrast_update_fragment_attribs(GLcontext *ctx) if (ctx->FragmentProgram._Current) { /* fragment program/shader */ attribsMask = ctx->FragmentProgram._Current->Base.InputsRead; + attribsMask &= ~FRAG_BIT_WPOS; /* WPOS is always handled specially */ } else if (ctx->ATIFragmentShader._Enabled) { attribsMask = ~0; /* XXX fix me */ -- cgit v1.2.3 From 3a2ffadb7c98c040f01340d20289cffe753d48c2 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 22 May 2007 16:50:05 -0600 Subject: include swrast_setup/swrast_setup.h to silence warning --- src/mesa/drivers/dri/i965/brw_draw.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index c7798b14a93..0c64d7e756d 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -47,6 +47,7 @@ #include "tnl/tnl.h" #include "vbo/vbo_context.h" #include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" -- cgit v1.2.3 From a99114a69f2b7963ca1f855a320aea8aa56755ac Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 22 May 2007 16:54:25 -0600 Subject: added _mesa_init_driver_state() to replace duplicated code in intel drivers --- src/mesa/drivers/common/driverfuncs.c | 96 ++++++++++++++++++++++++++++++++++- src/mesa/drivers/common/driverfuncs.h | 7 ++- 2 files changed, 101 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index adf9aafe596..9b1c3f1e060 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -292,3 +292,97 @@ _mesa_init_glsl_driver_functions(struct dd_function_table *driver) driver->UseProgram = _mesa_use_program; driver->ValidateProgram = _mesa_validate_program; } + + +/** + * Call the ctx->Driver.* state functions with current values to initialize + * driver state. + * Only the Intel drivers use this so far. + */ +void +_mesa_init_driver_state(GLcontext *ctx) +{ + ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); + + ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); + + ctx->Driver.BlendEquationSeparate(ctx, + ctx->Color.BlendEquationRGB, + ctx->Color.BlendEquationA); + + ctx->Driver.BlendFuncSeparate(ctx, + ctx->Color.BlendSrcRGB, + ctx->Color.BlendDstRGB, + ctx->Color.BlendSrcA, ctx->Color.BlendDstA); + + ctx->Driver.ColorMask(ctx, + ctx->Color.ColorMask[RCOMP], + ctx->Color.ColorMask[GCOMP], + ctx->Color.ColorMask[BCOMP], + ctx->Color.ColorMask[ACOMP]); + + ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode); + ctx->Driver.DepthFunc(ctx, ctx->Depth.Func); + ctx->Driver.DepthMask(ctx, ctx->Depth.Mask); + + ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); + ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled); + ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled); + ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled); + ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag); + ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); + ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag); + ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled); + ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled); + ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); + ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); + ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); + ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); + ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); + + ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); + ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0); + ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); + ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); + ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); + + ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); + + { + GLfloat f = (GLfloat) ctx->Light.Model.ColorControl; + ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f); + } + + ctx->Driver.LineWidth(ctx, ctx->Line.Width); + ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); + ctx->Driver.PointSize(ctx, ctx->Point.Size); + ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); + ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, + ctx->Scissor.Width, ctx->Scissor.Height); + ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); + ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, + ctx->Stencil.Function[0], + ctx->Stencil.Ref[0], + ctx->Stencil.ValueMask[0]); + ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, + ctx->Stencil.Function[1], + ctx->Stencil.Ref[1], + ctx->Stencil.ValueMask[1]); + ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]); + ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]); + ctx->Driver.StencilOpSeparate(ctx, GL_FRONT, + ctx->Stencil.FailFunc[0], + ctx->Stencil.ZFailFunc[0], + ctx->Stencil.ZPassFunc[0]); + ctx->Driver.StencilOpSeparate(ctx, GL_BACK, + ctx->Stencil.FailFunc[1], + ctx->Stencil.ZFailFunc[1], + ctx->Stencil.ZPassFunc[1]); + + + ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]); +} diff --git a/src/mesa/drivers/common/driverfuncs.h b/src/mesa/drivers/common/driverfuncs.h index 50f2b4271dc..6ed23c4520e 100644 --- a/src/mesa/drivers/common/driverfuncs.h +++ b/src/mesa/drivers/common/driverfuncs.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -33,4 +33,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver); extern void _mesa_init_glsl_driver_functions(struct dd_function_table *driver); + +extern void +_mesa_init_driver_state(GLcontext *ctx); + + #endif -- cgit v1.2.3 From a194bc3a8527ed41eead88632cc79ecabe4c81ac Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 22 May 2007 16:56:02 -0600 Subject: Replace initInitState() with _mesa_init_driver_state(). --- src/mesa/drivers/dri/i915/i830_state.c | 9 +-- src/mesa/drivers/dri/i915/i915_state.c | 11 +--- src/mesa/drivers/dri/i915/intel_context.c | 95 --------------------------- src/mesa/drivers/dri/i915/intel_context.h | 1 - src/mesa/drivers/dri/i915tex/i830_state.c | 4 +- src/mesa/drivers/dri/i915tex/i915_state.c | 4 +- src/mesa/drivers/dri/i915tex/intel_context.h | 1 - src/mesa/drivers/dri/i915tex/intel_state.c | 94 --------------------------- src/mesa/drivers/dri/i965/intel_context.h | 1 - src/mesa/drivers/dri/i965/intel_state.c | 96 ---------------------------- 10 files changed, 12 insertions(+), 304 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index 95125190108..f7980201f9a 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -34,6 +34,8 @@ #include "texmem.h" +#include "drivers/common/driverfuncs.h" + #include "intel_screen.h" #include "intel_batchbuffer.h" @@ -1074,7 +1076,7 @@ void i830InitState( i830ContextPtr i830 ) i830_init_packets( i830 ); - intelInitState( ctx ); + _mesa_init_driver_state(ctx); memcpy( &i830->initial, &i830->state, sizeof(i830->state) ); @@ -1085,8 +1087,3 @@ void i830InitState( i830ContextPtr i830 ) I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS); } - - - - - diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 0d5ca32969a..1c4ec747558 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -36,6 +36,8 @@ #include "texmem.h" +#include "drivers/common/driverfuncs.h" + #include "intel_screen.h" #include "intel_batchbuffer.h" @@ -961,15 +963,8 @@ void i915InitState( i915ContextPtr i915 ) i915_init_packets( i915 ); - intelInitState( ctx ); + _mesa_init_driver_state(ctx); memcpy( &i915->initial, &i915->state, sizeof(i915->state) ); i915->current = &i915->state; } - - - - - - - diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index e1e7cdb7233..e747fc6991b 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -766,98 +766,3 @@ void intelCopySubBuffer( __DRIdrawablePrivate *dPriv, fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); } } - -void intelInitState( GLcontext *ctx ) -{ - /* Mesa should do this for us: - */ - ctx->Driver.AlphaFunc( ctx, - ctx->Color.AlphaFunc, - ctx->Color.AlphaRef); - - ctx->Driver.BlendColor( ctx, - ctx->Color.BlendColor ); - - ctx->Driver.BlendEquationSeparate( ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA); - - ctx->Driver.BlendFuncSeparate( ctx, - ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, - ctx->Color.BlendDstA); - - ctx->Driver.ColorMask( ctx, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP]); - - ctx->Driver.CullFace( ctx, ctx->Polygon.CullFaceMode ); - ctx->Driver.DepthFunc( ctx, ctx->Depth.Func ); - ctx->Driver.DepthMask( ctx, ctx->Depth.Mask ); - - ctx->Driver.Enable( ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled ); - ctx->Driver.Enable( ctx, GL_BLEND, ctx->Color.BlendEnabled ); - ctx->Driver.Enable( ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled ); - ctx->Driver.Enable( ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled ); - ctx->Driver.Enable( ctx, GL_CULL_FACE, ctx->Polygon.CullFlag ); - ctx->Driver.Enable( ctx, GL_DEPTH_TEST, ctx->Depth.Test ); - ctx->Driver.Enable( ctx, GL_DITHER, ctx->Color.DitherFlag ); - ctx->Driver.Enable( ctx, GL_FOG, ctx->Fog.Enabled ); - ctx->Driver.Enable( ctx, GL_LIGHTING, ctx->Light.Enabled ); - ctx->Driver.Enable( ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag ); - ctx->Driver.Enable( ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag ); - ctx->Driver.Enable( ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled ); - ctx->Driver.Enable( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled ); - ctx->Driver.Enable( ctx, GL_TEXTURE_1D, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_2D, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_3D, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE ); - - ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color ); - ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 ); - ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density ); - ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start ); - ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End ); - - ctx->Driver.FrontFace( ctx, ctx->Polygon.FrontFace ); - - { - GLfloat f = (GLfloat)ctx->Light.Model.ColorControl; - ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f ); - } - - ctx->Driver.LineWidth( ctx, ctx->Line.Width ); - ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp ); - ctx->Driver.PointSize( ctx, ctx->Point.Size ); - ctx->Driver.PolygonStipple( ctx, (const GLubyte *)ctx->PolygonStipple ); - ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height ); - ctx->Driver.ShadeModel( ctx, ctx->Light.ShadeModel ); - ctx->Driver.StencilFuncSeparate( ctx, GL_FRONT, - ctx->Stencil.Function[0], - ctx->Stencil.Ref[0], - ctx->Stencil.ValueMask[0] ); - ctx->Driver.StencilFuncSeparate( ctx, GL_BACK, - ctx->Stencil.Function[1], - ctx->Stencil.Ref[1], - ctx->Stencil.ValueMask[1] ); - ctx->Driver.StencilMaskSeparate( ctx, GL_FRONT, ctx->Stencil.WriteMask[0] ); - ctx->Driver.StencilMaskSeparate( ctx, GL_BACK, ctx->Stencil.WriteMask[1] ); - ctx->Driver.StencilOpSeparate( ctx, GL_FRONT, - ctx->Stencil.FailFunc[0], - ctx->Stencil.ZFailFunc[0], - ctx->Stencil.ZPassFunc[0]); - ctx->Driver.StencilOpSeparate( ctx, GL_BACK, - ctx->Stencil.FailFunc[1], - ctx->Stencil.ZFailFunc[1], - ctx->Stencil.ZPassFunc[1]); - - - ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] ); -} - - diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index 05195e76d65..c48b074cc51 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -473,7 +473,6 @@ extern void intelSetBackClipRects(intelContextPtr intel); extern void intelSetFrontClipRects(intelContextPtr intel); extern void intelWindowMoved( intelContextPtr intel ); -extern void intelInitState( GLcontext *ctx ); extern const GLubyte *intelGetString( GLcontext *ctx, GLenum name ); diff --git a/src/mesa/drivers/dri/i915tex/i830_state.c b/src/mesa/drivers/dri/i915tex/i830_state.c index 812daa65246..3c149e69055 100644 --- a/src/mesa/drivers/dri/i915tex/i830_state.c +++ b/src/mesa/drivers/dri/i915tex/i830_state.c @@ -34,6 +34,8 @@ #include "texmem.h" +#include "drivers/common/driverfuncs.h" + #include "intel_screen.h" #include "intel_batchbuffer.h" #include "intel_fbo.h" @@ -1101,7 +1103,7 @@ i830InitState(struct i830_context *i830) i830_init_packets(i830); - intelInitState(ctx); + _mesa_init_driver_state(ctx); memcpy(&i830->initial, &i830->state, sizeof(i830->state)); diff --git a/src/mesa/drivers/dri/i915tex/i915_state.c b/src/mesa/drivers/dri/i915tex/i915_state.c index d3217fa0caa..e5d8d279936 100644 --- a/src/mesa/drivers/dri/i915tex/i915_state.c +++ b/src/mesa/drivers/dri/i915tex/i915_state.c @@ -36,6 +36,8 @@ #include "texmem.h" +#include "drivers/common/driverfuncs.h" + #include "intel_fbo.h" #include "intel_screen.h" #include "intel_batchbuffer.h" @@ -1005,7 +1007,7 @@ i915InitState(struct i915_context *i915) i915_init_packets(i915); - intelInitState(ctx); + _mesa_init_driver_state(ctx); memcpy(&i915->initial, &i915->state, sizeof(i915->state)); i915->current = &i915->state; diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h index bcbbb127b12..e61d72eaec6 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.h +++ b/src/mesa/drivers/dri/i915tex/intel_context.h @@ -399,7 +399,6 @@ extern GLboolean intelInitContext(struct intel_context *intel, extern void intelGetLock(struct intel_context *intel, GLuint flags); -extern void intelInitState(GLcontext * ctx); extern void intelFinish(GLcontext * ctx); extern void intelFlush(GLcontext * ctx); diff --git a/src/mesa/drivers/dri/i915tex/intel_state.c b/src/mesa/drivers/dri/i915tex/intel_state.c index f85d8ef8353..271511037e9 100644 --- a/src/mesa/drivers/dri/i915tex/intel_state.c +++ b/src/mesa/drivers/dri/i915tex/intel_state.c @@ -267,97 +267,3 @@ intelInitStateFuncs(struct dd_function_table *functions) functions->DepthRange = intelDepthRange; functions->ClearColor = intelClearColor; } - - - - -void -intelInitState(GLcontext * ctx) -{ - /* Mesa should do this for us: - */ - ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); - - ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); - - ctx->Driver.BlendEquationSeparate(ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA); - - ctx->Driver.BlendFuncSeparate(ctx, - ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, ctx->Color.BlendDstA); - - ctx->Driver.ColorMask(ctx, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP]); - - ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode); - ctx->Driver.DepthFunc(ctx, ctx->Depth.Func); - ctx->Driver.DepthMask(ctx, ctx->Depth.Mask); - - ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); - ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled); - ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled); - ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled); - ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag); - ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); - ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag); - ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled); - ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled); - ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); - ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); - ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); - ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); - ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); - - ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); - ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0); - ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); - ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); - ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); - - ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); - - { - GLfloat f = (GLfloat) ctx->Light.Model.ColorControl; - ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f); - } - - ctx->Driver.LineWidth(ctx, ctx->Line.Width); - ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); - ctx->Driver.PointSize(ctx, ctx->Point.Size); - ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); - ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height); - ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); - ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, - ctx->Stencil.Function[0], - ctx->Stencil.Ref[0], - ctx->Stencil.ValueMask[0]); - ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, - ctx->Stencil.Function[1], - ctx->Stencil.Ref[1], - ctx->Stencil.ValueMask[1]); - ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]); - ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]); - ctx->Driver.StencilOpSeparate(ctx, GL_FRONT, - ctx->Stencil.FailFunc[0], - ctx->Stencil.ZFailFunc[0], - ctx->Stencil.ZPassFunc[0]); - ctx->Driver.StencilOpSeparate(ctx, GL_BACK, - ctx->Stencil.FailFunc[1], - ctx->Stencil.ZFailFunc[1], - ctx->Stencil.ZPassFunc[1]); - - - /* XXX this isn't really needed */ - ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]); -} diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h index 808512f7fd5..a3c65b66e08 100644 --- a/src/mesa/drivers/dri/i965/intel_context.h +++ b/src/mesa/drivers/dri/i965/intel_context.h @@ -399,7 +399,6 @@ extern GLboolean intelInitContext( struct intel_context *intel, extern void intelGetLock(struct intel_context *intel, GLuint flags); -extern void intelInitState( GLcontext *ctx ); extern void intelFinish( GLcontext *ctx ); extern void intelFlush( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c index ec6e0465d4a..2e442db6198 100644 --- a/src/mesa/drivers/dri/i965/intel_state.c +++ b/src/mesa/drivers/dri/i965/intel_state.c @@ -197,99 +197,3 @@ void intelInitStateFuncs( struct dd_function_table *functions ) functions->RenderMode = intelRenderMode; functions->ClearColor = intelClearColor; } - - - - -void intelInitState( GLcontext *ctx ) -{ - /* Mesa should do this for us: - */ - ctx->Driver.AlphaFunc( ctx, - ctx->Color.AlphaFunc, - ctx->Color.AlphaRef); - - ctx->Driver.BlendColor( ctx, - ctx->Color.BlendColor ); - - ctx->Driver.BlendEquationSeparate( ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA); - - ctx->Driver.BlendFuncSeparate( ctx, - ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, - ctx->Color.BlendDstA); - - ctx->Driver.ColorMask( ctx, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP]); - - ctx->Driver.CullFace( ctx, ctx->Polygon.CullFaceMode ); - ctx->Driver.DepthFunc( ctx, ctx->Depth.Func ); - ctx->Driver.DepthMask( ctx, ctx->Depth.Mask ); - - ctx->Driver.Enable( ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled ); - ctx->Driver.Enable( ctx, GL_BLEND, ctx->Color.BlendEnabled ); - ctx->Driver.Enable( ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled ); - ctx->Driver.Enable( ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled ); - ctx->Driver.Enable( ctx, GL_CULL_FACE, ctx->Polygon.CullFlag ); - ctx->Driver.Enable( ctx, GL_DEPTH_TEST, ctx->Depth.Test ); - ctx->Driver.Enable( ctx, GL_DITHER, ctx->Color.DitherFlag ); - ctx->Driver.Enable( ctx, GL_FOG, ctx->Fog.Enabled ); - ctx->Driver.Enable( ctx, GL_LIGHTING, ctx->Light.Enabled ); - ctx->Driver.Enable( ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag ); - ctx->Driver.Enable( ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag ); - ctx->Driver.Enable( ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled ); - ctx->Driver.Enable( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled ); - ctx->Driver.Enable( ctx, GL_TEXTURE_1D, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_2D, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_3D, GL_FALSE ); - ctx->Driver.Enable( ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE ); - - ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color ); - ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 ); - ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density ); - ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start ); - ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End ); - - ctx->Driver.FrontFace( ctx, ctx->Polygon.FrontFace ); - - { - GLfloat f = (GLfloat)ctx->Light.Model.ColorControl; - ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f ); - } - - ctx->Driver.LineWidth( ctx, ctx->Line.Width ); - ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp ); - ctx->Driver.PointSize( ctx, ctx->Point.Size ); - ctx->Driver.PolygonStipple( ctx, (const GLubyte *)ctx->PolygonStipple ); - ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height ); - ctx->Driver.ShadeModel( ctx, ctx->Light.ShadeModel ); - ctx->Driver.StencilFuncSeparate( ctx, GL_FRONT, - ctx->Stencil.Function[0], - ctx->Stencil.Ref[0], - ctx->Stencil.ValueMask[0] ); - ctx->Driver.StencilFuncSeparate( ctx, GL_BACK, - ctx->Stencil.Function[1], - ctx->Stencil.Ref[1], - ctx->Stencil.ValueMask[1] ); - ctx->Driver.StencilMaskSeparate( ctx, GL_FRONT, ctx->Stencil.WriteMask[0] ); - ctx->Driver.StencilMaskSeparate( ctx, GL_BACK, ctx->Stencil.WriteMask[1] ); - ctx->Driver.StencilOpSeparate( ctx, GL_FRONT, - ctx->Stencil.FailFunc[0], - ctx->Stencil.ZFailFunc[0], - ctx->Stencil.ZPassFunc[0]); - ctx->Driver.StencilOpSeparate( ctx, GL_BACK, - ctx->Stencil.FailFunc[1], - ctx->Stencil.ZFailFunc[1], - ctx->Stencil.ZPassFunc[1]); - - - ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] ); -} -- cgit v1.2.3 From d062b6cd2672f42fdfe20f6d932aacef9895aebc Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 23 May 2007 08:58:08 -0600 Subject: Fix point attentuation problem (bug 11042) ctx->Point._Attentuation was computed in wrong place and the VB->Eye coord Z array wasn't indexed correctly in run_point_stage(). --- src/mesa/main/points.c | 11 +++++------ src/mesa/tnl/t_vb_points.c | 10 ++++++---- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 9caa9ab3ab2..8674c7299c5 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.0 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -61,10 +61,6 @@ _mesa_PointSize( GLfloat size ) ctx->Point.MinSize, ctx->Point.MaxSize); - ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 || - ctx->Point.Params[1] != 0.0 || - ctx->Point.Params[2] != 0.0); - if (ctx->Driver.PointSize) ctx->Driver.PointSize(ctx, size); } @@ -122,6 +118,9 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) return; FLUSH_VERTICES(ctx, _NEW_POINT); COPY_3V(ctx->Point.Params, params); + ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 || + ctx->Point.Params[1] != 0.0 || + ctx->Point.Params[2] != 0.0); } else { _mesa_error(ctx, GL_INVALID_ENUM, diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index 9327f8c273c..1ac14fedf99 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.0 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -50,7 +50,8 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) if (ctx->Point._Attenuated && !ctx->VertexProgram._Current) { struct point_stage_data *store = POINT_STAGE_DATA(stage); struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - const GLfloat (*eye)[4] = (const GLfloat (*)[4]) VB->EyePtr->data; + const GLfloat *eyeCoord = (GLfloat *) VB->EyePtr->data + 2; + const GLint eyeCoordStride = VB->EyePtr->stride / sizeof(GLfloat); const GLfloat p0 = ctx->Point.Params[0]; const GLfloat p1 = ctx->Point.Params[1]; const GLfloat p2 = ctx->Point.Params[2]; @@ -59,10 +60,11 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) GLuint i; for (i = 0; i < VB->Count; i++) { - const GLfloat dist = FABSF(eye[i][2]); + const GLfloat dist = FABSF(*eyeCoord); const GLfloat q = p0 + dist * (p1 + dist * p2); const GLfloat atten = (q != 0.0) ? SQRTF(1.0 / q) : 1.0; size[i][0] = pointSize * atten; /* clamping done in rasterization */ + eyeCoord += eyeCoordStride; } VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->PointSize; -- cgit v1.2.3 From bb3558e6517209086cf8426bbe4743da50351158 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 21 May 2007 15:51:38 +0000 Subject: r300: Removed the R300_RS_INTERP_[0-9]_UNKNOWN (magic) defines. Supposedly you need to set these values for the interpolaters to work, but they seem to work fine without these values. --- src/mesa/drivers/dri/r300/r300_reg.h | 6 ------ src/mesa/drivers/dri/r300/r300_state.c | 14 +------------- 2 files changed, 1 insertion(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 0a31f0b9785..e64f5095bc5 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -628,17 +628,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * 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_INTERP_0 0x4310 #define R300_RS_INTERP_1 0x4314 -# define R300_RS_INTERP_1_UNKNOWN 0x40 #define R300_RS_INTERP_2 0x4318 -# define R300_RS_INTERP_2_UNKNOWN 0x80 #define R300_RS_INTERP_3 0x431C -# define R300_RS_INTERP_3_UNKNOWN 0xC0 #define R300_RS_INTERP_4 0x4320 #define R300_RS_INTERP_5 0x4324 #define R300_RS_INTERP_6 0x4328 diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index e8d67f9aec1..8a85478f73e 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1442,17 +1442,6 @@ union r300_outputs_written { static void r300SetupRSUnit(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); - /* I'm still unsure if these are needed */ - GLuint interp_magic[8] = { - 0x00, - R300_RS_INTERP_1_UNKNOWN, - R300_RS_INTERP_2_UNKNOWN, - R300_RS_INTERP_3_UNKNOWN, - 0x00, - 0x00, - 0x00, - 0x00 - }; union r300_outputs_written OutputsWritten; GLuint InputsRead; int fp_reg, high_rr; @@ -1498,8 +1487,7 @@ static void r300SetupRSUnit(GLcontext * ctx) for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = 0 | R300_RS_INTERP_USED - | (in_texcoords << R300_RS_INTERP_SRC_SHIFT) - | interp_magic[i]; + | (in_texcoords << R300_RS_INTERP_SRC_SHIFT); r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0; if (InputsRead & (FRAG_BIT_TEX0 << i)) { -- cgit v1.2.3 From 9b9a1602f9822c3e29a3dc4f9ed025a4c337b007 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 23 May 2007 17:56:47 +0000 Subject: r300: Corrected the RGB888 texture format entry. I think this is correct, assuming no endian issues. See commmit 59a08923f51d4ed83effbfcd91473c9ee86465f1. --- src/mesa/drivers/dri/r300/r300_texstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 8203189b7f4..5505eae21c5 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -76,7 +76,7 @@ static const struct tx_table { _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), - _ASSIGN(RGB888, 0xffffffff), + _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), _ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), -- cgit v1.2.3 From ba8d3fb13651fd7c7b68c4a0394545b3760fa9c2 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 23 May 2007 18:37:55 +0000 Subject: r300: Use a single texture format table; reduces duplication. --- src/mesa/drivers/dri/r300/r300_texstate.c | 83 +++++++------------------------ 1 file changed, 19 insertions(+), 64 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 5505eae21c5..18837e1e062 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -54,7 +54,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \ || ((f) >= MESA_FORMAT_RGBA_FLOAT32 && \ (f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \ - && tx_table_le[f].flag ) + && tx_table[f].flag ) #define _ASSIGN(entry, format) \ [ MESA_FORMAT_ ## entry ] = { format, 0, 1} @@ -70,53 +70,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static const struct tx_table { GLuint format, filter, flag; -} tx_table_be[] = { - /* *INDENT-OFF* */ - _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), - _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), - _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), - _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), - _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), - _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), - _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), - _ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), - _ASSIGN(ARGB4444_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), - _ASSIGN(ARGB1555, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), - _ASSIGN(ARGB1555_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), - _ASSIGN(AL88, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), - _ASSIGN(AL88_REV, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), - _ASSIGN(RGB332, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z3Y3X2)), - _ASSIGN(A8, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, X8)), - _ASSIGN(L8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8)), - _ASSIGN(I8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), - _ASSIGN(CI8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), - _ASSIGN(YCBCR, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE ), - _ASSIGN(YCBCR_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE), - _ASSIGN(RGB_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1)), - _ASSIGN(RGBA_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1)), - _ASSIGN(RGBA_DXT3, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3)), - _ASSIGN(RGBA_DXT5, R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5)), - _ASSIGN(RGBA_FLOAT32, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R32G32B32A32)), - _ASSIGN(RGBA_FLOAT16, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16)), - _ASSIGN(RGB_FLOAT32, 0xffffffff), - _ASSIGN(RGB_FLOAT16, 0xffffffff), - _ASSIGN(ALPHA_FLOAT32, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32)), - _ASSIGN(ALPHA_FLOAT16, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16)), - _ASSIGN(LUMINANCE_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32)), - _ASSIGN(LUMINANCE_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I16)), - _ASSIGN(LUMINANCE_ALPHA_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I32A32)), - _ASSIGN(LUMINANCE_ALPHA_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I16A16)), - _ASSIGN(INTENSITY_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, X, FL_I32)), - _ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)), - /* *INDENT-ON* */ -}; - -static const struct tx_table tx_table_le[] = { +} tx_table[] = { /* *INDENT-OFF* */ +#ifdef MESA_LITTLE_ENDIAN _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), +#else + _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), + _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), + _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), + _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), +#endif _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), @@ -178,22 +144,10 @@ static void r300SetTexImages(r300ContextPtr rmesa, /* Set the hardware texture format */ - if (!t->image_override && VALID_FORMAT(baseImage->TexFormat->MesaFormat)) { - if (_mesa_little_endian()) { - t->format = - tx_table_le[baseImage->TexFormat->MesaFormat]. - format; - t->filter |= - tx_table_le[baseImage->TexFormat->MesaFormat]. - filter; - } else { - t->format = - tx_table_be[baseImage->TexFormat->MesaFormat]. - format; - t->filter |= - tx_table_be[baseImage->TexFormat->MesaFormat]. - filter; - } + if (!t->image_override + && VALID_FORMAT(baseImage->TexFormat->MesaFormat)) { + t->format = tx_table[baseImage->TexFormat->MesaFormat].format; + t->filter |= tx_table[baseImage->TexFormat->MesaFormat].filter; } else if (!t->image_override) { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); @@ -538,13 +492,14 @@ static GLboolean r300UpdateTexture(GLcontext * ctx, int unit) return !t->border_fallback; } -void r300SetTexOffset(__DRIcontext *pDRICtx, GLint texname, +void r300SetTexOffset(__DRIcontext * pDRICtx, GLint texname, unsigned long long offset, GLint depth, GLuint pitch) { r300ContextPtr rmesa = - (r300ContextPtr)((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate; + (r300ContextPtr) ((__DRIcontextPrivate *) pDRICtx->private)-> + driverPrivate; struct gl_texture_object *tObj = - _mesa_lookup_texture(rmesa->radeon.glCtx, texname); + _mesa_lookup_texture(rmesa->radeon.glCtx, texname); r300TexObjPtr t; int idx; @@ -579,8 +534,8 @@ void r300SetTexOffset(__DRIcontext *pDRICtx, GLint texname, t->pitch_reg--; - t->format = tx_table_le[idx].format; - t->filter |= tx_table_le[idx].filter; + t->format = tx_table[idx].format; + t->filter |= tx_table[idx].filter; } static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit) -- cgit v1.2.3 From f1441bbd180452e4eeab27545d6b9f48c0c54d11 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 23 May 2007 18:48:05 +0000 Subject: r300: Minor indenting corrections in the texture format table. --- src/mesa/drivers/dri/r300/r300_texstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 18837e1e062..eeaba584df8 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -97,8 +97,8 @@ static const struct tx_table { _ASSIGN(L8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8)), _ASSIGN(I8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), _ASSIGN(CI8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), - _ASSIGN(YCBCR, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE ), - _ASSIGN(YCBCR_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE), + _ASSIGN(YCBCR, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE), + _ASSIGN(YCBCR_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE), _ASSIGN(RGB_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1)), _ASSIGN(RGBA_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1)), _ASSIGN(RGBA_DXT3, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3)), -- cgit v1.2.3 From 491618b33dcb388f5d2335862cba8cf110d72ae7 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 23 May 2007 21:12:11 +0000 Subject: r300: Use switch statements in r300ResetHwState, etc. --- src/mesa/drivers/dri/r300/r300_state.c | 71 ++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 8a85478f73e..b3a6ce4c76c 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1813,12 +1813,6 @@ static void r300ResetHwState(r300ContextPtr r300) if (RADEON_DEBUG & DEBUG_STATE) fprintf(stderr, "%s\n", __FUNCTION__); - /* This is a place to initialize registers which - have bitfields accessed by different functions - and not all bits are used */ - - /* go and compute register values from GL state */ - r300UpdateWindow(ctx); r300ColorMask(ctx, @@ -1848,13 +1842,11 @@ static void r300ResetHwState(r300ContextPtr r300) r300AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); r300Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); - /* Initialize magic registers - TODO : learn what they really do, or get rid of - those we don't have to touch */ if (!has_tcl) r300->hw.vap_cntl.cmd[1] = 0x0014045a; else r300->hw.vap_cntl.cmd[1] = 0x0030045A; //0x0030065a /* Dangerous */ + r300->hw.vte.cmd[1] = R300_VPORT_X_SCALE_ENA | R300_VPORT_X_OFFSET_ENA | R300_VPORT_Y_SCALE_ENA @@ -1883,11 +1875,15 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.unk2220.cmd[3] = r300PackFloat32(1.0); r300->hw.unk2220.cmd[4] = r300PackFloat32(1.0); - /* what about other chips than r300 or rv350??? */ - if (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R300) + /* XXX: Other families? */ + switch (r300->radeon.radeonScreen->chip_family) { + case CHIP_FAMILY_R300: r300->hw.unk2288.cmd[1] = R300_2288_R300; - else + break; + default: r300->hw.unk2288.cmd[1] = R300_2288_RV350; + break; + } r300->hw.gb_enable.cmd[1] = R300_GB_POINT_STUFF_ENABLE | R300_GB_LINE_STUFF_ENABLE @@ -1895,26 +1891,35 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.gb_misc.cmd[R300_GB_MISC_MSPOS_0] = 0x66666666; r300->hw.gb_misc.cmd[R300_GB_MISC_MSPOS_1] = 0x06666666; - if ((r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R300) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R350)) - r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = - R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_R300 | - R300_GB_TILE_SIZE_16; - else if (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV410) - r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = - R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_RV410 | - R300_GB_TILE_SIZE_16; - else if (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R420) - r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = - R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_R420 | - R300_GB_TILE_SIZE_16; - else - r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = - R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_RV300 | - R300_GB_TILE_SIZE_16; - /* set to 0 when fog is disabled? */ + + /* XXX: Other families? */ + r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = + R300_GB_TILE_ENABLE | R300_GB_TILE_SIZE_16; + switch (r300->radeon.radeonScreen->chip_family) { + case CHIP_FAMILY_R300: + case CHIP_FAMILY_R350: + r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] |= + R300_GB_TILE_PIPE_COUNT_R300; + break; + case CHIP_FAMILY_RV410: + r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] |= + R300_GB_TILE_PIPE_COUNT_RV410; + break; + case CHIP_FAMILY_R420: + r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] |= + R300_GB_TILE_PIPE_COUNT_R420; + break; + default: + r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] |= + R300_GB_TILE_PIPE_COUNT_RV300; + break; + } + + /* XXX: set to 0 when fog is disabled? */ r300->hw.gb_misc.cmd[R300_GB_MISC_SELECT] = R300_GB_FOG_SELECT_1_1_W; - r300->hw.gb_misc.cmd[R300_GB_MISC_AA_CONFIG] = R300_AA_DISABLE; /* No antialiasing */ + + /* XXX: Enable anti-aliasing? */ + r300->hw.gb_misc.cmd[R300_GB_MISC_AA_CONFIG] = R300_AA_DISABLE; r300->hw.unk4200.cmd[1] = r300PackFloat32(0.0); r300->hw.unk4200.cmd[2] = r300PackFloat32(0.0); @@ -2035,7 +2040,7 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.zb.cmd[R300_ZB_PITCH] = r300->radeon.radeonScreen->depthPitch; if (r300->radeon.sarea->tiling_enabled) { - /* Turn off when clearing buffers ? */ + /* XXX: Turn off when clearing buffers ? */ r300->hw.zb.cmd[R300_ZB_PITCH] |= R300_DEPTH_TILE_ENABLE; if (ctx->Visual.depthBits == 24) @@ -2058,7 +2063,7 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.vps.cmd[R300_VPS_POINTSIZE] = r300PackFloat32(1.0); r300->hw.vps.cmd[R300_VPS_ZERO_3] = 0; } -//END: TODO + r300->hw.all_dirty = GL_TRUE; } -- cgit v1.2.3 From a7008322146f589ed5cb7a563365ff5e31844c62 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 23 May 2007 15:33:46 -0600 Subject: Fix problem w/ two-sided lighting and fragment programs (depth-peel regression) --- src/mesa/swrast_setup/ss_context.c | 13 ++++---- src/mesa/swrast_setup/ss_context.h | 6 ++-- src/mesa/swrast_setup/ss_tritmp.h | 66 ++++++++++++++++++++++++++++++-------- 3 files changed, 62 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 9f83fde1f56..cd4ac57d37d 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -123,12 +123,13 @@ setup_vertex_format(GLcontext *ctx) EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] ); if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) { - if (ctx->FragmentProgram._Current - || ctx->ATIFragmentShader._Enabled - || CHAN_TYPE == GL_FLOAT) - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]); - else + swsetup->intColors = !ctx->FragmentProgram._Current + && !ctx->ATIFragmentShader._Enabled + && CHAN_TYPE == GL_UNSIGNED_BYTE; + if (swsetup->intColors) EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); + else + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]); } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { diff --git a/src/mesa/swrast_setup/ss_context.h b/src/mesa/swrast_setup/ss_context.h index e5d890447a7..11f9ded3ffb 100644 --- a/src/mesa/swrast_setup/ss_context.h +++ b/src/mesa/swrast_setup/ss_context.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -39,6 +38,7 @@ typedef struct { GLenum render_prim; DECLARE_RENDERINPUTS(last_index_bitset); SWvertex *verts; + GLboolean intColors; } SScontext; #define SWSETUP_CONTEXT(ctx) ((SScontext *)ctx->swsetup_context) diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 9fcde31644d..c14468e9514 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 7.1 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -26,9 +26,14 @@ */ +/** + * This is where we handle assigning vertex colors based on front/back + * facing, compute polygon offset and handle glPolygonMode(). + */ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; + SScontext *swsetup = SWSETUP_CONTEXT(ctx); SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; SWvertex *v[3]; GLfloat z[3]; @@ -36,6 +41,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) GLenum mode = GL_FILL; GLuint facing = 0; GLchan saved_color[3][4]; + GLfloat saved_col0[3][4]; GLfloat saved_spec[3][4]; GLfloat saved_index[3]; @@ -66,19 +72,41 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (VB->ColorPtr[1]) { GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; - COPY_CHAN4(saved_color[0], v[0]->color); - COPY_CHAN4(saved_color[1], v[1]->color); - COPY_CHAN4(saved_color[2], v[2]->color); + if (swsetup->intColors) { + COPY_CHAN4(saved_color[0], v[0]->color); + COPY_CHAN4(saved_color[1], v[1]->color); + COPY_CHAN4(saved_color[2], v[2]->color); + } + else { + COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]); + COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]); + COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]); + } if (VB->ColorPtr[1]->stride) { - SS_COLOR(v[0]->color, vbcolor[e0]); - SS_COLOR(v[1]->color, vbcolor[e1]); - SS_COLOR(v[2]->color, vbcolor[e2]); + if (swsetup->intColors) { + SS_COLOR(v[0]->color, vbcolor[e0]); + SS_COLOR(v[1]->color, vbcolor[e1]); + SS_COLOR(v[2]->color, vbcolor[e2]); + } + else { + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]); + } } else { - SS_COLOR(v[0]->color, vbcolor[0]); - SS_COLOR(v[1]->color, vbcolor[0]); - SS_COLOR(v[2]->color, vbcolor[0]); + /* flat shade */ + if (swsetup->intColors) { + SS_COLOR(v[0]->color, vbcolor[0]); + SS_COLOR(v[1]->color, vbcolor[0]); + SS_COLOR(v[2]->color, vbcolor[0]); + } + else { + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); + } } } @@ -160,6 +188,9 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) _swrast_Triangle( ctx, v[0], v[1], v[2] ); } + /* + * Restore original vertex colors, etc. + */ if (IND & SS_OFFSET_BIT) { v[0]->attrib[FRAG_ATTRIB_WPOS][2] = z[0]; v[1]->attrib[FRAG_ATTRIB_WPOS][2] = z[1]; @@ -170,9 +201,16 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (facing == 1) { if (IND & SS_RGBA_BIT) { if (VB->ColorPtr[1]) { - COPY_CHAN4(v[0]->color, saved_color[0]); - COPY_CHAN4(v[1]->color, saved_color[1]); - COPY_CHAN4(v[2]->color, saved_color[2]); + if (swsetup->intColors) { + COPY_CHAN4(v[0]->color, saved_color[0]); + COPY_CHAN4(v[1]->color, saved_color[1]); + COPY_CHAN4(v[2]->color, saved_color[2]); + } + else { + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]); + } } if (VB->SecondaryColorPtr[1]) { -- cgit v1.2.3 From f2e99e6a581490b3dd412eb587f31bce43fc8c25 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 23 May 2007 21:26:35 +0000 Subject: r300: Call the r300Fogfv function directly within r300_state.c. This required moving the r300Enable function but there are no actual changes. --- src/mesa/drivers/dri/r300/r300_state.c | 200 ++++++++++++++++----------------- 1 file changed, 99 insertions(+), 101 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index b3a6ce4c76c..b235baaf10f 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -65,6 +65,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" +extern int future_hw_tcl_on; +extern void _tnl_UpdateFixedFunctionProgram(GLcontext * ctx); + static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4]) { GLubyte color[4]; @@ -462,97 +465,6 @@ static void r300SetDepthState(GLcontext * ctx) r300SetEarlyZState(ctx); } -/** - * Handle glEnable()/glDisable(). - * - * \note Mesa already filters redundant calls to glEnable/glDisable. - */ -static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); - - if (RADEON_DEBUG & DEBUG_STATE) - fprintf(stderr, "%s( %s = %s )\n", __FUNCTION__, - _mesa_lookup_enum_by_nr(cap), - state ? "GL_TRUE" : "GL_FALSE"); - - switch (cap) { - /* Fast track this one... - */ - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - break; - - case GL_FOG: - R300_STATECHANGE(r300, fogs); - if (state) { - r300->hw.fogs.cmd[R300_FOGS_STATE] |= R300_FOG_ENABLE; - - ctx->Driver.Fogfv(ctx, GL_FOG_MODE, NULL); - ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, - &ctx->Fog.Density); - ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); - ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); - ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); - } else { - r300->hw.fogs.cmd[R300_FOGS_STATE] &= ~R300_FOG_ENABLE; - } - - break; - - case GL_ALPHA_TEST: - r300SetAlphaState(ctx); - break; - - case GL_BLEND: - case GL_COLOR_LOGIC_OP: - r300SetBlendState(ctx); - break; - - case GL_DEPTH_TEST: - r300SetDepthState(ctx); - break; - - case GL_STENCIL_TEST: - if (r300->state.stencil.hw_stencil) { - R300_STATECHANGE(r300, zs); - if (state) { - r300->hw.zs.cmd[R300_ZS_CNTL_0] |= - R300_RB3D_STENCIL_ENABLE; - } else { - r300->hw.zs.cmd[R300_ZS_CNTL_0] &= - ~R300_RB3D_STENCIL_ENABLE; - } - } else { -#if R200_MERGED - FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, state); -#endif - } - break; - - case GL_CULL_FACE: - r300UpdateCulling(ctx); - break; - - case GL_POLYGON_OFFSET_POINT: - case GL_POLYGON_OFFSET_LINE: - break; - - case GL_POLYGON_OFFSET_FILL: - R300_STATECHANGE(r300, occlusion_cntl); - if (state) { - r300->hw.occlusion_cntl.cmd[1] |= (3 << 0); - } else { - r300->hw.occlusion_cntl.cmd[1] &= ~(3 << 0); - } - break; - default: - radeonEnable(ctx, cap, state); - return; - } -} - static void r300UpdatePolygonMode(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -1799,6 +1711,96 @@ static void r300SetupVertexShader(r300ContextPtr rmesa) #endif } +/** + * Enable/Disable states. + * + * \note Mesa already filters redundant calls to this function. + */ +static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + + if (RADEON_DEBUG & DEBUG_STATE) + fprintf(stderr, "%s( %s = %s )\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(cap), + state ? "GL_TRUE" : "GL_FALSE"); + + switch (cap) { + /* Fast track this one... + */ + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + break; + + case GL_FOG: + R300_STATECHANGE(r300, fogs); + if (state) { + r300->hw.fogs.cmd[R300_FOGS_STATE] |= R300_FOG_ENABLE; + + r300Fogfv(ctx, GL_FOG_MODE, NULL); + r300Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); + r300Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); + r300Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); + r300Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); + } else { + r300->hw.fogs.cmd[R300_FOGS_STATE] &= ~R300_FOG_ENABLE; + } + + break; + + case GL_ALPHA_TEST: + r300SetAlphaState(ctx); + break; + + case GL_BLEND: + case GL_COLOR_LOGIC_OP: + r300SetBlendState(ctx); + break; + + case GL_DEPTH_TEST: + r300SetDepthState(ctx); + break; + + case GL_STENCIL_TEST: + if (r300->state.stencil.hw_stencil) { + R300_STATECHANGE(r300, zs); + if (state) { + r300->hw.zs.cmd[R300_ZS_CNTL_0] |= + R300_RB3D_STENCIL_ENABLE; + } else { + r300->hw.zs.cmd[R300_ZS_CNTL_0] &= + ~R300_RB3D_STENCIL_ENABLE; + } + } else { +#if R200_MERGED + FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, state); +#endif + } + break; + + case GL_CULL_FACE: + r300UpdateCulling(ctx); + break; + + case GL_POLYGON_OFFSET_POINT: + case GL_POLYGON_OFFSET_LINE: + break; + + case GL_POLYGON_OFFSET_FILL: + R300_STATECHANGE(r300, occlusion_cntl); + if (state) { + r300->hw.occlusion_cntl.cmd[1] |= (3 << 0); + } else { + r300->hw.occlusion_cntl.cmd[1] &= ~(3 << 0); + } + break; + default: + radeonEnable(ctx, cap, state); + return; + } +} + /** * Completely recalculates hardware state based on the Mesa state. */ @@ -1970,12 +1972,12 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.unk46A4.cmd[5] = 0x00000001; r300Enable(ctx, GL_FOG, ctx->Fog.Enabled); - ctx->Driver.Fogfv(ctx, GL_FOG_MODE, NULL); - ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); - ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); - ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); - ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); - ctx->Driver.Fogfv(ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL); + r300Fogfv(ctx, GL_FOG_MODE, NULL); + r300Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); + r300Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); + r300Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); + r300Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); + r300Fogfv(ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL); r300->hw.at.cmd[R300_AT_UNKNOWN] = 0; r300->hw.unk4BD8.cmd[1] = 0; @@ -2067,10 +2069,6 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.all_dirty = GL_TRUE; } - -extern void _tnl_UpdateFixedFunctionProgram(GLcontext * ctx); - -extern int future_hw_tcl_on; void r300UpdateShaders(r300ContextPtr rmesa) { GLcontext *ctx; -- cgit v1.2.3 From e5ed09e60e32cf7d5afc778321e417ea97fe8494 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 23 May 2007 16:42:29 -0600 Subject: incr/decr 1D/2DArray texture refcounts like other targets --- src/mesa/main/attrib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 46995462629..0ee3418fddb 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -348,6 +348,8 @@ _mesa_PushAttrib(GLbitfield mask) ctx->Texture.Unit[u].Current3D->RefCount++; ctx->Texture.Unit[u].CurrentCubeMap->RefCount++; ctx->Texture.Unit[u].CurrentRect->RefCount++; + ctx->Texture.Unit[u].Current1DArray->RefCount++; + ctx->Texture.Unit[u].Current2DArray->RefCount++; } attr = MALLOC_STRUCT( gl_texture_attrib ); MEMCPY( attr, &ctx->Texture, sizeof(struct gl_texture_attrib) ); @@ -813,6 +815,8 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) ctx->Texture.Unit[u].Current3D->RefCount--; ctx->Texture.Unit[u].CurrentCubeMap->RefCount--; ctx->Texture.Unit[u].CurrentRect->RefCount--; + ctx->Texture.Unit[u].Current1DArray->RefCount--; + ctx->Texture.Unit[u].Current2DArray->RefCount--; } } -- cgit v1.2.3 From f116aed1ede0d802e9f3c5989290002975c00330 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 23 May 2007 16:49:32 -0600 Subject: restore GL_TEXTURE_LOD_BIAS in _mesa_PopAttrib(), bug 11049 --- src/mesa/main/attrib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 0ee3418fddb..1aa0a02fc78 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -782,6 +782,7 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, obj->MagFilter); _mesa_TexParameterf(target, GL_TEXTURE_MIN_LOD, obj->MinLod); _mesa_TexParameterf(target, GL_TEXTURE_MAX_LOD, obj->MaxLod); + _mesa_TexParameterf(target, GL_TEXTURE_LOD_BIAS, obj->LodBias); _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, obj->BaseLevel); if (target != GL_TEXTURE_RECTANGLE_ARB) _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel); -- cgit v1.2.3 From 98d2a4a2445bae3597e29472ebcf6deeef35a313 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 23 May 2007 16:58:01 -0600 Subject: doxygen-ize some comments --- src/mesa/main/mtypes.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index fc712def576..7397199a11c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1290,15 +1290,22 @@ struct gl_texture_format * GL_DEPTH_COMPONENT. */ GLenum DataType; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */ - GLubyte RedBits; /**< Bits per texel component */ - GLubyte GreenBits; /**< These are just rough approximations for */ - GLubyte BlueBits; /**< compressed texture formats. */ + + /** + * Bits per texel component. These are just rough approximations + * for compressed texture formats. + */ + /*@{*/ + GLubyte RedBits; + GLubyte GreenBits; + GLubyte BlueBits; GLubyte AlphaBits; GLubyte LuminanceBits; GLubyte IntensityBits; GLubyte IndexBits; GLubyte DepthBits; GLubyte StencilBits; /**< GL_EXT_packed_depth_stencil */ + /*@}*/ GLuint TexelBytes; /**< Bytes per texel, 0 if compressed format */ @@ -1490,7 +1497,7 @@ struct gl_texture_unit GLbitfield _GenBitT; GLbitfield _GenBitR; GLbitfield _GenBitQ; - GLbitfield _GenFlags; /**< bitwise or of GenBit[STRQ] */ + GLbitfield _GenFlags; /**< bitwise or of _GenBit[STRQ] */ GLfloat ObjectPlaneS[4]; GLfloat ObjectPlaneT[4]; GLfloat ObjectPlaneR[4]; @@ -1528,18 +1535,23 @@ struct gl_texture_unit struct gl_texture_object *_Current; /**< Points to really enabled tex obj */ - struct gl_texture_object Saved1D; /**< only used by glPush/PopAttrib */ + /** These are used for glPush/PopAttrib */ + /*@{*/ + struct gl_texture_object Saved1D; struct gl_texture_object Saved2D; struct gl_texture_object Saved3D; struct gl_texture_object SavedCubeMap; struct gl_texture_object SavedRect; struct gl_texture_object Saved1DArray; struct gl_texture_object Saved2DArray; + /*@}*/ - /* GL_SGI_texture_color_table */ + /** GL_SGI_texture_color_table */ + /*@{*/ struct gl_color_table ColorTable; struct gl_color_table ProxyColorTable; GLboolean ColorTableEnabled; + /*@}*/ }; struct texenvprog_cache_item { -- cgit v1.2.3 From e4b037051e79a607044ed233b7eda66cf1873245 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 24 May 2007 17:07:48 -0600 Subject: fix logic for calling _swrast_update_deferred_texture() --- src/mesa/swrast/s_context.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index f373fde781b..cb3bc756a44 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -663,16 +663,14 @@ _swrast_validate_derived( GLcontext *ctx ) _NEW_PROGRAM)) _swrast_update_fragment_program( ctx, swrast->NewState ); - if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) - _swrast_update_texture_samplers( ctx ); - if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) { + _swrast_update_texture_samplers( ctx ); _swrast_validate_texture_images(ctx); - if (swrast->NewState & (_NEW_COLOR)) { - _swrast_update_deferred_texture(ctx); - } } + if (swrast->NewState & (_NEW_COLOR | _NEW_PROGRAM)) + _swrast_update_deferred_texture(ctx); + if (swrast->NewState & _SWRAST_NEW_RASTERMASK) _swrast_update_rasterflags( ctx ); -- cgit v1.2.3 From 00a9e4eb8cede0042e53275ddd3894cdeb6db742 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 24 May 2007 09:15:57 +0000 Subject: r300: Removed unused vpucount macro from r300_state.c. --- src/mesa/drivers/dri/r300/r300_state.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index b235baaf10f..8610fdd21ff 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1484,8 +1484,6 @@ static void r300SetupRSUnit(GLcontext * ctx) InputsRead); } -#define vpucount(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count) - #define bump_vpu_count(ptr, new_count) do{\ drm_r300_cmd_header_t* _p=((drm_r300_cmd_header_t*)(ptr));\ int _nc=(new_count)/4; \ -- cgit v1.2.3 From 8a6a5dc66008a006211ed0bb1ed4c5a17db4b323 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 13:59:15 +0000 Subject: r300: Use GL_TRUE rather than 1 for the GLboolean type. --- src/mesa/drivers/dri/r300/r300_shader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 59fe17ba10e..5f5ac7c4c71 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -54,6 +54,7 @@ r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) fp->translated = GL_FALSE; break; } + /* need this for tcl fallbacks */ _tnl_program_string(ctx, target, prog); } @@ -61,7 +62,7 @@ r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) static GLboolean r300IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) { - return 1; + return GL_TRUE; } void r300InitShaderFuncs(struct dd_function_table *functions) -- cgit v1.2.3 From e734369565c816dea47c3c8e2fde76fa09fd9e6c Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 25 May 2007 08:57:44 -0600 Subject: remove #include "GL/glxtokens.h" --- src/mesa/drivers/x11/xm_api.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index cff64d17ade..eaa277db4ad 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -63,7 +63,6 @@ #endif #include "glxheader.h" -#include "GL/glxtokens.h" #include "GL/xmesa.h" #include "xmesaP.h" #include "context.h" -- cgit v1.2.3 From 93206f7815a22fa176c5ab20201c029f18e9b393 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 21:38:49 +0000 Subject: r300: Added a TODO note and some tiny cleanups to r300_emit.c. --- src/mesa/drivers/dri/r300/r300_emit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 9fb712f7b8f..ccbf838ca22 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -223,6 +223,7 @@ static void r300EmitVec(GLcontext * ctx, } +/* TODO: explain this... */ #define R300_VIR0_AOS_SIZE_SHIFT 0 #define R300_VIR0_AOS_INPUT_SHIFT 8 #define R300_VIR0_AOS_STOP_SHIFT 13 @@ -405,6 +406,7 @@ int r300EmitArrays(GLcontext * ctx) RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, inputs_bitset); } + assert(InputsRead); assert(OutputsWritten); @@ -427,8 +429,7 @@ int r300EmitArrays(GLcontext * ctx) for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) swizzle[i][ci] = ci; - if (r300IsGartMemory(rmesa, vb->AttribPtr[tab[i]]->data, - /*(count-1)*stride */ 4)) { + if (r300IsGartMemory(rmesa, vb->AttribPtr[tab[i]]->data, 4)) { if (vb->AttribPtr[tab[i]]->stride % 4) return R300_FALLBACK_TCL; -- cgit v1.2.3 From b04270393574e99184f729a757af7f46ebef5e56 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 21:43:24 +0000 Subject: r300: Use #if 0 for disabled code. --- src/mesa/drivers/dri/r300/r300_emit.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index ccbf838ca22..f0e7490b84a 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -519,12 +519,17 @@ int r300EmitArrays(GLcontext * ctx) r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; - /*if(OutputsWritten & (1 << VERT_RESULT_BFC0)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT; +#if 0 + if (OutputsWritten & (1 << VERT_RESULT_BFC0)) + r300->hw.vof.cmd[R300_VOF_CNTL_0] |= + R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_BFC1)) + r300->hw.vof.cmd[R300_VOF_CNTL_0] |= + R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT; - if(OutputsWritten & (1 << VERT_RESULT_BFC1)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT; */ - //if(OutputsWritten & (1 << VERT_RESULT_FOGC)) + if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ; +#endif if (OutputsWritten & (1 << VERT_RESULT_PSIZ)) r300->hw.vof.cmd[R300_VOF_CNTL_0] |= -- cgit v1.2.3 From 31a86804aefe167a93d81f1537a24a13204635f2 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 21:49:53 +0000 Subject: r300: Improved the r300EmitVec debugging information. --- src/mesa/drivers/dri/r300/r300_emit.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index f0e7490b84a..2910344de5f 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -94,8 +94,8 @@ static void r300EmitVec4(GLcontext * ctx, int *out = (int *)(rvb->address + rvb->start); if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d stride %d\n", - __FUNCTION__, count, stride); + fprintf(stderr, "%s count %d stride %d out %p data %p\n", + __FUNCTION__, count, stride, (void *)out, (void *)data); if (stride == 4) COPY_DWORDS(out, data, count); @@ -115,8 +115,8 @@ static void r300EmitVec8(GLcontext * ctx, int *out = (int *)(rvb->address + rvb->start); if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d stride %d\n", - __FUNCTION__, count, stride); + fprintf(stderr, "%s count %d stride %d out %p data %p\n", + __FUNCTION__, count, stride, (void *)out, (void *)data); if (stride == 8) COPY_DWORDS(out, data, count * 2); @@ -160,8 +160,8 @@ static void r300EmitVec16(GLcontext * ctx, int *out = (int *)(rvb->address + rvb->start); if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d stride %d\n", - __FUNCTION__, count, stride); + fprintf(stderr, "%s count %d stride %d out %p data %p\n", + __FUNCTION__, count, stride, (void *)out, (void *)data); if (stride == 16) COPY_DWORDS(out, data, count * 4); @@ -182,10 +182,6 @@ static void r300EmitVec(GLcontext * ctx, { r300ContextPtr rmesa = R300_CONTEXT(ctx); - if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d size %d stride %d\n", - __FUNCTION__, count, size, stride); - /* Gets triggered when playing with future_hw_tcl_on ... */ //assert(!rvb->buf); -- cgit v1.2.3 From 67ac9bf82216e1fe0c3972d9d3af3007ad937e10 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 21:54:45 +0000 Subject: r300: Removed a (disabled and unneeded) assertion. The r300EmitVec functions don't touch the buf member so the assertion isn't needed here. --- src/mesa/drivers/dri/r300/r300_emit.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 2910344de5f..2f8c4abee50 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -182,22 +182,17 @@ static void r300EmitVec(GLcontext * ctx, { r300ContextPtr rmesa = R300_CONTEXT(ctx); - /* Gets triggered when playing with future_hw_tcl_on ... */ - //assert(!rvb->buf); - if (stride == 0) { r300AllocDmaRegion(rmesa, rvb, size * 4, 4); count = 1; rvb->aos_offset = GET_START(rvb); rvb->aos_stride = 0; } else { - r300AllocDmaRegion(rmesa, rvb, size * count * 4, 4); /* alignment? */ + r300AllocDmaRegion(rmesa, rvb, size * count * 4, 4); rvb->aos_offset = GET_START(rvb); rvb->aos_stride = size; } - /* Emit the data - */ switch (size) { case 1: r300EmitVec4(ctx, rvb, data, stride, count); -- cgit v1.2.3 From f78ddc69a0d2d4a61ad8b97bc3abc46bb45cc0c3 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 22:01:20 +0000 Subject: r300: Use C style comments in r300_emit.c. --- src/mesa/drivers/dri/r300/r300_emit.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 2f8c4abee50..605c72f6de4 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -221,13 +221,22 @@ static void r300EmitVec(GLcontext * ctx, #define R300_VIR0_AOS_TYPE_SHIFT 14 #define R300_VIR0_HIGH_SHIFT 16 -// Pack 4 elemets in a 16 bit (aos_size first 8, input next 5, 1 stop bit(Whild gues), aos_type last 2); +/* + * pack 4 elemets in a 16 bit integer. + * + * aos_size first 8 + * input next 5 + * 1 stop bit (whild gues) + * aos_type last 2 + */ static inline GLuint t_vir_pack(GLvector4f ** dt, int *inputs, int i) { GLuint dw; dw = (dt[i]->size - 1) << R300_VIR0_AOS_SIZE_SHIFT; dw |= inputs[i] << R300_VIR0_AOS_INPUT_SHIFT; - //dw |= t_type(&dt[i]) << R300_VIR0_AOS_TYPE_SHIFT; +#if 0 + dw |= t_type(&dt[i]) << R300_VIR0_AOS_TYPE_SHIFT; +#endif return dw; } @@ -246,7 +255,7 @@ static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, (1 << (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); } - dst[i >> 1] = dw; // Is the same as i/2 + dst[i >> 1] = dw; /* i / 2 */ } if (nr & 1) { @@ -256,7 +265,7 @@ static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, dst[nr >> 1] = dw; } - return (nr + 1) >> 1; // Is the same as (nr+1)/2 + return (nr + 1) >> 1; /* (nr + 1) / 2 */ } static GLuint t_swizzle(int swizzle[4]) -- cgit v1.2.3 From 9b727e117e26ef6e5a410bc1e2ad9d33e54603eb Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 23:02:57 +0000 Subject: r300: Cleaned up t_vir0 and t_vir1 slightly. --- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_emit.c | 25 +++++++++---------------- 2 files changed, 10 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 01caa617667..4bc73dc862d 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -785,7 +785,7 @@ struct r300_fragment_program { #define AOS_FORMAT_USHORT 0 #define AOS_FORMAT_FLOAT 1 -#define AOS_FORMAT_UBYTE 2 +#define AOS_FORMAT_UNSIGNED_BYTE 2 #define AOS_FORMAT_FLOAT_COLOR 3 #define REG_COORDS 0 diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 605c72f6de4..fcf2ae3f089 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -243,29 +243,24 @@ static inline GLuint t_vir_pack(GLvector4f ** dt, int *inputs, int i) static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, GLint * tab, GLuint nr) { - GLuint i, dw, dwInternel; + GLuint i, dw; for (i = 0; i + 1 < nr; i += 2) { dw = t_vir_pack(dt, inputs, tab[i]); - dwInternel = t_vir_pack(dt, inputs, tab[i + 1]); - dw |= dwInternel << R300_VIR0_HIGH_SHIFT; - + dw |= t_vir_pack(dt, inputs, tab[i + 1]) << R300_VIR0_HIGH_SHIFT; if (i + 2 == nr) { - dw |= - (1 << - (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); + dw |= (1 << (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); } - dst[i >> 1] = dw; /* i / 2 */ + dst[i >> 1] = dw; } if (nr & 1) { dw = t_vir_pack(dt, inputs, tab[nr - 1]); dw |= 1 << R300_VIR0_AOS_STOP_SHIFT; - dst[nr >> 1] = dw; } - return (nr + 1) >> 1; /* (nr + 1) / 2 */ + return (nr + 1) >> 1; } static GLuint t_swizzle(int swizzle[4]) @@ -282,14 +277,12 @@ static GLuint t_vir1(uint32_t * dst, int swizzle[][4], GLuint nr) for (i = 0; i + 1 < nr; i += 2) { dst[i >> 1] = t_swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE; - dst[i >> 1] |= - (t_swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) - << 16; + dst[i >> 1] |= (t_swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16; } - if (nr & 1) - dst[nr >> 1] = - t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + if (nr & 1) { + dst[nr >> 1] = t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + } return (nr + 1) >> 1; } -- cgit v1.2.3 From b9c0a00ed0022f0131dbf3cd9755ba8212ce3908 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 23:42:03 +0000 Subject: r300: Specify the type in the t_vir0 function. --- src/mesa/drivers/dri/r300/r300_emit.c | 40 ++++++++--------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index fcf2ae3f089..51e6d55cc93 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -214,49 +214,27 @@ static void r300EmitVec(GLcontext * ctx, } -/* TODO: explain this... */ -#define R300_VIR0_AOS_SIZE_SHIFT 0 -#define R300_VIR0_AOS_INPUT_SHIFT 8 -#define R300_VIR0_AOS_STOP_SHIFT 13 -#define R300_VIR0_AOS_TYPE_SHIFT 14 -#define R300_VIR0_HIGH_SHIFT 16 - -/* - * pack 4 elemets in a 16 bit integer. +/* dw: size, inputs, stop bit, type * - * aos_size first 8 - * input next 5 - * 1 stop bit (whild gues) - * aos_type last 2 + * I'll create some documentation for t_vir0 and t_vir1 tomorrow and probably + * add the shifts as defines in r300_reg.h. */ -static inline GLuint t_vir_pack(GLvector4f ** dt, int *inputs, int i) -{ - GLuint dw; - dw = (dt[i]->size - 1) << R300_VIR0_AOS_SIZE_SHIFT; - dw |= inputs[i] << R300_VIR0_AOS_INPUT_SHIFT; -#if 0 - dw |= t_type(&dt[i]) << R300_VIR0_AOS_TYPE_SHIFT; -#endif - return dw; -} - -static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, - GLint * tab, GLuint nr) +static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, GLint * tab, GLuint nr) { GLuint i, dw; for (i = 0; i + 1 < nr; i += 2) { - dw = t_vir_pack(dt, inputs, tab[i]); - dw |= t_vir_pack(dt, inputs, tab[i + 1]) << R300_VIR0_HIGH_SHIFT; + dw = (dt[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw |= ((dt[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | (AOS_FORMAT_FLOAT << 14)) << 16; if (i + 2 == nr) { - dw |= (1 << (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); + dw |= (1 << (13 + 16)); } dst[i >> 1] = dw; } if (nr & 1) { - dw = t_vir_pack(dt, inputs, tab[nr - 1]); - dw |= 1 << R300_VIR0_AOS_STOP_SHIFT; + dw = (dt[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw |= 1 << 13; dst[nr >> 1] = dw; } -- cgit v1.2.3 From 9ed32f42510a7e6a2cc965a27a97a22a0d5c7e0a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 23:50:36 +0000 Subject: r300: Renamed "dt" to "attribptr" in the t_vir0 function. --- src/mesa/drivers/dri/r300/r300_emit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 51e6d55cc93..7a716d7f6d9 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -219,13 +219,13 @@ static void r300EmitVec(GLcontext * ctx, * I'll create some documentation for t_vir0 and t_vir1 tomorrow and probably * add the shifts as defines in r300_reg.h. */ -static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, GLint * tab, GLuint nr) +static GLuint t_vir0(uint32_t * dst, GLvector4f ** attribptr, int *inputs, GLint * tab, GLuint nr) { GLuint i, dw; for (i = 0; i + 1 < nr; i += 2) { - dw = (dt[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | (AOS_FORMAT_FLOAT << 14); - dw |= ((dt[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | (AOS_FORMAT_FLOAT << 14)) << 16; + dw = (attribptr[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw |= ((attribptr[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | (AOS_FORMAT_FLOAT << 14)) << 16; if (i + 2 == nr) { dw |= (1 << (13 + 16)); } @@ -233,7 +233,7 @@ static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, GLint * tab, } if (nr & 1) { - dw = (dt[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw = (attribptr[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | (AOS_FORMAT_FLOAT << 14); dw |= 1 << 13; dst[nr >> 1] = dw; } -- cgit v1.2.3 From fbe705f60025169f9e1c68d34088ef1a4a0fa252 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 00:07:25 +0000 Subject: r300: Renamed the t_vir0 and t_vir1 functions. --- src/mesa/drivers/dri/r300/r300_emit.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 7a716d7f6d9..fbd094aff51 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -216,10 +216,10 @@ static void r300EmitVec(GLcontext * ctx, /* dw: size, inputs, stop bit, type * - * I'll create some documentation for t_vir0 and t_vir1 tomorrow and probably - * add the shifts as defines in r300_reg.h. + * I'll create some documentation for r300VAPInputRoute0 and r300VAPInputRoute1 + * tomorrow and probably add the shifts as defines in r300_reg.h. */ -static GLuint t_vir0(uint32_t * dst, GLvector4f ** attribptr, int *inputs, GLint * tab, GLuint nr) +static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, int *inputs, GLint * tab, GLuint nr) { GLuint i, dw; @@ -241,7 +241,7 @@ static GLuint t_vir0(uint32_t * dst, GLvector4f ** attribptr, int *inputs, GLint return (nr + 1) >> 1; } -static GLuint t_swizzle(int swizzle[4]) +static GLuint r300VAPInputRoute1Swizzle(int swizzle[4]) { return (swizzle[0] << R300_INPUT_ROUTE_X_SHIFT) | (swizzle[1] << R300_INPUT_ROUTE_Y_SHIFT) | @@ -249,17 +249,17 @@ static GLuint t_swizzle(int swizzle[4]) (swizzle[3] << R300_INPUT_ROUTE_W_SHIFT); } -static GLuint t_vir1(uint32_t * dst, int swizzle[][4], GLuint nr) +static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) { GLuint i; for (i = 0; i + 1 < nr; i += 2) { - dst[i >> 1] = t_swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE; - dst[i >> 1] |= (t_swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16; + dst[i >> 1] = r300VAPInputRoute1Swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE; + dst[i >> 1] |= (r300VAPInputRoute1Swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16; } if (nr & 1) { - dst[nr >> 1] = t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + dst[nr >> 1] = r300VAPInputRoute1Swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; } return (nr + 1) >> 1; @@ -458,12 +458,12 @@ int r300EmitArrays(GLcontext * ctx) /* setup INPUT_ROUTE */ R300_STATECHANGE(r300, vir[0]); ((drm_r300_cmd_header_t *) r300->hw.vir[0].cmd)->packet0.count = - t_vir0(&r300->hw.vir[0].cmd[R300_VIR_CNTL_0], vb->AttribPtr, + r300VAPInputRoute0(&r300->hw.vir[0].cmd[R300_VIR_CNTL_0], vb->AttribPtr, inputs, tab, nr); R300_STATECHANGE(r300, vir[1]); ((drm_r300_cmd_header_t *) r300->hw.vir[1].cmd)->packet0.count = - t_vir1(&r300->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, nr); + r300VAPInputRoute1(&r300->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, nr); /* Set up input_cntl */ /* I don't think this is needed for vertex buffers, but it doesn't hurt anything */ -- cgit v1.2.3 From f4ad34e8bbabedee76cb723ed0fc5343121ad036 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 12:34:55 +0000 Subject: r300: Renamed the t_vic function. --- src/mesa/drivers/dri/r300/r300_emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index fbd094aff51..18441d5df6f 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -265,7 +265,7 @@ static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) return (nr + 1) >> 1; } -static GLuint t_vic(GLcontext * ctx, GLuint InputsRead) +static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) { r300ContextPtr r300 = R300_CONTEXT(ctx); GLuint i, vic_1 = 0; @@ -469,7 +469,7 @@ int r300EmitArrays(GLcontext * ctx) /* I don't think this is needed for vertex buffers, but it doesn't hurt anything */ R300_STATECHANGE(r300, vic); r300->hw.vic.cmd[R300_VIC_CNTL_0] = 0x5555; /* Hard coded value, no idea what it means */ - r300->hw.vic.cmd[R300_VIC_CNTL_1] = t_vic(ctx, InputsRead); + r300->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); /* Stage 3: VAP output */ -- cgit v1.2.3 From 4e98dcb85f5f302771412f62b5efb36f32b010ab Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 14:43:04 +0000 Subject: r300: Removed R300_PFS_NODE_LAST_NODE replaced by R300_PFS_NODE_OUTPUT_COLOR. --- src/mesa/drivers/dri/r300/r300_reg.h | 2 -- src/mesa/drivers/dri/r300/r300_state.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index e64f5095bc5..9356c48b8d5 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -961,7 +961,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * first node is stored in NODE_2, the second node is stored in NODE_3. * * Offsets are relative to the master offset from PFS_CNTL_2. - * LAST_NODE is set for the last node, and only for the last node. */ #define R300_PFS_NODE_0 0x4610 #define R300_PFS_NODE_1 0x4614 @@ -975,7 +974,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_PFS_NODE_TEX_OFFSET_MASK (31 << 12) # define R300_PFS_NODE_TEX_END_SHIFT 17 # define R300_PFS_NODE_TEX_END_MASK (31 << 17) -/*# define R300_PFS_NODE_LAST_NODE (1 << 22) */ # define R300_PFS_NODE_OUTPUT_COLOR (1 << 22) # define R300_PFS_NODE_OUTPUT_DEPTH (1 << 23) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 8610fdd21ff..22d780a096d 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2150,7 +2150,7 @@ static void r300SetupPixelShader(r300ContextPtr rmesa) tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) | (fp->node[i]. tex_end << R300_PFS_NODE_TEX_END_SHIFT) - | fp->node[i].flags; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ + | fp->node[i].flags; } else { rmesa->hw.fp.cmd[R300_FP_NODE0 + (3 - i)] = 0; } -- cgit v1.2.3 From ae0f17d59168692c45bf780ff90fbcebd22e3577 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 15:45:04 +0000 Subject: r300: Added r300VAPOutputCntl0 and r300VAPOutputCntl1 to r300_emit.c. --- src/mesa/drivers/dri/r300/r300_emit.c | 107 ++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 51 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 18441d5df6f..76740df81fc 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -208,21 +208,16 @@ static void r300EmitVec(GLcontext * ctx, break; default: assert(0); - _mesa_exit(-1); break; } - } -/* dw: size, inputs, stop bit, type - * - * I'll create some documentation for r300VAPInputRoute0 and r300VAPInputRoute1 - * tomorrow and probably add the shifts as defines in r300_reg.h. - */ -static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, int *inputs, GLint * tab, GLuint nr) +static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, + int *inputs, GLint * tab, GLuint nr) { GLuint i, dw; + /* dw: size, inputs, stop bit, type */ for (i = 0; i + 1 < nr; i += 2) { dw = (attribptr[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | (AOS_FORMAT_FLOAT << 14); dw |= ((attribptr[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | (AOS_FORMAT_FLOAT << 14)) << 16; @@ -289,11 +284,52 @@ static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) return vic_1; } +static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten) +{ + GLuint ret = 0; + + if (OutputsWritten & (1 << VERT_RESULT_HPOS)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_COL0)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_COL1)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; + +#if 0 + if (OutputsWritten & (1 << VERT_RESULT_BFC0)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_BFC1)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ; +#endif + + if (OutputsWritten & (1 << VERT_RESULT_PSIZ)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; + + return ret; +} + +static GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten) +{ + GLuint i, ret = 0; + + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + if (OutputsWritten & (1 << (VERT_RESULT_TEX0 + i))) { + ret |= (4 << (3 * i)); + } + } + + return ret; +} + /* Emit vertex data to GART memory * Route inputs to the vertex processor * This function should never return R300_FALLBACK_TCL when using software tcl. */ - int r300EmitArrays(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -455,60 +491,29 @@ int r300EmitArrays(GLcontext * ctx) } } - /* setup INPUT_ROUTE */ + /* Setup INPUT_ROUTE. */ R300_STATECHANGE(r300, vir[0]); ((drm_r300_cmd_header_t *) r300->hw.vir[0].cmd)->packet0.count = - r300VAPInputRoute0(&r300->hw.vir[0].cmd[R300_VIR_CNTL_0], vb->AttribPtr, - inputs, tab, nr); + r300VAPInputRoute0(&r300->hw.vir[0].cmd[R300_VIR_CNTL_0], + vb->AttribPtr, inputs, tab, nr); R300_STATECHANGE(r300, vir[1]); ((drm_r300_cmd_header_t *) r300->hw.vir[1].cmd)->packet0.count = - r300VAPInputRoute1(&r300->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, nr); + r300VAPInputRoute1(&r300->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, + nr); - /* Set up input_cntl */ + /* Setup INPUT_CNTL. */ /* I don't think this is needed for vertex buffers, but it doesn't hurt anything */ R300_STATECHANGE(r300, vic); r300->hw.vic.cmd[R300_VIC_CNTL_0] = 0x5555; /* Hard coded value, no idea what it means */ r300->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); - /* Stage 3: VAP output */ - + /* Setup OUTPUT_VTX_FMT. */ R300_STATECHANGE(r300, vof); - - r300->hw.vof.cmd[R300_VOF_CNTL_0] = 0; - r300->hw.vof.cmd[R300_VOF_CNTL_1] = 0; - - if (OutputsWritten & (1 << VERT_RESULT_HPOS)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= - R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_COL0)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= - R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_COL1)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= - R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; - -#if 0 - if (OutputsWritten & (1 << VERT_RESULT_BFC0)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= - R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_BFC1)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= - R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ; -#endif - - if (OutputsWritten & (1 << VERT_RESULT_PSIZ)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= - R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; - - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) - if (OutputsWritten & (1 << (VERT_RESULT_TEX0 + i))) - r300->hw.vof.cmd[R300_VOF_CNTL_1] |= (4 << (3 * i)); + r300->hw.vof.cmd[R300_VOF_CNTL_0] = + r300VAPOutputCntl0(ctx, OutputsWritten); + r300->hw.vof.cmd[R300_VOF_CNTL_1] = + r300VAPOutputCntl1(ctx, OutputsWritten); rmesa->state.aos_count = nr; -- cgit v1.2.3 From 0d8aba9a478a555794921f3d51cfe0c1c631853c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 15:49:24 +0000 Subject: r300: Added the r300VAPInputCntl0 function. The function just returns the hard-coded value (0x5555) even though we have no idea what this means... --- src/mesa/drivers/dri/r300/r300_emit.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 76740df81fc..f7d04f1d906 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -260,6 +260,12 @@ static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) return (nr + 1) >> 1; } +static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) +{ + /* Hard coded value, no idea what it means */ + return 0x5555; +} + static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -505,7 +511,7 @@ int r300EmitArrays(GLcontext * ctx) /* Setup INPUT_CNTL. */ /* I don't think this is needed for vertex buffers, but it doesn't hurt anything */ R300_STATECHANGE(r300, vic); - r300->hw.vic.cmd[R300_VIC_CNTL_0] = 0x5555; /* Hard coded value, no idea what it means */ + r300->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); r300->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); /* Setup OUTPUT_VTX_FMT. */ -- cgit v1.2.3 From 6be60a389b66fcfcfe90ae848cbbb3f9ef1120dd Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 17:13:57 +0000 Subject: r300: Whitespace cleanup in r300_emit.c. --- src/mesa/drivers/dri/r300/r300_emit.c | 59 +++++++++++------------------------ 1 file changed, 18 insertions(+), 41 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index f7d04f1d906..c25b0e49c2c 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -86,8 +86,7 @@ do { \ } while (0) #endif -static void r300EmitVec4(GLcontext * ctx, - struct r300_dma_region *rvb, +static void r300EmitVec4(GLcontext * ctx, struct r300_dma_region *rvb, GLvoid * data, int stride, int count) { int i; @@ -107,8 +106,7 @@ static void r300EmitVec4(GLcontext * ctx, } } -static void r300EmitVec8(GLcontext * ctx, - struct r300_dma_region *rvb, +static void r300EmitVec8(GLcontext * ctx, struct r300_dma_region *rvb, GLvoid * data, int stride, int count) { int i; @@ -129,8 +127,7 @@ static void r300EmitVec8(GLcontext * ctx, } } -static void r300EmitVec12(GLcontext * ctx, - struct r300_dma_region *rvb, +static void r300EmitVec12(GLcontext * ctx, struct r300_dma_region *rvb, GLvoid * data, int stride, int count) { int i; @@ -152,8 +149,7 @@ static void r300EmitVec12(GLcontext * ctx, } } -static void r300EmitVec16(GLcontext * ctx, - struct r300_dma_region *rvb, +static void r300EmitVec16(GLcontext * ctx, struct r300_dma_region *rvb, GLvoid * data, int stride, int count) { int i; @@ -176,8 +172,7 @@ static void r300EmitVec16(GLcontext * ctx, } } -static void r300EmitVec(GLcontext * ctx, - struct r300_dma_region *rvb, +static void r300EmitVec(GLcontext * ctx, struct r300_dma_region *rvb, GLvoid * data, int size, int stride, int count) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -352,8 +347,7 @@ int r300EmitArrays(GLcontext * ctx) int swizzle[VERT_ATTRIB_MAX][4]; if (hw_tcl_on) { - struct r300_vertex_program *prog = - (struct r300_vertex_program *) + struct r300_vertex_program *prog = (struct r300_vertex_program *) CURRENT_VERTEX_SHADER(ctx); inputs = prog->inputs; InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead; @@ -362,15 +356,13 @@ int r300EmitArrays(GLcontext * ctx) DECLARE_RENDERINPUTS(inputs_bitset); inputs = r300->state.sw_tcl_inputs; - RENDERINPUTS_COPY(inputs_bitset, - TNL_CONTEXT(ctx)->render_inputs_bitset); + RENDERINPUTS_COPY(inputs_bitset, TNL_CONTEXT(ctx)->render_inputs_bitset); assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_POS)); InputsRead |= 1 << VERT_ATTRIB_POS; OutputsWritten |= 1 << VERT_RESULT_HPOS; - assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_NORMAL) - == 0); + assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_NORMAL) == 0); assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_COLOR0)); InputsRead |= 1 << VERT_ATTRIB_COLOR0; @@ -382,8 +374,7 @@ int r300EmitArrays(GLcontext * ctx) } for (i = 0; i < ctx->Const.MaxTextureUnits; i++) - if (RENDERINPUTS_TEST - (inputs_bitset, _TNL_ATTRIB_TEX(i))) { + if (RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_TEX(i))) { InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); } @@ -394,12 +385,9 @@ int r300EmitArrays(GLcontext * ctx) else inputs[i] = -1; - if (! - (r300->radeon.radeonScreen-> - chip_flags & RADEON_CHIPSET_TCL)) { + if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { /* Fixed, apply to vir0 only */ - memcpy(vir_inputs, inputs, - VERT_ATTRIB_MAX * sizeof(int)); + memcpy(vir_inputs, inputs, VERT_ATTRIB_MAX * sizeof(int)); inputs = vir_inputs; if (InputsRead & VERT_ATTRIB_POS) @@ -416,8 +404,7 @@ int r300EmitArrays(GLcontext * ctx) inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); } - RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, - inputs_bitset); + RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, inputs_bitset); } assert(InputsRead); @@ -446,18 +433,12 @@ int r300EmitArrays(GLcontext * ctx) if (vb->AttribPtr[tab[i]]->stride % 4) return R300_FALLBACK_TCL; - rmesa->state.aos[i].address = - (void *)(vb->AttribPtr[tab[i]]->data); + rmesa->state.aos[i].address = (void *)(vb->AttribPtr[tab[i]]->data); rmesa->state.aos[i].start = 0; - rmesa->state.aos[i].aos_offset = - r300GartOffsetFromVirtual(rmesa, - vb-> - AttribPtr[tab[i]]->data); - rmesa->state.aos[i].aos_stride = - vb->AttribPtr[tab[i]]->stride / 4; - - rmesa->state.aos[i].aos_size = - vb->AttribPtr[tab[i]]->size; + rmesa->state.aos[i].aos_offset = r300GartOffsetFromVirtual(rmesa, vb->AttribPtr[tab[i]]->data); + rmesa->state.aos[i].aos_stride = vb->AttribPtr[tab[i]]->stride / 4; + + rmesa->state.aos[i].aos_size = vb->AttribPtr[tab[i]]->size; } else { r300EmitVec(ctx, &rmesa->state.aos[i], vb->AttribPtr[tab[i]]->data, @@ -470,10 +451,8 @@ int r300EmitArrays(GLcontext * ctx) comp_size = _mesa_sizeof_type(GL_FLOAT); for (fix = 0; fix <= 4 - vb->AttribPtr[tab[i]]->size; fix++) { - if ((rmesa->state.aos[i].aos_offset - - comp_size * fix) % 4) + if ((rmesa->state.aos[i].aos_offset - comp_size * fix) % 4) continue; - found = 1; break; } @@ -482,9 +461,7 @@ int r300EmitArrays(GLcontext * ctx) if (fix > 0) { WARN_ONCE("Feeling lucky?\n"); } - rmesa->state.aos[i].aos_offset -= comp_size * fix; - for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) swizzle[i][ci] += fix; } else { -- cgit v1.2.3 From 7bc7f08d882b8e2c569bb69de25fd9d104609dda Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 17:36:08 +0000 Subject: r300: Cleaned up the non-TCL RENDERINPUTS, etc. --- src/mesa/drivers/dri/r300/r300_emit.c | 81 +++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 38 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index c25b0e49c2c..b6a00592043 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -345,99 +345,104 @@ int r300EmitArrays(GLcontext * ctx) int vir_inputs[VERT_ATTRIB_MAX]; GLint tab[VERT_ATTRIB_MAX]; int swizzle[VERT_ATTRIB_MAX][4]; + struct r300_vertex_program *prog = + (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); if (hw_tcl_on) { - struct r300_vertex_program *prog = (struct r300_vertex_program *) - CURRENT_VERTEX_SHADER(ctx); inputs = prog->inputs; - InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead; - OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; + InputsRead = prog->key.InputsRead; + OutputsWritten = prog->key.OutputsWritten; } else { - DECLARE_RENDERINPUTS(inputs_bitset); inputs = r300->state.sw_tcl_inputs; - RENDERINPUTS_COPY(inputs_bitset, TNL_CONTEXT(ctx)->render_inputs_bitset); + DECLARE_RENDERINPUTS(render_inputs_bitset); + RENDERINPUTS_COPY(render_inputs_bitset, tnl->render_inputs_bitset); - assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_POS)); - InputsRead |= 1 << VERT_ATTRIB_POS; - OutputsWritten |= 1 << VERT_RESULT_HPOS; + assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_POS)); + assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_NORMAL) == 0); + assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_COLOR0)); - assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_NORMAL) == 0); + if (RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_POS)) { + InputsRead |= 1 << VERT_ATTRIB_POS; + OutputsWritten |= 1 << VERT_RESULT_HPOS; + } - assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_COLOR0)); - InputsRead |= 1 << VERT_ATTRIB_COLOR0; - OutputsWritten |= 1 << VERT_RESULT_COL0; + if (RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_COLOR0)) { + InputsRead |= 1 << VERT_ATTRIB_COLOR0; + OutputsWritten |= 1 << VERT_RESULT_COL0; + } - if (RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_COLOR1)) { + if (RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_COLOR1)) { InputsRead |= 1 << VERT_ATTRIB_COLOR1; OutputsWritten |= 1 << VERT_RESULT_COL1; } - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) - if (RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_TEX(i))) { + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + if (RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_TEX(i))) { InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); } + } - for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) - if (InputsRead & (1 << i)) + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { + if (InputsRead & (1 << i)) { inputs[i] = nr++; - else + } else { inputs[i] = -1; + } + } if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { /* Fixed, apply to vir0 only */ memcpy(vir_inputs, inputs, VERT_ATTRIB_MAX * sizeof(int)); inputs = vir_inputs; - if (InputsRead & VERT_ATTRIB_POS) inputs[VERT_ATTRIB_POS] = 0; - if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) inputs[VERT_ATTRIB_COLOR0] = 2; - if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) inputs[VERT_ATTRIB_COLOR1] = 3; - for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) if (InputsRead & (1 << i)) inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); } - RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, inputs_bitset); + RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, render_inputs_bitset); } assert(InputsRead); assert(OutputsWritten); - for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) - if (InputsRead & (1 << i)) + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { + if (InputsRead & (1 << i)) { tab[nr++] = i; + } + } - if (nr > R300_MAX_AOS_ARRAYS) + if (nr > R300_MAX_AOS_ARRAYS) { return R300_FALLBACK_TCL; + } for (i = 0; i < nr; i++) { - int ci; - int comp_size, fix, found = 0; + int ci, fix, found = 0; swizzle[i][0] = SWIZZLE_ZERO; swizzle[i][1] = SWIZZLE_ZERO; swizzle[i][2] = SWIZZLE_ZERO; swizzle[i][3] = SWIZZLE_ONE; - for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) + for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) { swizzle[i][ci] = ci; + } if (r300IsGartMemory(rmesa, vb->AttribPtr[tab[i]]->data, 4)) { - if (vb->AttribPtr[tab[i]]->stride % 4) + if (vb->AttribPtr[tab[i]]->stride % 4) { return R300_FALLBACK_TCL; - + } rmesa->state.aos[i].address = (void *)(vb->AttribPtr[tab[i]]->data); rmesa->state.aos[i].start = 0; rmesa->state.aos[i].aos_offset = r300GartOffsetFromVirtual(rmesa, vb->AttribPtr[tab[i]]->data); rmesa->state.aos[i].aos_stride = vb->AttribPtr[tab[i]]->stride / 4; - rmesa->state.aos[i].aos_size = vb->AttribPtr[tab[i]]->size; } else { r300EmitVec(ctx, &rmesa->state.aos[i], @@ -448,11 +453,10 @@ int r300EmitArrays(GLcontext * ctx) rmesa->state.aos[i].aos_size = vb->AttribPtr[tab[i]]->size; - comp_size = _mesa_sizeof_type(GL_FLOAT); - for (fix = 0; fix <= 4 - vb->AttribPtr[tab[i]]->size; fix++) { - if ((rmesa->state.aos[i].aos_offset - comp_size * fix) % 4) + if ((rmesa->state.aos[i].aos_offset - _mesa_sizeof_type(GL_FLOAT) * fix) % 4) { continue; + } found = 1; break; } @@ -461,9 +465,10 @@ int r300EmitArrays(GLcontext * ctx) if (fix > 0) { WARN_ONCE("Feeling lucky?\n"); } - rmesa->state.aos[i].aos_offset -= comp_size * fix; - for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) + rmesa->state.aos[i].aos_offset -= _mesa_sizeof_type(GL_FLOAT) * fix; + for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) { swizzle[i][ci] += fix; + } } else { WARN_ONCE ("Cannot handle offset %x with stride %d, comp %d\n", -- cgit v1.2.3 From e8b8fd366bcc52b9c9227a1a1dc3e7d254b984b1 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 17:55:30 +0000 Subject: r300: Use "rmesa" not "r300" in r300_emit.c; some of the macros require "rmesa". --- src/mesa/drivers/dri/r300/r300_emit.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index b6a00592043..a59b7ac5adc 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -263,7 +263,7 @@ static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) { - r300ContextPtr r300 = R300_CONTEXT(ctx); + r300ContextPtr rmesa = R300_CONTEXT(ctx); GLuint i, vic_1 = 0; if (InputsRead & (1 << VERT_ATTRIB_POS)) @@ -275,10 +275,10 @@ static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) vic_1 |= R300_INPUT_CNTL_COLOR; - r300->state.texture.tc_count = 0; + rmesa->state.texture.tc_count = 0; for (i = 0; i < ctx->Const.MaxTextureUnits; i++) if (InputsRead & (1 << (VERT_ATTRIB_TEX0 + i))) { - r300->state.texture.tc_count++; + rmesa->state.texture.tc_count++; vic_1 |= R300_INPUT_CNTL_TC0 << i; } @@ -334,7 +334,6 @@ static GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten) int r300EmitArrays(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - r300ContextPtr r300 = rmesa; TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = &tnl->vb; GLuint nr; @@ -353,7 +352,7 @@ int r300EmitArrays(GLcontext * ctx) InputsRead = prog->key.InputsRead; OutputsWritten = prog->key.OutputsWritten; } else { - inputs = r300->state.sw_tcl_inputs; + inputs = rmesa->state.sw_tcl_inputs; DECLARE_RENDERINPUTS(render_inputs_bitset); RENDERINPUTS_COPY(render_inputs_bitset, tnl->render_inputs_bitset); @@ -392,7 +391,7 @@ int r300EmitArrays(GLcontext * ctx) } } - if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { + if (!(rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { /* Fixed, apply to vir0 only */ memcpy(vir_inputs, inputs, VERT_ATTRIB_MAX * sizeof(int)); inputs = vir_inputs; @@ -480,27 +479,27 @@ int r300EmitArrays(GLcontext * ctx) } /* Setup INPUT_ROUTE. */ - R300_STATECHANGE(r300, vir[0]); - ((drm_r300_cmd_header_t *) r300->hw.vir[0].cmd)->packet0.count = - r300VAPInputRoute0(&r300->hw.vir[0].cmd[R300_VIR_CNTL_0], + R300_STATECHANGE(rmesa, vir[0]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = + r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], vb->AttribPtr, inputs, tab, nr); - R300_STATECHANGE(r300, vir[1]); - ((drm_r300_cmd_header_t *) r300->hw.vir[1].cmd)->packet0.count = - r300VAPInputRoute1(&r300->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, + R300_STATECHANGE(rmesa, vir[1]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = + r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, nr); /* Setup INPUT_CNTL. */ /* I don't think this is needed for vertex buffers, but it doesn't hurt anything */ - R300_STATECHANGE(r300, vic); - r300->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); - r300->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); + R300_STATECHANGE(rmesa, vic); + rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); + rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); /* Setup OUTPUT_VTX_FMT. */ - R300_STATECHANGE(r300, vof); - r300->hw.vof.cmd[R300_VOF_CNTL_0] = + R300_STATECHANGE(rmesa, vof); + rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); - r300->hw.vof.cmd[R300_VOF_CNTL_1] = + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); rmesa->state.aos_count = nr; -- cgit v1.2.3 From e96d10a86179242c349138224e61e2ac2e8eac9a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 19:39:35 +0000 Subject: r300: Removed unused aos_reg variable. --- src/mesa/drivers/dri/r300/r300_context.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 4bc73dc862d..781277dfda3 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -149,7 +149,6 @@ struct r300_dma_region { int aos_offset; /* address in GART memory */ int aos_stride; /* distance between elements, in dwords */ int aos_size; /* number of components (1-4) */ - int aos_reg; /* VAP register assignment */ }; struct r300_dma { -- cgit v1.2.3 From 3b8fc727e611143e35725d987efd1d342893c8a1 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 20:59:16 +0000 Subject: r300: Removed duplicate AOS format defines; already defined in r300_reg.h. --- src/mesa/drivers/dri/r300/r300_context.h | 5 ----- src/mesa/drivers/dri/r300/r300_emit.c | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 781277dfda3..9aa61a466a0 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -782,11 +782,6 @@ struct r300_fragment_program { #define R300_MAX_AOS_ARRAYS 16 -#define AOS_FORMAT_USHORT 0 -#define AOS_FORMAT_FLOAT 1 -#define AOS_FORMAT_UNSIGNED_BYTE 2 -#define AOS_FORMAT_FLOAT_COLOR 3 - #define REG_COORDS 0 #define REG_COLOR0 1 #define REG_TEX0 2 diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index a59b7ac5adc..f42bcd9e45a 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -214,8 +214,8 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, /* dw: size, inputs, stop bit, type */ for (i = 0; i + 1 < nr; i += 2) { - dw = (attribptr[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | (AOS_FORMAT_FLOAT << 14); - dw |= ((attribptr[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | (AOS_FORMAT_FLOAT << 14)) << 16; + dw = (attribptr[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | R300_INPUT_ROUTE_FLOAT; + dw |= ((attribptr[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | R300_INPUT_ROUTE_FLOAT) << 16; if (i + 2 == nr) { dw |= (1 << (13 + 16)); } @@ -223,7 +223,7 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, } if (nr & 1) { - dw = (attribptr[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw = (attribptr[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | R300_INPUT_ROUTE_FLOAT; dw |= 1 << 13; dst[nr >> 1] = dw; } -- cgit v1.2.3 From d42c8ab630af1ee7a153823f23a46a0e05c01019 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 21:38:52 +0000 Subject: r300: Rearranged the DWORD construction in r300VAPInputRoute0 for clarity. Doesn't actually change anything; just makes it easier to read. --- src/mesa/drivers/dri/r300/r300_emit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index f42bcd9e45a..2390d9be653 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -212,10 +212,10 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, { GLuint i, dw; - /* dw: size, inputs, stop bit, type */ + /* type, inputs, stop bit, size */ for (i = 0; i + 1 < nr; i += 2) { - dw = (attribptr[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | R300_INPUT_ROUTE_FLOAT; - dw |= ((attribptr[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | R300_INPUT_ROUTE_FLOAT) << 16; + dw = R300_INPUT_ROUTE_FLOAT | (inputs[tab[i]] << 8) | (attribptr[tab[i]]->size - 1); + dw |= (R300_INPUT_ROUTE_FLOAT | (inputs[tab[i + 1]] << 8) | (attribptr[tab[i + 1]]->size - 1)) << 16; if (i + 2 == nr) { dw |= (1 << (13 + 16)); } @@ -223,7 +223,7 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, } if (nr & 1) { - dw = (attribptr[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | R300_INPUT_ROUTE_FLOAT; + dw = R300_INPUT_ROUTE_FLOAT | (inputs[tab[nr - 1]] << 8) | (attribptr[tab[nr - 1]]->size - 1); dw |= 1 << 13; dst[nr >> 1] = dw; } -- cgit v1.2.3 From 1fc08251eece0cd1d859592ab03e775e971dca63 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 27 May 2007 02:25:31 +0000 Subject: Revert "r300: Removed the R300_RS_INTERP_[0-9]_UNKNOWN (magic) defines." This reverts commit bb3558e6517209086cf8426bbe4743da50351158. This commit caused a regression reported by Markus Amsler . Apparently these defines are required, although I'm not sure why. --- src/mesa/drivers/dri/r300/r300_reg.h | 6 ++++++ src/mesa/drivers/dri/r300/r300_state.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 9356c48b8d5..f98af8e1d2a 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -628,11 +628,17 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * 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_INTERP_0 0x4310 #define R300_RS_INTERP_1 0x4314 +# define R300_RS_INTERP_1_UNKNOWN 0x40 #define R300_RS_INTERP_2 0x4318 +# define R300_RS_INTERP_2_UNKNOWN 0x80 #define R300_RS_INTERP_3 0x431C +# define R300_RS_INTERP_3_UNKNOWN 0xC0 #define R300_RS_INTERP_4 0x4320 #define R300_RS_INTERP_5 0x4324 #define R300_RS_INTERP_6 0x4328 diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 22d780a096d..a9b20622e4c 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1354,6 +1354,17 @@ union r300_outputs_written { static void r300SetupRSUnit(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); + /* I'm still unsure if these are needed */ + GLuint interp_magic[8] = { + 0x00, + R300_RS_INTERP_1_UNKNOWN, + R300_RS_INTERP_2_UNKNOWN, + R300_RS_INTERP_3_UNKNOWN, + 0x00, + 0x00, + 0x00, + 0x00 + }; union r300_outputs_written OutputsWritten; GLuint InputsRead; int fp_reg, high_rr; @@ -1399,7 +1410,8 @@ static void r300SetupRSUnit(GLcontext * ctx) for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = 0 | R300_RS_INTERP_USED - | (in_texcoords << R300_RS_INTERP_SRC_SHIFT); + | (in_texcoords << R300_RS_INTERP_SRC_SHIFT) + | interp_magic[i]; r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0; if (InputsRead & (FRAG_BIT_TEX0 << i)) { -- cgit v1.2.3 From 5237f863edf4f61447b9b436e2fc4efb4ee819f1 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 25 May 2007 16:22:15 -0600 Subject: check for flat/smooth interp for generic/specular attrib --- src/mesa/swrast/s_aalinetemp.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 8756f122d09..3d3511823d7 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -185,10 +185,18 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) compute_plane(line.x0, line.y0, line.x1, line.y1, invW0, invW1, line.wPlane); ATTRIB_LOOP_BEGIN GLuint c; - for (c = 0; c < 4; c++) { - const GLfloat a0 = v0->attrib[attr][c] * invW0; - const GLfloat a1 = v1->attrib[attr][c] * invW1; - compute_plane(line.x0, line.y0, line.x1, line.y1, a0, a1, line.attrPlane[attr][c]); + if (swrast->_InterpMode[attr] == GL_FLAT) { + for (c = 0; c < 4; c++) { + constant_plane(v1->attrib[attr][c], line.attrPlane[attr][c]); + } + } + else { + for (c = 0; c < 4; c++) { + const GLfloat a0 = v0->attrib[attr][c] * invW0; + const GLfloat a1 = v1->attrib[attr][c] * invW1; + compute_plane(line.x0, line.y0, line.x1, line.y1, a0, a1, + line.attrPlane[attr][c]); + } } line.span.arrayAttribs |= (1 << attr); if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) { -- cgit v1.2.3 From 7e2c381a22b104a8b91479c8510b564f5a0d548e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 27 May 2007 15:25:50 +0000 Subject: r300: R300_SE_VTE_CNTL applies to both non-TCL and TCL hardware. See r300ResetHwState. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 416ea7f231d..15c2cf3ad7b 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -224,25 +224,23 @@ static void r300EmitClearState(GLcontext * ctx) e32(R300_INPUT_CNTL_0_COLOR); e32(R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR | R300_INPUT_CNTL_TC0); - if (!has_tcl) { - R300_STATECHANGE(r300, vte); - /* comes from fglrx startup of clear */ - reg_start(R300_SE_VTE_CNTL, 1); - e32(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); - e32(0x8); - - reg_start(0x21dc, 0); - e32(0xaaaaaaaa); - } + R300_STATECHANGE(r300, vte); + /* comes from fglrx startup of clear */ + reg_start(R300_SE_VTE_CNTL, 1); + e32(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); + e32(0x8); + + reg_start(0x21dc, 0); + e32(0xaaaaaaaa); R300_STATECHANGE(r300, vof); reg_start(R300_VAP_OUTPUT_VTX_FMT_0, 1); e32(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT); - e32(0x0); /* no textures */ + e32(0x0); /* no textures */ R300_STATECHANGE(r300, txe); reg_start(R300_TX_ENABLE, 0); -- cgit v1.2.3 From 6a2ef09918deb4b4b4bd56380040a5bed1c0d589 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 27 May 2007 20:23:52 +0000 Subject: r300: Cleaned up r300DestroyTexObj. --- src/mesa/drivers/dri/r300/r300_texmem.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index e2e8355d275..38f0da8b7c0 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -63,29 +63,16 @@ SOFTWARE. */ void r300DestroyTexObj(r300ContextPtr rmesa, r300TexObjPtr t) { + int i; + if (RADEON_DEBUG & DEBUG_TEXTURE) { fprintf(stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)t, (void *)t->base.tObj); } - if (rmesa != NULL) { - unsigned i; - - for (i = 0; i < rmesa->radeon.glCtx->Const.MaxTextureUnits; i++) { - if (t == rmesa->state.texture.unit[i].texobj) { - rmesa->state.texture.unit[i].texobj = NULL; - /* This code below is meant to shorten state - pushed to the hardware by not programming - unneeded units. - - This does not appear to be worthwhile on R300 */ -#if 0 - remove_from_list(&rmesa->hw.tex[i]); - make_empty_list(&rmesa->hw.tex[i]); - remove_from_list(&rmesa->hw.cube[i]); - make_empty_list(&rmesa->hw.cube[i]); -#endif - } + for (i = 0; i < rmesa->radeon.glCtx->Const.MaxTextureUnits; i++) { + if (rmesa->state.texture.unit[i].texobj == t) { + rmesa->state.texture.unit[i].texobj = NULL; } } } -- cgit v1.2.3 From b8813572ae8dc4ec75122945088e40382e2826bf Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 27 May 2007 21:45:19 +0000 Subject: r300: Added a comment in r300VAPInputCntl0. --- src/mesa/drivers/dri/r300/r300_emit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 2390d9be653..c1b795f8149 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -257,7 +257,8 @@ static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) { - /* Hard coded value, no idea what it means */ + /* No idea what this value means. I have seen other values written to + * this register... */ return 0x5555; } -- cgit v1.2.3 From 7c893e98a30114059cd69873413a136ba2be768b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 27 May 2007 23:19:30 +0000 Subject: r300: Cleaned up the AOS code in r300_render.c. --- src/mesa/drivers/dri/r300/r300_render.c | 35 +++++++++++++-------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 143fe9fd35d..1a7ebc91a5f 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -221,12 +221,9 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0); if (elt_size == 4) { - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | - (vertex_count << 16) | type | - R300_VAP_VF_CNTL__INDEX_SIZE_32bit); + e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); } else { - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | - (vertex_count << 16) | type); + e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type); } start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2); @@ -268,24 +265,21 @@ static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) start_packet3(RADEON_CP_PACKET3_3D_LOAD_VBPNTR, sz - 1); e32(nr); + for (i = 0; i + 1 < nr; i += 2) { - e32((rmesa->state.aos[i].aos_size << 0) - | (rmesa->state.aos[i].aos_stride << 8) - | (rmesa->state.aos[i + 1].aos_size << 16) - | (rmesa->state.aos[i + 1].aos_stride << 24) - ); - e32(rmesa->state.aos[i].aos_offset + - offset * 4 * rmesa->state.aos[i].aos_stride); - e32(rmesa->state.aos[i + 1].aos_offset + - offset * 4 * rmesa->state.aos[i + 1].aos_stride); + e32((rmesa->state.aos[i].aos_size << 0) | + (rmesa->state.aos[i].aos_stride << 8) | + (rmesa->state.aos[i + 1].aos_size << 16) | + (rmesa->state.aos[i + 1].aos_stride << 24)); + + e32(rmesa->state.aos[i].aos_offset + offset * 4 * rmesa->state.aos[i].aos_stride); + e32(rmesa->state.aos[i + 1].aos_offset + offset * 4 * rmesa->state.aos[i + 1].aos_stride); } if (nr & 1) { - e32((rmesa->state.aos[nr - 1].aos_size << 0) - | (rmesa->state.aos[nr - 1].aos_stride << 8) - ); - e32(rmesa->state.aos[nr - 1].aos_offset + - offset * 4 * rmesa->state.aos[nr - 1].aos_stride); + e32((rmesa->state.aos[nr - 1].aos_size << 0) | + (rmesa->state.aos[nr - 1].aos_stride << 8)); + e32(rmesa->state.aos[nr - 1].aos_offset + offset * 4 * rmesa->state.aos[nr - 1].aos_stride); } } @@ -296,8 +290,7 @@ static void r300FireAOS(r300ContextPtr rmesa, int vertex_count, int type) drm_radeon_cmd_header_t *cmd = NULL; start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0); - e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) - | type); + e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) | type); } static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, -- cgit v1.2.3 From 3e5f8a6c894b7e818443ac08dada65e57610fa69 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 27 May 2007 23:35:12 +0000 Subject: r300: Removed the (completely broken since new VBO branch) OPTIMIZE_ELTS path. The VTXFMT code was broken by the new VBO branch and the OPTIMIZE_ELTS path relied on the VTXFMT code... I'm not even sure if the OPTIMIZE_ELTS path ever worked; the testing that I did after minimizing the code duplication would have taken the same path as the non-OPTIMIZE_ELTS code. --- src/mesa/drivers/dri/r300/r300_context.h | 2 -- src/mesa/drivers/dri/r300/r300_render.c | 20 -------------------- 2 files changed, 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 9aa61a466a0..6bd74fe9cd8 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -49,8 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define USER_BUFFERS -//#define OPTIMIZE_ELTS - struct r300_context; typedef struct r300_context r300ContextRec; typedef struct r300_context *r300ContextPtr; diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 1a7ebc91a5f..0c5750de875 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -205,8 +205,6 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - unsigned long t_addr; - unsigned long magic_1, magic_2; assert(elt_size == 2 || elt_size == 4); @@ -215,10 +213,6 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, return; } - magic_1 = (addr % 32) / 4; - t_addr = addr & ~0x1d; - magic_2 = (vertex_count + 1 + (t_addr & 0x2)) / 2 + magic_1; - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0); if (elt_size == 4) { e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); @@ -227,27 +221,13 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, } start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2); -#ifdef OPTIMIZE_ELTS - if (elt_size == 4) { - e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); - e32(addr); - } else { - e32(R300_EB_UNK1 | (magic_1 << 16) | R300_EB_UNK2); - e32(t_addr); - } -#else e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); e32(addr); -#endif if (elt_size == 4) { e32(vertex_count); } else { -#ifdef OPTIMIZE_ELTS - e32(magic_2); -#else e32((vertex_count + 1) / 2); -#endif } } -- cgit v1.2.3 From 1baef2f080b2afe806e9dc85a5930cb0dfb4c66e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 28 May 2007 00:16:50 +0000 Subject: r300: Use the CP_PACKET3 macro for Type 3 packets. I haven't converted all of the Type 3 packets to the CP_PACKET3 macro yet because some of the Type 3 packet defines are missing from the R300 register definition file. These defines need to be copied from DRM and Mesa into the R300 register definition file then copied into both DRM and Mesa. --- src/mesa/drivers/dri/r300/r300_emit.h | 17 ++++------------- src/mesa/drivers/dri/r300/r300_reg.h | 1 + src/mesa/drivers/dri/r300/r300_render.c | 8 ++++---- 3 files changed, 9 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 4f841a54139..2f79ee3a23a 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -44,20 +44,11 @@ #include "r300_cmdbuf.h" #include "radeon_reg.h" -/* - * CP type-3 packets - */ -#define RADEON_CP_PACKET3_UNK1B 0xC0001B00 -#define RADEON_CP_PACKET3_INDX_BUFFER 0xC0003300 -#define RADEON_CP_PACKET3_3D_DRAW_VBUF_2 0xC0003400 -#define RADEON_CP_PACKET3_3D_DRAW_IMMD_2 0xC0003500 -#define RADEON_CP_PACKET3_3D_DRAW_INDX_2 0xC0003600 -#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00 -#define RADEON_CP_PACKET3_3D_CLEAR_ZMASK 0xC0003202 -#define RADEON_CP_PACKET3_3D_CLEAR_CMASK 0xC0003802 -#define RADEON_CP_PACKET3_3D_CLEAR_HIZ 0xC0003702 - +/* TODO: move these defines (and the ones from DRM) into r300_reg.h and sync up + * with DRM */ #define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2)) +#define CP_PACKET3( pkt, n ) \ + (RADEON_CP_PACKET3 | (pkt) | ((n) << 16)) static inline uint32_t cmdpacket0(int reg, int count) { diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index f98af8e1d2a..3f14dafc70a 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -1589,6 +1589,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_EB_UNK1_SHIFT 24 # define R300_EB_UNK1 (0x80<<24) # define R300_EB_UNK2 0x0810 +#define R300_PACKET3_3D_DRAW_VBUF_2 0x00003400 #define R300_PACKET3_3D_DRAW_INDX_2 0x00003600 /* END: Packet 3 commands */ diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 0c5750de875..3dd53c65af8 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -213,14 +213,14 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, return; } - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0); + start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_INDX_2, 0), 0); if (elt_size == 4) { e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); } else { e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type); } - start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2); + start_packet3(CP_PACKET3(R300_PACKET3_INDX_BUFFER, 2), 2); e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); e32(addr); @@ -243,7 +243,7 @@ static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __FUNCTION__, nr, offset); - start_packet3(RADEON_CP_PACKET3_3D_LOAD_VBPNTR, sz - 1); + start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, sz - 1), sz - 1); e32(nr); for (i = 0; i + 1 < nr; i += 2) { @@ -269,7 +269,7 @@ static void r300FireAOS(r300ContextPtr rmesa, int vertex_count, int type) int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0); + start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0), 0); e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) | type); } -- cgit v1.2.3 From 779a5c160ff45428279e1ef997fd36338226df39 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 28 May 2007 00:23:47 +0000 Subject: r300: Only support size 4 ELTs; this is what Mesa provides. --- src/mesa/drivers/dri/r300/r300_render.c | 38 ++++++++------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 3dd53c65af8..1e3cc4d5dc4 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -171,16 +171,13 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) return num_verts - verts_off; } -static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, - int elt_size) +static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct r300_dma_region *rvb = &rmesa->state.elt_dma; void *out; - assert(elt_size == 2 || elt_size == 4); - - if (r300IsGartMemory(rmesa, elts, n_elts * elt_size)) { + if (r300IsGartMemory(rmesa, elts, n_elts * 4)) { rvb->address = rmesa->radeon.radeonScreen->gartTextures.map; rvb->start = ((char *)elts) - rvb->address; rvb->aos_offset = @@ -192,43 +189,27 @@ static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, _mesa_exit(-1); } - r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); + r300AllocDmaRegion(rmesa, rvb, n_elts * 4, 4); rvb->aos_offset = GET_START(rvb); out = rvb->address + rvb->start; - memcpy(out, elts, n_elts * elt_size); + memcpy(out, elts, n_elts * 4); } static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, - int vertex_count, int type, int elt_size) + int vertex_count, int type) { int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - assert(elt_size == 2 || elt_size == 4); - - if (addr & (elt_size - 1)) { - WARN_ONCE("Badly aligned buffer\n"); - return; - } - start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_INDX_2, 0), 0); - if (elt_size == 4) { - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); - } else { - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type); - } + e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); start_packet3(CP_PACKET3(R300_PACKET3_INDX_BUFFER, 2), 2); e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); e32(addr); - - if (elt_size == 4) { - e32(vertex_count); - } else { - e32((vertex_count + 1) / 2); - } + e32(vertex_count); } static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) @@ -293,9 +274,8 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, WARN_ONCE("Too many elts\n"); return; } - r300EmitElts(ctx, vb->Elts, num_verts, 4); - r300FireEB(rmesa, rmesa->state.elt_dma.aos_offset, - num_verts, type, 4); + r300EmitElts(ctx, vb->Elts, num_verts); + r300FireEB(rmesa, rmesa->state.elt_dma.aos_offset, num_verts, type); } else { r300EmitAOS(rmesa, rmesa->state.aos_count, start); r300FireAOS(rmesa, num_verts, type); -- cgit v1.2.3 From 97a89227b0edd3ef51d3ef9fd015bff12dc9b97b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 28 May 2007 01:11:54 +0000 Subject: r300: Document registers 0x2220 to 0x2230. These registers are per-pixel and per-vertex X and Y clipping planes. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 4 ++-- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 10 ++++++++++ src/mesa/drivers/dri/r300/r300_state.c | 8 ++++---- 4 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 0351989b2e4..0bc3be8880c 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -318,8 +318,8 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1); ALLOC_STATE(unk221C, always, 2, 0); r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1); - ALLOC_STATE(unk2220, always, 5, 0); - r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4); + ALLOC_STATE(vap_clip, always, 5, 0); + r300->hw.vap_clip.cmd[0] = cmdpacket0(R300_VAP_CLIP_X_0, 4); ALLOC_STATE(unk2288, always, 2, 0); r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, 0); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 6bd74fe9cd8..076bb49a006 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -452,7 +452,7 @@ struct r300_hw_state { struct r300_state_atom vic; /* vap input control (2180) */ struct r300_state_atom unk21DC; /* (21DC) */ struct r300_state_atom unk221C; /* (221C) */ - struct r300_state_atom unk2220; /* (2220) */ + struct r300_state_atom vap_clip; struct r300_state_atom unk2288; /* (2288) */ struct r300_state_atom pvs; /* pvs_cntl (22D0) */ struct r300_state_atom gb_enable; /* (4008) */ diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 3f14dafc70a..6f0ed4d74ee 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -299,6 +299,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_221C_NORMAL 0x00000000 # define R300_221C_CLEAR 0x0001C000 +/* 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. + */ +#define R300_VAP_CLIP_X_0 0x2220 +#define R300_VAP_CLIP_X_1 0x2224 +#define R300_VAP_CLIP_Y_0 0x2228 +#define R300_VAP_CLIP_Y_1 0x2230 + /* gap */ /* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index a9b20622e4c..38cf9d29a73 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1882,10 +1882,10 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.unk221C.cmd[1] = R300_221C_NORMAL; - r300->hw.unk2220.cmd[1] = r300PackFloat32(1.0); - r300->hw.unk2220.cmd[2] = r300PackFloat32(1.0); - r300->hw.unk2220.cmd[3] = r300PackFloat32(1.0); - r300->hw.unk2220.cmd[4] = r300PackFloat32(1.0); + r300->hw.vap_clip.cmd[1] = r300PackFloat32(1.0); /* X */ + r300->hw.vap_clip.cmd[2] = r300PackFloat32(1.0); /* X */ + r300->hw.vap_clip.cmd[3] = r300PackFloat32(1.0); /* Y */ + r300->hw.vap_clip.cmd[4] = r300PackFloat32(1.0); /* Y */ /* XXX: Other families? */ switch (r300->radeon.radeonScreen->chip_family) { -- cgit v1.2.3 From f973ae78b28d78c589702f74bfd1f612ff86e866 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 28 May 2007 01:34:26 +0000 Subject: r300: Use compile-time endian detection in r300_state.c as well as r300_texstate.c. Probably best to not mix-and-match compile-time and run-time detection... --- src/mesa/drivers/dri/r300/r300_state.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 38cf9d29a73..475eed1e951 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1869,10 +1869,12 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.unk2134.cmd[1] = 0x00FFFFFF; r300->hw.unk2134.cmd[2] = 0x00000000; - if (_mesa_little_endian()) - r300->hw.vap_cntl_status.cmd[1] = R300_VC_NO_SWAP; - else - r300->hw.vap_cntl_status.cmd[1] = R300_VC_32BIT_SWAP; + +#ifdef MESA_LITTLE_ENDIAN + r300->hw.vap_cntl_status.cmd[1] = R300_VC_NO_SWAP; +#else + r300->hw.vap_cntl_status.cmd[1] = R300_VC_32BIT_SWAP; +#endif /* disable VAP/TCL on non-TCL capable chips */ if (!has_tcl) -- cgit v1.2.3 From 6439bc5c0d67a0b55773cefaff6769190684120e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 29 May 2007 01:18:33 +0000 Subject: r300: Cleaned up the state atom debugging code. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 37 ++++++++++++++------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 0bc3be8880c..eb5164f2ff9 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -133,13 +133,15 @@ static void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *stat int i; int dwords = (*state->check) (r300, state); - fprintf(stderr, " emit %s/%d/%d\n", state->name, dwords, + fprintf(stderr, " emit %s %d/%d\n", state->name, dwords, state->cmd_size); - if (RADEON_DEBUG & DEBUG_VERBOSE) - for (i = 0; i < dwords; i++) - fprintf(stderr, " %s[%d]: %08X\n", + if (RADEON_DEBUG & DEBUG_VERBOSE) { + for (i = 0; i < dwords; i++) { + fprintf(stderr, " %s[%d]: %08x\n", state->name, i, state->cmd[i]); + } + } } /** @@ -152,24 +154,10 @@ static inline void r300EmitAtoms(r300ContextPtr r300, GLboolean dirty) { struct r300_state_atom *atom; uint32_t *dest; + int dwords; dest = r300->cmdbuf.cmd_buf + r300->cmdbuf.count_used; - if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_STATE) { - foreach(atom, &r300->hw.atomlist) { - if ((atom->dirty || r300->hw.all_dirty) == dirty) { - int dwords = (*atom->check) (r300, atom); - - if (dwords) - r300PrintStateAtom(r300, atom); - else - fprintf(stderr, - " skip state %s\n", - atom->name); - } - } - } - /* Emit WAIT */ *dest = cmdwait(R300_WAIT_3D | R300_WAIT_3D_CLEAN); dest++; @@ -193,13 +181,20 @@ static inline void r300EmitAtoms(r300ContextPtr r300, GLboolean dirty) foreach(atom, &r300->hw.atomlist) { if ((atom->dirty || r300->hw.all_dirty) == dirty) { - int dwords = (*atom->check) (r300, atom); - + dwords = (*atom->check) (r300, atom); if (dwords) { + if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_STATE) { + r300PrintStateAtom(r300, atom); + } memcpy(dest, atom->cmd, dwords * 4); dest += dwords; r300->cmdbuf.count_used += dwords; atom->dirty = GL_FALSE; + } else { + if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_STATE) { + fprintf(stderr, " skip state %s\n", + atom->name); + } } } } -- cgit v1.2.3 From 705298c281861f49fd4e6af4c6b1ac9d240e3727 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 29 May 2007 02:58:10 +0000 Subject: r300: Cleaned up the state atom checking functions. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index eb5164f2ff9..7055286ba95 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -240,22 +240,28 @@ void r300EmitState(r300ContextPtr r300) r300->hw.all_dirty = GL_FALSE; } -#define CHECK( NM, COUNT ) \ -static int check_##NM( r300ContextPtr r300, \ - struct r300_state_atom* atom ) \ -{ \ - (void) atom; (void) r300; \ - return (COUNT); \ -} - #define packet0_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->packet0.count) #define vpu_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count) -CHECK(always, atom->cmd_size) - CHECK(variable, packet0_count(atom->cmd) ? (1 + packet0_count(atom->cmd)) : 0) - CHECK(vpu, vpu_count(atom->cmd) ? (1 + vpu_count(atom->cmd) * 4) : 0) -#undef packet0_count -#undef vpu_count +static int check_always(r300ContextPtr r300, struct r300_state_atom *atom) +{ + return atom->cmd_size; +} + +static int check_variable(r300ContextPtr r300, struct r300_state_atom *atom) +{ + int cnt; + cnt = packet0_count(atom->cmd); + return cnt ? cnt + 1 : 0; +} + +static int check_vpu(r300ContextPtr r300, struct r300_state_atom *atom) +{ + int cnt; + cnt = vpu_count(atom->cmd); + return cnt ? (cnt * 4) + 1 : 0; +} + #define ALLOC_STATE( ATOM, CHK, SZ, IDX ) \ do { \ r300->hw.ATOM.cmd_size = (SZ); \ -- cgit v1.2.3 From e20acd9168acaa920483df98d46cae3fe472f2e9 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 29 May 2007 05:02:03 +0000 Subject: r300: Cleaned up r300SetupRSUnit. --- src/mesa/drivers/dri/r300/r300_state.c | 51 ++++++++++------------------------ 1 file changed, 15 insertions(+), 36 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 475eed1e951..b9b1fa7567d 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1372,11 +1372,9 @@ static void r300SetupRSUnit(GLcontext * ctx) int i; if (hw_tcl_on) - OutputsWritten.vp_outputs = - CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; + OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; else - RENDERINPUTS_COPY(OutputsWritten.index_bitset, - r300->state.render_inputs_bitset); + RENDERINPUTS_COPY(OutputsWritten.index_bitset, r300->state.render_inputs_bitset); if (ctx->FragmentProgram._Current) InputsRead = ctx->FragmentProgram._Current->Base.InputsRead; @@ -1408,9 +1406,7 @@ static void r300SetupRSUnit(GLcontext * ctx) } for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = 0 - | R300_RS_INTERP_USED - | (in_texcoords << R300_RS_INTERP_SRC_SHIFT) + r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = 0 | R300_RS_INTERP_USED | (in_texcoords << R300_RS_INTERP_SRC_SHIFT) | interp_magic[i]; r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0; @@ -1420,13 +1416,9 @@ static void r300SetupRSUnit(GLcontext * ctx) | (fp_reg << R300_RS_ROUTE_DEST_SHIFT); high_rr = fp_reg; - if (!R300_OUTPUTS_WRITTEN_TEST - (OutputsWritten, VERT_RESULT_TEX0 + i, - _TNL_ATTRIB_TEX(i))) { + if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) { /* Passing invalid data here can lock the GPU. */ - WARN_ONCE - ("fragprog wants coords for tex%d, vp doesn't provide them!\n", - i); + WARN_ONCE("fragprog wants coords for tex%d, vp doesn't provide them!\n", i); //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base); //_mesa_exit(-1); } @@ -1434,40 +1426,31 @@ static void r300SetupRSUnit(GLcontext * ctx) fp_reg++; } /* Need to count all coords enabled at vof */ - if (R300_OUTPUTS_WRITTEN_TEST - (OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) + if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) in_texcoords++; } if (InputsRead & FRAG_BIT_COL0) { - if (!R300_OUTPUTS_WRITTEN_TEST - (OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) { - WARN_ONCE - ("fragprog wants col0, vp doesn't provide it\n"); + if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) { + WARN_ONCE("fragprog wants col0, vp doesn't provide it\n"); goto out; /* FIXME */ //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base); //_mesa_exit(-1); } - r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 - | R300_RS_ROUTE_0_COLOR - | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); + r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); InputsRead &= ~FRAG_BIT_COL0; col_interp_nr++; } out: if (InputsRead & FRAG_BIT_COL1) { - if (!R300_OUTPUTS_WRITTEN_TEST - (OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) { - WARN_ONCE - ("fragprog wants col1, vp doesn't provide it\n"); + if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) { + WARN_ONCE("fragprog wants col1, vp doesn't provide it\n"); //_mesa_exit(-1); } - r300->hw.rr.cmd[R300_RR_ROUTE_1] |= - R300_RS_ROUTE_1_UNKNOWN11 | R300_RS_ROUTE_1_COLOR1 | - (fp_reg++ << R300_RS_ROUTE_1_COLOR1_DEST_SHIFT); + r300->hw.rr.cmd[R300_RR_ROUTE_1] |= R300_RS_ROUTE_1_UNKNOWN11 | R300_RS_ROUTE_1_COLOR1 | (fp_reg++ << R300_RS_ROUTE_1_COLOR1_DEST_SHIFT); InputsRead &= ~FRAG_BIT_COL1; if (high_rr < 1) high_rr = 1; @@ -1476,9 +1459,7 @@ static void r300SetupRSUnit(GLcontext * ctx) /* Need at least one. This might still lock as the values are undefined... */ if (in_texcoords == 0 && col_interp_nr == 0) { - r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 - | R300_RS_ROUTE_0_COLOR - | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); + r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); col_interp_nr++; } @@ -1487,13 +1468,11 @@ static void r300SetupRSUnit(GLcontext * ctx) | R300_RS_CNTL_0_UNKNOWN_18; assert(high_rr >= 0); - r300->hw.rr.cmd[R300_RR_CMD_0] = - cmdpacket0(R300_RS_ROUTE_0, high_rr + 1); + r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, high_rr + 1); r300->hw.rc.cmd[2] = 0xC0 | high_rr; if (InputsRead) - WARN_ONCE("Don't know how to satisfy InputsRead=0x%08x\n", - InputsRead); + WARN_ONCE("Don't know how to satisfy InputsRead=0x%08x\n", InputsRead); } #define bump_vpu_count(ptr, new_count) do{\ -- cgit v1.2.3 From 7c008f365be722876b0563ad68b3ae3ec2e37ba6 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 29 May 2007 05:07:33 +0000 Subject: r300: Removed goto statement in r300SetupRSUnit. --- src/mesa/drivers/dri/r300/r300_state.c | 43 +++++++++++++++------------------- 1 file changed, 19 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index b9b1fa7567d..8a61167090f 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1416,45 +1416,40 @@ static void r300SetupRSUnit(GLcontext * ctx) | (fp_reg << R300_RS_ROUTE_DEST_SHIFT); high_rr = fp_reg; - if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) { - /* Passing invalid data here can lock the GPU. */ + /* Passing invalid data here can lock the GPU. */ + if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) { + InputsRead &= ~(FRAG_BIT_TEX0 << i); + fp_reg++; + } else { WARN_ONCE("fragprog wants coords for tex%d, vp doesn't provide them!\n", i); - //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base); - //_mesa_exit(-1); } - InputsRead &= ~(FRAG_BIT_TEX0 << i); - fp_reg++; } /* Need to count all coords enabled at vof */ - if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) + if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) { in_texcoords++; + } } if (InputsRead & FRAG_BIT_COL0) { - if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) { + if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) { + r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); + InputsRead &= ~FRAG_BIT_COL0; + col_interp_nr++; + } else { WARN_ONCE("fragprog wants col0, vp doesn't provide it\n"); - goto out; /* FIXME */ - //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base); - //_mesa_exit(-1); } - - r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); - InputsRead &= ~FRAG_BIT_COL0; - col_interp_nr++; } - out: if (InputsRead & FRAG_BIT_COL1) { - if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) { + if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) { + r300->hw.rr.cmd[R300_RR_ROUTE_1] |= R300_RS_ROUTE_1_UNKNOWN11 | R300_RS_ROUTE_1_COLOR1 | (fp_reg++ << R300_RS_ROUTE_1_COLOR1_DEST_SHIFT); + InputsRead &= ~FRAG_BIT_COL1; + if (high_rr < 1) + high_rr = 1; + col_interp_nr++; + } else { WARN_ONCE("fragprog wants col1, vp doesn't provide it\n"); - //_mesa_exit(-1); } - - r300->hw.rr.cmd[R300_RR_ROUTE_1] |= R300_RS_ROUTE_1_UNKNOWN11 | R300_RS_ROUTE_1_COLOR1 | (fp_reg++ << R300_RS_ROUTE_1_COLOR1_DEST_SHIFT); - InputsRead &= ~FRAG_BIT_COL1; - if (high_rr < 1) - high_rr = 1; - col_interp_nr++; } /* Need at least one. This might still lock as the values are undefined... */ -- cgit v1.2.3 From da1d9d97959bd1e4c8e359d28b4fd6cafdd4168a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 30 May 2007 03:11:49 +0000 Subject: r300: Corrected r300LineWidth based on dumping the blob. The OpenGL specification also verifies the default line width should be 1.0. --- src/mesa/drivers/dri/r300/r300_state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 8a61167090f..d7d89145416 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -715,8 +715,8 @@ static void r300LineWidth(GLcontext * ctx, GLfloat widthf) widthf = ctx->Line._Width; R300_STATECHANGE(r300, lcntl); - r300->hw.lcntl.cmd[1] = (int)(widthf * 6.0); - r300->hw.lcntl.cmd[1] |= R300_LINE_CNT_VE; + r300->hw.lcntl.cmd[1] |= + R300_LINE_CNT_HO | R300_LINE_CNT_VE | (int)(widthf * 6.0); } static void r300PolygonMode(GLcontext * ctx, GLenum face, GLenum mode) @@ -1922,7 +1922,7 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.unk4230.cmd[2] = 0x00020006; r300->hw.unk4230.cmd[3] = r300PackFloat32(1.0 / 192.0); - r300LineWidth(ctx, 0.0); + r300LineWidth(ctx, 1.0); r300->hw.unk4260.cmd[1] = 0; r300->hw.unk4260.cmd[2] = r300PackFloat32(0.0); -- cgit v1.2.3 From d61a595a5b1752a0f377e9a2e698f723ea4a6207 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 30 May 2007 03:15:52 +0000 Subject: r300: Corrected r300PointSize based on dumping the blob. The OpenGL specification also verifies the default point size should be 1.0. --- src/mesa/drivers/dri/r300/r300_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index d7d89145416..e6163262743 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1916,7 +1916,7 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.unk4214.cmd[1] = 0x00050005; - r300PointSize(ctx, 0.0); + r300PointSize(ctx, 1.0); r300->hw.unk4230.cmd[1] = 0x18000006; r300->hw.unk4230.cmd[2] = 0x00020006; -- cgit v1.2.3 From 2b7ef2549f017996073f51bc147f508c325a1db6 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Wed, 30 May 2007 15:37:42 +0200 Subject: Fix r300SetTexOffset for big endian platforms. This was broken by the unification of the texture format table. --- src/mesa/drivers/dri/r300/r300_texstate.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index eeaba584df8..ac5a5ba1cd4 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -501,7 +501,6 @@ void r300SetTexOffset(__DRIcontext * pDRICtx, GLint texname, struct gl_texture_object *tObj = _mesa_lookup_texture(rmesa->radeon.glCtx, texname); r300TexObjPtr t; - int idx; if (!tObj) return; @@ -518,24 +517,24 @@ void r300SetTexOffset(__DRIcontext * pDRICtx, GLint texname, switch (depth) { case 32: - idx = 2; + t->format = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); + t->filter |= tx_table[2].filter; t->pitch_reg /= 4; break; case 24: default: - idx = 4; + t->format = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); + t->filter |= tx_table[4].filter; t->pitch_reg /= 4; break; case 16: - idx = 5; + t->format = R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); + t->filter |= tx_table[5].filter; t->pitch_reg /= 2; break; } t->pitch_reg--; - - t->format = tx_table[idx].format; - t->filter |= tx_table[idx].filter; } static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit) -- cgit v1.2.3 From 1b27ef39c9abeaa03d65f477ac4538361f2341cc Mon Sep 17 00:00:00 2001 From: Wang Zhenyu Date: Wed, 30 May 2007 16:03:50 +0800 Subject: i965: Add pci info for 965GME/GLE chip. --- src/mesa/drivers/dri/i965/intel_context.c | 13 ++++++++----- src/mesa/drivers/dri/i965/intel_context.h | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c index 10eb9a2e28d..4f51fefe0f6 100644 --- a/src/mesa/drivers/dri/i965/intel_context.c +++ b/src/mesa/drivers/dri/i965/intel_context.c @@ -106,20 +106,23 @@ static const GLubyte *intelGetString( GLcontext *ctx, GLenum name ) case GL_RENDERER: switch (intel_context(ctx)->intelScreen->deviceID) { case PCI_CHIP_I965_Q: - chipset = "Intel(R) 965Q"; break; + chipset = "Intel(R) 965Q"; break; case PCI_CHIP_I965_G: case PCI_CHIP_I965_G_1: - chipset = "Intel(R) 965G"; break; + chipset = "Intel(R) 965G"; break; case PCI_CHIP_I946_GZ: - chipset = "Intel(R) 946GZ"; break; + chipset = "Intel(R) 946GZ"; break; case PCI_CHIP_I965_GM: - chipset = "Intel(R) 965GM"; break; + chipset = "Intel(R) 965GM"; + break; + case PCI_CHIP_I965_GME: + chipset = "Intel(R) 965GME/GLE"; break; default: - chipset = "Unknown Intel Chipset"; break; + chipset = "Unknown Intel Chipset"; } (void) driGetRendererString( buffer, chipset, DRIVER_VERSION, 0 ); diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h index a3c65b66e08..406f8483dce 100644 --- a/src/mesa/drivers/dri/i965/intel_context.h +++ b/src/mesa/drivers/dri/i965/intel_context.h @@ -385,6 +385,7 @@ extern int INTEL_DEBUG; #define PCI_CHIP_I965_G_1 0x2982 #define PCI_CHIP_I946_GZ 0x2972 #define PCI_CHIP_I965_GM 0x2A02 +#define PCI_CHIP_I965_GME 0x2A12 /* ================================================================ -- cgit v1.2.3 From a74eec5af5397b612d60dd4b0d81666027f19bb0 Mon Sep 17 00:00:00 2001 From: Wang Zhenyu Date: Wed, 30 May 2007 16:11:12 +0800 Subject: i915: Add support for 945GME chip --- src/mesa/drivers/dri/i915/i915_texstate.c | 3 ++- src/mesa/drivers/dri/i915/intel_context.c | 2 ++ src/mesa/drivers/dri/i915/intel_context.h | 1 + src/mesa/drivers/dri/i915/intel_screen.c | 1 + src/mesa/drivers/dri/i915/intel_tex.c | 3 ++- 5 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 9f0c9491b22..d0e8474b449 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -493,7 +493,8 @@ static void i915SetTexImages( i915ContextPtr i915, if (i915->intel.intelScreen->deviceID == PCI_CHIP_I945_G || - i915->intel.intelScreen->deviceID == PCI_CHIP_I945_GM) + i915->intel.intelScreen->deviceID == PCI_CHIP_I945_GM || + i915->intel.intelScreen->deviceID == PCI_CHIP_I945_GME) i945LayoutTextureImages( i915, tObj ); else i915LayoutTextureImages( i915, tObj ); diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index e747fc6991b..9f25b099b11 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -123,6 +123,8 @@ const GLubyte *intelGetString( GLcontext *ctx, GLenum name ) chipset = "Intel(R) 945G"; break; case PCI_CHIP_I945_GM: chipset = "Intel(R) 945GM"; break; + case PCI_CHIP_I945_GME: + chipset = "Intel(R) 945GME"; break; default: chipset = "Unknown Intel Chipset"; break; } diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index c48b074cc51..ae05145a56b 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -454,6 +454,7 @@ extern int INTEL_DEBUG; #define PCI_CHIP_I915_GM 0x2592 #define PCI_CHIP_I945_G 0x2772 #define PCI_CHIP_I945_GM 0x27A2 +#define PCI_CHIP_I945_GME 0x27AE /* ================================================================ diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 67e176a1c6f..d6c1cfe6565 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -514,6 +514,7 @@ static GLboolean intelCreateContext( const __GLcontextModes *mesaVis, case PCI_CHIP_I915_GM: case PCI_CHIP_I945_G: case PCI_CHIP_I945_GM: + case PCI_CHIP_I945_GME: return i915CreateContext( mesaVis, driContextPriv, sharedContextPrivate ); diff --git a/src/mesa/drivers/dri/i915/intel_tex.c b/src/mesa/drivers/dri/i915/intel_tex.c index 98ddc796724..d75ebd8ffcf 100644 --- a/src/mesa/drivers/dri/i915/intel_tex.c +++ b/src/mesa/drivers/dri/i915/intel_tex.c @@ -677,7 +677,8 @@ static void intelUploadTexImage( intelContextPtr intel, /* Time for another vtbl entry: */ else if (intel->intelScreen->deviceID == PCI_CHIP_I945_G || - intel->intelScreen->deviceID == PCI_CHIP_I945_GM) { + intel->intelScreen->deviceID == PCI_CHIP_I945_GM || + intel->intelScreen->deviceID == PCI_CHIP_I945_GME) { GLuint row_len = image->Width * image->TexFormat->TexelBytes; GLubyte *dst = (GLubyte *)(t->BufAddr + offset); GLubyte *src = (GLubyte *)image->Data; -- cgit v1.2.3 From ad6351a994fd14af9d07da4f06837a7f9b9d0de4 Mon Sep 17 00:00:00 2001 From: Wang Zhenyu Date: Wed, 30 May 2007 16:18:26 +0800 Subject: i915tex: Add support for 945GME --- src/mesa/drivers/dri/i915tex/intel_context.c | 3 +++ src/mesa/drivers/dri/i915tex/intel_context.h | 1 + src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c | 1 + src/mesa/drivers/dri/i915tex/intel_screen.c | 1 + 4 files changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c index 20b2b41ef24..e581cb080b9 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -130,6 +130,9 @@ intelGetString(GLcontext * ctx, GLenum name) case PCI_CHIP_I945_GM: chipset = "Intel(R) 945GM"; break; + case PCI_CHIP_I945_GME: + chipset = "Intel(R) 945GME"; + break; default: chipset = "Unknown Intel Chipset"; break; diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h index e61d72eaec6..24e2b37e0bf 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.h +++ b/src/mesa/drivers/dri/i915tex/intel_context.h @@ -385,6 +385,7 @@ extern int INTEL_DEBUG; #define PCI_CHIP_I915_GM 0x2592 #define PCI_CHIP_I945_G 0x2772 #define PCI_CHIP_I945_GM 0x27A2 +#define PCI_CHIP_I945_GME 0x27AE /* ================================================================ diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c index 8e83028b26c..9e90dd16c1d 100644 --- a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c @@ -79,6 +79,7 @@ intel_miptree_create(struct intel_context *intel, switch (intel->intelScreen->deviceID) { case PCI_CHIP_I945_G: case PCI_CHIP_I945_GM: + case PCI_CHIP_I945_GME: ok = i945_miptree_layout(mt); break; case PCI_CHIP_I915_G: diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c index 5e6df81950b..5840d6297e7 100644 --- a/src/mesa/drivers/dri/i915tex/intel_screen.c +++ b/src/mesa/drivers/dri/i915tex/intel_screen.c @@ -752,6 +752,7 @@ intelCreateContext(const __GLcontextModes * mesaVis, case PCI_CHIP_I915_GM: case PCI_CHIP_I945_G: case PCI_CHIP_I945_GM: + case PCI_CHIP_I945_GME: return i915CreateContext(mesaVis, driContextPriv, sharedContextPrivate); default: -- cgit v1.2.3 From 90630feeec52c6d4f2a17f75cdf3dab9f5baf923 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 2 Jun 2007 16:21:50 +1000 Subject: r300: fix non-tcl rs4xx again. --- src/mesa/drivers/dri/r300/r300_render.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 1e3cc4d5dc4..1aaf43bfafc 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -296,6 +296,8 @@ static GLboolean r300RunRender(GLcontext * ctx, if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); + if (hw_tcl_on == GL_FALSE) + vb->AttribPtr[VERT_ATTRIB_POS] = vb->ClipPtr; r300UpdateShaders(rmesa); if (r300EmitArrays(ctx)) return GL_TRUE; -- cgit v1.2.3 From 69358e73ce09b392a94df753b9bf3cb2f6ad97b9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 5 Jun 2007 09:24:27 -0700 Subject: Updates for array texture shadow targets. --- src/mesa/shader/arbprogparse.c | 14 +++++++++----- src/mesa/shader/arbprogram.syn | 33 ++++++++++++++++++++++++++++----- src/mesa/shader/arbprogram_syn.h | 20 ++++++++++++++++---- 3 files changed, 53 insertions(+), 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 7da3c19a89a..9af3fd0764d 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -374,6 +374,8 @@ LONGSTRING static char arb_grammar_text[] = /* GL_MESA_texture_array */ #define TEXTARGET_1D_ARRAY 0x09 #define TEXTARGET_2D_ARRAY 0x0a +#define TEXTARGET_SHADOW1D_ARRAY 0x0b +#define TEXTARGET_SHADOW2D_ARRAY 0x0c /* face type */ #define FACE_FRONT 0x00 @@ -2991,11 +2993,13 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, case TEXTARGET_CUBE: fp->TexSrcTarget = TEXTURE_CUBE_INDEX; break; - case TEXTARGET_SHADOW1D: - case TEXTARGET_SHADOW2D: - case TEXTARGET_SHADOWRECT: - /* TODO ARB_fragment_program_shadow code */ - break; + case TEXTARGET_SHADOW1D: + case TEXTARGET_SHADOW2D: + case TEXTARGET_SHADOW1D_ARRAY: + case TEXTARGET_SHADOW2D_ARRAY: + case TEXTARGET_SHADOWRECT: + /* TODO ARB_fragment_program_shadow code */ + break; case TEXTARGET_1D_ARRAY: fp->TexSrcTarget = TEXTURE_1D_ARRAY_INDEX; break; diff --git a/src/mesa/shader/arbprogram.syn b/src/mesa/shader/arbprogram.syn index 4f82717873e..1746a876c30 100644 --- a/src/mesa/shader/arbprogram.syn +++ b/src/mesa/shader/arbprogram.syn @@ -21,13 +21,13 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - + /** * \file arbprogram.syn * ARB_fragment/vertex_program syntax * \author Michal Krol */ - + .syntax program; /* @@ -226,8 +226,11 @@ .emtcode TEXTARGET_SHADOW1D 0x06 .emtcode TEXTARGET_SHADOW2D 0x07 .emtcode TEXTARGET_SHADOWRECT 0x08 +/* GL_MESA_texture_array */ .emtcode TEXTARGET_1D_ARRAY 0x09 .emtcode TEXTARGET_2D_ARRAY 0x0a +.emtcode TEXTARGET_SHADOW1D_ARRAY 0x0b +.emtcode TEXTARGET_SHADOW2D_ARRAY 0x0c /* face type */ .emtcode FACE_FRONT 0x00 @@ -912,6 +915,7 @@ fragment program | "CUBE" | "RECT" | (if option ARB_fragment_program_shadow present) + | (if option MESA_texture_array present) */ texTarget "1D" .emit TEXTARGET_1D .or @@ -920,19 +924,38 @@ texTarget .if (texture_rectangle != 0x00) "RECT" .emit TEXTARGET_RECT .or "CUBE" .emit TEXTARGET_CUBE .or .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or - .if (MESA_texture_array != 0x00) "ARRAY1D" .emit TEXTARGET_1D_ARRAY .or - .if (MESA_texture_array != 0x00) "ARRAY2D" .emit TEXTARGET_2D_ARRAY; + .if (MESA_texture_array != 0x00) arrayTarget; /* GL_ARB_fragment_program_shadow ::= "SHADOW1D" | "SHADOW2D" | "SHADOWRECT" + | (if option MESA_texture_array present) */ shadowTarget "SHADOW1D" .emit TEXTARGET_SHADOW1D .or "SHADOW2D" .emit TEXTARGET_SHADOW2D .or - .if (texture_rectangle != 0x00) "SHADOWRECT" .emit TEXTARGET_SHADOWRECT; + .if (texture_rectangle != 0x00) "SHADOWRECT" .emit TEXTARGET_SHADOWRECT .or + .if (MESA_texture_array != 0x00) shadowArrayTarget; + +/* +GL_MESA_texture_array + + ::= "ARRAY1D" + | "ARRAY2D" + + ::= "SHADOWARRAY1D" + | "SHADOWARRAY2D" +*/ + +arrayTarget + "ARRAY1D" .emit TEXTARGET_1D_ARRAY .or + "ARRAY2D" .emit TEXTARGET_2D_ARRAY; + +shadowArrayTarget + "SHADOWARRAY1D" .emit TEXTARGET_SHADOW1D_ARRAY .or + "SHADOWARRAY2D" .emit TEXTARGET_SHADOW2D_ARRAY; /* fragment program diff --git a/src/mesa/shader/arbprogram_syn.h b/src/mesa/shader/arbprogram_syn.h index 30dc9f4594e..5f3f7d6cf46 100644 --- a/src/mesa/shader/arbprogram_syn.h +++ b/src/mesa/shader/arbprogram_syn.h @@ -1,3 +1,7 @@ + +/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ + +" \n" ".syntax program;\n" ".emtcode REVISION 0x0a\n" ".emtcode FRAGMENT_PROGRAM 0x01\n" @@ -122,7 +126,9 @@ ".emtcode TEXTARGET_SHADOW2D 0x07\n" ".emtcode TEXTARGET_SHADOWRECT 0x08\n" ".emtcode TEXTARGET_1D_ARRAY 0x09\n" -".emtcode TEXTARGET_2D_ARRAY 0x0A\n" +".emtcode TEXTARGET_2D_ARRAY 0x0a\n" +".emtcode TEXTARGET_SHADOW1D_ARRAY 0x0b\n" +".emtcode TEXTARGET_SHADOW2D_ARRAY 0x0c\n" ".emtcode FACE_FRONT 0x00\n" ".emtcode FACE_BACK 0x01\n" ".emtcode COLOR_PRIMARY 0x00\n" @@ -479,12 +485,18 @@ " .if (texture_rectangle != 0x00) \"RECT\" .emit TEXTARGET_RECT .or\n" " \"CUBE\" .emit TEXTARGET_CUBE .or\n" " .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or\n" -" .if (MESA_texture_array != 0x00) \"ARRAY1D\" .emit TEXTARGET_1D_ARRAY .or\n" -" .if (MESA_texture_array != 0x00) \"ARRAY2D\" .emit TEXTARGET_2D_ARRAY;\n" +" .if (MESA_texture_array != 0x00) arrayTarget;\n" "shadowTarget\n" " \"SHADOW1D\" .emit TEXTARGET_SHADOW1D .or\n" " \"SHADOW2D\" .emit TEXTARGET_SHADOW2D .or\n" -" .if (texture_rectangle != 0x00) \"SHADOWRECT\" .emit TEXTARGET_SHADOWRECT;\n" +" .if (texture_rectangle != 0x00) \"SHADOWRECT\" .emit TEXTARGET_SHADOWRECT .or\n" +" .if (MESA_texture_array != 0x00) shadowArrayTarget;\n" +"arrayTarget\n" +" \"ARRAY1D\" .emit TEXTARGET_1D_ARRAY .or\n" +" \"ARRAY2D\" .emit TEXTARGET_2D_ARRAY;\n" +"shadowArrayTarget\n" +" \"SHADOWARRAY1D\" .emit TEXTARGET_SHADOW1D_ARRAY .or\n" +" \"SHADOWARRAY2D\" .emit TEXTARGET_SHADOW2D_ARRAY;\n" "optTexImageUnitNum\n" " optTexImageUnitNum_1 .or .true .emit 0x00;\n" "optTexImageUnitNum_1\n" -- cgit v1.2.3 From 89f070b3bbb86204306857b8cf690abbd56a939d Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 5 Jun 2007 19:52:10 +0200 Subject: Remove dubious compile-time test for pre-2.4 Linux kernels. LINUX_VERSION_CODE shouldn't be used by userspace code, it can be defined empty these days. If anybody still cares about 2.2 kernels, they should reinstate this as a proper runtime test. --- src/mesa/x86/common_x86.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 889b40a89f2..0b2af0a3706 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -104,12 +104,7 @@ static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp) static void check_os_sse_support( void ) { -#if defined(__linux__) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) - _mesa_debug(NULL, "Cannot safely enable SSE on pre-2.4 kernels.\n"); - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); -#endif -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) { int ret, enabled; unsigned int len; @@ -160,7 +155,7 @@ static void check_os_sse_support( void ) /* Do nothing on other platforms for now. */ _mesa_debug(NULL, "Not testing OS support for SSE, leaving enabled.\n"); -#endif /* __linux__ */ +#endif /* __FreeBSD__ */ } #endif /* USE_SSE_ASM */ -- cgit v1.2.3 From 08a2cc2d234386550c0810567f58eb4d5fb68945 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 5 Jun 2007 19:55:53 +0200 Subject: i915tex: Better attempt to release miptree when overriding texture image. The previous approach could lead to crashes in FBO code that dereferences the miptree struct pointer unconditionally. --- src/mesa/drivers/dri/i915tex/intel_tex_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c index abab90cc066..f790b1e6f73 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_image.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c @@ -378,9 +378,6 @@ intelTexImage(GLcontext * ctx, assert(!intelObj->mt); } - if (!pixels) - return; - if (!intelObj->mt) { guess_and_alloc_mipmap_tree(intel, intelObj, intelImage); if (!intelObj->mt) { @@ -682,6 +679,9 @@ intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, if (!intelObj) return; + if (intelObj->mt) + intel_miptree_release(intel, &intelObj->mt); + intelObj->imageOverride = GL_TRUE; intelObj->depthOverride = depth; intelObj->pitchOverride = pitch; -- cgit v1.2.3 From 8331d9d7aa7cde7126d38d4e1eb5fe8a168077f3 Mon Sep 17 00:00:00 2001 From: Wang Zhenyu Date: Tue, 5 Jun 2007 11:42:43 -0700 Subject: Add PCI IDs for the G33, Q33, and Q35 chipsets. --- src/mesa/drivers/dri/i915/i915_texstate.c | 20 +++++++++++++------- src/mesa/drivers/dri/i915/intel_context.c | 6 ++++++ src/mesa/drivers/dri/i915/intel_context.h | 3 +++ src/mesa/drivers/dri/i915/intel_screen.c | 3 +++ src/mesa/drivers/dri/i915/intel_tex.c | 5 ++++- src/mesa/drivers/dri/i915tex/intel_context.c | 9 +++++++++ src/mesa/drivers/dri/i915tex/intel_context.h | 3 +++ src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c | 3 +++ src/mesa/drivers/dri/i915tex/intel_screen.c | 3 +++ 9 files changed, 47 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index d0e8474b449..a19d4b65840 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -491,13 +491,19 @@ static void i915SetTexImages( i915ContextPtr i915, abort(); } - - if (i915->intel.intelScreen->deviceID == PCI_CHIP_I945_G || - i915->intel.intelScreen->deviceID == PCI_CHIP_I945_GM || - i915->intel.intelScreen->deviceID == PCI_CHIP_I945_GME) - i945LayoutTextureImages( i915, tObj ); - else - i915LayoutTextureImages( i915, tObj ); + switch (i915->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: + i945LayoutTextureImages( i915, tObj ); + break; + default: + i915LayoutTextureImages( i915, tObj ); + break; + } t->Setup[I915_TEXREG_MS3] = (((tObj->Image[0][t->intel.base.firstLevel]->Height - 1) << MS3_HEIGHT_SHIFT) | diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index 9f25b099b11..11c23f24a1b 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -125,6 +125,12 @@ const GLubyte *intelGetString( GLcontext *ctx, GLenum name ) chipset = "Intel(R) 945GM"; break; case PCI_CHIP_I945_GME: chipset = "Intel(R) 945GME"; break; + case PCI_CHIP_G33_G: + chipset = "Intel(R) G33"; break; + case PCI_CHIP_Q35_G: + chipset = "Intel(R) Q35"; break; + case PCI_CHIP_Q33_G: + chipset = "Intel(R) Q33"; break; default: chipset = "Unknown Intel Chipset"; break; } diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index ae05145a56b..3b50107d73f 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -455,6 +455,9 @@ extern int INTEL_DEBUG; #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 /* ================================================================ diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index d6c1cfe6565..ca8610b4965 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -515,6 +515,9 @@ static GLboolean intelCreateContext( const __GLcontextModes *mesaVis, case PCI_CHIP_I945_G: case PCI_CHIP_I945_GM: case PCI_CHIP_I945_GME: + case PCI_CHIP_G33_G: + case PCI_CHIP_Q35_G: + case PCI_CHIP_Q33_G: return i915CreateContext( mesaVis, driContextPriv, sharedContextPrivate ); diff --git a/src/mesa/drivers/dri/i915/intel_tex.c b/src/mesa/drivers/dri/i915/intel_tex.c index d75ebd8ffcf..5bd280652af 100644 --- a/src/mesa/drivers/dri/i915/intel_tex.c +++ b/src/mesa/drivers/dri/i915/intel_tex.c @@ -678,7 +678,10 @@ static void intelUploadTexImage( intelContextPtr intel, */ else if (intel->intelScreen->deviceID == PCI_CHIP_I945_G || intel->intelScreen->deviceID == PCI_CHIP_I945_GM || - intel->intelScreen->deviceID == PCI_CHIP_I945_GME) { + intel->intelScreen->deviceID == PCI_CHIP_I945_GME || + intel->intelScreen->deviceID == PCI_CHIP_G33_G || + intel->intelScreen->deviceID == PCI_CHIP_Q33_G || + intel->intelScreen->deviceID == PCI_CHIP_Q35_G) { GLuint row_len = image->Width * image->TexFormat->TexelBytes; GLubyte *dst = (GLubyte *)(t->BufAddr + offset); GLubyte *src = (GLubyte *)image->Data; diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c index e581cb080b9..c927dca8e5a 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -133,6 +133,15 @@ intelGetString(GLcontext * ctx, GLenum name) case PCI_CHIP_I945_GME: chipset = "Intel(R) 945GME"; break; + case PCI_CHIP_G33_G: + chipset = "Intel(R) G33"; + break; + case PCI_CHIP_Q35_G: + chipset = "Intel(R) Q35"; + break; + case PCI_CHIP_Q33_G: + chipset = "Intel(R) Q33"; + break; default: chipset = "Unknown Intel Chipset"; break; diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h index 24e2b37e0bf..9d060eb866f 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.h +++ b/src/mesa/drivers/dri/i915tex/intel_context.h @@ -386,6 +386,9 @@ extern int INTEL_DEBUG; #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 /* ================================================================ diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c index 9e90dd16c1d..843a78eb82b 100644 --- a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c @@ -80,6 +80,9 @@ intel_miptree_create(struct intel_context *intel, 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: ok = i945_miptree_layout(mt); break; case PCI_CHIP_I915_G: diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c index 5840d6297e7..2acdead63d5 100644 --- a/src/mesa/drivers/dri/i915tex/intel_screen.c +++ b/src/mesa/drivers/dri/i915tex/intel_screen.c @@ -753,6 +753,9 @@ intelCreateContext(const __GLcontextModes * mesaVis, case PCI_CHIP_I945_G: case PCI_CHIP_I945_GM: case PCI_CHIP_I945_GME: + case PCI_CHIP_G33_G: + case PCI_CHIP_Q35_G: + case PCI_CHIP_Q33_G: return i915CreateContext(mesaVis, driContextPriv, sharedContextPrivate); default: -- cgit v1.2.3 From 10d5dd685c155d8e7a8f447bcc19a7a59393ec2e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 7 Jun 2007 13:19:47 +0000 Subject: r300: Cleaned up long lines in r300Choose8888TexFormat. --- src/mesa/drivers/dri/r300/r300_tex.c | 74 +++++++++++++------------------ src/mesa/drivers/dri/r300/r300_texstate.c | 4 +- 2 files changed, 34 insertions(+), 44 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 2a21c611629..1805cecd0af 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -294,27 +294,20 @@ static const struct gl_texture_format *r300Choose8888TexFormat(GLenum srcFormat, const GLubyte littleEndian = *((const GLubyte *)&ui); if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) || - (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE - && !littleEndian) || (srcFormat == GL_ABGR_EXT - && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) - || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE - && littleEndian)) { + (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) { return &_mesa_texformat_rgba8888; - } else - if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) - || (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE - && littleEndian) || (srcFormat == GL_ABGR_EXT - && srcType == GL_UNSIGNED_INT_8_8_8_8) - || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE - && !littleEndian)) { + } else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || + (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) { return &_mesa_texformat_rgba8888_rev; - } else if (srcFormat == GL_BGRA && - ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || - srcType == GL_UNSIGNED_INT_8_8_8_8)) { + } else if (srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || + srcType == GL_UNSIGNED_INT_8_8_8_8)) { return &_mesa_texformat_argb8888_rev; - } else if (srcFormat == GL_BGRA && - ((srcType == GL_UNSIGNED_BYTE && littleEndian) || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) { + } else if (srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && littleEndian) || + srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) { return &_mesa_texformat_argb8888; } else return _dri_texformat_argb8888; @@ -563,34 +556,31 @@ r300ValidateClientStorage(GLcontext * ctx, GLenum target, return 0; } - { - GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth, - format, type); + GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth, + format, type); - if (RADEON_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, "%s: srcRowStride %d/%x\n", - __FUNCTION__, srcRowStride, srcRowStride); + if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: srcRowStride %d/%x\n", + __FUNCTION__, srcRowStride, srcRowStride); - /* Could check this later in upload, pitch restrictions could be - * relaxed, but would need to store the image pitch somewhere, - * as packing details might change before image is uploaded: - */ - if (!r300IsGartMemory(rmesa, pixels, srcHeight * srcRowStride) - || (srcRowStride & 63)) - return 0; + /* Could check this later in upload, pitch restrictions could be + * relaxed, but would need to store the image pitch somewhere, + * as packing details might change before image is uploaded: + */ + if (!r300IsGartMemory(rmesa, pixels, srcHeight * srcRowStride) + || (srcRowStride & 63)) + return 0; - /* Have validated that _mesa_transfer_teximage would be a straight - * memcpy at this point. NOTE: future calls to TexSubImage will - * overwrite the client data. This is explicitly mentioned in the - * extension spec. - */ - texImage->Data = (void *)pixels; - texImage->IsClientData = GL_TRUE; - texImage->RowStride = - srcRowStride / texImage->TexFormat->TexelBytes; + /* Have validated that _mesa_transfer_teximage would be a straight + * memcpy at this point. NOTE: future calls to TexSubImage will + * overwrite the client data. This is explicitly mentioned in the + * extension spec. + */ + texImage->Data = (void *)pixels; + texImage->IsClientData = GL_TRUE; + texImage->RowStride = srcRowStride / texImage->TexFormat->TexelBytes; - return 1; - } + return 1; } static void r300TexImage1D(GLcontext * ctx, GLenum target, GLint level, diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index ac5a5ba1cd4..1d2909fd214 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -480,11 +480,11 @@ static GLboolean r300UpdateTexture(GLcontext * ctx, int unit) */ rmesa->state.texture.unit[unit].texobj->base.bound &= - ~(1UL << unit); + ~(1 << unit); } rmesa->state.texture.unit[unit].texobj = t; - t->base.bound |= (1UL << unit); + t->base.bound |= (1 << unit); t->dirty_state |= 1 << unit; driUpdateTextureLRU((driTextureObject *) t); /* XXX: should be locked! */ } -- cgit v1.2.3 From 9c50d8477506dacc7b4f6b96ee92e0801e0e2153 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 7 Jun 2007 13:20:08 +0000 Subject: r300: Explain the R300_VAP_OUTPUT_VTX_FMT_1 register. --- src/mesa/drivers/dri/r300/r300_reg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 6f0ed4d74ee..c1897784e2d 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -116,6 +116,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT (1<<16) /* GUESS */ #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 -- cgit v1.2.3 From 65b45d6d583cce20c8e025643f8e042b2ae6e778 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 7 Jun 2007 13:20:27 +0000 Subject: r300: Removed a "don't think this is needed" comment, it actually is needed. According to the comment you do not need to setup INPUT_CNTL when using vertex buffers. However, not doing so results in a lockup. --- src/mesa/drivers/dri/r300/r300_emit.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index c1b795f8149..4670c28a02f 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -484,14 +484,12 @@ int r300EmitArrays(GLcontext * ctx) ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], vb->AttribPtr, inputs, tab, nr); - R300_STATECHANGE(rmesa, vir[1]); ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, nr); /* Setup INPUT_CNTL. */ - /* I don't think this is needed for vertex buffers, but it doesn't hurt anything */ R300_STATECHANGE(rmesa, vic); rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); -- cgit v1.2.3 From 871f57365e3ce7d30fe57dba8fd0df2a451f006e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 7 Jun 2007 13:21:18 +0000 Subject: r300: Added a comment regarding the R300_VAP_CLIP registers. --- src/mesa/drivers/dri/r300/r300_reg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index c1897784e2d..3ce09c16d3f 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -305,6 +305,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * 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_CLIP_X_0 0x2220 #define R300_VAP_CLIP_X_1 0x2224 -- cgit v1.2.3 From 84d1b24647c0719551e8bcd5fa4601fbd3b1d555 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 7 Jun 2007 13:38:06 -0700 Subject: Fix ARB_fp spec conformance bug WRT shadow sampling. The ARB_fp (and other assembly-level fragment program specs) say that the depth comparison function is always GL_NONE in fragment program mode. --- src/mesa/main/mtypes.h | 4 ++++ src/mesa/main/texstate.c | 35 +++++++++++++++++++++++++++++++++++ src/mesa/main/texstate.h | 4 ++++ src/mesa/swrast/s_fragprog.c | 16 ++++++++++++++++ src/mesa/swrast/s_texfilter.c | 20 +------------------- 5 files changed, 60 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 7397199a11c..6cbbf145a19 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1426,6 +1426,10 @@ struct gl_texture_object GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ GLenum CompareMode; /**< GL_ARB_shadow */ GLenum CompareFunc; /**< GL_ARB_shadow */ + GLenum _Function; /**< Comparison function derrived from + * \c CompareOperator, \c CompareMode, and + * \c CompareFunc. + */ GLenum DepthMode; /**< GL_ARB_depth_texture */ GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index d15af22b7db..fb024437798 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1178,6 +1178,36 @@ _mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) } +/** + * Update derrived compare function state. + */ +void +_mesa_update_texture_compare_function(struct gl_texture_object *tObj, + GLboolean in_frag_prog) +{ + if (in_frag_prog) { + 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; + } + else { + tObj->_Function = GL_NONE; /* pass depth through as grayscale */ + } +} + + void GLAPIENTRY _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) { @@ -1385,6 +1415,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (ctx->Extensions.SGIX_shadow) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; + _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1399,6 +1430,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) op == GL_TEXTURE_GEQUAL_R_SGIX) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->CompareOperator = op; + _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); @@ -1437,6 +1469,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (mode == GL_NONE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->CompareMode = mode; + _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1472,6 +1505,8 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)"); return; } + + _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index ca29c6a23ff..df468ecf9bd 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -41,6 +41,10 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ); extern void _mesa_print_texunit_state( GLcontext *ctx, GLuint unit ); +extern void +_mesa_update_texture_compare_function(struct gl_texture_object *tObj, + GLboolean in_frag_prog); + /** * \name Called from API diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index e47dbbdaf35..f5ffe41fc19 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -26,6 +26,7 @@ #include "colormac.h" #include "context.h" #include "prog_instruction.h" +#include "texstate.h" #include "s_fragprog.h" #include "s_span.h" @@ -199,6 +200,7 @@ void _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) { const struct gl_fragment_program *program = ctx->FragmentProgram._Current; + GLuint i; /* incoming colors should be floats */ if (program->Base.InputsRead & FRAG_BIT_COL0) { @@ -207,8 +209,22 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._Current != NULL) { + _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, + GL_TRUE); + } + } + run_program(ctx, span, 0, span->end); + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._Current != NULL) { + _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, + GL_FALSE); + } + } + if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR)) { span->interpMask &= ~SPAN_RGBA; span->arrayMask |= SPAN_RGBA; diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 2c8e443daf9..d4516f6faa8 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -2893,25 +2893,7 @@ sample_depth_texture( GLcontext *ctx, /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */ - /* XXX this could be precomputed and saved in the texture object */ - if (tObj->CompareFlag) { - /* GL_SGIX_shadow */ - if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - function = GL_LEQUAL; - } - else { - ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX); - function = GL_GEQUAL; - } - } - else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { - /* GL_ARB_shadow */ - function = tObj->CompareFunc; - } - else { - function = GL_NONE; /* pass depth through as grayscale */ - } - + function = tObj->_Function; if (tObj->MagFilter == GL_NEAREST) { GLuint i; for (i = 0; i < n; i++) { -- cgit v1.2.3 From 7b559a91028d297b34df9ec939bd4d00fad6027c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 7 Jun 2007 13:58:50 -0700 Subject: Add support for GL_ARB_fragment_program_shadow. --- src/mesa/main/extensions.c | 2 ++ src/mesa/main/mtypes.h | 2 ++ src/mesa/main/texstate.c | 2 ++ src/mesa/shader/arbprogparse.c | 40 +++++++++++++++++++++++++++++++++------- src/mesa/swrast/s_fragprog.c | 3 ++- 5 files changed, 41 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index a4a6cdae366..80dce56c0c1 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -47,6 +47,7 @@ static const struct { { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, { OFF, "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) }, { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, { OFF, "GL_ARB_imaging", F(ARB_imaging) }, @@ -184,6 +185,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) 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; #endif #if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6cbbf145a19..49332501d27 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1903,6 +1903,7 @@ struct gl_program GLbitfield InputsRead; /**< Bitmask of which input regs are read */ GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */ GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */ + GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */ /** Named parameters, constants, etc. from program text */ struct gl_program_parameter_list *Parameters; @@ -2532,6 +2533,7 @@ struct gl_extensions GLboolean ARB_depth_texture; GLboolean ARB_draw_buffers; GLboolean ARB_fragment_program; + GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; GLboolean ARB_half_float_pixel; GLboolean ARB_imaging; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index fb024437798..18afaf4edde 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1527,6 +1527,8 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) "glTexParameter(bad GL_DEPTH_TEXTURE_MODE_ARB)"); return; } + + _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 9af3fd0764d..5d8f763741f 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -71,6 +71,7 @@ struct arb_program /* ARB_fragment_program specifics */ GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; + GLbitfield ShadowSamplers; GLuint NumAluInstructions; GLuint NumTexInstructions; GLuint NumTexIndirections; @@ -2661,6 +2662,7 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, GLuint texcoord; GLubyte instClass, type, code; GLboolean rel; + GLuint shadow_tex = 0; _mesa_init_instructions(fp, 1); @@ -2978,35 +2980,54 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, /* texTarget */ switch (*(*inst)++) { + case TEXTARGET_SHADOW1D: + shadow_tex = 1 << texcoord; + /* FALLTHROUGH */ case TEXTARGET_1D: fp->TexSrcTarget = TEXTURE_1D_INDEX; break; + case TEXTARGET_SHADOW2D: + shadow_tex = 1 << texcoord; + /* FALLTHROUGH */ case TEXTARGET_2D: fp->TexSrcTarget = TEXTURE_2D_INDEX; break; case TEXTARGET_3D: fp->TexSrcTarget = TEXTURE_3D_INDEX; break; + case TEXTARGET_SHADOWRECT: + shadow_tex = 1 << texcoord; + /* FALLTHROUGH */ case TEXTARGET_RECT: fp->TexSrcTarget = TEXTURE_RECT_INDEX; break; case TEXTARGET_CUBE: fp->TexSrcTarget = TEXTURE_CUBE_INDEX; break; - case TEXTARGET_SHADOW1D: - case TEXTARGET_SHADOW2D: case TEXTARGET_SHADOW1D_ARRAY: - case TEXTARGET_SHADOW2D_ARRAY: - case TEXTARGET_SHADOWRECT: - /* TODO ARB_fragment_program_shadow code */ - break; + shadow_tex = 1 << texcoord; + /* FALLTHROUGH */ case TEXTARGET_1D_ARRAY: fp->TexSrcTarget = TEXTURE_1D_ARRAY_INDEX; break; + case TEXTARGET_SHADOW2D_ARRAY: + shadow_tex = 1 << texcoord; + /* FALLTHROUGH */ case TEXTARGET_2D_ARRAY: fp->TexSrcTarget = TEXTURE_2D_ARRAY_INDEX; break; } + + /* Don't test the first time a particular sampler is seen. Each time + * after that, make sure the shadow state is the same. + */ + if ((_mesa_bitcount(Program->TexturesUsed[texcoord]) > 0) + && ((Program->ShadowSamplers & (1 << texcoord)) != shadow_tex)) { + program_error(ctx, Program->Position, + "texture image unit used for shadow sampling and non-shadow sampling"); + return 1; + } + Program->TexturesUsed[texcoord] |= (1 << fp->TexSrcTarget); /* Check that both "2D" and "CUBE" (for example) aren't both used */ if (_mesa_bitcount(Program->TexturesUsed[texcoord]) > 1) { @@ -3014,6 +3035,9 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, "multiple targets used on one texture image unit"); return 1; } + + + Program->ShadowSamplers |= shadow_tex; break; case OP_TEX_KIL: @@ -3604,10 +3628,10 @@ enable_parser_extensions(GLcontext *ctx, grammar id) if (ctx->Extensions.ARB_matrix_palette && !enable_ext(ctx, id, "matrix_palette")) return GL_FALSE; +#endif if (ctx->Extensions.ARB_fragment_program_shadow && !enable_ext(ctx, id, "fragment_program_shadow")) return GL_FALSE; -#endif if (ctx->Extensions.EXT_point_parameters && !enable_ext(ctx, id, "point_parameters")) return GL_FALSE; @@ -3804,6 +3828,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, program->HintPositionInvariant = GL_FALSE; for (a = 0; a < MAX_TEXTURE_IMAGE_UNITS; a++) program->TexturesUsed[a] = 0x0; + program->ShadowSamplers = 0x0; program->NumAluInstructions = program->NumTexInstructions = program->NumTexIndirections = 0; @@ -3884,6 +3909,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, program->Base.OutputsWritten = ap.Base.OutputsWritten; for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) program->Base.TexturesUsed[i] = ap.TexturesUsed[i]; + program->Base.ShadowSamplers = ap.ShadowSamplers; program->FogOption = ap.FogOption; program->UsesKill = ap.UsesKill; diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index f5ffe41fc19..a36c1ba4919 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -211,8 +211,9 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { if (ctx->Texture.Unit[i]._Current != NULL) { + const GLboolean enable_shadow = ((1 << i) & program->Base.ShadowSamplers); _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, - GL_TRUE); + !enable_shadow); } } -- cgit v1.2.3 From 009ddb4e509f7dd39a17408332c6b0eff47a16fe Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 8 Jun 2007 12:24:35 -0600 Subject: remove obsolete comment about max DEFAULT_SOFTWARE_DEPTH_BITS --- src/mesa/main/config.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 9e4d1838ade..55199245568 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -243,10 +243,7 @@ /** - * Bits per depth buffer value. - * - * Any reasonable value up to 31 will work. 32 doesn't work because of integer - * overflow problems in the rasterizer code. + * Bits per depth buffer value (max is 32). */ #ifndef DEFAULT_SOFTWARE_DEPTH_BITS #define DEFAULT_SOFTWARE_DEPTH_BITS 16 -- cgit v1.2.3 From ee170f29552b353bc14be4473f0e517149f47c1d Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 8 Jun 2007 14:12:27 -0600 Subject: disable depthBits test in check_compatible(), see bug 11161 --- src/mesa/main/context.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ccaf6f64280..24469b01fb4 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1357,9 +1357,9 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) * Check if the given context can render into the given framebuffer * by checking visual attributes. * - * XXX this may go away someday because we're moving toward more freedom - * in binding contexts to drawables with different visual attributes. - * The GL_EXT_f_b_o extension is prompting some of that. + * Most of these tests could go away because Mesa is now pretty flexible + * in terms of mixing rendering contexts with framebuffers. As long + * as RGB vs. CI mode agree, we're probably good. * * \return GL_TRUE if compatible, GL_FALSE otherwise. */ @@ -1393,8 +1393,11 @@ check_compatible(const GLcontext *ctx, const GLframebuffer *buffer) return GL_FALSE; if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask) return GL_FALSE; +#if 0 + /* disabled (see bug 11161) */ if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits) return GL_FALSE; +#endif if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits) return GL_FALSE; -- cgit v1.2.3 From 86eecc701e9891d7668cc01002070ff78b938ad2 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 8 Jun 2007 14:13:13 -0600 Subject: In supported_buffer_bitmask(), use framebuffer's visual, not context's visual --- src/mesa/main/buffers.c | 51 ++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 11bd173e35c..c280f89e1d1 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -184,17 +184,19 @@ _mesa_Clear( GLbitfield mask ) /** * Return bitmask of BUFFER_BIT_* flags indicating which color buffers are - * available to the rendering context. - * This depends on the framebuffer we're writing to. For window system - * framebuffers we look at the framebuffer's visual. But for user- - * create framebuffers we look at the number of supported color attachments. + * available to the rendering context (for drawing or reading). + * This depends on the type of framebuffer. For window system framebuffers + * we look at the framebuffer's visual. But for user-create framebuffers we + * look at the number of supported color attachments. + * \param fb the framebuffer to draw to, or read from + * \return bitmask of BUFFER_BIT_* flags */ static GLbitfield -supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID) +supported_buffer_bitmask(const GLcontext *ctx, const struct gl_framebuffer *fb) { GLbitfield mask = 0x0; - if (framebufferID > 0) { + if (fb->Name > 0) { /* A user-created renderbuffer */ GLuint i; ASSERT(ctx->Extensions.EXT_framebuffer_object); @@ -203,20 +205,20 @@ supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID) } } else { - /* A window system renderbuffer */ + /* A window system framebuffer */ GLint i; mask = BUFFER_BIT_FRONT_LEFT; /* always have this */ - if (ctx->Visual.stereoMode) { + if (fb->Visual.stereoMode) { mask |= BUFFER_BIT_FRONT_RIGHT; - if (ctx->Visual.doubleBufferMode) { + if (fb->Visual.doubleBufferMode) { mask |= BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT; } } - else if (ctx->Visual.doubleBufferMode) { + else if (fb->Visual.doubleBufferMode) { mask |= BUFFER_BIT_BACK_LEFT; } - for (i = 0; i < ctx->Visual.numAuxBuffers; i++) { + for (i = 0; i < fb->Visual.numAuxBuffers; i++) { mask |= (BUFFER_BIT_AUX0 << i); } } @@ -338,7 +340,6 @@ read_buffer_enum_to_index(GLenum buffer) void GLAPIENTRY _mesa_DrawBuffer(GLenum buffer) { - GLuint bufferID; GLbitfield destMask; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */ @@ -347,13 +348,12 @@ _mesa_DrawBuffer(GLenum buffer) _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); } - bufferID = ctx->DrawBuffer->Name; - if (buffer == GL_NONE) { destMask = 0x0; } else { - const GLbitfield supportedMask = supported_buffer_bitmask(ctx, bufferID); + const GLbitfield supportedMask + = supported_buffer_bitmask(ctx, ctx->DrawBuffer); destMask = draw_buffer_enum_to_bitmask(buffer); if (destMask == BAD_MASK) { /* totally bogus buffer */ @@ -386,7 +386,6 @@ void GLAPIENTRY _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) { GLint output; - GLuint bufferID; GLbitfield usedBufferMask, supportedMask; GLbitfield destMask[MAX_DRAW_BUFFERS]; GET_CURRENT_CONTEXT(ctx); @@ -401,9 +400,7 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) return; } - bufferID = ctx->DrawBuffer->Name; - - supportedMask = supported_buffer_bitmask(ctx, bufferID); + supportedMask = supported_buffer_bitmask(ctx, ctx->DrawBuffer); usedBufferMask = 0x0; /* complicated error checking... */ @@ -492,8 +489,8 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, if (!destMask) { /* compute destMask values now */ - const GLuint bufferID = ctx->DrawBuffer->Name; - const GLbitfield supportedMask = supported_buffer_bitmask(ctx, bufferID); + const GLbitfield supportedMask + = supported_buffer_bitmask(ctx, ctx->DrawBuffer); for (output = 0; output < n; output++) { mask[output] = draw_buffer_enum_to_bitmask(buffers[output]); ASSERT(mask[output] != BAD_MASK); @@ -534,17 +531,15 @@ _mesa_ReadBuffer(GLenum buffer) struct gl_framebuffer *fb; GLbitfield supportedMask; GLint srcBuffer; - GLuint bufferID; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); fb = ctx->ReadBuffer; - bufferID = fb->Name; if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); - if (bufferID > 0 && buffer == GL_NONE) { + if (fb->Name > 0 && buffer == GL_NONE) { /* This is legal for user-created framebuffer objects */ srcBuffer = -1; } @@ -555,14 +550,14 @@ _mesa_ReadBuffer(GLenum buffer) _mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(buffer=0x%x)", buffer); return; } - supportedMask = supported_buffer_bitmask(ctx, bufferID); + supportedMask = supported_buffer_bitmask(ctx, fb); if (((1 << srcBuffer) & supportedMask) == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(buffer=0x%x)", buffer); return; } } - if (bufferID == 0) { + if (fb->Name == 0) { ctx->Pixel.ReadBuffer = buffer; } fb->ColorReadBuffer = buffer; -- cgit v1.2.3 From b96dbd2a3e3b26c45096c73896fa6b109bf8229a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 10 Jun 2007 12:25:23 +1000 Subject: r300: i can't see why we fallback for polygon offset line/fill --- src/mesa/drivers/dri/r300/r300_render.c | 2 -- src/mesa/drivers/dri/r300/r300_state.c | 2 -- 2 files changed, 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 1aaf43bfafc..83999307b56 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -371,8 +371,6 @@ static int r300Fallback(GLcontext * ctx) FALLBACK_IF(ctx->Point.PointSprite); if (!r300->disable_lowimpact_fallback) { - FALLBACK_IF(ctx->Polygon.OffsetPoint); - FALLBACK_IF(ctx->Polygon.OffsetLine); FALLBACK_IF(ctx->Polygon.StippleFlag); FALLBACK_IF(ctx->Multisample.Enabled); FALLBACK_IF(ctx->Line.StippleFlag); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index e6163262743..e6c394610dd 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1769,8 +1769,6 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) case GL_POLYGON_OFFSET_POINT: case GL_POLYGON_OFFSET_LINE: - break; - case GL_POLYGON_OFFSET_FILL: R300_STATECHANGE(r300, occlusion_cntl); if (state) { -- cgit v1.2.3 From c56588407c01760978f524b42abceb677fbaa8f1 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 8 Jun 2007 15:02:05 -0600 Subject: remove dead code --- src/mesa/main/depth.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index f5511ce2fbf..91c036ef968 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -28,7 +28,6 @@ #include "context.h" #include "depth.h" #include "enums.h" -#include "hash.h" #include "macros.h" #include "mtypes.h" @@ -153,36 +152,11 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ) /** * Initialize the depth buffer attribute group in the given context. */ -void _mesa_init_depth( GLcontext * ctx ) +void +_mesa_init_depth(GLcontext *ctx) { - /* Depth buffer group */ ctx->Depth.Test = GL_FALSE; ctx->Depth.Clear = 1.0; ctx->Depth.Func = GL_LESS; ctx->Depth.Mask = GL_TRUE; - - /* XXX this is now per-framebuffer state */ -#if 00 - /* Z buffer stuff */ - if (ctx->Visual.depthBits == 0) { - /* Special case. Even if we don't have a depth buffer we need - * good values for DepthMax for Z vertex transformation purposes - * and for per-fragment fog computation. - */ - ctx->DepthMax = (1 << 16) - 1; - ctx->DepthMaxF = (GLfloat) ctx->DepthMax; - } - else if (ctx->Visual.depthBits < 32) { - ctx->DepthMax = (1 << ctx->Visual.depthBits) - 1; - ctx->DepthMaxF = (GLfloat) ctx->DepthMax; - } - else { - /* Special case since shift values greater than or equal to the - * number of bits in the left hand expression's type are undefined. - */ - ctx->DepthMax = 0xffffffff; - ctx->DepthMaxF = (GLfloat) ctx->DepthMax; - } - ctx->MRD = 1.0; /* Minimum resolvable depth value, for polygon offset */ -#endif } -- cgit v1.2.3 From cf239ced0deb839b85eedd0dba322969e79f1704 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 11 Jun 2007 10:57:01 -0600 Subject: In generic_nop() call _mesa_warning() instead of _mesa_problem() since it's an app issue, not a mesa bug. --- src/mesa/main/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 24469b01fb4..255023c0fa9 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -978,7 +978,7 @@ init_attrib_groups(GLcontext *ctx) static int generic_nop(void) { - _mesa_problem(NULL, "User called no-op dispatch function (an unsupported extension function?)"); + _mesa_warning(NULL, "User called no-op dispatch function (an unsupported extension function?)"); return 0; } -- cgit v1.2.3 From 0186f1bc8356bc3c2946d4ffcb5e6d7b61b84e02 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 11 Jun 2007 16:04:36 -0600 Subject: Temporarily disable the calls to _mesa_update_texture_compare_function(). This fixes the depth-peel regression reported by Brad King. --- src/mesa/swrast/s_fragprog.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index a36c1ba4919..1cbcde3c0ad 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -209,6 +209,7 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ +#if 0 for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { if (ctx->Texture.Unit[i]._Current != NULL) { const GLboolean enable_shadow = ((1 << i) & program->Base.ShadowSamplers); @@ -216,15 +217,18 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) !enable_shadow); } } +#endif run_program(ctx, span, 0, span->end); +#if 0 for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { if (ctx->Texture.Unit[i]._Current != NULL) { _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, GL_FALSE); } } +#endif if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR)) { span->interpMask &= ~SPAN_RGBA; -- cgit v1.2.3 From a28977a4c726ac5023fcefb58695498c0c5ae507 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 11 Jun 2007 16:27:33 -0600 Subject: typo: s/derrived/derived/ --- src/mesa/main/mtypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 49332501d27..7dfa94ee13d 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1426,7 +1426,7 @@ struct gl_texture_object GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ GLenum CompareMode; /**< GL_ARB_shadow */ GLenum CompareFunc; /**< GL_ARB_shadow */ - GLenum _Function; /**< Comparison function derrived from + GLenum _Function; /**< Comparison function derived from * \c CompareOperator, \c CompareMode, and * \c CompareFunc. */ -- cgit v1.2.3 From 227315278dea9095cee6e508d03b28720b2e7880 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 11 Jun 2007 16:32:57 -0600 Subject: Replace texobj->Complete with texobj->_Complete since it's a derived field. --- src/mesa/drivers/dri/i915tex/intel_tex_validate.c | 2 +- src/mesa/drivers/dri/i965/intel_tex_validate.c | 2 +- src/mesa/main/mtypes.h | 2 +- src/mesa/main/teximage.c | 16 ++++----- src/mesa/main/texobj.c | 42 +++++++++++------------ src/mesa/main/texstate.c | 6 ++-- src/mesa/swrast/s_texfilter.c | 2 +- 7 files changed, 36 insertions(+), 36 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c index 0ae4fee1ba0..af18c26d55c 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c @@ -116,7 +116,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* We know/require this is true by now: */ - assert(intelObj->base.Complete); + assert(intelObj->base._Complete); /* What levels must the tree include at a minimum? */ diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c index cb23b9dd879..44ee94614d5 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c @@ -138,7 +138,7 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel, /* We know/require this is true by now: */ - assert(intelObj->base.Complete); + assert(intelObj->base._Complete); /* What levels must the tree include at a minimum? */ diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 7dfa94ee13d..05c08c19fec 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1434,7 +1434,7 @@ struct gl_texture_object GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ - GLboolean Complete; /**< Is texture object complete? */ + GLboolean _Complete; /**< Is texture object complete? */ /** 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 1f4c9f4722c..f315c3de74e 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2463,7 +2463,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, update_fbo_texture(ctx, texObj, face, level); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: @@ -2566,7 +2566,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, update_fbo_texture(ctx, texObj, face, level); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: @@ -2667,7 +2667,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, update_fbo_texture(ctx, texObj, face, level); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: @@ -2938,7 +2938,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, update_fbo_texture(ctx, texObj, face, level); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: @@ -3004,7 +3004,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, update_fbo_texture(ctx, texObj, face, level); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: @@ -3398,7 +3398,7 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, texObj, texImage); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: @@ -3495,7 +3495,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, texObj, texImage); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: @@ -3591,7 +3591,7 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, texObj, texImage); /* state update */ - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; ctx->NewState |= _NEW_TEXTURE; } out: diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 0d2946e95a7..df64002f994 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -209,7 +209,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, dest->_MaxLambda = src->_MaxLambda; dest->GenerateMipmap = src->GenerateMipmap; dest->Palette = src->Palette; - dest->Complete = src->Complete; + dest->_Complete = src->_Complete; } @@ -251,7 +251,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, const GLint baseLevel = t->BaseLevel; GLint maxLog2 = 0, maxLevels = 0; - t->Complete = GL_TRUE; /* be optimistic */ + t->_Complete = GL_TRUE; /* be optimistic */ /* Always need the base level image */ if (!t->Image[0][baseLevel]) { @@ -259,7 +259,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, _mesa_sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL", (void *) t, t->Name, baseLevel); incomplete(t, s); - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; return; } @@ -268,7 +268,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->Image[0][baseLevel]->Height == 0 || t->Image[0][baseLevel]->Depth == 0) { incomplete(t, "texture width = 0"); - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; return; } @@ -322,7 +322,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, if (t->Image[face][baseLevel] == NULL || t->Image[face][baseLevel]->Width2 != w || t->Image[face][baseLevel]->Height2 != h) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "Non-quare cubemap image"); return; } @@ -339,7 +339,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, GLint maxLevel = t->_MaxLevel; if (minLevel > maxLevel) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "minLevel > maxLevel"); return; } @@ -348,12 +348,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, for (i = minLevel; i <= maxLevel; i++) { if (t->Image[0][i]) { if (t->Image[0][i]->TexFormat != t->Image[0][baseLevel]->TexFormat) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "Format[i] != Format[baseLevel]"); return; } if (t->Image[0][i]->Border != t->Image[0][baseLevel]->Border) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "Border[i] != Border[baseLevel]"); return; } @@ -371,12 +371,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, } if (i >= minLevel && i <= maxLevel) { if (!t->Image[0][i]) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "1D Image[0][i] == NULL"); return; } if (t->Image[0][i]->Width2 != width ) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "1D Image[0][i] bad width"); return; } @@ -400,17 +400,17 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, } if (i >= minLevel && i <= maxLevel) { if (!t->Image[0][i]) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "2D Image[0][i] == NULL"); return; } if (t->Image[0][i]->Width2 != width) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "2D Image[0][i] bad width"); return; } if (t->Image[0][i]->Height2 != height) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "2D Image[0][i] bad height"); return; } @@ -438,26 +438,26 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, if (i >= minLevel && i <= maxLevel) { if (!t->Image[0][i]) { incomplete(t, "3D Image[0][i] == NULL"); - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; return; } if (t->Image[0][i]->_BaseFormat == GL_DEPTH_COMPONENT) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex"); return; } if (t->Image[0][i]->Width2 != width) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "3D Image[0][i] bad width"); return; } if (t->Image[0][i]->Height2 != height) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "3D Image[0][i] bad height"); return; } if (t->Image[0][i]->Depth2 != depth) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "3D Image[0][i] bad depth"); return; } @@ -483,20 +483,20 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, for (face = 0; face < 6; face++) { /* check that we have images defined */ if (!t->Image[face][i]) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "CubeMap Image[n][i] == NULL"); return; } /* Don't support GL_DEPTH_COMPONENT for cube maps */ if (t->Image[face][i]->_BaseFormat == GL_DEPTH_COMPONENT) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex"); return; } /* check that all six images have same size */ if (t->Image[face][i]->Width2!=width || t->Image[face][i]->Height2!=height) { - t->Complete = GL_FALSE; + t->_Complete = GL_FALSE; incomplete(t, "CubeMap Image[n][i] bad size"); return; } diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 18afaf4edde..a951a024336 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1552,7 +1552,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) return; } - texObj->Complete = GL_FALSE; + texObj->_Complete = GL_FALSE; if (ctx->Driver.TexParameter) { (*ctx->Driver.TexParameter)( ctx, target, texObj, pname, params ); @@ -2839,10 +2839,10 @@ texture_override(GLcontext *ctx, struct gl_texture_object *texObj, GLuint textureBit) { if (!texUnit->_ReallyEnabled && (enableBits & textureBit)) { - if (!texObj->Complete) { + if (!texObj->_Complete) { _mesa_test_texobj_completeness(ctx, texObj); } - if (texObj->Complete) { + if (texObj->_Complete) { texUnit->_ReallyEnabled = textureBit; texUnit->_Current = texObj; } diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index d4516f6faa8..c2a7512388e 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -3347,7 +3347,7 @@ texture_sample_func _swrast_choose_texture_sample_func( GLcontext *ctx, const struct gl_texture_object *t ) { - if (!t || !t->Complete) { + if (!t || !t->_Complete) { return &null_sample_func; } else { -- cgit v1.2.3 From 84e051b6a0b694b44adee381e388b00062c90b33 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 11 Jun 2007 16:36:06 -0600 Subject: fix typo, added comment --- src/mesa/main/texstate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index a951a024336..75fea56119a 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -1179,13 +1179,16 @@ _mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) /** - * Update derrived compare function state. + * Update derived compare function state. */ void _mesa_update_texture_compare_function(struct gl_texture_object *tObj, GLboolean in_frag_prog) { if (in_frag_prog) { + /* Texel/coordinate comparison is ignored for programs. + * See GL_ARB_fragment_program/shader spec for details. + */ tObj->_Function = GL_NONE; } else if (tObj->CompareFlag) { -- cgit v1.2.3 From 495e2c8327ad4b5b7e01971bb3dacf4fd812aedf Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 11 Jun 2007 16:42:35 -0600 Subject: rename/clean-up _mesa_validate_texture_wrap_mode --- src/mesa/main/texstate.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 75fea56119a..ed82f8028dc 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1141,26 +1141,29 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) /* Texture Parameters */ /**********************************************************************/ +/** + * Check if a coordinate wrap mode is supported for the texture target. + * \return GL_TRUE if legal, GL_FALSE otherwise + */ static GLboolean -_mesa_validate_texture_wrap_mode(GLcontext * ctx, - GLenum target, GLenum eparam) +validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) { const struct gl_extensions * const e = & ctx->Extensions; - if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) { + if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE || + (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) { /* any texture target */ return GL_TRUE; } else if (target != GL_TEXTURE_RECTANGLE_NV && - (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT && + (wrap == GL_REPEAT || + (wrap == GL_MIRRORED_REPEAT && e->ARB_texture_mirrored_repeat) || - (eparam == GL_MIRROR_CLAMP_EXT && + (wrap == GL_MIRROR_CLAMP_EXT && (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || - (eparam == GL_MIRROR_CLAMP_TO_EDGE_EXT && + (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT && (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || - (eparam == GL_MIRROR_CLAMP_TO_BORDER_EXT && + (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT && (e->EXT_texture_mirror_clamp)))) { /* non-rectangle texture */ return GL_TRUE; @@ -1316,7 +1319,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) case GL_TEXTURE_WRAP_S: if (texObj->WrapS == eparam) return; - if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { + if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->WrapS = eparam; } @@ -1327,7 +1330,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) case GL_TEXTURE_WRAP_T: if (texObj->WrapT == eparam) return; - if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { + if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->WrapT = eparam; } @@ -1338,7 +1341,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) case GL_TEXTURE_WRAP_R: if (texObj->WrapR == eparam) return; - if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { + if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->WrapR = eparam; } -- cgit v1.2.3 From 0fbc4c51a07a5980956d62b3f70c46c65f6c7a57 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 11 Jun 2007 17:16:18 -0600 Subject: Rework _mesa_update_texture_compare_function() to only be called during state validation/update. Note that we're still temporarily skipping the test for an active fragment program. Need to fix shadow2D() ... --- src/mesa/main/texstate.c | 82 +++++++++++++++++++++++--------------------- src/mesa/main/texstate.h | 7 ++-- src/mesa/swrast/s_fragprog.c | 20 ----------- 3 files changed, 44 insertions(+), 65 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index ed82f8028dc..c9f8a0656e8 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1181,39 +1181,6 @@ _mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) } -/** - * Update derived compare function state. - */ -void -_mesa_update_texture_compare_function(struct gl_texture_object *tObj, - GLboolean in_frag_prog) -{ - if (in_frag_prog) { - /* Texel/coordinate comparison is ignored for programs. - * See GL_ARB_fragment_program/shader spec for details. - */ - 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; - } - else { - tObj->_Function = GL_NONE; /* pass depth through as grayscale */ - } -} - - void GLAPIENTRY _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) { @@ -1421,7 +1388,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (ctx->Extensions.SGIX_shadow) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; - _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1436,7 +1402,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) op == GL_TEXTURE_GEQUAL_R_SGIX) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->CompareOperator = op; - _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); @@ -1475,7 +1440,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (mode == GL_NONE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->CompareMode = mode; - _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1511,8 +1475,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)"); return; } - - _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1533,8 +1495,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) "glTexParameter(bad GL_DEPTH_TEXTURE_MODE_ARB)"); return; } - - _mesa_update_texture_compare_function(texObj, GL_FALSE); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -2835,6 +2795,47 @@ update_texture_matrices( GLcontext *ctx ) } +/** + * Update texture object's _Function field. We need to do this + * whenever any of the texture object's shadow-related fields change + * or when we start/stop using a fragment program. + * + * This function could be expanded someday to update additional per-object + * fields that depend on assorted state changes. + */ +static void +update_texture_compare_function(GLcontext *ctx, + struct gl_texture_object *tObj) +{ + /* XXX temporarily disable this test since it breaks the GLSL + * shadow2D(), etc. functions. + */ + if (0 /*ctx->FragmentProgram._Current*/) { + /* Texel/coordinate comparison is ignored for programs. + * See GL_ARB_fragment_program/shader spec for details. + */ + 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; + } + else { + tObj->_Function = GL_NONE; /* pass depth through as grayscale */ + } +} + + /** * Helper function for determining which texture object (1D, 2D, cube, etc) * should actually be used. @@ -2851,6 +2852,7 @@ texture_override(GLcontext *ctx, if (texObj->_Complete) { texUnit->_ReallyEnabled = textureBit; texUnit->_Current = texObj; + update_texture_compare_function(ctx, texObj); } } } diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index df468ecf9bd..60145691b8c 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -41,9 +41,6 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ); extern void _mesa_print_texunit_state( GLcontext *ctx, GLuint unit ); -extern void -_mesa_update_texture_compare_function(struct gl_texture_object *tObj, - GLboolean in_frag_prog); /** diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 1cbcde3c0ad..923b67e78e6 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -200,7 +200,6 @@ void _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) { const struct gl_fragment_program *program = ctx->FragmentProgram._Current; - GLuint i; /* incoming colors should be floats */ if (program->Base.InputsRead & FRAG_BIT_COL0) { @@ -209,27 +208,8 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ -#if 0 - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { - if (ctx->Texture.Unit[i]._Current != NULL) { - const GLboolean enable_shadow = ((1 << i) & program->Base.ShadowSamplers); - _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, - !enable_shadow); - } - } -#endif - run_program(ctx, span, 0, span->end); -#if 0 - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { - if (ctx->Texture.Unit[i]._Current != NULL) { - _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, - GL_FALSE); - } - } -#endif - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR)) { span->interpMask &= ~SPAN_RGBA; span->arrayMask |= SPAN_RGBA; -- cgit v1.2.3 From c1ba308e6499a6eb3f970b81a3f25d63da988d1c Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 12 Jun 2007 08:57:12 -0600 Subject: fix GLX_USE_TLS breakage, fix a warning --- src/mesa/drivers/x11/glxapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 5f11c90c13c..309a0008d76 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -141,7 +141,7 @@ static void SetCurrentContext(GLXContext c) { #if defined(GLX_USE_TLS) - CurrentContext = context; + CurrentContext = c; #elif defined(THREADS) _glthread_SetTSD(&ContextTSD, c); #else @@ -1169,7 +1169,7 @@ _glxapi_get_extensions(void) #ifdef GLX_SGIX_pbuffer "GLX_SGIX_pbuffer", #endif -#ifdef GLX_EXT_texture_from_pixmap, +#ifdef GLX_EXT_texture_from_pixmap "GLX_EXT_texture_from_pixmap", #endif NULL -- cgit v1.2.3 From edf07417be431ec36c340e21c6c4b6d51eb74363 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 12 Jun 2007 09:47:03 -0600 Subject: Fix TEXREL issues when using GLX_USE_TLS (see bug 7459). --- src/mesa/glapi/gl_x86_asm.py | 15 ++++++++++++--- src/mesa/glapi/glapi.c | 20 +++++++++++--------- src/mesa/x86/glapi_x86.S | 14 +++++++++++--- 3 files changed, 34 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py index 650331a0c5a..403e87261b0 100644 --- a/src/mesa/glapi/gl_x86_asm.py +++ b/src/mesa/glapi/gl_x86_asm.py @@ -82,12 +82,18 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '' print '#ifdef GLX_USE_TLS' print '' + print '#ifdef GLX_X86_READONLY_TEXT' + print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)' + print '#else' + print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */' + print '#endif' + print '' print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' print 'ALIGNTEXT16;\t\t\t\t\t\t\\' print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' print '\tCALL(_x86_get_dispatch) ;\t\t\t\\' - print '\tNOP ;\t\t\t\t\t\t\\' + print '\tCTX_INSNS ; \\' print '\tJMP(GL_OFFSET(off))' print '' print '#elif defined(PTHREADS)' @@ -138,7 +144,10 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tHIDDEN(GLNAME(_x86_get_dispatch))' print 'ALIGNTEXT16' print 'GLNAME(_x86_get_dispatch):' - print '\tmovl\t%gs:_glapi_tls_Dispatch@NTPOFF, %eax' + print '\tcall 1f' + print '1:\tpopl %eax' + print '\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax' + print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax' print '\tret' print '' print '#elif defined(PTHREADS)' @@ -158,7 +167,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '#endif' print '' - print '#if defined( GLX_USE_TLS )' + print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )' print '\t\t.section\twtext, "awx", @progbits' print '#endif /* defined( GLX_USE_TLS ) */' diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 5815dbff842..47c57822732 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -1028,22 +1028,24 @@ _glapi_check_table(const struct _glapi_table *table) #if defined(PTHREADS) || defined(GLX_USE_TLS) /** * Perform platform-specific GL API entry-point fixups. - * - * */ static void init_glapi_relocs( void ) { -#if defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) - extern void * _x86_get_dispatch(void); - const GLubyte * const get_disp = (const GLubyte *) _x86_get_dispatch; +#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) + extern unsigned long _x86_get_dispatch(void); + char run_time_patch[] = { + 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ + }; + GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ + const GLubyte * const get_disp = (const GLubyte *) run_time_patch; GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; - + *offset = _x86_get_dispatch(); while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { - (void) memcpy( curr_func, get_disp, 6 ); + (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); curr_func += DISPATCH_FUNCTION_SIZE; } -#endif /* defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) */ -} #endif +} +#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index bdf42ac0887..74e93721bc3 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -58,12 +58,17 @@ #ifdef GLX_USE_TLS +#ifdef GLX_X86_READONLY_TEXT +# define CTX_INSNS MOV_L(GS:(EAX), EAX) +#else +# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */ +#endif # define GL_STUB(fn,off,fn_alt) \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ CALL(_x86_get_dispatch) ; \ - NOP ; \ + CTX_INSNS ; \ JMP(GL_OFFSET(off)) #elif defined(PTHREADS) @@ -114,7 +119,10 @@ SEG_TEXT HIDDEN(GLNAME(_x86_get_dispatch)) ALIGNTEXT16 GLNAME(_x86_get_dispatch): - movl %gs:_glapi_tls_Dispatch@NTPOFF, %eax + call 1f +1: popl %eax + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax + movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax ret #elif defined(PTHREADS) @@ -133,7 +141,7 @@ GLNAME(_x86_get_dispatch): EXTERN GLNAME(_glapi_get_dispatch) #endif -#if defined( GLX_USE_TLS ) +#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT ) .section wtext, "awx", @progbits #endif /* defined( GLX_USE_TLS ) */ -- cgit v1.2.3 From ef82f004fab29f5aff809a31cbcb51e381df1a49 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 12 Jun 2007 15:08:43 -0600 Subject: fix comment --- src/mesa/main/imports.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index ca5f079f72a..8a5dfdb4b80 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -20,7 +20,7 @@ /* * Mesa 3-D graphics library - * Version: 7.0 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -254,7 +254,7 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ) *dst++ = val; } -/** Wrapper around either memcpy() or bzero() */ +/** Wrapper around either memset() or bzero() */ void _mesa_bzero( void *dst, size_t n ) { -- cgit v1.2.3 From 261ed740749a7f358573ba470c25ed78d4abd2c4 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 12 Jun 2007 17:06:27 -0600 Subject: fix make clean commands so missing subdirs don't cause infinite loops --- src/mesa/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/Makefile b/src/mesa/Makefile index c03c5f80ff2..6943219036d 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -176,9 +176,9 @@ clean: -rm -f */*/*.o -rm -f depend depend.bak libmesa.a -rm -f drivers/*/*.o - (cd drivers/dri ; $(MAKE) clean) - (cd x86 ; $(MAKE) clean) - (cd x86-64 ; $(MAKE) clean) + (cd drivers/dri && $(MAKE) clean) + (cd x86 && $(MAKE) clean) + (cd x86-64 && $(MAKE) clean) include depend -- cgit v1.2.3 From 144e1e439faf994ad25901aaf2a9d60a1078eed9 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 12 Jun 2007 17:17:43 -0600 Subject: fix an error string, refactor _mesa_GetCompressedTexImageARB() to get rid of a goto --- src/mesa/main/teximage.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index f315c3de74e..f902365b9bd 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -3768,7 +3768,7 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, width, height, depth, /*size*/ format, imageSize); if (error) { - _mesa_error(ctx, error, "glCompressedTexSubImage2D"); + _mesa_error(ctx, error, "glCompressedTexSubImage3D"); return; } @@ -3819,7 +3819,6 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); if (!texObj) { @@ -3840,24 +3839,25 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) return; } - _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (!texImage) { - /* probably invalid mipmap level */ - _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)"); - goto out; + if (texImage) { + if (texImage->IsCompressed) { + /* this typically calls _mesa_get_compressed_teximage() */ + ctx->Driver.GetCompressedTexImage(ctx, target, level, img, + texObj, texImage); + } + else { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImageARB"); + } } - - if (!texImage->IsCompressed) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImageARB"); - goto out; + else { + /* probably invalid mipmap level */ + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetCompressedTexImageARB(level)"); } - - /* this typically calls _mesa_get_compressed_teximage() */ - ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj,texImage); } - out: _mesa_unlock_texture(ctx, texObj); } -- cgit v1.2.3 From 40cc47f8ee635c131af1328089d4a918555659e2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 13 Jun 2007 12:56:48 +1000 Subject: move clip to r300 emit --- src/mesa/drivers/dri/r300/r300_emit.c | 4 +++- src/mesa/drivers/dri/r300/r300_render.c | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 4670c28a02f..e8f0f89cf3f 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -358,9 +358,11 @@ int r300EmitArrays(GLcontext * ctx) DECLARE_RENDERINPUTS(render_inputs_bitset); RENDERINPUTS_COPY(render_inputs_bitset, tnl->render_inputs_bitset); + vb->AttribPtr[VERT_ATTRIB_POS] = vb->ClipPtr; + assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_POS)); assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_NORMAL) == 0); - assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_COLOR0)); + //assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_COLOR0)); if (RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_POS)) { InputsRead |= 1 << VERT_ATTRIB_POS; diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 83999307b56..7770cbbacb5 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -293,11 +293,10 @@ static GLboolean r300RunRender(GLcontext * ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = &tnl->vb; + if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); - if (hw_tcl_on == GL_FALSE) - vb->AttribPtr[VERT_ATTRIB_POS] = vb->ClipPtr; r300UpdateShaders(rmesa); if (r300EmitArrays(ctx)) return GL_TRUE; -- cgit v1.2.3 From f6963f57d9d1e9bf630c05c1c89f188091b12fc5 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Thu, 14 Jun 2007 00:44:16 +0200 Subject: nouveau: remove useless viewport xform with id matrix. --- src/mesa/drivers/dri/nouveau/nv10_swtcl.c | 45 ++++++++++--------------------- 1 file changed, 14 insertions(+), 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c index 3bc84d862d3..4576c1ede4d 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c @@ -392,15 +392,6 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa) int i; int slots=0; int total_size=0; - /* t_vertex_generic dereferences a NULL pointer if we - * pass NULL as the vp transform... - */ - const GLfloat ident_vp[16] = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }; nmesa->vertex_attr_count = 0; RENDERINPUTS_COPY(index, nmesa->render_inputs_bitset); @@ -431,28 +422,20 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa) if (RENDERINPUTS_TEST(index, i)) { slots=i+1; - if (i==_TNL_ATTRIB_POS) - { - /* special-case POS */ - EMIT_ATTR(_TNL_ATTRIB_POS,EMIT_3F_VIEWPORT); - } - else + switch(attr_size[i]) { - switch(attr_size[i]) - { - case 1: - EMIT_ATTR(i,EMIT_1F); - break; - case 2: - EMIT_ATTR(i,EMIT_2F); - break; - case 3: - EMIT_ATTR(i,EMIT_3F); - break; - case 4: - EMIT_ATTR(i,EMIT_4F); - break; - } + case 1: + EMIT_ATTR(i,EMIT_1F); + break; + case 2: + EMIT_ATTR(i,EMIT_2F); + break; + case 3: + EMIT_ATTR(i,EMIT_3F); + break; + case 4: + EMIT_ATTR(i,EMIT_4F); + break; } if (i==_TNL_ATTRIB_COLOR0) nmesa->color_offset=total_size; @@ -465,7 +448,7 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa) nmesa->vertex_size=_tnl_install_attrs( ctx, nmesa->vertex_attrs, nmesa->vertex_attr_count, - ident_vp, 0 ); + NULL, 0 ); assert(nmesa->vertex_size==total_size*4); /* -- cgit v1.2.3 From bc81885bb2b498449a1362997ca67dd53f97d2e7 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 14 Jun 2007 15:26:39 +1000 Subject: Initial r300 modes for swtcl it compiles!! --- src/mesa/drivers/dri/r300/Makefile | 1 + src/mesa/drivers/dri/r300/r300_context.c | 4 +- src/mesa/drivers/dri/r300/r300_context.h | 67 +++- src/mesa/drivers/dri/r300/r300_swtcl.c | 570 +++++++++++++++++++++++++++++++ 4 files changed, 640 insertions(+), 2 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/r300_swtcl.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index c1d223c7600..44248964fdb 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -41,6 +41,7 @@ DRIVER_SOURCES = \ r300_fragprog.c \ r300_shader.c \ r300_emit.c \ + r300_swtcl.c \ $(EGL_SOURCES) C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 9ea14ab4c78..311d003633a 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -63,6 +63,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_ioctl.h" #include "r300_tex.h" #include "r300_emit.h" +#include "r300_swtcl.h" #ifdef USER_BUFFERS #include "r300_mem.h" @@ -164,7 +165,7 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = { /* Else do them here. */ - &_r300_render_stage, + // &_r300_render_stage, &_tnl_render_stage, /* FALLBACK */ 0, }; @@ -363,6 +364,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, radeonInitSpanFuncs(ctx); r300InitCmdBuf(r300); r300InitState(r300); + r300InitSwtcl(ctx); TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 076bb49a006..5e07cbd88fd 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -600,6 +600,11 @@ struct r300_vertex_shader_state { extern int hw_tcl_on; +#define COLOR_IS_RGBA +#define TAG(x) r300##x +#include "tnl_dd/t_dd_vertex.h" +#undef TAG + //#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current) #define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->selected_vp) @@ -796,7 +801,8 @@ struct r300_state { GLuint *Elts; struct r300_dma_region elt_dma; - DECLARE_RENDERINPUTS(render_inputs_bitset); /* actual render inputs that R300 was configured for. + struct r300_dma_region swtcl_dma; + DECLARE_RENDERINPUTS(render_inputs_bitset); /* actual render inputs that R300 was configured for. They are the same as tnl->render_inputs for fixed pipeline */ struct { @@ -811,6 +817,62 @@ struct r300_state { #define R300_FALLBACK_TCL 1 #define R300_FALLBACK_RAST 2 +/* r300_swtcl.c + */ +struct r300_swtcl_info { + GLuint RenderIndex; + + /** + * Size of a hardware vertex. This is calculated when \c ::vertex_attrs is + * installed in the Mesa state vector. + */ + GLuint vertex_size; + + /** + * Attributes instructing the Mesa TCL pipeline where / how to put vertex + * data in the hardware buffer. + */ + struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; + + /** + * Number of elements of \c ::vertex_attrs that are actually used. + */ + GLuint vertex_attr_count; + + /** + * Cached pointer to the buffer where Mesa will store vertex data. + */ + GLubyte *verts; + + /* Fallback rasterization functions + */ + // r200_point_func draw_point; + // r200_line_func draw_line; + // r200_tri_func draw_tri; + + GLuint hw_primitive; + GLenum render_primitive; + GLuint numverts; + + /** + * Offset of the 4UB color data within a hardware (swtcl) vertex. + */ + GLuint coloroffset; + + /** + * Offset of the 3UB specular color data within a hardware (swtcl) vertex. + */ + GLuint specoffset; + + /** + * Should Mesa project vertex data or will the hardware do it? + */ + GLboolean needproj; + + struct r300_dma_region indexed_verts; +}; + + /** * \brief R300 context structure. */ @@ -849,6 +911,9 @@ struct r300_context { GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; GLboolean disable_lowimpact_fallback; + + DECLARE_RENDERINPUTS(tnl_index_bitset); /* index of bits for last tnl_install_attrs */ + struct r300_swtcl_info swtcl; }; struct r300_buffer_object { diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c new file mode 100644 index 00000000000..3ed454de484 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -0,0 +1,570 @@ +/************************************************************************** + +Copyright (C) 2007 Dave Airlie + +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 +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: + * Dave Airlie + */ + +/* derived from r200 swtcl path */ + + + +#include "glheader.h" +#include "mtypes.h" +#include "colormac.h" +#include "enums.h" +#include "image.h" +#include "imports.h" +#include "macros.h" + +#include "swrast/s_context.h" +#include "swrast/s_fog.h" +#include "swrast_setup/swrast_setup.h" +#include "math/m_translate.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" + +#include "r300_context.h" +#include "r300_swtcl.h" +#include "r300_state.h" +#include "r300_ioctl.h" + +#define EMIT_ATTR( ATTR, STYLE, F0 ) \ +do { \ + rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = (ATTR); \ + rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].format = (STYLE); \ + rmesa->swtcl.vertex_attr_count++; \ + vap_fmt_0 |= F0; \ +} while (0) + +#define EMIT_PAD( N ) \ +do { \ + rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = 0; \ + rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].format = EMIT_PAD; \ + rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].offset = (N); \ + rmesa->swtcl.vertex_attr_count++; \ +} while (0) + +static void r300SetVertexFormat( GLcontext *ctx ) +{ + r300ContextPtr rmesa = R300_CONTEXT( ctx ); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + DECLARE_RENDERINPUTS(index_bitset); + int vap_fmt_0 = 0; + int vap_fmt_1 = 0; + int vap_vte_cntl = 0; + int offset = 0; + + RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); + + /* Important: + */ + if ( VB->NdcPtr != NULL ) { + VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; + } + else { + VB->AttribPtr[VERT_ATTRIB_POS] = VB->ClipPtr; + } + + assert( VB->AttribPtr[VERT_ATTRIB_POS] != NULL ); + rmesa->swtcl.vertex_attr_count = 0; + + /* EMIT_ATTR's must be in order as they tell t_vertex.c how to + * build up a hardware vertex. + */ + if ( !rmesa->swtcl.needproj || + RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { /* need w coord for projected textures */ + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT); + vap_vte_cntl |= R300_VTX_XY_FMT | R300_VTX_Z_FMT | R300_VTX_W0_FMT; + + offset = 4; + } + else { + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT ); + vap_vte_cntl |= R300_VTX_XY_FMT | R300_VTX_Z_FMT; + offset = 3; + } + + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { + EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT); + offset += 1; + } + + rmesa->swtcl.coloroffset = offset; +#if MESA_LITTLE_ENDIAN + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT ); +#else + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_ABGR, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT ); +#endif + offset += 1; + + rmesa->swtcl.specoffset = 0; + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || + RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { + +#if MESA_LITTLE_ENDIAN + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { + rmesa->swtcl.specoffset = offset; + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + } + else { + EMIT_PAD( 3 ); + } + + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { + EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + } + else { + EMIT_PAD( 1 ); + } +#else + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { + EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + } + else { + EMIT_PAD( 1 ); + } + + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { + rmesa->swtcl.specoffset = offset; + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + } + else { + EMIT_PAD( 3 ); + } +#endif + } + + if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { + int i; + + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { + GLuint sz = VB->TexCoordPtr[i]->size; + + vap_fmt_1 |= sz << (3 * i); + EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_1F + sz - 1, 0 ); + } + } + } + +#if 0 + if ( (rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] & R200_FOG_USE_MASK) + != R200_FOG_USE_SPEC_ALPHA ) { + R200_STATECHANGE( rmesa, ctx ); + rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_USE_MASK; + rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= R200_FOG_USE_SPEC_ALPHA; + } +#endif + + if (!RENDERINPUTS_EQUAL( rmesa->tnl_index_bitset, index_bitset ) || + (rmesa->hw.vof.cmd[R300_VOF_CNTL_0] != vap_fmt_0) || + (rmesa->hw.vof.cmd[R300_VOF_CNTL_1] != vap_fmt_1) ) { +// R200_NEWPRIM(rmesa); + R300_STATECHANGE(rmesa, vof); + rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = + vap_fmt_0; + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = + vap_fmt_1; + + rmesa->swtcl.vertex_size = + _tnl_install_attrs( ctx, + rmesa->swtcl.vertex_attrs, + rmesa->swtcl.vertex_attr_count, + NULL, 0 ); + rmesa->swtcl.vertex_size /= 4; + RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); + } +} + +static void * +r300AllocDmaLowVerts( r300ContextPtr rmesa, int nverts, int vsize ) +{ + GLuint bytes = vsize * nverts; + + r300AllocDmaRegion(rmesa, &rmesa->state.swtcl_dma, bytes, 0); + + rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; + rmesa->swtcl.numverts += nverts; + + return (rmesa->dma.current.address + rmesa->dma.current.ptr); +} + +static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ); +static void r300RenderPrimitive( GLcontext *ctx, GLenum prim ); +//static void r300ResetLineStipple( GLcontext *ctx ); + + +static const GLenum reduced_prim[GL_POLYGON+1] = { + GL_POINTS, + GL_LINES, + GL_LINES, + GL_LINES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES +}; + + +/*********************************************************************** + * Emit primitives as inline vertices * + ***********************************************************************/ + + +#define HAVE_POINTS 1 +#define HAVE_LINES 1 +#define HAVE_LINE_STRIPS 1 +#define HAVE_TRIANGLES 1 +#define HAVE_TRI_STRIPS 1 +#define HAVE_TRI_STRIP_1 0 +#define HAVE_TRI_FANS 1 +#define HAVE_QUADS 0 +#define HAVE_QUAD_STRIPS 0 +#define HAVE_POLYGONS 1 +#define HAVE_ELTS 1 + +#undef LOCAL_VARS +#undef ALLOC_VERTS +#define CTX_ARG r300ContextPtr rmesa +#define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size +#define ALLOC_VERTS( n, size ) r300AllocDmaLowVerts( rmesa, n, size * 4 ) +#define LOCAL_VARS \ + r300ContextPtr rmesa = R300_CONTEXT(ctx); \ + const char *r300verts = (char *)rmesa->swtcl.verts; +#define VERT(x) (r300Vertex *)(r300verts + ((x) * vertsize * sizeof(int))) +#define VERTEX r300Vertex +#define DO_DEBUG_VERTS (1 && (RADEON_DEBUG & DEBUG_VERTS)) + +#undef TAG +#define TAG(x) r300_##x +#include "tnl_dd/t_dd_triemit.h" + + + +/*********************************************************************** + * Macros for t_dd_tritmp.h to draw basic primitives * + ***********************************************************************/ + +#define QUAD( a, b, c, d ) r300_quad( rmesa, a, b, c, d ) +#define TRI( a, b, c ) r300_triangle( rmesa, a, b, c ) +#define LINE( a, b ) r300_line( rmesa, a, b ) +#define POINT( a ) r300_point( rmesa, a ) + +/*********************************************************************** + * Build render functions from dd templates * + ***********************************************************************/ + +#define R300_TWOSIDE_BIT 0x01 +#define R300_UNFILLED_BIT 0x02 +#define R300_MAX_TRIFUNC 0x04 + +static struct { + tnl_points_func points; + tnl_line_func line; + tnl_triangle_func triangle; + tnl_quad_func quad; +} rast_tab[R300_MAX_TRIFUNC]; + +#define DO_FALLBACK 0 +#define DO_UNFILLED (IND & R300_UNFILLED_BIT) +#define DO_TWOSIDE (IND & R300_TWOSIDE_BIT) +#define DO_FLAT 0 +#define DO_OFFSET 0 +#define DO_TRI 1 +#define DO_QUAD 1 +#define DO_LINE 1 +#define DO_POINTS 1 +#define DO_FULL_QUAD 1 + +#define HAVE_RGBA 1 +#define HAVE_SPEC 1 +#define HAVE_BACK_COLORS 0 +#define HAVE_HW_FLATSHADE 1 +#define TAB rast_tab + +#define DEPTH_SCALE 1.0 +#define UNFILLED_TRI unfilled_tri +#define UNFILLED_QUAD unfilled_quad +#define VERT_X(_v) _v->v.x +#define VERT_Y(_v) _v->v.y +#define VERT_Z(_v) _v->v.z +#define AREA_IS_CCW( a ) (a < 0) +#define GET_VERTEX(e) (rmesa->swtcl.verts + (e*rmesa->swtcl.vertex_size*sizeof(int))) + +#define VERT_SET_RGBA( v, c ) \ +do { \ + r300_color_t *color = (r300_color_t *)&((v)->ui[coloroffset]); \ + UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \ + UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \ + UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \ + UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \ +} while (0) + +#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset] + +#define VERT_SET_SPEC( v, c ) \ +do { \ + if (specoffset) { \ + r300_color_t *spec = (r300_color_t *)&((v)->ui[specoffset]); \ + UNCLAMPED_FLOAT_TO_UBYTE(spec->red, (c)[0]); \ + UNCLAMPED_FLOAT_TO_UBYTE(spec->green, (c)[1]); \ + UNCLAMPED_FLOAT_TO_UBYTE(spec->blue, (c)[2]); \ + } \ +} while (0) +#define VERT_COPY_SPEC( v0, v1 ) \ +do { \ + if (specoffset) { \ + r300_color_t *spec0 = (r300_color_t *)&((v0)->ui[specoffset]); \ + r300_color_t *spec1 = (r300_color_t *)&((v1)->ui[specoffset]); \ + spec0->red = spec1->red; \ + spec0->green = spec1->green; \ + spec0->blue = spec1->blue; \ + } \ +} while (0) + +/* These don't need LE32_TO_CPU() as they used to save and restore + * colors which are already in the correct format. + */ +#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset] +#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx] +#define VERT_SAVE_SPEC( idx ) if (specoffset) spec[idx] = v[idx]->ui[specoffset] +#define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx] + +#undef LOCAL_VARS +#undef TAG +#undef INIT + +#define LOCAL_VARS(n) \ + r300ContextPtr rmesa = R300_CONTEXT(ctx); \ + GLuint color[n], spec[n]; \ + GLuint coloroffset = rmesa->swtcl.coloroffset; \ + GLuint specoffset = rmesa->swtcl.specoffset; \ + (void) color; (void) spec; (void) coloroffset; (void) specoffset; + +/*********************************************************************** + * Helpers for rendering unfilled primitives * + ***********************************************************************/ + +#define RASTERIZE(x) r300RasterPrimitive( ctx, reduced_prim[x] ) +#define RENDER_PRIMITIVE rmesa->swtcl.render_primitive +#undef TAG +#define TAG(x) x +#include "tnl_dd/t_dd_unfilled.h" +#undef IND + + +/*********************************************************************** + * Generate GL render functions * + ***********************************************************************/ + + +#define IND (0) +#define TAG(x) x +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (R300_TWOSIDE_BIT) +#define TAG(x) x##_twoside +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (R300_UNFILLED_BIT) +#define TAG(x) x##_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (R300_TWOSIDE_BIT|R300_UNFILLED_BIT) +#define TAG(x) x##_twoside_unfilled +#include "tnl_dd/t_dd_tritmp.h" + + +static void init_rast_tab( void ) +{ + init(); + init_twoside(); + init_unfilled(); + init_twoside_unfilled(); +} + +/**********************************************************************/ +/* Render unclipped begin/end objects */ +/**********************************************************************/ + +#define RENDER_POINTS( start, count ) \ + for ( ; start < count ; start++) \ + r300_point( rmesa, VERT(start) ) +#define RENDER_LINE( v0, v1 ) \ + r300_line( rmesa, VERT(v0), VERT(v1) ) +#define RENDER_TRI( v0, v1, v2 ) \ + r300_triangle( rmesa, VERT(v0), VERT(v1), VERT(v2) ) +#define RENDER_QUAD( v0, v1, v2, v3 ) \ + r300_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) +#define INIT(x) do { \ + r300RenderPrimitive( ctx, x ); \ +} while (0) +#undef LOCAL_VARS +#define LOCAL_VARS \ + r300ContextPtr rmesa = R300_CONTEXT(ctx); \ + const GLuint vertsize = rmesa->swtcl.vertex_size; \ + const char *r300verts = (char *)rmesa->swtcl.verts; \ + const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ + const GLboolean stipple = ctx->Line.StippleFlag; \ + (void) elt; (void) stipple; +#define RESET_STIPPLE //if ( stipple ) r200ResetLineStipple( ctx ); +#define RESET_OCCLUSION +#define PRESERVE_VB_DEFS +#define ELT(x) (x) +#define TAG(x) r300_##x##_verts +#include "tnl/t_vb_rendertmp.h" +#undef ELT +#undef TAG +#define TAG(x) r300_##x##_elts +#define ELT(x) elt[x] +#include "tnl/t_vb_rendertmp.h" + + + + +/**********************************************************************/ +/* Choose render functions */ +/**********************************************************************/ + +void r300ChooseRenderState( GLcontext *ctx ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + r300ContextPtr rmesa = R300_CONTEXT(ctx); + GLuint index = 0; + GLuint flags = ctx->_TriangleCaps; + + // if (!rmesa->TclFallback || rmesa->Fallback) +// return; + +// if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R200_TWOSIDE_BIT; +// if (flags & DD_TRI_UNFILLED) index |= R200_UNFILLED_BIT; + + if (index != rmesa->swtcl.RenderIndex) { + tnl->Driver.Render.Points = rast_tab[index].points; + tnl->Driver.Render.Line = rast_tab[index].line; + tnl->Driver.Render.ClippedLine = rast_tab[index].line; + tnl->Driver.Render.Triangle = rast_tab[index].triangle; + tnl->Driver.Render.Quad = rast_tab[index].quad; + + if (index == 0) { + tnl->Driver.Render.PrimTabVerts = r300_render_tab_verts; + tnl->Driver.Render.PrimTabElts = r300_render_tab_elts; + tnl->Driver.Render.ClippedPolygon = r300_fast_clipped_poly; + } else { + tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; + tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; + tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; + } + + rmesa->swtcl.RenderIndex = index; + } +} + + +static void r300RenderStart(GLcontext *ctx) +{ + fprintf(stderr, "%s\n", __FUNCTION__); + + r300SetVertexFormat(ctx); +} + +static void r300RenderFinish(GLcontext *ctx) +{ + fprintf(stderr, "%s\n", __FUNCTION__); +} + +static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ) +{ + r300ContextPtr rmesa = R300_CONTEXT(ctx); + + if (rmesa->swtcl.hw_primitive != hwprim) { +// R300_NEWPRIM( rmesa ); + rmesa->swtcl.hw_primitive = hwprim; + } +} + +static void r300RenderPrimitive(GLcontext *ctx, GLenum prim) +{ + + r300ContextPtr rmesa = R300_CONTEXT(ctx); + rmesa->swtcl.render_primitive = prim; + if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) + r300RasterPrimitive( ctx, reduced_prim[prim] ); + fprintf(stderr, "%s\n", __FUNCTION__); + +} + +static void r300ResetLineStipple(GLcontext *ctx) +{ + + +} + +void r300InitSwtcl(GLcontext *ctx) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + r300ContextPtr rmesa = R300_CONTEXT(ctx); + static int firsttime = 1; + + if (firsttime) { + init_rast_tab(); + firsttime = 0; + } + + tnl->Driver.Render.Start = r300RenderStart; + tnl->Driver.Render.Finish = r300RenderFinish; + tnl->Driver.Render.PrimitiveNotify = r300RenderPrimitive; + tnl->Driver.Render.ResetLineStipple = r300ResetLineStipple; + tnl->Driver.Render.BuildVertices = _tnl_build_vertices; + tnl->Driver.Render.CopyPV = _tnl_copy_pv; + tnl->Driver.Render.Interp = _tnl_interp; + + /* FIXME: what are these numbers? */ + _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, + 36 * sizeof(GLfloat) ); + + rmesa->swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf; + rmesa->swtcl.RenderIndex = ~0; + rmesa->swtcl.render_primitive = GL_TRIANGLES; + rmesa->swtcl.hw_primitive = 0; + + r300ChooseRenderState(ctx); +} + +void r300DestroySwtcl(GLcontext *ctx) +{ + r300ContextPtr rmesa = R300_CONTEXT(ctx); +// if (rmesa->swtcl.indexed_verts.buf) +// r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ ); + +} -- cgit v1.2.3 From 9cde7fb61dd26cd98a26dcb0a54197e8d28ac3be Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Fri, 15 Jun 2007 15:24:35 +0200 Subject: i915tex: Missing piece of SetTexOffset hook implementation for I830 generation. --- src/mesa/drivers/dri/i915tex/i830_vtbl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c index dd0670dec37..e432648ada0 100644 --- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c @@ -490,11 +490,13 @@ i830_emit_state(struct intel_context *intel) DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, state->tex_offset[i] | TM0S0_USE_FENCE); } - else { - assert(i == 0); - assert(state == &i830->meta); - OUT_BATCH(0); - } + else if (state == &i830->meta) { + assert(i == 0); + OUT_BATCH(0); + } + else { + OUT_BATCH(state->tex_offset[i]); + } OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S1]); OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S2]); -- cgit v1.2.3 From d42888dac3a0b648bf1babfde77e0e104e036831 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 17 Jun 2007 14:17:11 +1000 Subject: add more swtcl code to r300 - hangs card now --- src/mesa/drivers/dri/r300/r300_ioctl.c | 9 ++- src/mesa/drivers/dri/r300/r300_swtcl.c | 102 +++++++++++++++++++++++++++++++-- 2 files changed, 103 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 15c2cf3ad7b..52345855fe3 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -412,13 +412,16 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask) void r300Flush(GLcontext * ctx) { - r300ContextPtr r300 = R300_CONTEXT(ctx); + r300ContextPtr rmesa = R300_CONTEXT(ctx); if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s\n", __FUNCTION__); - if (r300->cmdbuf.count_used > r300->cmdbuf.count_reemit) - r300FlushCmdBuf(r300, __FUNCTION__); + if (rmesa->dma.flush) + rmesa->dma.flush( rmesa ); + + if (rmesa->cmdbuf.count_used > rmesa->cmdbuf.count_reemit) + r300FlushCmdBuf(rmesa, __FUNCTION__); } #ifdef USER_BUFFERS diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 3ed454de484..7a3ddcd503f 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -54,7 +54,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_swtcl.h" #include "r300_state.h" #include "r300_ioctl.h" +#include "r300_emit.h" +#include "r300_mem.h" +static void flush_last_swtcl_prim( r300ContextPtr rmesa ); + +void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset); +void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr); #define EMIT_ATTR( ATTR, STYLE, F0 ) \ do { \ rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = (ATTR); \ @@ -204,6 +210,45 @@ static void r300SetVertexFormat( GLcontext *ctx ) } } + +/* Flush vertices in the current dma region. + */ +static void flush_last_swtcl_prim( r300ContextPtr rmesa ) +{ + if (RADEON_DEBUG & DEBUG_IOCTL) + fprintf(stderr, "%s\n", __FUNCTION__); + + rmesa->dma.flush = NULL; + + if (rmesa->dma.current.buf) { + struct r300_dma_region *current = &rmesa->dma.current; + // GLuint current_offset = rmesa->state.swtcl_dma.aos_offset; + + GLuint current_offset = r300_mem_offset(rmesa,current->buf->id); + // assert (!(rmesa->swtcl.hw_primitive & R200_VF_PRIM_WALK_IND)); + + assert (current->start + + rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == + current->ptr); + + if (rmesa->dma.current.start != rmesa->dma.current.ptr) { + // r200EnsureCmdBufSpace( rmesa, VERT_AOS_BUFSZ + + // rmesa->hw.max_state_size + VBUF_BUFSZ ); + r300EmitVertexAOS( rmesa, + rmesa->swtcl.vertex_size, + current_offset); + + r300EmitVbufPrim( rmesa, + rmesa->swtcl.hw_primitive, + rmesa->swtcl.numverts); + } + + rmesa->swtcl.numverts = 0; + current->start = current->ptr; + } +} + + static void * r300AllocDmaLowVerts( r300ContextPtr rmesa, int nverts, int vsize ) { @@ -211,9 +256,14 @@ r300AllocDmaLowVerts( r300ContextPtr rmesa, int nverts, int vsize ) r300AllocDmaRegion(rmesa, &rmesa->state.swtcl_dma, bytes, 0); - rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; - rmesa->swtcl.numverts += nverts; + if (!rmesa->dma.flush) { + rmesa->dma.flush = flush_last_swtcl_prim; + rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; + } + + rmesa->swtcl.numverts += nverts; + rmesa->dma.current.ptr += bytes; return (rmesa->dma.current.address + rmesa->dma.current.ptr); } @@ -221,6 +271,11 @@ static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ); static void r300RenderPrimitive( GLcontext *ctx, GLenum prim ); //static void r300ResetLineStipple( GLcontext *ctx ); +static void r300PrintVertex(r300Vertex *v) +{ + fprintf(stderr,"Vertex %p\n", v); + +} static const GLenum reduced_prim[GL_POLYGON+1] = { GL_POINTS, @@ -264,7 +319,7 @@ static const GLenum reduced_prim[GL_POLYGON+1] = { #define VERT(x) (r300Vertex *)(r300verts + ((x) * vertsize * sizeof(int))) #define VERTEX r300Vertex #define DO_DEBUG_VERTS (1 && (RADEON_DEBUG & DEBUG_VERTS)) - +#define PRINT_VERTEX(x) r300PrintVertex(x) #undef TAG #define TAG(x) r300_##x #include "tnl_dd/t_dd_triemit.h" @@ -466,8 +521,8 @@ void r300ChooseRenderState( GLcontext *ctx ) // if (!rmesa->TclFallback || rmesa->Fallback) // return; -// if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R200_TWOSIDE_BIT; -// if (flags & DD_TRI_UNFILLED) index |= R200_UNFILLED_BIT; + if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R300_TWOSIDE_BIT; + if (flags & DD_TRI_UNFILLED) index |= R300_UNFILLED_BIT; if (index != rmesa->swtcl.RenderIndex) { tnl->Driver.Render.Points = rast_tab[index].points; @@ -493,9 +548,13 @@ void r300ChooseRenderState( GLcontext *ctx ) static void r300RenderStart(GLcontext *ctx) { + r300ContextPtr rmesa = R300_CONTEXT( ctx ); fprintf(stderr, "%s\n", __FUNCTION__); r300SetVertexFormat(ctx); + if (rmesa->dma.flush != 0 && + rmesa->dma.flush != flush_last_swtcl_prim) + rmesa->dma.flush( rmesa ); } static void r300RenderFinish(GLcontext *ctx) @@ -558,6 +617,10 @@ void r300InitSwtcl(GLcontext *ctx) rmesa->swtcl.render_primitive = GL_TRIANGLES; rmesa->swtcl.hw_primitive = 0; + _tnl_invalidate_vertex_state( ctx, ~0 ); + _tnl_invalidate_vertices( ctx, ~0 ); + RENDERINPUTS_ZERO( rmesa->tnl_index_bitset ); + r300ChooseRenderState(ctx); } @@ -568,3 +631,32 @@ void r300DestroySwtcl(GLcontext *ctx) // r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ ); } + +void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset) +{ + int cmd_reserved = 0; + int cmd_written = 0; + + drm_radeon_cmd_header_t *cmd = NULL; + if (1)//RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s: vertex_size %d, offset 0x%x \n", + __FUNCTION__, vertex_size, offset); + + start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2); + e32(1); + e32(vertex_size | (vertex_size << 8)); + e32(offset); +} + +void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr) +{ + + int cmd_reserved = 0; + int cmd_written = 0; + + drm_radeon_cmd_header_t *cmd = NULL; + r300EmitState(rmesa); + + start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0), 0); + e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_nr << 16) | primitive); +} -- cgit v1.2.3 From aaf76906e8dcad06a1af26863a6c1faf12014692 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 17 Jun 2007 14:27:58 +1000 Subject: add missing swtcl file --- src/mesa/drivers/dri/r300/r300_swtcl.h | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/mesa/drivers/dri/r300/r300_swtcl.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.h b/src/mesa/drivers/dri/r300/r300_swtcl.h new file mode 100644 index 00000000000..92362b745bc --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_swtcl.h @@ -0,0 +1,75 @@ +/* +Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. + +The Weather Channel (TM) funded Tungsten Graphics to develop the +initial release of the Radeon 8500 driver under the XFree86 license. +This notice must be preserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + * Authors: + * Keith Whitwell + */ + +#ifndef __R300_SWTCL_H__ +#define __R300_SWTCL_H__ + +#include "mtypes.h" +#include "swrast/swrast.h" +#include "r300_context.h" + +extern void r300InitSwtcl( GLcontext *ctx ); +extern void r300DestroySwtcl( GLcontext *ctx ); + +#if 0 +extern void r200ChooseRenderState( GLcontext *ctx ); +extern void r200ChooseVertexState( GLcontext *ctx ); + +extern void r200CheckTexSizes( GLcontext *ctx ); + +extern void r200BuildVertices( GLcontext *ctx, GLuint start, GLuint count, + GLuint newinputs ); + +extern void r200PrintSetupFlags(char *msg, GLuint flags ); + + +extern void r200_emit_indexed_verts( GLcontext *ctx, + GLuint start, + GLuint count ); + +extern void r200_translate_vertex( GLcontext *ctx, + const r200Vertex *src, + SWvertex *dst ); + +extern void r200_print_vertex( GLcontext *ctx, const r200Vertex *v ); + +extern void r200_import_float_colors( GLcontext *ctx ); +extern void r200_import_float_spec_colors( GLcontext *ctx ); + +extern void r200PointsBitmap( GLcontext *ctx, GLint px, GLint py, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap ); +#endif + +#endif -- cgit v1.2.3 From 3b8cf84aa5019c0770ef13c571ec17f31041b25a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 17 Jun 2007 14:47:09 +1000 Subject: fixup packet setup - still hangs --- src/mesa/drivers/dri/r300/r300_emit.h | 2 ++ src/mesa/drivers/dri/r300/r300_render.c | 6 +++--- src/mesa/drivers/dri/r300/r300_swtcl.c | 31 +++++++++++++++++-------------- 3 files changed, 22 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 2f79ee3a23a..ce7279bbef4 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -225,5 +225,7 @@ void r300UseArrays(GLcontext * ctx); #endif extern void r300ReleaseArrays(GLcontext * ctx); +extern int r300PrimitiveType(r300ContextPtr rmesa, int prim); +extern int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim); #endif diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 7770cbbacb5..7d97245281f 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -79,7 +79,7 @@ extern int future_hw_tcl_on; /** * \brief Convert a OpenGL primitive type into a R300 primitive type. */ -static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) +int r300PrimitiveType(r300ContextPtr rmesa, int prim) { switch (prim & PRIM_MODE_MASK) { case GL_POINTS: @@ -119,7 +119,7 @@ static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) } } -static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) +int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) { int verts_off = 0; @@ -261,7 +261,7 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = &tnl->vb; - type = r300PrimitiveType(rmesa, ctx, prim); + type = r300PrimitiveType(rmesa, prim); num_verts = r300NumVerts(rmesa, end - start, prim); if (type < 0 || num_verts <= 0) diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 7a3ddcd503f..f724a8e6f85 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -637,15 +637,15 @@ void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset) int cmd_reserved = 0; int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - if (1)//RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s: vertex_size %d, offset 0x%x \n", - __FUNCTION__, vertex_size, offset); - - start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2); - e32(1); - e32(vertex_size | (vertex_size << 8)); - e32(offset); + drm_radeon_cmd_header_t *cmd = NULL; + if (1)//RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s: vertex_size %d, offset 0x%x \n", + __FUNCTION__, vertex_size, offset); + + start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2); + e32(1); + e32(vertex_size | (vertex_size << 8)); + e32(offset); } void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr) @@ -653,10 +653,13 @@ void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr) int cmd_reserved = 0; int cmd_written = 0; + int type, num_verts; + drm_radeon_cmd_header_t *cmd = NULL; - drm_radeon_cmd_header_t *cmd = NULL; - r300EmitState(rmesa); - - start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0), 0); - e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_nr << 16) | primitive); + type = r300PrimitiveType(rmesa, primitive); + num_verts = r300NumVerts(rmesa, vertex_nr, primitive); + r300EmitState(rmesa); + + start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0), 0); + e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (num_verts << 16) | type); } -- cgit v1.2.3 From 780ae9f17d23dc1a553e66298d223582f8a7f022 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 17 Jun 2007 15:05:43 +1000 Subject: cleaned up reduced prim --- src/mesa/drivers/dri/r300/r300_swtcl.c | 53 ++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index f724a8e6f85..fc101c3e75b 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -57,8 +57,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_emit.h" #include "r300_mem.h" +#define R300_NEWPRIM( rmesa ) \ + do { \ + if ( rmesa->dma.flush ) \ + rmesa->dma.flush( rmesa ); \ + } while (0) + static void flush_last_swtcl_prim( r300ContextPtr rmesa ); + void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset); void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr); #define EMIT_ATTR( ATTR, STYLE, F0 ) \ @@ -193,7 +200,7 @@ static void r300SetVertexFormat( GLcontext *ctx ) if (!RENDERINPUTS_EQUAL( rmesa->tnl_index_bitset, index_bitset ) || (rmesa->hw.vof.cmd[R300_VOF_CNTL_0] != vap_fmt_0) || (rmesa->hw.vof.cmd[R300_VOF_CNTL_1] != vap_fmt_1) ) { -// R200_NEWPRIM(rmesa); + R300_NEWPRIM(rmesa); R300_STATECHANGE(rmesa, vof); rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = vap_fmt_0; @@ -267,6 +274,26 @@ r300AllocDmaLowVerts( r300ContextPtr rmesa, int nverts, int vsize ) return (rmesa->dma.current.address + rmesa->dma.current.ptr); } + +static INLINE GLuint reduced_hw_prim( GLcontext *ctx, GLuint prim) +{ + switch (prim) { + case GL_POINTS: + return R300_VAP_VF_CNTL__PRIM_POINTS; + case GL_LINES: + return R300_VAP_VF_CNTL__PRIM_LINES; + /* fallthrough */ + case GL_LINE_LOOP: + return R300_VAP_VF_CNTL__PRIM_LINE_LOOP; + /* fallthrough */ + case GL_LINE_STRIP: + return R300_VAP_VF_CNTL__PRIM_LINE_STRIP; + default: + /* all others reduced to triangles */ + return R300_VAP_VF_CNTL__PRIM_TRIANGLES; + } +} + static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ); static void r300RenderPrimitive( GLcontext *ctx, GLenum prim ); //static void r300ResetLineStipple( GLcontext *ctx ); @@ -277,20 +304,6 @@ static void r300PrintVertex(r300Vertex *v) } -static const GLenum reduced_prim[GL_POLYGON+1] = { - GL_POINTS, - GL_LINES, - GL_LINES, - GL_LINES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES -}; - - /*********************************************************************** * Emit primitives as inline vertices * ***********************************************************************/ @@ -430,7 +443,7 @@ do { \ * Helpers for rendering unfilled primitives * ***********************************************************************/ -#define RASTERIZE(x) r300RasterPrimitive( ctx, reduced_prim[x] ) +#define RASTERIZE(x) r300RasterPrimitive( ctx, reduced_hw_prim(ctx, x) ) #define RENDER_PRIMITIVE rmesa->swtcl.render_primitive #undef TAG #define TAG(x) x @@ -567,7 +580,7 @@ static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ) r300ContextPtr rmesa = R300_CONTEXT(ctx); if (rmesa->swtcl.hw_primitive != hwprim) { -// R300_NEWPRIM( rmesa ); + R300_NEWPRIM( rmesa ); rmesa->swtcl.hw_primitive = hwprim; } } @@ -578,7 +591,7 @@ static void r300RenderPrimitive(GLcontext *ctx, GLenum prim) r300ContextPtr rmesa = R300_CONTEXT(ctx); rmesa->swtcl.render_primitive = prim; if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) - r300RasterPrimitive( ctx, reduced_prim[prim] ); + r300RasterPrimitive( ctx, reduced_hw_prim(ctx, prim) ); fprintf(stderr, "%s\n", __FUNCTION__); } @@ -626,10 +639,6 @@ void r300InitSwtcl(GLcontext *ctx) void r300DestroySwtcl(GLcontext *ctx) { - r300ContextPtr rmesa = R300_CONTEXT(ctx); -// if (rmesa->swtcl.indexed_verts.buf) -// r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ ); - } void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset) -- cgit v1.2.3 From 492bc67df1ceefe7580e8d7129f6f11a2f11ea67 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 17 Jun 2007 15:44:42 +1000 Subject: swtcl add debug and fix offset --- src/mesa/drivers/dri/r300/r300_swtcl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index fc101c3e75b..e7c2d8f4965 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -231,7 +231,8 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) struct r300_dma_region *current = &rmesa->dma.current; // GLuint current_offset = rmesa->state.swtcl_dma.aos_offset; - GLuint current_offset = r300_mem_offset(rmesa,current->buf->id); + GLuint current_offset; + current_offset = GET_START(current); // assert (!(rmesa->swtcl.hw_primitive & R200_VF_PRIM_WALK_IND)); assert (current->start + @@ -669,6 +670,7 @@ void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr) num_verts = r300NumVerts(rmesa, vertex_nr, primitive); r300EmitState(rmesa); + fprintf(stderr, "num verts is %d, type is %d\n", num_verts, type); start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0), 0); e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (num_verts << 16) | type); } -- cgit v1.2.3 From 4a841b969ae0f05a4982215a0fc087be12c53e0c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 17 Jun 2007 19:55:13 +1000 Subject: more commits to fix things and stuff - still not doing anything except crashin --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- src/mesa/drivers/dri/r300/r300_swtcl.c | 55 +++++++++++++++++++++++---------- 2 files changed, 39 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 7055286ba95..aebc895d63f 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -54,7 +54,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_state.h" // Set this to 1 for extremely verbose debugging of command buffers -#define DEBUG_CMDBUF 0 +#define DEBUG_CMDBUF 1 /** * Send the current command buffer via ioctl to the hardware. diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index e7c2d8f4965..a7acee84800 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -112,18 +112,10 @@ static void r300SetVertexFormat( GLcontext *ctx ) /* EMIT_ATTR's must be in order as they tell t_vertex.c how to * build up a hardware vertex. */ - if ( !rmesa->swtcl.needproj || - RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { /* need w coord for projected textures */ - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT); - vap_vte_cntl |= R300_VTX_XY_FMT | R300_VTX_Z_FMT | R300_VTX_W0_FMT; - - offset = 4; - } - else { - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT ); - vap_vte_cntl |= R300_VTX_XY_FMT | R300_VTX_Z_FMT; - offset = 3; - } + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT); + // vap_vte_cntl |= R300_VTX_XY_FMT | R300_VTX_Z_FMT | R300_VTX_W0_FMT; + + offset = 4; if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT); @@ -212,6 +204,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) rmesa->swtcl.vertex_attrs, rmesa->swtcl.vertex_attr_count, NULL, 0 ); + fprintf(stderr,"Vap fmt 0 %08X, 1 %08X %d \n", vap_fmt_0, vap_fmt_1, rmesa->swtcl.vertex_size); + rmesa->swtcl.vertex_size /= 4; RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); } @@ -261,18 +255,19 @@ static void * r300AllocDmaLowVerts( r300ContextPtr rmesa, int nverts, int vsize ) { GLuint bytes = vsize * nverts; - + GLubyte *head; r300AllocDmaRegion(rmesa, &rmesa->state.swtcl_dma, bytes, 0); - + + fprintf(stderr, "Alloc DMA region %d\n", bytes); if (!rmesa->dma.flush) { rmesa->dma.flush = flush_last_swtcl_prim; rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; } - + head = (GLubyte *)(rmesa->dma.current.address + rmesa->dma.current.ptr); rmesa->swtcl.numverts += nverts; rmesa->dma.current.ptr += bytes; - return (rmesa->dma.current.address + rmesa->dma.current.ptr); + return head; } @@ -525,6 +520,19 @@ static void init_rast_tab( void ) /* Choose render functions */ /**********************************************************************/ +void r300ChooseVertexState( GLcontext *ctx ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + r300ContextPtr rmesa = R300_CONTEXT(ctx); + GLuint vte[2]; + _tnl_need_projected_coords( ctx, GL_FALSE ); + + vte[0] = rmesa->hw.vte.cmd[0]; + vte[1] = rmesa->hw.vte.cmd[1]; + + +} + void r300ChooseRenderState( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -636,6 +644,7 @@ void r300InitSwtcl(GLcontext *ctx) RENDERINPUTS_ZERO( rmesa->tnl_index_bitset ); r300ChooseRenderState(ctx); + // r300ChooseVertexState(ctx); } void r300DestroySwtcl(GLcontext *ctx) @@ -646,12 +655,23 @@ void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset) { int cmd_reserved = 0; int cmd_written = 0; + int vte; drm_radeon_cmd_header_t *cmd = NULL; if (1)//RADEON_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s: vertex_size %d, offset 0x%x \n", __FUNCTION__, vertex_size, offset); - + + /* emit vte */ + vte = rmesa->hw.vte.cmd[1]; + if (vertex_size == 5) { + vte &= ~R300_VTX_W0_FMT; + vte |= R300_VTX_XY_FMT; + } + R300_STATECHANGE(rmesa, vte); + rmesa->hw.vte.cmd[1] = vte; + rmesa->hw.vte.cmd[2] = vertex_size; + start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2); e32(1); e32(vertex_size | (vertex_size << 8)); @@ -668,6 +688,7 @@ void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr) type = r300PrimitiveType(rmesa, primitive); num_verts = r300NumVerts(rmesa, vertex_nr, primitive); + r300EmitState(rmesa); fprintf(stderr, "num verts is %d, type is %d\n", num_verts, type); -- cgit v1.2.3 From 2a6082b5319a21e0af8dc30516c38f7e7d704b04 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 20 Jun 2007 18:01:47 +1000 Subject: swtcl: gears works --- src/mesa/drivers/dri/r300/r300_ioctl.c | 2 +- src/mesa/drivers/dri/r300/r300_ioctl.h | 1 + src/mesa/drivers/dri/r300/r300_swtcl.c | 295 ++++++++++++++++++--------------- 3 files changed, 161 insertions(+), 137 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 52345855fe3..664a36a78b3 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -427,7 +427,7 @@ void r300Flush(GLcontext * ctx) #ifdef USER_BUFFERS #include "r300_mem.h" -static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) +void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) { struct r300_dma_buffer *dmabuf; size = MAX2(size, RADEON_BUFFER_SIZE * 16); diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h index 7a19a2cf3f9..e1143fb6c34 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.h +++ b/src/mesa/drivers/dri/r300/r300_ioctl.h @@ -56,4 +56,5 @@ extern void r300AllocDmaRegion(r300ContextPtr rmesa, extern void r300InitIoctlFuncs(struct dd_function_table *functions); +extern void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size); #endif /* __R300_IOCTL_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index a7acee84800..ab771aba87b 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -68,12 +68,11 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ); void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset); void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr); -#define EMIT_ATTR( ATTR, STYLE, F0 ) \ +#define EMIT_ATTR( ATTR, STYLE ) \ do { \ rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = (ATTR); \ rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].format = (STYLE); \ rmesa->swtcl.vertex_attr_count++; \ - vap_fmt_0 |= F0; \ } while (0) #define EMIT_PAD( N ) \ @@ -92,11 +91,19 @@ static void r300SetVertexFormat( GLcontext *ctx ) DECLARE_RENDERINPUTS(index_bitset); int vap_fmt_0 = 0; int vap_fmt_1 = 0; + int vic_0 = 0, vic_1 = 0; int vap_vte_cntl = 0; int offset = 0; + int vte = 0; + + DECLARE_RENDERINPUTS(render_inputs_bitset); + + RENDERINPUTS_COPY(render_inputs_bitset, tnl->render_inputs_bitset); RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); + RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, render_inputs_bitset); + /* Important: */ if ( VB->NdcPtr != NULL ) { @@ -112,23 +119,30 @@ static void r300SetVertexFormat( GLcontext *ctx ) /* EMIT_ATTR's must be in order as they tell t_vertex.c how to * build up a hardware vertex. */ - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT); - // vap_vte_cntl |= R300_VTX_XY_FMT | R300_VTX_Z_FMT | R300_VTX_W0_FMT; - + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F ); + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; + vap_vte_cntl |= R300_VTX_W0_FMT; + vic_1 |= R300_INPUT_CNTL_POS; + offset = 4; if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { - EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT); - offset += 1; + EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F ); + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; + offset += 1; } rmesa->swtcl.coloroffset = offset; #if MESA_LITTLE_ENDIAN - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT ); + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); #else - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_ABGR, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT ); + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); #endif - offset += 1; + + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT; + vic_1 |= R300_INPUT_CNTL_COLOR; + vic_0 |= 1; + offset += 4; rmesa->swtcl.specoffset = 0; if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || @@ -137,21 +151,25 @@ static void r300SetVertexFormat( GLcontext *ctx ) #if MESA_LITTLE_ENDIAN if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3F ); + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; + vic_0 |= (1<<2); } else { EMIT_PAD( 3 ); } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F ); + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; } else { EMIT_PAD( 1 ); } #else if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F ); + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; } else { EMIT_PAD( 1 ); @@ -159,7 +177,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT ); + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR ); + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; } else { EMIT_PAD( 3 ); @@ -175,7 +194,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) GLuint sz = VB->TexCoordPtr[i]->size; vap_fmt_1 |= sz << (3 * i); - EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_1F + sz - 1, 0 ); + vic_1 |= 0x400 << i; + EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_1F + sz - 1 ); } } } @@ -189,25 +209,30 @@ static void r300SetVertexFormat( GLcontext *ctx ) } #endif - if (!RENDERINPUTS_EQUAL( rmesa->tnl_index_bitset, index_bitset ) || - (rmesa->hw.vof.cmd[R300_VOF_CNTL_0] != vap_fmt_0) || - (rmesa->hw.vof.cmd[R300_VOF_CNTL_1] != vap_fmt_1) ) { - R300_NEWPRIM(rmesa); - R300_STATECHANGE(rmesa, vof); - rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = - vap_fmt_0; - rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = - vap_fmt_1; + R300_STATECHANGE(rmesa, vic); + rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = 0x1; + rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = vic_1; + + R300_STATECHANGE(rmesa, vof); + rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = vap_fmt_0; + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = vap_fmt_1; + + if (!RENDERINPUTS_EQUAL( rmesa->tnl_index_bitset, index_bitset)) { + rmesa->swtcl.vertex_size = _tnl_install_attrs( ctx, rmesa->swtcl.vertex_attrs, rmesa->swtcl.vertex_attr_count, NULL, 0 ); - fprintf(stderr,"Vap fmt 0 %08X, 1 %08X %d \n", vap_fmt_0, vap_fmt_1, rmesa->swtcl.vertex_size); rmesa->swtcl.vertex_size /= 4; RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); + + vte = rmesa->hw.vte.cmd[1]; + R300_STATECHANGE(rmesa, vte); + rmesa->hw.vte.cmd[1] = vte; + rmesa->hw.vte.cmd[2] = rmesa->swtcl.vertex_size; } } @@ -223,19 +248,14 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) if (rmesa->dma.current.buf) { struct r300_dma_region *current = &rmesa->dma.current; - // GLuint current_offset = rmesa->state.swtcl_dma.aos_offset; - - GLuint current_offset; - current_offset = GET_START(current); - // assert (!(rmesa->swtcl.hw_primitive & R200_VF_PRIM_WALK_IND)); + GLuint current_offset = GET_START(current); assert (current->start + rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == current->ptr); if (rmesa->dma.current.start != rmesa->dma.current.ptr) { - // r200EnsureCmdBufSpace( rmesa, VERT_AOS_BUFSZ + - // rmesa->hw.max_state_size + VBUF_BUFSZ ); + r300EmitVertexAOS( rmesa, rmesa->swtcl.vertex_size, current_offset); @@ -250,56 +270,54 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) } } - +/* Alloc space in the current dma region. + */ static void * r300AllocDmaLowVerts( r300ContextPtr rmesa, int nverts, int vsize ) { - GLuint bytes = vsize * nverts; - GLubyte *head; - r300AllocDmaRegion(rmesa, &rmesa->state.swtcl_dma, bytes, 0); - - fprintf(stderr, "Alloc DMA region %d\n", bytes); - if (!rmesa->dma.flush) { - rmesa->dma.flush = flush_last_swtcl_prim; - rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; - } - - head = (GLubyte *)(rmesa->dma.current.address + rmesa->dma.current.ptr); - rmesa->swtcl.numverts += nverts; - rmesa->dma.current.ptr += bytes; - return head; -} + GLuint bytes = vsize * nverts; + if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end ) + r300RefillCurrentDmaRegion( rmesa, bytes); -static INLINE GLuint reduced_hw_prim( GLcontext *ctx, GLuint prim) -{ - switch (prim) { - case GL_POINTS: - return R300_VAP_VF_CNTL__PRIM_POINTS; - case GL_LINES: - return R300_VAP_VF_CNTL__PRIM_LINES; - /* fallthrough */ - case GL_LINE_LOOP: - return R300_VAP_VF_CNTL__PRIM_LINE_LOOP; - /* fallthrough */ - case GL_LINE_STRIP: - return R300_VAP_VF_CNTL__PRIM_LINE_STRIP; - default: - /* all others reduced to triangles */ - return R300_VAP_VF_CNTL__PRIM_TRIANGLES; + if (!rmesa->dma.flush) { + rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; + rmesa->dma.flush = flush_last_swtcl_prim; } -} -static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ); -static void r300RenderPrimitive( GLcontext *ctx, GLenum prim ); -//static void r300ResetLineStipple( GLcontext *ctx ); + ASSERT( vsize == rmesa->swtcl.vertex_size * 4 ); + ASSERT( rmesa->dma.flush == flush_last_swtcl_prim ); + ASSERT( rmesa->dma.current.start + + rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == + rmesa->dma.current.ptr ); -static void r300PrintVertex(r300Vertex *v) -{ - fprintf(stderr,"Vertex %p\n", v); + + { + GLubyte *head = (GLubyte *) (rmesa->dma.current.address + rmesa->dma.current.ptr); + rmesa->dma.current.ptr += bytes; + rmesa->swtcl.numverts += nverts; + return head; + } } +static GLuint reduced_prim[] = { + GL_POINTS, + GL_LINES, + GL_LINES, + GL_LINES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, +}; + +static void r300RasterPrimitive( GLcontext *ctx, GLuint prim ); +static void r300RenderPrimitive( GLcontext *ctx, GLenum prim ); +//static void r300ResetLineStipple( GLcontext *ctx ); + /*********************************************************************** * Emit primitives as inline vertices * ***********************************************************************/ @@ -313,7 +331,7 @@ static void r300PrintVertex(r300Vertex *v) #define HAVE_TRI_STRIP_1 0 #define HAVE_TRI_FANS 1 #define HAVE_QUADS 0 -#define HAVE_QUAD_STRIPS 0 +#define HAVE_QUAD_STRIPS 1 #define HAVE_POLYGONS 1 #define HAVE_ELTS 1 @@ -328,7 +346,7 @@ static void r300PrintVertex(r300Vertex *v) #define VERT(x) (r300Vertex *)(r300verts + ((x) * vertsize * sizeof(int))) #define VERTEX r300Vertex #define DO_DEBUG_VERTS (1 && (RADEON_DEBUG & DEBUG_VERTS)) -#define PRINT_VERTEX(x) r300PrintVertex(x) +#define PRINT_VERTEX(x) #undef TAG #define TAG(x) r300_##x #include "tnl_dd/t_dd_triemit.h" @@ -385,42 +403,31 @@ static struct { #define AREA_IS_CCW( a ) (a < 0) #define GET_VERTEX(e) (rmesa->swtcl.verts + (e*rmesa->swtcl.vertex_size*sizeof(int))) -#define VERT_SET_RGBA( v, c ) \ -do { \ - r300_color_t *color = (r300_color_t *)&((v)->ui[coloroffset]); \ - UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \ - UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \ - UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \ - UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \ +/* Only used to pull back colors into vertices (ie, we know color is + * floating point). + */ +#define R300_COLOR( dst, src ) \ +do { \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[0], (src)[2]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[1], (src)[1]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[2], (src)[0]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[3], (src)[3]); \ } while (0) -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset] +#define VERT_SET_RGBA( v, c ) if (coloroffset) R300_COLOR( v->ub4[coloroffset], c ) +#define VERT_COPY_RGBA( v0, v1 ) if (coloroffset) v0->ui[coloroffset] = v1->ui[coloroffset] +#define VERT_SAVE_RGBA( idx ) if (coloroffset) color[idx] = v[idx]->ui[coloroffset] +#define VERT_RESTORE_RGBA( idx ) if (coloroffset) v[idx]->ui[coloroffset] = color[idx] -#define VERT_SET_SPEC( v, c ) \ -do { \ - if (specoffset) { \ - r300_color_t *spec = (r300_color_t *)&((v)->ui[specoffset]); \ - UNCLAMPED_FLOAT_TO_UBYTE(spec->red, (c)[0]); \ - UNCLAMPED_FLOAT_TO_UBYTE(spec->green, (c)[1]); \ - UNCLAMPED_FLOAT_TO_UBYTE(spec->blue, (c)[2]); \ - } \ -} while (0) -#define VERT_COPY_SPEC( v0, v1 ) \ +#define R300_SPEC( dst, src ) \ do { \ - if (specoffset) { \ - r300_color_t *spec0 = (r300_color_t *)&((v0)->ui[specoffset]); \ - r300_color_t *spec1 = (r300_color_t *)&((v1)->ui[specoffset]); \ - spec0->red = spec1->red; \ - spec0->green = spec1->green; \ - spec0->blue = spec1->blue; \ - } \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[0], (src)[2]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[1], (src)[1]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[2], (src)[0]); \ } while (0) -/* These don't need LE32_TO_CPU() as they used to save and restore - * colors which are already in the correct format. - */ -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx] +#define VERT_SET_SPEC( v, c ) if (specoffset) R300_SPEC( v->ub4[specoffset], c ) +#define VERT_COPY_SPEC( v0, v1 ) if (specoffset) COPY_3V(v0->ub4[specoffset], v1->ub4[specoffset]) #define VERT_SAVE_SPEC( idx ) if (specoffset) spec[idx] = v[idx]->ui[specoffset] #define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx] @@ -439,7 +446,7 @@ do { \ * Helpers for rendering unfilled primitives * ***********************************************************************/ -#define RASTERIZE(x) r300RasterPrimitive( ctx, reduced_hw_prim(ctx, x) ) +#define RASTERIZE(x) r300RasterPrimitive( ctx, reduced_prim[x] ) #define RENDER_PRIMITIVE rmesa->swtcl.render_primitive #undef TAG #define TAG(x) x @@ -469,6 +476,7 @@ do { \ #include "tnl_dd/t_dd_tritmp.h" + static void init_rast_tab( void ) { init(); @@ -491,7 +499,7 @@ static void init_rast_tab( void ) #define RENDER_QUAD( v0, v1, v2, v3 ) \ r300_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) #define INIT(x) do { \ - r300RenderPrimitive( ctx, x ); \ + r300RenderPrimitive( ctx, reduced_prim[x] ); \ } while (0) #undef LOCAL_VARS #define LOCAL_VARS \ @@ -519,21 +527,7 @@ static void init_rast_tab( void ) /**********************************************************************/ /* Choose render functions */ /**********************************************************************/ - -void r300ChooseVertexState( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - r300ContextPtr rmesa = R300_CONTEXT(ctx); - GLuint vte[2]; - _tnl_need_projected_coords( ctx, GL_FALSE ); - - vte[0] = rmesa->hw.vte.cmd[0]; - vte[1] = rmesa->hw.vte.cmd[1]; - - -} - -void r300ChooseRenderState( GLcontext *ctx ) +static void r300ChooseRenderState( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -571,9 +565,23 @@ void r300ChooseRenderState( GLcontext *ctx ) static void r300RenderStart(GLcontext *ctx) { r300ContextPtr rmesa = R300_CONTEXT( ctx ); - fprintf(stderr, "%s\n", __FUNCTION__); + int cmd_reserved = 0; + int cmd_written = 0; + drm_radeon_cmd_header_t *cmd = NULL; + // fprintf(stderr, "%s\n", __FUNCTION__); + r300SetVertexFormat(ctx); + + r300UpdateShaderStates(rmesa); + + reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); + e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); + + reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); + e32(R300_RB3D_ZCACHE_UNKNOWN_03); + + if (rmesa->dma.flush != 0 && rmesa->dma.flush != flush_last_swtcl_prim) rmesa->dma.flush( rmesa ); @@ -581,7 +589,16 @@ static void r300RenderStart(GLcontext *ctx) static void r300RenderFinish(GLcontext *ctx) { - fprintf(stderr, "%s\n", __FUNCTION__); + r300ContextPtr rmesa = R300_CONTEXT( ctx ); + int cmd_reserved = 0; + int cmd_written = 0; + drm_radeon_cmd_header_t *cmd = NULL; + + reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); + e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); + + reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); + e32(R300_RB3D_ZCACHE_UNKNOWN_03); } static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ) @@ -600,8 +617,8 @@ static void r300RenderPrimitive(GLcontext *ctx, GLenum prim) r300ContextPtr rmesa = R300_CONTEXT(ctx); rmesa->swtcl.render_primitive = prim; if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) - r300RasterPrimitive( ctx, reduced_hw_prim(ctx, prim) ); - fprintf(stderr, "%s\n", __FUNCTION__); + r300RasterPrimitive( ctx, prim ); + // fprintf(stderr, "%s\n", __FUNCTION__); } @@ -632,7 +649,7 @@ void r300InitSwtcl(GLcontext *ctx) /* FIXME: what are these numbers? */ _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, - 36 * sizeof(GLfloat) ); + 48 * sizeof(GLfloat) ); rmesa->swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf; rmesa->swtcl.RenderIndex = ~0; @@ -643,8 +660,8 @@ void r300InitSwtcl(GLcontext *ctx) _tnl_invalidate_vertices( ctx, ~0 ); RENDERINPUTS_ZERO( rmesa->tnl_index_bitset ); + _tnl_need_projected_coords( ctx, GL_FALSE ); r300ChooseRenderState(ctx); - // r300ChooseVertexState(ctx); } void r300DestroySwtcl(GLcontext *ctx) @@ -656,21 +673,28 @@ void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset) int cmd_reserved = 0; int cmd_written = 0; int vte; + int route0; drm_radeon_cmd_header_t *cmd = NULL; - if (1)//RADEON_DEBUG & DEBUG_VERTS) + if (RADEON_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s: vertex_size %d, offset 0x%x \n", __FUNCTION__, vertex_size, offset); /* emit vte */ - vte = rmesa->hw.vte.cmd[1]; - if (vertex_size == 5) { - vte &= ~R300_VTX_W0_FMT; - vte |= R300_VTX_XY_FMT; - } - R300_STATECHANGE(rmesa, vte); - rmesa->hw.vte.cmd[1] = vte; - rmesa->hw.vte.cmd[2] = vertex_size; + + R300_STATECHANGE(rmesa, vir[0]); + ((drm_r300_cmd_header_t *)rmesa->hw.vir[0].cmd)->packet0.count = 1; + rmesa->hw.vir[0].cmd[1] = 0x22030003; + + R300_STATECHANGE(rmesa, vir[1]); + ((drm_r300_cmd_header_t *)rmesa->hw.vir[1].cmd)->packet0.count = 1; + + route0 = (R300_INPUT_ROUTE_SELECT_X | + (R300_INPUT_ROUTE_SELECT_Y << R300_INPUT_ROUTE_Y_SHIFT) | + (R300_INPUT_ROUTE_SELECT_Z << R300_INPUT_ROUTE_Z_SHIFT) | + (R300_INPUT_ROUTE_SELECT_W << R300_INPUT_ROUTE_W_SHIFT) |(R300_INPUT_ROUTE_ENABLE)); + + rmesa->hw.vir[1].cmd[1] = route0 | (route0 << 16); start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2); e32(1); @@ -691,7 +715,6 @@ void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr) r300EmitState(rmesa); - fprintf(stderr, "num verts is %d, type is %d\n", num_verts, type); start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0), 0); e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (num_verts << 16) | type); } -- cgit v1.2.3 From d7777f45981bf91d2cb31502ba078312b1b4cf13 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 20 Jun 2007 18:02:08 +1000 Subject: fixup some bits of tcl path --- src/mesa/drivers/dri/r300/r300_emit.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index e8f0f89cf3f..adeb688d198 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -217,14 +217,14 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, dw = R300_INPUT_ROUTE_FLOAT | (inputs[tab[i]] << 8) | (attribptr[tab[i]]->size - 1); dw |= (R300_INPUT_ROUTE_FLOAT | (inputs[tab[i + 1]] << 8) | (attribptr[tab[i + 1]]->size - 1)) << 16; if (i + 2 == nr) { - dw |= (1 << (13 + 16)); + dw |= (R300_VAP_INPUT_ROUTE_END << 16); } dst[i >> 1] = dw; } if (nr & 1) { dw = R300_INPUT_ROUTE_FLOAT | (inputs[tab[nr - 1]] << 8) | (attribptr[tab[nr - 1]]->size - 1); - dw |= 1 << 13; + dw |= R300_VAP_INPUT_ROUTE_END; dst[nr >> 1] = dw; } @@ -394,20 +394,18 @@ int r300EmitArrays(GLcontext * ctx) } } - if (!(rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { - /* Fixed, apply to vir0 only */ - memcpy(vir_inputs, inputs, VERT_ATTRIB_MAX * sizeof(int)); - inputs = vir_inputs; - if (InputsRead & VERT_ATTRIB_POS) - inputs[VERT_ATTRIB_POS] = 0; - if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) - inputs[VERT_ATTRIB_COLOR0] = 2; - if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) - inputs[VERT_ATTRIB_COLOR1] = 3; - for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) - if (InputsRead & (1 << i)) - inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); - } + /* Fixed, apply to vir0 only */ + memcpy(vir_inputs, inputs, VERT_ATTRIB_MAX * sizeof(int)); + inputs = vir_inputs; + if (InputsRead & VERT_ATTRIB_POS) + inputs[VERT_ATTRIB_POS] = 0; + if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) + inputs[VERT_ATTRIB_COLOR0] = 2; + if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) + inputs[VERT_ATTRIB_COLOR1] = 3; + for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) + if (InputsRead & (1 << i)) + inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, render_inputs_bitset); } -- cgit v1.2.3 From c1cb5412336be0e1067899318403ea573be9bb4d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 20 Jun 2007 10:55:31 -0600 Subject: copy wpos attrib info into zoomed span (fixes fog perspective correction problem) --- src/mesa/swrast/s_zoom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 78fa137d3fd..1ab5911f2f1 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -162,12 +162,14 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, zoomed_arrays.rgba = zoomed_arrays.attribs[FRAG_ATTRIB_COL0]; #endif + /* copy attribute info (XXX copy all attribs?) */ + COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]); + COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]); + COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]); - /* copy fog interp info */ zoomed.attrStart[FRAG_ATTRIB_FOGC][0] = span->attrStart[FRAG_ATTRIB_FOGC][0]; zoomed.attrStepX[FRAG_ATTRIB_FOGC][0] = span->attrStepX[FRAG_ATTRIB_FOGC][0]; zoomed.attrStepY[FRAG_ATTRIB_FOGC][0] = span->attrStepY[FRAG_ATTRIB_FOGC][0]; - /* XXX copy texcoord info? */ if (format == GL_RGBA || format == GL_RGB) { /* copy Z info */ -- cgit v1.2.3 From b9080dd5493eb23af6c5c494550c7b1cb481ca7b Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 20 Jun 2007 10:56:13 -0600 Subject: fix glDrawPixels + fragment program problem --- src/mesa/swrast/s_span.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 90a3d5545f8..3aaa3395e4c 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1169,10 +1169,17 @@ shade_texture_span(GLcontext *ctx, SWspan *span) if (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { /* programmable shading */ + if (span->primitive == GL_BITMAP) { + if (span->array->ChanType != GL_FLOAT) + convert_color_type(span, GL_FLOAT, 0); + interpolate_active_attribs(ctx, span, ~FRAG_ATTRIB_COL0); + } + else { + /* point, line, triangle */ + interpolate_active_attribs(ctx, span, ~0); + } span->array->ChanType = GL_FLOAT; - interpolate_active_attribs(ctx, span, ~0); - if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z (ctx, span); -- cgit v1.2.3 From a4af3e5ab3fa0f45c25673c93d802cdff087145c Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 20 Jun 2007 11:01:04 -0600 Subject: Effectively disable _TexEnvProgram before calling _swrast_DrawPixels(). It's OK to use _TexEnvProgram regardless of the texture state, but if fog is also enabled, the fragment program is lacking the actual fog computation so fogging doesn't appear. Fixing this might involve a new _MaintainFogProgram field and related code. For now, just disable the _TexEnvProgram and let swrast handle everything. --- src/mesa/drivers/dri/i915/intel_pixel.c | 18 +++++++++++++++--- src/mesa/drivers/dri/i915tex/intel_pixel_draw.c | 14 +++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c index 535cbfcb26e..a52a81bf131 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel.c +++ b/src/mesa/drivers/dri/i915/intel_pixel.c @@ -440,9 +440,21 @@ intelDrawPixels( GLcontext *ctx, fprintf(stderr, "%s\n", __FUNCTION__); if (!intelTryDrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels )) - _swrast_DrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels ); + unpack, pixels )) { + if (ctx->FragmentProgram._Current == + ctx->FragmentProgram._TexEnvProgram) { + /* don't want the i915 texenv program to be applied to DrawPixels */ + struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current; + ctx->FragmentProgram._Current = NULL; + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); + ctx->FragmentProgram._Current = fpSave; + } + else { + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); + } + } } diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c index 10a079896ae..46480da1b12 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c @@ -363,5 +363,17 @@ intelDrawPixels(GLcontext * ctx, if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); - _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels); + if (ctx->FragmentProgram._Current == + ctx->FragmentProgram._TexEnvProgram) { + /* don't want the i915 texenv program to be applied to DrawPixels */ + struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current; + ctx->FragmentProgram._Current = NULL; + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); + ctx->FragmentProgram._Current = fpSave; + } + else { + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); + } } -- cgit v1.2.3 From 08fb0bad728a445adf8eaf4f3978ba9a41b69947 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 10:19:00 +1000 Subject: bring over vertex engine setup code from r300_Render and fix up now have gears going.. + a few other trivial textured demoes --- src/mesa/drivers/dri/r300/r300_swtcl.c | 225 ++++++++++++++++++++++++++++----- 1 file changed, 191 insertions(+), 34 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index ab771aba87b..cf2e4b6e338 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -83,18 +83,142 @@ do { \ rmesa->swtcl.vertex_attr_count++; \ } while (0) +static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, + int *inputs, GLint * tab, GLuint nr) +{ + GLuint i, dw; + + /* type, inputs, stop bit, size */ + for (i = 0; i + 1 < nr; i += 2) { + dw = (inputs[tab[i]] << 8) | 0x3; + dw |= ((inputs[tab[i + 1]] << 8) | 0x3) << 16; + if (i + 2 == nr) { + dw |= (R300_VAP_INPUT_ROUTE_END << 16); + } + dst[i >> 1] = dw; + } + + if (nr & 1) { + dw = (inputs[tab[nr - 1]] << 8) | 0x3; + dw |= R300_VAP_INPUT_ROUTE_END; + dst[nr >> 1] = dw; + } + + return (nr + 1) >> 1; +} + +static GLuint r300VAPInputRoute1Swizzle(int swizzle[4]) +{ + return (swizzle[0] << R300_INPUT_ROUTE_X_SHIFT) | + (swizzle[1] << R300_INPUT_ROUTE_Y_SHIFT) | + (swizzle[2] << R300_INPUT_ROUTE_Z_SHIFT) | + (swizzle[3] << R300_INPUT_ROUTE_W_SHIFT); +} + +static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) +{ + GLuint i; + + for (i = 0; i + 1 < nr; i += 2) { + dst[i >> 1] = r300VAPInputRoute1Swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE; + dst[i >> 1] |= (r300VAPInputRoute1Swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16; + } + + if (nr & 1) { + dst[nr >> 1] = r300VAPInputRoute1Swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + } + + return (nr + 1) >> 1; +} + +static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) +{ + /* No idea what this value means. I have seen other values written to + * this register... */ + return 0x5555; +} + +static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) +{ + r300ContextPtr rmesa = R300_CONTEXT(ctx); + GLuint i, vic_1 = 0; + + if (InputsRead & (1 << VERT_ATTRIB_POS)) + vic_1 |= R300_INPUT_CNTL_POS; + + if (InputsRead & (1 << VERT_ATTRIB_NORMAL)) + vic_1 |= R300_INPUT_CNTL_NORMAL; + + if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) + vic_1 |= R300_INPUT_CNTL_COLOR; + + rmesa->state.texture.tc_count = 0; + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) + if (InputsRead & (1 << (VERT_ATTRIB_TEX0 + i))) { + rmesa->state.texture.tc_count++; + vic_1 |= R300_INPUT_CNTL_TC0 << i; + } + + return vic_1; +} + +static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten) +{ + GLuint ret = 0; + + if (OutputsWritten & (1 << VERT_RESULT_HPOS)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_COL0)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_COL1)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; + +#if 0 + if (OutputsWritten & (1 << VERT_RESULT_BFC0)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_BFC1)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT; + + if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ; +#endif + + if (OutputsWritten & (1 << VERT_RESULT_PSIZ)) + ret |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; + + return ret; +} + +static GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten) +{ + GLuint i, ret = 0; + + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + if (OutputsWritten & (1 << (VERT_RESULT_TEX0 + i))) { + ret |= (4 << (3 * i)); + } + } + + return ret; +} + static void r300SetVertexFormat( GLcontext *ctx ) { r300ContextPtr rmesa = R300_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; DECLARE_RENDERINPUTS(index_bitset); + GLuint InputsRead = 0, OutputsWritten = 0; int vap_fmt_0 = 0; - int vap_fmt_1 = 0; - int vic_0 = 0, vic_1 = 0; int vap_vte_cntl = 0; int offset = 0; int vte = 0; + GLuint inputs[VERT_ATTRIB_MAX]; + GLint tab[VERT_ATTRIB_MAX]; + int swizzle[VERT_ATTRIB_MAX][4]; + GLuint i, nr; DECLARE_RENDERINPUTS(render_inputs_bitset); @@ -120,10 +244,9 @@ static void r300SetVertexFormat( GLcontext *ctx ) * build up a hardware vertex. */ EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F ); - vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; vap_vte_cntl |= R300_VTX_W0_FMT; - vic_1 |= R300_INPUT_CNTL_POS; - + InputsRead |= 1 << VERT_ATTRIB_POS; + OutputsWritten |= 1 << VERT_RESULT_HPOS; offset = 4; if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { @@ -139,9 +262,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); #endif - vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT; - vic_1 |= R300_INPUT_CNTL_COLOR; - vic_0 |= 1; + InputsRead |= 1 << VERT_ATTRIB_COLOR0; + OutputsWritten |= 1 << VERT_RESULT_COL0; offset += 4; rmesa->swtcl.specoffset = 0; @@ -152,8 +274,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3F ); - vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; - vic_0 |= (1<<2); + InputsRead |= 1 << VERT_ATTRIB_COLOR1; + OutputsWritten |= 1 << VERT_RESULT_COL1; } else { EMIT_PAD( 3 ); @@ -161,7 +283,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F ); - vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; + InputsRead |= 1 << VERT_ATTRIB_COLOR1; + OutputsWritten |= 1 << VERT_RESULT_COL1; } else { EMIT_PAD( 1 ); @@ -169,7 +292,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) #else if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F ); - vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; + InputsRead |= 1 << VERT_ATTRIB_COLOR1; + OutputsWritten |= 1 << VERT_RESULT_COL1; } else { EMIT_PAD( 1 ); @@ -178,7 +302,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR ); - vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; + InputsRead |= 1 << VERT_ATTRIB_COLOR1; + OutputsWritten |= 1 << VERT_RESULT_COL1; } else { EMIT_PAD( 3 ); @@ -193,9 +318,9 @@ static void r300SetVertexFormat( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { GLuint sz = VB->TexCoordPtr[i]->size; - vap_fmt_1 |= sz << (3 * i); - vic_1 |= 0x400 << i; - EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_1F + sz - 1 ); + InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); + OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); + EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_4F ); } } } @@ -209,14 +334,60 @@ static void r300SetVertexFormat( GLcontext *ctx ) } #endif + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { + if (InputsRead & (1 << i)) { + inputs[i] = nr++; + } else { + inputs[i] = -1; + } + } + + /* Fixed, apply to vir0 only */ + if (InputsRead & VERT_ATTRIB_POS) + inputs[VERT_ATTRIB_POS] = 0; + if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) + inputs[VERT_ATTRIB_COLOR0] = 2; + if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) + inputs[VERT_ATTRIB_COLOR1] = 3; + for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) + if (InputsRead & (1 << i)) + inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); + + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { + if (InputsRead & (1 << i)) { + tab[nr++] = i; + } + } + + for (i = 0; i < nr; i++) { + int ci, fix, found = 0; + + swizzle[i][0] = SWIZZLE_ZERO; + swizzle[i][1] = SWIZZLE_ZERO; + swizzle[i][2] = SWIZZLE_ZERO; + swizzle[i][3] = SWIZZLE_ONE; + + for (ci = 0; ci < VB->AttribPtr[tab[i]]->size; ci++) { + swizzle[i][ci] = ci; + } + } + + R300_STATECHANGE(rmesa, vir[0]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = + r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], + VB->AttribPtr, inputs, tab, nr); + R300_STATECHANGE(rmesa, vir[1]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = + r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, + nr); R300_STATECHANGE(rmesa, vic); - rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = 0x1; - rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = vic_1; + rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); + rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); R300_STATECHANGE(rmesa, vof); - rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = vap_fmt_0; - rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = vap_fmt_1; + rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); if (!RENDERINPUTS_EQUAL( rmesa->tnl_index_bitset, index_bitset)) { @@ -682,20 +853,6 @@ void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset) /* emit vte */ - R300_STATECHANGE(rmesa, vir[0]); - ((drm_r300_cmd_header_t *)rmesa->hw.vir[0].cmd)->packet0.count = 1; - rmesa->hw.vir[0].cmd[1] = 0x22030003; - - R300_STATECHANGE(rmesa, vir[1]); - ((drm_r300_cmd_header_t *)rmesa->hw.vir[1].cmd)->packet0.count = 1; - - route0 = (R300_INPUT_ROUTE_SELECT_X | - (R300_INPUT_ROUTE_SELECT_Y << R300_INPUT_ROUTE_Y_SHIFT) | - (R300_INPUT_ROUTE_SELECT_Z << R300_INPUT_ROUTE_Z_SHIFT) | - (R300_INPUT_ROUTE_SELECT_W << R300_INPUT_ROUTE_W_SHIFT) |(R300_INPUT_ROUTE_ENABLE)); - - rmesa->hw.vir[1].cmd[1] = route0 | (route0 << 16); - start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2); e32(1); e32(vertex_size | (vertex_size << 8)); -- cgit v1.2.3 From ad8abf71472ac7d8f25764e7a235ce97cf2fa700 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 10:32:39 +1000 Subject: fix quad-clip --- src/mesa/drivers/dri/r300/r300_swtcl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index cf2e4b6e338..3b4e92cd042 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -502,7 +502,7 @@ static void r300RenderPrimitive( GLcontext *ctx, GLenum prim ); #define HAVE_TRI_STRIP_1 0 #define HAVE_TRI_FANS 1 #define HAVE_QUADS 0 -#define HAVE_QUAD_STRIPS 1 +#define HAVE_QUAD_STRIPS 0 #define HAVE_POLYGONS 1 #define HAVE_ELTS 1 @@ -670,7 +670,7 @@ static void init_rast_tab( void ) #define RENDER_QUAD( v0, v1, v2, v3 ) \ r300_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) #define INIT(x) do { \ - r300RenderPrimitive( ctx, reduced_prim[x] ); \ + r300RenderPrimitive( ctx, x ); \ } while (0) #undef LOCAL_VARS #define LOCAL_VARS \ @@ -788,7 +788,7 @@ static void r300RenderPrimitive(GLcontext *ctx, GLenum prim) r300ContextPtr rmesa = R300_CONTEXT(ctx); rmesa->swtcl.render_primitive = prim; if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) - r300RasterPrimitive( ctx, prim ); + r300RasterPrimitive( ctx, reduced_prim[prim] ); // fprintf(stderr, "%s\n", __FUNCTION__); } -- cgit v1.2.3 From 6d8a4312ed0a05c104205236ac1eec69ac457116 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 10:50:27 +1000 Subject: fix projtex --- src/mesa/drivers/dri/r300/r300_swtcl.c | 39 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 3b4e92cd042..c4c928f374f 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -372,25 +372,25 @@ static void r300SetVertexFormat( GLcontext *ctx ) } } - R300_STATECHANGE(rmesa, vir[0]); - ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = - r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], - VB->AttribPtr, inputs, tab, nr); - R300_STATECHANGE(rmesa, vir[1]); - ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = - r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, - nr); - - R300_STATECHANGE(rmesa, vic); - rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); - rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); - - R300_STATECHANGE(rmesa, vof); - rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); - rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); - if (!RENDERINPUTS_EQUAL( rmesa->tnl_index_bitset, index_bitset)) { - + R300_NEWPRIM(rmesa); + R300_STATECHANGE(rmesa, vir[0]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = + r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], + VB->AttribPtr, inputs, tab, nr); + R300_STATECHANGE(rmesa, vir[1]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = + r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, + nr); + + R300_STATECHANGE(rmesa, vic); + rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); + rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); + + R300_STATECHANGE(rmesa, vof); + rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); + rmesa->swtcl.vertex_size = _tnl_install_attrs( ctx, rmesa->swtcl.vertex_attrs, @@ -398,6 +398,7 @@ static void r300SetVertexFormat( GLcontext *ctx ) NULL, 0 ); rmesa->swtcl.vertex_size /= 4; + RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); vte = rmesa->hw.vte.cmd[1]; @@ -752,10 +753,10 @@ static void r300RenderStart(GLcontext *ctx) reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); e32(R300_RB3D_ZCACHE_UNKNOWN_03); - if (rmesa->dma.flush != 0 && rmesa->dma.flush != flush_last_swtcl_prim) rmesa->dma.flush( rmesa ); + } static void r300RenderFinish(GLcontext *ctx) -- cgit v1.2.3 From 025efae411a8146a9766aa863d7baee13c2c79aa Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 10:59:11 +1000 Subject: fix secondary color, fog is off for now --- src/mesa/drivers/dri/r300/r300_swtcl.c | 51 ++++++---------------------------- 1 file changed, 9 insertions(+), 42 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index c4c928f374f..1eb485f7389 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -256,11 +256,10 @@ static void r300SetVertexFormat( GLcontext *ctx ) } rmesa->swtcl.coloroffset = offset; -#if MESA_LITTLE_ENDIAN - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); -#else - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); -#endif + if (_mesa_little_endian()) + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); + else + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); InputsRead |= 1 << VERT_ATTRIB_COLOR0; OutputsWritten |= 1 << VERT_RESULT_COL0; @@ -270,45 +269,22 @@ static void r300SetVertexFormat( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { -#if MESA_LITTLE_ENDIAN + if (_mesa_little_endian()) { if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3F ); + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F ); InputsRead |= 1 << VERT_ATTRIB_COLOR1; OutputsWritten |= 1 << VERT_RESULT_COL1; } - else { - EMIT_PAD( 3 ); - } - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F ); - InputsRead |= 1 << VERT_ATTRIB_COLOR1; - OutputsWritten |= 1 << VERT_RESULT_COL1; - } - else { - EMIT_PAD( 1 ); - } -#else - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F ); - InputsRead |= 1 << VERT_ATTRIB_COLOR1; - OutputsWritten |= 1 << VERT_RESULT_COL1; - } - else { - EMIT_PAD( 1 ); - } + } else { if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR ); + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F ); InputsRead |= 1 << VERT_ATTRIB_COLOR1; OutputsWritten |= 1 << VERT_RESULT_COL1; } - else { - EMIT_PAD( 3 ); - } -#endif + } } if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { @@ -325,15 +301,6 @@ static void r300SetVertexFormat( GLcontext *ctx ) } } -#if 0 - if ( (rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] & R200_FOG_USE_MASK) - != R200_FOG_USE_SPEC_ALPHA ) { - R200_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_USE_MASK; - rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= R200_FOG_USE_SPEC_ALPHA; - } -#endif - for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { if (InputsRead & (1 << i)) { inputs[i] = nr++; -- cgit v1.2.3 From d1be4ab80fc266ba6792ef1151d4bdf804cff92a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 14:20:33 +1000 Subject: fix up vertex emission before state change --- src/mesa/drivers/dri/r300/r300_state.h | 7 +++++++ src/mesa/drivers/dri/r300/r300_swtcl.c | 23 ++++------------------- 2 files changed, 11 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h index 21a49b7f361..365f7ecd0c6 100644 --- a/src/mesa/drivers/dri/r300/r300_state.h +++ b/src/mesa/drivers/dri/r300/r300_state.h @@ -37,8 +37,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" +#define R300_NEWPRIM( rmesa ) \ + do { \ + if ( rmesa->dma.flush ) \ + rmesa->dma.flush( rmesa ); \ + } while (0) + #define R300_STATECHANGE(r300, atom) \ do { \ + R300_NEWPRIM(r300); \ r300->hw.atom.dirty = GL_TRUE; \ r300->hw.is_dirty = GL_TRUE; \ } while(0) diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 1eb485f7389..ab85be37f03 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -57,12 +57,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_emit.h" #include "r300_mem.h" -#define R300_NEWPRIM( rmesa ) \ - do { \ - if ( rmesa->dma.flush ) \ - rmesa->dma.flush( rmesa ); \ - } while (0) - static void flush_last_swtcl_prim( r300ContextPtr rmesa ); @@ -215,7 +209,7 @@ static void r300SetVertexFormat( GLcontext *ctx ) int vap_vte_cntl = 0; int offset = 0; int vte = 0; - GLuint inputs[VERT_ATTRIB_MAX]; + GLint inputs[VERT_ATTRIB_MAX]; GLint tab[VERT_ATTRIB_MAX]; int swizzle[VERT_ATTRIB_MAX][4]; GLuint i, nr; @@ -256,10 +250,7 @@ static void r300SetVertexFormat( GLcontext *ctx ) } rmesa->swtcl.coloroffset = offset; - if (_mesa_little_endian()) - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); - else - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); InputsRead |= 1 << VERT_ATTRIB_COLOR0; OutputsWritten |= 1 << VERT_RESULT_COL0; @@ -292,8 +283,6 @@ static void r300SetVertexFormat( GLcontext *ctx ) for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { - GLuint sz = VB->TexCoordPtr[i]->size; - InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_4F ); @@ -327,8 +316,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) } for (i = 0; i < nr; i++) { - int ci, fix, found = 0; - + int ci; + swizzle[i][0] = SWIZZLE_ZERO; swizzle[i][1] = SWIZZLE_ZERO; swizzle[i][2] = SWIZZLE_ZERO; @@ -811,16 +800,12 @@ void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset) { int cmd_reserved = 0; int cmd_written = 0; - int vte; - int route0; drm_radeon_cmd_header_t *cmd = NULL; if (RADEON_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s: vertex_size %d, offset 0x%x \n", __FUNCTION__, vertex_size, offset); - /* emit vte */ - start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2); e32(1); e32(vertex_size | (vertex_size << 8)); -- cgit v1.2.3 From d3ef71166d032d1f77f0d83eaca76fbf612ac79c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 14:43:53 +1000 Subject: ensure cmd buffer space --- src/mesa/drivers/dri/r300/r300_swtcl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index ab85be37f03..dfa02f95232 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -384,6 +384,7 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) if (rmesa->dma.current.start != rmesa->dma.current.ptr) { + r300EnsureCmdBufSpace( rmesa, rmesa->hw.max_state_size + (8*sizeof(int)), __FUNCTION__); r300EmitVertexAOS( rmesa, rmesa->swtcl.vertex_size, current_offset); -- cgit v1.2.3 From faab84cfa6576a166c93d92e3faf3f3582a3a4bd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 15:07:31 +1000 Subject: fix unfilled tris/quads --- src/mesa/drivers/dri/r300/r300_swtcl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index dfa02f95232..97f1583abdd 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -699,7 +699,8 @@ static void r300RenderStart(GLcontext *ctx) drm_radeon_cmd_header_t *cmd = NULL; // fprintf(stderr, "%s\n", __FUNCTION__); - + + r300ChooseRenderState(ctx); r300SetVertexFormat(ctx); r300UpdateShaderStates(rmesa); @@ -745,8 +746,11 @@ static void r300RenderPrimitive(GLcontext *ctx, GLenum prim) r300ContextPtr rmesa = R300_CONTEXT(ctx); rmesa->swtcl.render_primitive = prim; - if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) - r300RasterPrimitive( ctx, reduced_prim[prim] ); + + if ((prim == GL_TRIANGLES) && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) + return; + + r300RasterPrimitive( ctx, reduced_prim[prim] ); // fprintf(stderr, "%s\n", __FUNCTION__); } -- cgit v1.2.3 From 36235e5ff169985e010659f0e5af0ab9bf6bbf3d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 18:35:00 +1000 Subject: add a mem use for current dma buffer --- src/mesa/drivers/dri/r300/r300_ioctl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 664a36a78b3..f7a44832e9b 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -439,9 +439,12 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) rmesa->dma.flush(rmesa); } - if (rmesa->dma.current.buf) + if (rmesa->dma.current.buf) { +#ifdef USER_BUFFERS + r300_mem_use(rmesa, rmesa->dma.current.buf->id); +#endif r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__); - + } if (rmesa->dma.nr_released_bufs > 4) r300FlushCmdBuf(rmesa, __FUNCTION__); -- cgit v1.2.3 From 41d28d97f5916ff1bdaae525c4de0e53e2dc470c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 21 Jun 2007 18:35:25 +1000 Subject: clean up color0 code --- src/mesa/drivers/dri/r300/r300_swtcl.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 97f1583abdd..35b0235aa14 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -257,25 +257,11 @@ static void r300SetVertexFormat( GLcontext *ctx ) offset += 4; rmesa->swtcl.specoffset = 0; - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || - RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { - - if (_mesa_little_endian()) { - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { - rmesa->swtcl.specoffset = offset; - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F ); - InputsRead |= 1 << VERT_ATTRIB_COLOR1; - OutputsWritten |= 1 << VERT_RESULT_COL1; - } - - } else { - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F ); InputsRead |= 1 << VERT_ATTRIB_COLOR1; OutputsWritten |= 1 << VERT_RESULT_COL1; - } - } } if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { -- cgit v1.2.3 From fe11b2c04bf206bd50654c31e6789519c6c07563 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 21 Jun 2007 09:11:43 -0600 Subject: rename _swrast_update_fragment_attribs() --- src/mesa/swrast/s_context.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index cb3bc756a44..791850cb502 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -535,10 +535,11 @@ _swrast_update_texture_samplers(GLcontext *ctx) /** - * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs, swrast->_ActiveAtttribMask. + * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs, + * swrast->_ActiveAtttribMask. */ static void -_swrast_update_fragment_attribs(GLcontext *ctx) +_swrast_update_active_attribs(GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint attribsMask; @@ -679,7 +680,7 @@ _swrast_validate_derived( GLcontext *ctx ) _NEW_LIGHT | _NEW_PROGRAM | _NEW_TEXTURE)) - _swrast_update_fragment_attribs(ctx); + _swrast_update_active_attribs(ctx); if (swrast->NewState & (_NEW_PROGRAM | _NEW_BUFFERS)) _swrast_update_color_outputs(ctx); -- cgit v1.2.3 From 171dcdfa27dda30916a7f9bfed89577feee5d350 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 21 Jun 2007 09:15:32 -0600 Subject: Another round of fixing attribute interpolation for glDraw/CopyPixels. Need to turn off FRAG_BIT_COL0 in swrast->_ActiveAttribMask when doing glRead/CopyPixels to prevent the user's colors from getting overwritten when a fragment program is active. This was happening in the DRI drivers when MaintainTexEnv program was used (the texenv fragment program was enabled when _swrast_DrawPixels was called). This still isn't an ideal solution, but fixes things for now. --- src/mesa/drivers/dri/i915/intel_pixel.c | 34 ++++++++++++++----------- src/mesa/drivers/dri/i915tex/intel_pixel_draw.c | 9 ++++--- src/mesa/swrast/s_copypix.c | 14 +++++++--- src/mesa/swrast/s_drawpix.c | 17 ++++++++++--- src/mesa/swrast/s_span.c | 16 ++++++------ 5 files changed, 57 insertions(+), 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c index a52a81bf131..d175870a0c5 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel.c +++ b/src/mesa/drivers/dri/i915/intel_pixel.c @@ -439,21 +439,25 @@ intelDrawPixels( GLcontext *ctx, if (INTEL_DEBUG & DEBUG_PIXEL) fprintf(stderr, "%s\n", __FUNCTION__); - if (!intelTryDrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels )) { - if (ctx->FragmentProgram._Current == - ctx->FragmentProgram._TexEnvProgram) { - /* don't want the i915 texenv program to be applied to DrawPixels */ - struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current; - ctx->FragmentProgram._Current = NULL; - _swrast_DrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels ); - ctx->FragmentProgram._Current = fpSave; - } - else { - _swrast_DrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels ); - } + if (intelTryDrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels )) + return; + + if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) { + /* + * We don't want the i915 texenv program to be applied to DrawPixels. + * This is really just a performance optimization (mesa will other- + * wise happily run the fragment program on each pixel in the image). + */ + struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current; + ctx->FragmentProgram._Current = NULL; + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); + ctx->FragmentProgram._Current = fpSave; + } + else { + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); } } diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c index 46480da1b12..77c67c821eb 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c @@ -363,9 +363,12 @@ intelDrawPixels(GLcontext * ctx, if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); - if (ctx->FragmentProgram._Current == - ctx->FragmentProgram._TexEnvProgram) { - /* don't want the i915 texenv program to be applied to DrawPixels */ + if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) { + /* + * We don't want the i915 texenv program to be applied to DrawPixels. + * This is really just a performance optimization (mesa will other- + * wise happily run the fragment program on each pixel in the image). + */ struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current; ctx->FragmentProgram._Current = NULL; _swrast_DrawPixels( ctx, x, y, width, height, format, type, diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 53e584b3b6b..2383015000a 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -188,6 +188,8 @@ static void copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLbitfield prevActiveAttribs = swrast->_ActiveAttribMask; GLfloat *tmpImage, *p; GLint sy, dy, stepy, row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; @@ -197,12 +199,15 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (!ctx->ReadBuffer->_ColorReadBuffer) { /* no readbuffer - OK */ - return; + goto end; } + /* don't interpolate COL0 and overwrite the glDrawPixel colors! */ + swrast->_ActiveAttribMask &= ~FRAG_BIT_COL0; + if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty); - return; + goto end; } else if (ctx->Pixel.Convolution1DEnabled) { /* make sure we don't apply 1D convolution */ @@ -239,7 +244,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - return; + goto end; } /* read the source image as RGBA/float */ p = tmpImage; @@ -294,6 +299,9 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) _mesa_free(tmpImage); + +end: + swrast->_ActiveAttribMask = prevActiveAttribs; } diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index d971d90fb9a..925358d77eb 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -532,16 +532,22 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLbitfield prevActiveAttribs = swrast->_ActiveAttribMask; const GLint imgX = x, imgY = y; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLfloat *convImage = NULL; GLbitfield transferOps = ctx->_ImageTransferState; SWspan span; + /* don't interpolate COL0 and overwrite the glDrawPixel colors! */ + swrast->_ActiveAttribMask &= ~FRAG_BIT_COL0; + /* Try an optimized glDrawPixels first */ if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type, - unpack, pixels)) - return; + unpack, pixels)) { + goto end; + } INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA); _swrast_span_default_attribs(ctx, &span); @@ -559,13 +565,13 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - return; + goto end; } convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { _mesa_free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - return; + goto end; } /* Unpack the image and apply transfer ops up to convolution */ @@ -669,6 +675,9 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, if (convImage) { _mesa_free(convImage); } + +end: + swrast->_ActiveAttribMask = prevActiveAttribs; } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 3aaa3395e4c..431629efb1f 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -171,6 +171,11 @@ interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); + /* for glDraw/CopyPixels() we may have turned off some bits in + * the _ActiveAttribMask - be sure to obey that mask now. + */ + attrMask &= swrast->_ActiveAttribMask; + ATTRIB_LOOP_BEGIN if (attrMask & (1 << attr)) { const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; @@ -1169,15 +1174,10 @@ shade_texture_span(GLcontext *ctx, SWspan *span) if (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { /* programmable shading */ - if (span->primitive == GL_BITMAP) { - if (span->array->ChanType != GL_FLOAT) - convert_color_type(span, GL_FLOAT, 0); - interpolate_active_attribs(ctx, span, ~FRAG_ATTRIB_COL0); - } - else { - /* point, line, triangle */ - interpolate_active_attribs(ctx, span, ~0); + if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) { + convert_color_type(span, GL_FLOAT, 0); } + interpolate_active_attribs(ctx, span, ~0); span->array->ChanType = GL_FLOAT; if (!(span->arrayMask & SPAN_Z)) -- cgit v1.2.3 From ed5ed6fe2f64f45eb3a43f9c57037d9e9b7fa5ea Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 21 Jun 2007 15:53:26 +0000 Subject: r300: Corrected a bug in r300LineWidth. Thanks to Panagiotis Papadakos for reporting it. --- src/mesa/drivers/dri/r300/r300_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index e6c394610dd..bdd6855802b 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -715,7 +715,7 @@ static void r300LineWidth(GLcontext * ctx, GLfloat widthf) widthf = ctx->Line._Width; R300_STATECHANGE(r300, lcntl); - r300->hw.lcntl.cmd[1] |= + r300->hw.lcntl.cmd[1] = R300_LINE_CNT_HO | R300_LINE_CNT_VE | (int)(widthf * 6.0); } -- cgit v1.2.3 From 93becd8a18f6ccf2f86e506ee36fc0bb75787c29 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 21 Jun 2007 16:04:02 -0600 Subject: fix rgba pointer bug hit on zoomed+fogged glDrawPixels --- src/mesa/swrast/s_span.c | 7 +++++-- src/mesa/swrast/s_zoom.c | 17 +++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 431629efb1f..9777391ded2 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1150,6 +1150,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output) span->end, span->array->mask); span->array->ChanType = newType; + span->array->rgba = dst; } @@ -1234,7 +1235,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) const GLbitfield origInterpMask = span->interpMask; const GLbitfield origArrayMask = span->arrayMask; const GLbitfield origArrayAttribs = span->arrayAttribs; - const GLenum chanType = span->array->ChanType; + const GLenum origChanType = span->array->ChanType; + void * const origRgba = span->array->rgba; const GLboolean shader = (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled); const GLboolean shaderOrTexture = shader || ctx->Texture._EnabledUnits; @@ -1456,7 +1458,8 @@ end: span->interpMask = origInterpMask; span->arrayMask = origArrayMask; span->arrayAttribs = origArrayAttribs; - span->array->ChanType = chanType; + span->array->ChanType = origChanType; + span->array->rgba = origRgba; } diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 1ab5911f2f1..ab02e3fbb35 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -153,16 +153,13 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, zoomed.end = zoomedWidth; zoomed.array = &zoomed_arrays; zoomed_arrays.ChanType = span->array->ChanType; - /* XXX temporary */ -#if CHAN_TYPE == GL_UNSIGNED_BYTE - zoomed_arrays.rgba = zoomed_arrays.rgba8; -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - zoomed_arrays.rgba = zoomed_arrays.rgba16; -#else - zoomed_arrays.rgba = zoomed_arrays.attribs[FRAG_ATTRIB_COL0]; -#endif - - /* copy attribute info (XXX copy all attribs?) */ + if (zoomed_arrays.ChanType == GL_UNSIGNED_BYTE) + zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba8; + else if (zoomed_arrays.ChanType == GL_UNSIGNED_SHORT) + zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba16; + else + zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.attribs[FRAG_ATTRIB_COL0]; + COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]); COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]); COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]); -- cgit v1.2.3 From 0f7f6e4e9586b792548349567ba1646fcf1cac44 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 22 Jun 2007 19:18:04 +1000 Subject: clean up cache flush emission into one place makes gears work with swtcl --- src/mesa/drivers/dri/r300/r300_emit.c | 16 ++++++++++++++++ src/mesa/drivers/dri/r300/r300_emit.h | 1 + src/mesa/drivers/dri/r300/r300_ioctl.c | 6 +----- src/mesa/drivers/dri/r300/r300_render.c | 16 ++-------------- src/mesa/drivers/dri/r300/r300_swtcl.c | 26 +++++--------------------- 5 files changed, 25 insertions(+), 40 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index adeb688d198..a7763bd76e6 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -532,3 +532,19 @@ void r300ReleaseArrays(GLcontext * ctx) r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__); } } + +void r300EmitCacheFlush(r300ContextPtr rmesa) +{ + int cmd_reserved = 0; + int cmd_written = 0; + + drm_radeon_cmd_header_t *cmd = NULL; + + reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); + e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); + + reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); + e32(R300_RB3D_ZCACHE_UNKNOWN_03); + + +} diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index ce7279bbef4..400e97f6f85 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -228,4 +228,5 @@ extern void r300ReleaseArrays(GLcontext * ctx); extern int r300PrimitiveType(r300ContextPtr rmesa, int prim); extern int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim); +extern void r300EmitCacheFlush(r300ContextPtr rmesa); #endif diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index f7a44832e9b..1001c4ec073 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -172,11 +172,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer) cmd2[7].u = r300PackFloat32(ctx->Color.ClearColor[2]); cmd2[8].u = r300PackFloat32(ctx->Color.ClearColor[3]); - reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); - e32(R300_RB3D_ZCACHE_UNKNOWN_03); + r300EmitCacheFlush(rmesa); cp_wait(rmesa, R300_WAIT_3D | R300_WAIT_3D_CLEAN); } diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 7d97245281f..db935795c79 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -287,9 +287,6 @@ static GLboolean r300RunRender(GLcontext * ctx, { r300ContextPtr rmesa = R300_CONTEXT(ctx); int i; - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = &tnl->vb; @@ -303,12 +300,7 @@ static GLboolean r300RunRender(GLcontext * ctx, r300UpdateShaderStates(rmesa); - reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); - e32(R300_RB3D_ZCACHE_UNKNOWN_03); - + r300EmitCacheFlush(rmesa); r300EmitState(rmesa); for (i = 0; i < vb->PrimitiveCount; i++) { @@ -318,11 +310,7 @@ static GLboolean r300RunRender(GLcontext * ctx, r300RunRenderPrimitive(rmesa, ctx, start, end, prim); } - reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); - e32(R300_RB3D_ZCACHE_UNKNOWN_03); + r300EmitCacheFlush(rmesa); #ifdef USER_BUFFERS r300UseArrays(ctx); diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 35b0235aa14..e340f0b6e33 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -370,7 +370,7 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) if (rmesa->dma.current.start != rmesa->dma.current.ptr) { - r300EnsureCmdBufSpace( rmesa, rmesa->hw.max_state_size + (8*sizeof(int)), __FUNCTION__); + r300EnsureCmdBufSpace( rmesa, rmesa->hw.max_state_size + (12*sizeof(int)), __FUNCTION__); r300EmitVertexAOS( rmesa, rmesa->swtcl.vertex_size, current_offset); @@ -378,6 +378,8 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) r300EmitVbufPrim( rmesa, rmesa->swtcl.hw_primitive, rmesa->swtcl.numverts); + + r300EmitCacheFlush(rmesa); } rmesa->swtcl.numverts = 0; @@ -679,11 +681,7 @@ static void r300ChooseRenderState( GLcontext *ctx ) static void r300RenderStart(GLcontext *ctx) { - r300ContextPtr rmesa = R300_CONTEXT( ctx ); - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - + r300ContextPtr rmesa = R300_CONTEXT( ctx ); // fprintf(stderr, "%s\n", __FUNCTION__); r300ChooseRenderState(ctx); @@ -691,11 +689,7 @@ static void r300RenderStart(GLcontext *ctx) r300UpdateShaderStates(rmesa); - reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); - e32(R300_RB3D_ZCACHE_UNKNOWN_03); + r300EmitCacheFlush(rmesa); if (rmesa->dma.flush != 0 && rmesa->dma.flush != flush_last_swtcl_prim) @@ -705,16 +699,6 @@ static void r300RenderStart(GLcontext *ctx) static void r300RenderFinish(GLcontext *ctx) { - r300ContextPtr rmesa = R300_CONTEXT( ctx ); - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - - reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); - e32(R300_RB3D_ZCACHE_UNKNOWN_03); } static void r300RasterPrimitive( GLcontext *ctx, GLuint hwprim ) -- cgit v1.2.3 From 1bf507656921f216a69599143f1aef9bbb170b4e Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 22 Jun 2007 08:02:46 -0600 Subject: Fix feedback color bug #11332. In feedback mode, produce float colors. --- src/mesa/swrast/s_feedback.c | 7 +------ src/mesa/swrast_setup/ss_context.c | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 606afc63ba9..07b7409ab57 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -39,19 +39,14 @@ static void feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv) { GLfloat win[4]; - GLfloat color[4]; const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0]; + const GLfloat *color = v->attrib[FRAG_ATTRIB_COL0]; win[0] = v->attrib[FRAG_ATTRIB_WPOS][0]; win[1] = v->attrib[FRAG_ATTRIB_WPOS][1]; win[2] = v->attrib[FRAG_ATTRIB_WPOS][2] / ctx->DrawBuffer->_DepthMaxF; win[3] = 1.0F / v->attrib[FRAG_ATTRIB_WPOS][3]; - color[0] = CHAN_TO_FLOAT(pv->color[0]); - color[1] = CHAN_TO_FLOAT(pv->color[1]); - color[2] = CHAN_TO_FLOAT(pv->color[2]); - color[3] = CHAN_TO_FLOAT(pv->color[3]); - _mesa_feedback_vertex(ctx, win, color, v->attrib[FRAG_ATTRIB_CI][0], vtc); } diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index cd4ac57d37d..50b93b36c2b 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -125,6 +125,7 @@ setup_vertex_format(GLcontext *ctx) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) { swsetup->intColors = !ctx->FragmentProgram._Current && !ctx->ATIFragmentShader._Enabled + && ctx->RenderMode == GL_RENDER && CHAN_TYPE == GL_UNSIGNED_BYTE; if (swsetup->intColors) EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); -- cgit v1.2.3 From 1d52b6aaf41b32aaf8d1cdf5a3cd5ff4ecba28f4 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 22 Jun 2007 09:47:30 -0600 Subject: fix bug rendering points with fragment program (see #11330) --- src/mesa/swrast/s_points.c | 20 +++++++++++++------- src/mesa/swrast/s_span.c | 7 +++++-- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 02c9d9b4251..b91ce73d7a3 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 7.1 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -208,6 +208,14 @@ _swrast_choose_point( GLcontext *ctx ) GLboolean specular = (ctx->Fog.ColorSumEnabled || (ctx->Light.Enabled && ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); + GLboolean attribs = (ctx->FragmentProgram._Current || + ctx->Texture._EnabledCoordUnits || + swrast->_FogEnabled || + specular); + + /* + * XXX this is a mess that should be cleaned up someday + */ if (ctx->RenderMode==GL_RENDER) { if (ctx->Point.PointSprite) { @@ -218,7 +226,7 @@ _swrast_choose_point( GLcontext *ctx ) else USE(sprite_point); } - else if (ctx->Point.SmoothFlag) { + else if (ctx->Point.SmoothFlag && !attribs) { /* Smooth points */ if (rgbMode) { if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { @@ -237,7 +245,7 @@ _swrast_choose_point( GLcontext *ctx ) } else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { if (rgbMode) { - if (ctx->Texture._EnabledCoordUnits) { + if (attribs) { if (ctx->Point.SmoothFlag) { USE(atten_antialiased_rgba_point); } @@ -254,9 +262,7 @@ _swrast_choose_point( GLcontext *ctx ) USE(atten_general_ci_point); } } - else if ((ctx->Texture._EnabledCoordUnits - || specular - || swrast->_FogEnabled) && rgbMode) { + else if (attribs && rgbMode) { /* textured, fogged */ USE(textured_rgba_point); } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 9777391ded2..4ab6e2e9fbf 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -1178,7 +1178,10 @@ shade_texture_span(GLcontext *ctx, SWspan *span) if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) { convert_color_type(span, GL_FLOAT, 0); } - interpolate_active_attribs(ctx, span, ~0); + if (span->primitive != GL_POINT) { + /* for points, we populated the arrays already */ + interpolate_active_attribs(ctx, span, ~0); + } span->array->ChanType = GL_FLOAT; if (!(span->arrayMask & SPAN_Z)) -- cgit v1.2.3 From 5eb2015a966e52dc0dabfe2c2e923bb5b354ffce Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 24 Jun 2007 17:21:26 +1000 Subject: r300: 2288 is a tcl only reg --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 8 ++++++-- src/mesa/drivers/dri/r300/r300_state.c | 16 +++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index aebc895d63f..6adf1413219 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -321,8 +321,12 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1); ALLOC_STATE(vap_clip, always, 5, 0); r300->hw.vap_clip.cmd[0] = cmdpacket0(R300_VAP_CLIP_X_0, 4); - ALLOC_STATE(unk2288, always, 2, 0); - r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); + + if (has_tcl) { + ALLOC_STATE(unk2288, always, 2, 0); + r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); + } + ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, 0); r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index e6c394610dd..a723c3c5305 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1862,13 +1862,15 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.vap_clip.cmd[4] = r300PackFloat32(1.0); /* Y */ /* XXX: Other families? */ - switch (r300->radeon.radeonScreen->chip_family) { - case CHIP_FAMILY_R300: - r300->hw.unk2288.cmd[1] = R300_2288_R300; - break; - default: - r300->hw.unk2288.cmd[1] = R300_2288_RV350; - break; + if (has_tcl) { + switch (r300->radeon.radeonScreen->chip_family) { + case CHIP_FAMILY_R300: + r300->hw.unk2288.cmd[1] = R300_2288_R300; + break; + default: + r300->hw.unk2288.cmd[1] = R300_2288_RV350; + break; + } } r300->hw.gb_enable.cmd[1] = R300_GB_POINT_STUFF_ENABLE -- cgit v1.2.3 From 381b86329e827ea81e4a7e8a99c4aaa21c5ec8ac Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 17 Jun 2007 02:04:58 +0000 Subject: r300: Trivial clean up in radeon_lock.h. --- src/mesa/drivers/dri/r300/radeon_lock.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h index c47adc9575b..a344837f475 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.h +++ b/src/mesa/drivers/dri/r300/radeon_lock.h @@ -42,9 +42,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_LOCK_H__ #define __RADEON_LOCK_H__ -#if 0 -#include "r200_ioctl.h" -#endif #include "radeon_context.h" extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags); -- cgit v1.2.3 From 204f9e3fdb83fa9ef94c6e94a5fbd0dfa8d3b3dc Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 02:31:35 +0000 Subject: r300: Cleaned up the r300SetupPixelShader function. --- src/mesa/drivers/dri/r300/r300_state.c | 83 +++++++++++++++++----------------- 1 file changed, 41 insertions(+), 42 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index bdd6855802b..6ae2d924d6e 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2111,62 +2111,61 @@ static void r300SetupPixelShader(r300ContextPtr rmesa) __FUNCTION__); return; } -#define OUTPUT_FIELD(st, reg, field) \ - R300_STATECHANGE(rmesa, st); \ - for(i=0;i<=fp->alu_end;i++) \ - rmesa->hw.st.cmd[R300_FPI_INSTR_0+i]=fp->alu.inst[i].field;\ - rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmdpacket0(reg, fp->alu_end+1); - - OUTPUT_FIELD(fpi[0], R300_PFS_INSTR0_0, inst0); - OUTPUT_FIELD(fpi[1], R300_PFS_INSTR1_0, inst1); - OUTPUT_FIELD(fpi[2], R300_PFS_INSTR2_0, inst2); - OUTPUT_FIELD(fpi[3], R300_PFS_INSTR3_0, inst3); -#undef OUTPUT_FIELD + + R300_STATECHANGE(rmesa, fpi[0]); + rmesa->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, fp->alu_end + 1); + for (i = 0; i <= fp->alu_end; i++) { + rmesa->hw.fpi[0].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst0; + } + + R300_STATECHANGE(rmesa, fpi[1]); + rmesa->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, fp->alu_end + 1); + for (i = 0; i <= fp->alu_end; i++) { + rmesa->hw.fpi[1].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst1; + } + + R300_STATECHANGE(rmesa, fpi[2]); + rmesa->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, fp->alu_end + 1); + for (i = 0; i <= fp->alu_end; i++) { + rmesa->hw.fpi[2].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst2; + } + + R300_STATECHANGE(rmesa, fpi[3]); + rmesa->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, fp->alu_end + 1); + for (i = 0; i <= fp->alu_end; i++) { + rmesa->hw.fpi[3].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst3; + } R300_STATECHANGE(rmesa, fp); + rmesa->hw.fp.cmd[R300_FP_CNTL0] = fp->cur_node | (fp->first_node_has_tex << 3); + rmesa->hw.fp.cmd[R300_FP_CNTL1] = fp->max_temp_idx; + rmesa->hw.fp.cmd[R300_FP_CNTL2] = + (fp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT) | + (fp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT) | + (fp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT) | + (fp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT); /* I just want to say, the way these nodes are stored.. weird.. */ for (i = 0, k = (4 - (fp->cur_node + 1)); i < 4; i++, k++) { if (i < (fp->cur_node + 1)) { rmesa->hw.fp.cmd[R300_FP_NODE0 + k] = - (fp->node[i]. - alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT) - | (fp->node[i]. - alu_end << R300_PFS_NODE_ALU_END_SHIFT) - | (fp->node[i]. - tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) - | (fp->node[i]. - tex_end << R300_PFS_NODE_TEX_END_SHIFT) - | fp->node[i].flags; + (fp->node[i].alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT) | + (fp->node[i].alu_end << R300_PFS_NODE_ALU_END_SHIFT) | + (fp->node[i].tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) | + (fp->node[i].tex_end << R300_PFS_NODE_TEX_END_SHIFT) | + fp->node[i].flags; } else { rmesa->hw.fp.cmd[R300_FP_NODE0 + (3 - i)] = 0; } } - /* PFS_CNTL_0 */ - rmesa->hw.fp.cmd[R300_FP_CNTL0] = - fp->cur_node | (fp->first_node_has_tex << 3); - /* PFS_CNTL_1 */ - rmesa->hw.fp.cmd[R300_FP_CNTL1] = fp->max_temp_idx; - /* PFS_CNTL_2 */ - rmesa->hw.fp.cmd[R300_FP_CNTL2] = - (fp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT) - | (fp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT) - | (fp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT) - | (fp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT); - R300_STATECHANGE(rmesa, fpp); + rmesa->hw.fpp.cmd[R300_FPP_CMD_0] = cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4); for (i = 0; i < fp->const_nr; i++) { - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 0] = - r300PackFloat24(fp->constant[i][0]); - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 1] = - r300PackFloat24(fp->constant[i][1]); - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 2] = - r300PackFloat24(fp->constant[i][2]); - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 3] = - r300PackFloat24(fp->constant[i][3]); + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 0] = r300PackFloat24(fp->constant[i][0]); + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 1] = r300PackFloat24(fp->constant[i][1]); + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 2] = r300PackFloat24(fp->constant[i][2]); + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 3] = r300PackFloat24(fp->constant[i][3]); } - rmesa->hw.fpp.cmd[R300_FPP_CMD_0] = - cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4); } void r300UpdateShaderStates(r300ContextPtr rmesa) -- cgit v1.2.3 From bf334d852d60b9a5ea21234a816d0acb03f1b48c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 02:37:44 +0000 Subject: r300: Cleaned up the r300SetupVertexShader function. --- src/mesa/drivers/dri/r300/r300_state.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 6ae2d924d6e..85212b56c7b 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1649,9 +1649,7 @@ static void r300SetupVertexShader(r300ContextPtr rmesa) 0x400 area might have something to do with pixel shaders as it appears right after pfs programming. 0x406 is set to { 0.0, 0.0, 1.0, 0.0 } most of the time but should change with smooth points and in other rare cases. */ //setup_vertex_shader_fragment(rmesa, 0x406, &unk4); - if (hw_tcl_on - && ((struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx))-> - translated) { + if (hw_tcl_on && ((struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx))->translated) { r300SetupVertexProgram(rmesa); return; } @@ -1659,33 +1657,24 @@ static void r300SetupVertexShader(r300ContextPtr rmesa) /* This needs to be replaced by vertex shader generation code */ r300GenerateSimpleVertexShader(rmesa); - setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, - &(rmesa->state.vertex_shader.program)); + setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(rmesa->state.vertex_shader.program)); #if 0 - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, - &(rmesa->state.vertex_shader.unknown1)); - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, - &(rmesa->state.vertex_shader.unknown2)); + setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); + setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2)); #endif R300_STATECHANGE(rmesa, pvs); rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] = - (rmesa->state.vertex_shader. - program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) - | (rmesa->state.vertex_shader. - unknown_ptr1 << R300_PVS_CNTL_1_POS_END_SHIFT) - | (rmesa->state.vertex_shader. - program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); + (rmesa->state.vertex_shader.program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | + (rmesa->state.vertex_shader.unknown_ptr1 << R300_PVS_CNTL_1_POS_END_SHIFT) | + (rmesa->state.vertex_shader.program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] = - (rmesa->state.vertex_shader. - param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) - | (rmesa->state.vertex_shader. - param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); + (rmesa->state.vertex_shader.param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | + (rmesa->state.vertex_shader.param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = - (rmesa->state.vertex_shader. - unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) - | (rmesa->state.vertex_shader.unknown_ptr3 << 0); + (rmesa->state.vertex_shader.unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | + (rmesa->state.vertex_shader.unknown_ptr3 << 0); /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, so I leave it as a reminder */ -- cgit v1.2.3 From 909091b7dc2ee2875807a1d3ebcb9732fdfeaab3 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 03:02:34 +0000 Subject: r300: Setup the default state for polygon offset point/line. I believe there are still bugs with all polygon offset types. The point and line types may need to be handled specially, too. This shouldn't break anything because it just enabled the occlusion control bits for polygon offset. --- src/mesa/drivers/dri/r300/r300_state.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 85212b56c7b..dfde2f090f5 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1928,6 +1928,8 @@ static void r300ResetHwState(r300ContextPtr r300) r300PolygonOffset(ctx, ctx->Polygon.OffsetFactor, ctx->Polygon.OffsetUnits); + r300Enable(ctx, GL_POLYGON_OFFSET_POINT, ctx->Polygon.OffsetPoint); + r300Enable(ctx, GL_POLYGON_OFFSET_LINE, ctx->Polygon.OffsetLine); r300Enable(ctx, GL_POLYGON_OFFSET_FILL, ctx->Polygon.OffsetFill); r300->hw.unk42C0.cmd[1] = 0x4B7FFFFF; -- cgit v1.2.3 From 804d3a8f6eaa0beee1504c3e6fbda5dae9f79299 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 11:42:53 +0000 Subject: r300: Cleaned up long lines in the vertex functions. --- src/mesa/drivers/dri/r300/r300_state.c | 62 ++++++++++++---------------------- 1 file changed, 22 insertions(+), 40 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index dfde2f090f5..dea0482123f 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1477,9 +1477,7 @@ static void r300SetupRSUnit(GLcontext * ctx) if(_nc>_p->vpu.count)_p->vpu.count=_nc;\ }while(0) -void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, struct - r300_vertex_shader_fragment - *vsf) +static inline void setup_vertex_shader_fragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf) { int i; @@ -1487,8 +1485,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, s return; if (vsf->length & 0x3) { - fprintf(stderr, - "VERTEX_SHADER_FRAGMENT must have length divisible by 4\n"); + fprintf(stderr, "VERTEX_SHADER_FRAGMENT must have length divisible by 4\n"); _mesa_exit(-1); } @@ -1496,32 +1493,24 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, s case 0: R300_STATECHANGE(r300, vpi); for (i = 0; i < vsf->length; i++) - r300->hw.vpi.cmd[R300_VPI_INSTR_0 + i + - 4 * (dest & 0xff)] = (vsf->body.d[i]); - bump_vpu_count(r300->hw.vpi.cmd, - vsf->length + 4 * (dest & 0xff)); + r300->hw.vpi.cmd[R300_VPI_INSTR_0 + i + 4 * (dest & 0xff)] = (vsf->body.d[i]); + bump_vpu_count(r300->hw.vpi.cmd, vsf->length + 4 * (dest & 0xff)); break; case 2: R300_STATECHANGE(r300, vpp); for (i = 0; i < vsf->length; i++) - r300->hw.vpp.cmd[R300_VPP_PARAM_0 + i + - 4 * (dest & 0xff)] = (vsf->body.d[i]); - bump_vpu_count(r300->hw.vpp.cmd, - vsf->length + 4 * (dest & 0xff)); + r300->hw.vpp.cmd[R300_VPP_PARAM_0 + i + 4 * (dest & 0xff)] = (vsf->body.d[i]); + bump_vpu_count(r300->hw.vpp.cmd, vsf->length + 4 * (dest & 0xff)); break; case 4: R300_STATECHANGE(r300, vps); for (i = 0; i < vsf->length; i++) - r300->hw.vps.cmd[1 + i + 4 * (dest & 0xff)] = - (vsf->body.d[i]); - bump_vpu_count(r300->hw.vps.cmd, - vsf->length + 4 * (dest & 0xff)); + r300->hw.vps.cmd[1 + i + 4 * (dest & 0xff)] = (vsf->body.d[i]); + bump_vpu_count(r300->hw.vps.cmd, vsf->length + 4 * (dest & 0xff)); break; default: - fprintf(stderr, - "%s:%s don't know how to handle dest %04x\n", - __FILE__, __FUNCTION__, dest); + fprintf(stderr, "%s:%s don't know how to handle dest %04x\n", __FILE__, __FUNCTION__, dest); _mesa_exit(-1); } } @@ -1586,16 +1575,13 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) GLcontext *ctx = rmesa->radeon.glCtx; int inst_count; int param_count; - struct r300_vertex_program *prog = - (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); + struct r300_vertex_program *prog = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); ((drm_r300_cmd_header_t *) rmesa->hw.vpp.cmd)->vpu.count = 0; R300_STATECHANGE(rmesa, vpp); - param_count = - r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *) - ctx->VertexProgram._Current /*prog */ , - (float *)&rmesa->hw.vpp. - cmd[R300_VPP_PARAM_0]); + param_count = r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *) + ctx->VertexProgram._Current /*prog */ , + (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]); bump_vpu_count(rmesa->hw.vpp.cmd, param_count); param_count /= 4; @@ -1606,27 +1592,23 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(prog->program)); #if 0 - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, - &(rmesa->state.vertex_shader.unknown1)); - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, - &(rmesa->state.vertex_shader.unknown2)); + setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); + setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2)); #endif inst_count = prog->program.length / 4 - 1; R300_STATECHANGE(rmesa, pvs); rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] = - (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) - | (inst_count /*pos_end */ << R300_PVS_CNTL_1_POS_END_SHIFT) - | (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); + (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | + (inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) | + (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] = - (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) - | (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); + (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | + (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = - (0 /*rmesa->state.vertex_shader.unknown_ptr2 */ << - R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) - | (inst_count /*rmesa->state.vertex_shader.unknown_ptr3 */ << - 0); + (0 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | + (inst_count << 0); /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, so I leave it as a reminder */ -- cgit v1.2.3 From 27c8488526c5b3b0606cb5a3fbfac7a82246c0bd Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 11:45:07 +0000 Subject: r300: Removed unused vap_param structure. --- src/mesa/drivers/dri/r300/r300_context.h | 4 ---- src/mesa/drivers/dri/r300/r300_state.c | 1 - 2 files changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 076bb49a006..c150053d873 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -799,10 +799,6 @@ struct r300_state { DECLARE_RENDERINPUTS(render_inputs_bitset); /* actual render inputs that R300 was configured for. They are the same as tnl->render_inputs for fixed pipeline */ - struct { - int transform_offset; /* Transform matrix offset, -1 if none */ - } vap_param; /* vertex processor parameter allocation - tells where to write parameters */ - struct r300_stencilbuffer_state stencil; }; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index dea0482123f..c37964957a4 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1527,7 +1527,6 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) GLuint o_reg = 0; /* Allocate parameters */ - r300->state.vap_param.transform_offset = 0x0; /* transform matrix */ r300->state.vertex_shader.param_offset = 0x0; r300->state.vertex_shader.param_count = 0x4; /* 4 vector values - 4x4 matrix */ -- cgit v1.2.3 From 252fc61e4860f6a539faaf48f7d657d7d2242fbe Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 12:03:42 +0000 Subject: r300: Vertex program position end bits are known. Possibly performance may improve by setting it to the last instruction that writes result.position, rather than the last instruction in the vertex program. --- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 8 +++++--- src/mesa/drivers/dri/r300/r300_state.c | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index c150053d873..44f02229b38 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -588,7 +588,7 @@ struct r300_vertex_shader_state { struct r300_vertex_shader_fragment unknown2; int program_start; - int unknown_ptr1; /* pointer within program space */ + int program_pos_end; int program_end; int param_offset; diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 3ce09c16d3f..e59919be493 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -336,13 +336,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * 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 - * CNTL_1_UNKNOWN points to instruction where last write to position takes - * place. + * 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. + * position calculations. */ #define R300_VAP_PVS_CNTL_1 0x22D0 # define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0 diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index c37964957a4..8d08279b3a8 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1531,7 +1531,7 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) r300->state.vertex_shader.param_count = 0x4; /* 4 vector values - 4x4 matrix */ r300->state.vertex_shader.program_start = 0x0; - r300->state.vertex_shader.unknown_ptr1 = 0x4; /* magic value ? */ + r300->state.vertex_shader.program_pos_end = 0x4; r300->state.vertex_shader.program_end = 0x0; r300->state.vertex_shader.unknown_ptr2 = 0x0; /* magic value */ @@ -1563,7 +1563,7 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) r300->state.vertex_shader.program.length = (r300->state.vertex_shader.program_end + 1) * 4; - r300->state.vertex_shader.unknown_ptr1 = r300->state.vertex_shader.program_end; /* magic value ? */ + r300->state.vertex_shader.program_pos_end = r300->state.vertex_shader.program_end; r300->state.vertex_shader.unknown_ptr2 = r300->state.vertex_shader.program_end; /* magic value ? */ r300->state.vertex_shader.unknown_ptr3 = r300->state.vertex_shader.program_end; /* magic value ? */ @@ -1607,7 +1607,7 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = (0 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | - (inst_count << 0); + (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, so I leave it as a reminder */ @@ -1648,14 +1648,14 @@ static void r300SetupVertexShader(r300ContextPtr rmesa) R300_STATECHANGE(rmesa, pvs); rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] = (rmesa->state.vertex_shader.program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | - (rmesa->state.vertex_shader.unknown_ptr1 << R300_PVS_CNTL_1_POS_END_SHIFT) | + (rmesa->state.vertex_shader.program_pos_end << R300_PVS_CNTL_1_POS_END_SHIFT) | (rmesa->state.vertex_shader.program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] = (rmesa->state.vertex_shader.param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | (rmesa->state.vertex_shader.param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = (rmesa->state.vertex_shader.unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | - (rmesa->state.vertex_shader.unknown_ptr3 << 0); + (rmesa->state.vertex_shader.unknown_ptr3 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, so I leave it as a reminder */ -- cgit v1.2.3 From b41ef5506153fc2cd471341b4ad1eda2338f2438 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 12:13:44 +0000 Subject: r300: Clean up the vertex program state code slightly; still needs lots of work. --- src/mesa/drivers/dri/r300/r300_state.c | 115 +++++++++++++++------------------ 1 file changed, 51 insertions(+), 64 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 8d08279b3a8..03c65b46750 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1521,54 +1521,68 @@ static inline void setup_vertex_shader_fragment(r300ContextPtr r300, int dest, s while leaving colors intact. Nothing fancy (like lights) If implementing lights make a copy first, so it is easy to switch between the two versions */ -static void r300GenerateSimpleVertexShader(r300ContextPtr r300) + +#define WRITE_OP(oper,source1,source2,source3) {\ + rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].op=(oper); \ + rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].src[0]=(source1); \ + rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].src[1]=(source2); \ + rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].src[2]=(source3); \ + rmesa->state.vertex_shader.program_end++; \ + } + +static void r300GenerateSimpleVertexShader(r300ContextPtr rmesa) { int i; GLuint o_reg = 0; /* Allocate parameters */ - r300->state.vertex_shader.param_offset = 0x0; - r300->state.vertex_shader.param_count = 0x4; /* 4 vector values - 4x4 matrix */ - - r300->state.vertex_shader.program_start = 0x0; - r300->state.vertex_shader.program_pos_end = 0x4; - r300->state.vertex_shader.program_end = 0x0; - - r300->state.vertex_shader.unknown_ptr2 = 0x0; /* magic value */ - r300->state.vertex_shader.unknown_ptr3 = 0x4; /* magic value */ - - r300->state.vertex_shader.unknown1.length = 0; - r300->state.vertex_shader.unknown2.length = 0; - -#define WRITE_OP(oper,source1,source2,source3) {\ - r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].op=(oper); \ - r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src[0]=(source1); \ - r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src[1]=(source2); \ - r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src[2]=(source3); \ - r300->state.vertex_shader.program_end++; \ - } + rmesa->state.vertex_shader.param_offset = 0x0; + rmesa->state.vertex_shader.param_count = 0x4; /* 4 vector values - 4x4 matrix */ + rmesa->state.vertex_shader.program_start = 0x0; + rmesa->state.vertex_shader.program_pos_end = 0x4; + rmesa->state.vertex_shader.program_end = 0x0; + rmesa->state.vertex_shader.unknown_ptr2 = 0x0; /* magic value */ + rmesa->state.vertex_shader.unknown_ptr3 = 0x4; /* magic value */ + rmesa->state.vertex_shader.unknown1.length = 0; + rmesa->state.vertex_shader.unknown2.length = 0; for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++) - if (r300->state.sw_tcl_inputs[i] != -1) { + if (rmesa->state.sw_tcl_inputs[i] != -1) { WRITE_OP(EASY_VSF_OP(MUL, o_reg++, ALL, RESULT), - VSF_REG(r300->state.sw_tcl_inputs[i]), - VSF_ATTR_UNITY(r300->state. + VSF_REG(rmesa->state.sw_tcl_inputs[i]), + VSF_ATTR_UNITY(rmesa->state. sw_tcl_inputs[i]), - VSF_UNITY(r300->state.sw_tcl_inputs[i]) + VSF_UNITY(rmesa->state.sw_tcl_inputs[i]) ) - } - r300->state.vertex_shader.program_end--; /* r300 wants program length to be one more - no idea why */ - r300->state.vertex_shader.program.length = - (r300->state.vertex_shader.program_end + 1) * 4; + rmesa->state.vertex_shader.program_end--; /* rmesa wants program length to be one more - no idea why */ + rmesa->state.vertex_shader.program.length = (rmesa->state.vertex_shader.program_end + 1) * 4; + rmesa->state.vertex_shader.program_pos_end = rmesa->state.vertex_shader.program_end; + rmesa->state.vertex_shader.unknown_ptr2 = rmesa->state.vertex_shader.program_end; /* magic value ? */ + rmesa->state.vertex_shader.unknown_ptr3 = rmesa->state.vertex_shader.program_end; /* magic value ? */ - r300->state.vertex_shader.program_pos_end = r300->state.vertex_shader.program_end; - r300->state.vertex_shader.unknown_ptr2 = r300->state.vertex_shader.program_end; /* magic value ? */ - r300->state.vertex_shader.unknown_ptr3 = r300->state.vertex_shader.program_end; /* magic value ? */ + setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(rmesa->state.vertex_shader.program)); +#if 0 + setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); + setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2)); +#endif + R300_STATECHANGE(rmesa, pvs); + rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] = + (rmesa->state.vertex_shader.program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | + (rmesa->state.vertex_shader.program_pos_end << R300_PVS_CNTL_1_POS_END_SHIFT) | + (rmesa->state.vertex_shader.program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); + rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] = + (rmesa->state.vertex_shader.param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | + (rmesa->state.vertex_shader.param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); + rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = + (rmesa->state.vertex_shader.unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | + (rmesa->state.vertex_shader.unknown_ptr3 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); } +#undef WRITE_OP + static void r300SetupVertexProgram(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; @@ -1589,7 +1603,6 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0; setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(prog->program)); - #if 0 setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2)); @@ -1608,13 +1621,6 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = (0 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); - - /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, - so I leave it as a reminder */ -#if 0 - reg_start(R300_VAP_PVS_WAITIDLE, 0); - e32(0x00000000); -#endif } static void r300SetupVertexShader(r300ContextPtr rmesa) @@ -1632,33 +1638,14 @@ static void r300SetupVertexShader(r300ContextPtr rmesa) //setup_vertex_shader_fragment(rmesa, 0x406, &unk4); if (hw_tcl_on && ((struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx))->translated) { r300SetupVertexProgram(rmesa); - return; + } else { + /* FIXME: This needs to be replaced by vertex shader generation code. */ + r300GenerateSimpleVertexShader(rmesa); } - /* This needs to be replaced by vertex shader generation code */ - r300GenerateSimpleVertexShader(rmesa); - - setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(rmesa->state.vertex_shader.program)); - -#if 0 - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2)); -#endif - - R300_STATECHANGE(rmesa, pvs); - rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] = - (rmesa->state.vertex_shader.program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | - (rmesa->state.vertex_shader.program_pos_end << R300_PVS_CNTL_1_POS_END_SHIFT) | - (rmesa->state.vertex_shader.program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); - rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] = - (rmesa->state.vertex_shader.param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | - (rmesa->state.vertex_shader.param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); - rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = - (rmesa->state.vertex_shader.unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | - (rmesa->state.vertex_shader.unknown_ptr3 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); - /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, - so I leave it as a reminder */ + /* FIXME: This is done for vertex shader fragments, but also needs to be + * done for vap_pvs, so I leave it as a reminder. */ #if 0 reg_start(R300_VAP_PVS_WAITIDLE, 0); e32(0x00000000); -- cgit v1.2.3 From 62b83638a5ffe4df25994ce5f36c493d51da046e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 12:23:47 +0000 Subject: r300: The vpi, vpp, and vps counts are already initialized; don't do it twice. --- src/mesa/drivers/dri/r300/r300_state.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 03c65b46750..9d6de67bbf3 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1590,7 +1590,6 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) int param_count; struct r300_vertex_program *prog = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); - ((drm_r300_cmd_header_t *) rmesa->hw.vpp.cmd)->vpu.count = 0; R300_STATECHANGE(rmesa, vpp); param_count = r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *) ctx->VertexProgram._Current /*prog */ , @@ -1598,10 +1597,6 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) bump_vpu_count(rmesa->hw.vpp.cmd, param_count); param_count /= 4; - /* Reset state, in case we don't use something */ - ((drm_r300_cmd_header_t *) rmesa->hw.vpi.cmd)->vpu.count = 0; - ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0; - setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(prog->program)); #if 0 setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); -- cgit v1.2.3 From 43e601206d9618eb5f9ec9660d9a7e0fa22feff0 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 12:42:19 +0000 Subject: r300: Should use inst_count not 0 for R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT. --- src/mesa/drivers/dri/r300/r300_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 9d6de67bbf3..770b16ed453 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1614,7 +1614,7 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = - (0 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | + (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); } -- cgit v1.2.3 From e92903e24c245df80245776ed9423bd933a97740 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 20 Jun 2007 14:24:04 +0000 Subject: r300: Initial work on merging the real and generated vertex program functions. --- src/mesa/drivers/dri/r300/r300_context.h | 13 ---- src/mesa/drivers/dri/r300/r300_state.c | 113 +++++++++++-------------------- 2 files changed, 40 insertions(+), 86 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 44f02229b38..afd3dd384b5 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -583,19 +583,6 @@ struct r300_vertex_shader_fragment { struct r300_vertex_shader_state { struct r300_vertex_shader_fragment program; - - struct r300_vertex_shader_fragment unknown1; - struct r300_vertex_shader_fragment unknown2; - - int program_start; - int program_pos_end; - int program_end; - - int param_offset; - int param_count; - - int unknown_ptr2; /* pointer within program space */ - int unknown_ptr3; /* pointer within program space */ }; extern int hw_tcl_on; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 770b16ed453..310102fcc51 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1477,7 +1477,7 @@ static void r300SetupRSUnit(GLcontext * ctx) if(_nc>_p->vpu.count)_p->vpu.count=_nc;\ }while(0) -static inline void setup_vertex_shader_fragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf) +static inline void r300SetupVertexProgramFragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf) { int i; @@ -1515,95 +1515,63 @@ static inline void setup_vertex_shader_fragment(r300ContextPtr r300, int dest, s } } -/* just a skeleton for now.. */ - -/* Generate a vertex shader that simply transforms vertex and texture coordinates, - while leaving colors intact. Nothing fancy (like lights) - - If implementing lights make a copy first, so it is easy to switch between the two versions */ - -#define WRITE_OP(oper,source1,source2,source3) {\ - rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].op=(oper); \ - rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].src[0]=(source1); \ - rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].src[1]=(source2); \ - rmesa->state.vertex_shader.program.body.i[rmesa->state.vertex_shader.program_end].src[2]=(source3); \ - rmesa->state.vertex_shader.program_end++; \ - } - -static void r300GenerateSimpleVertexShader(r300ContextPtr rmesa) +static void r300SetupDefaultVertexProgram(r300ContextPtr rmesa) { - int i; + struct r300_vertex_shader_state *prog = &(rmesa->state.vertex_shader); GLuint o_reg = 0; + int i; + int inst_count = 0; + int param_count = 0; + int program_end = 0; - /* Allocate parameters */ - rmesa->state.vertex_shader.param_offset = 0x0; - rmesa->state.vertex_shader.param_count = 0x4; /* 4 vector values - 4x4 matrix */ - rmesa->state.vertex_shader.program_start = 0x0; - rmesa->state.vertex_shader.program_pos_end = 0x4; - rmesa->state.vertex_shader.program_end = 0x0; - rmesa->state.vertex_shader.unknown_ptr2 = 0x0; /* magic value */ - rmesa->state.vertex_shader.unknown_ptr3 = 0x4; /* magic value */ - rmesa->state.vertex_shader.unknown1.length = 0; - rmesa->state.vertex_shader.unknown2.length = 0; - - for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++) + for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++) { if (rmesa->state.sw_tcl_inputs[i] != -1) { - WRITE_OP(EASY_VSF_OP(MUL, o_reg++, ALL, RESULT), - VSF_REG(rmesa->state.sw_tcl_inputs[i]), - VSF_ATTR_UNITY(rmesa->state. - sw_tcl_inputs[i]), - VSF_UNITY(rmesa->state.sw_tcl_inputs[i]) - ) + prog->program.body.i[program_end].op = EASY_VSF_OP(MUL, o_reg++, ALL, RESULT); + prog->program.body.i[program_end].src[0] = VSF_REG(rmesa->state.sw_tcl_inputs[i]); + prog->program.body.i[program_end].src[1] = VSF_ATTR_UNITY(rmesa->state.sw_tcl_inputs[i]); + prog->program.body.i[program_end].src[2] = VSF_UNITY(rmesa->state.sw_tcl_inputs[i]); + program_end++; } + } - rmesa->state.vertex_shader.program_end--; /* rmesa wants program length to be one more - no idea why */ - rmesa->state.vertex_shader.program.length = (rmesa->state.vertex_shader.program_end + 1) * 4; - rmesa->state.vertex_shader.program_pos_end = rmesa->state.vertex_shader.program_end; - rmesa->state.vertex_shader.unknown_ptr2 = rmesa->state.vertex_shader.program_end; /* magic value ? */ - rmesa->state.vertex_shader.unknown_ptr3 = rmesa->state.vertex_shader.program_end; /* magic value ? */ + prog->program.length = program_end * 4; - setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(rmesa->state.vertex_shader.program)); -#if 0 - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2)); -#endif + r300SetupVertexProgramFragment(rmesa, VSF_DEST_PROGRAM, &(prog->program)); + inst_count = (prog->program.length / 4) - 1; R300_STATECHANGE(rmesa, pvs); rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] = - (rmesa->state.vertex_shader.program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | - (rmesa->state.vertex_shader.program_pos_end << R300_PVS_CNTL_1_POS_END_SHIFT) | - (rmesa->state.vertex_shader.program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); + (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | + (inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) | + (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] = - (rmesa->state.vertex_shader.param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | - (rmesa->state.vertex_shader.param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); + (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | + (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT); rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] = - (rmesa->state.vertex_shader.unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | - (rmesa->state.vertex_shader.unknown_ptr3 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); + (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | + (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); } -#undef WRITE_OP - -static void r300SetupVertexProgram(r300ContextPtr rmesa) +static void r300SetupRealVertexProgram(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; - int inst_count; - int param_count; struct r300_vertex_program *prog = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); + int inst_count = 0; + int param_count = 0; + /* FIXME: r300SetupVertexProgramFragment */ R300_STATECHANGE(rmesa, vpp); - param_count = r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *) - ctx->VertexProgram._Current /*prog */ , - (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]); + param_count = + r300VertexProgUpdateParams(ctx, + (struct r300_vertex_program_cont *) + ctx->VertexProgram._Current, + (float *)&rmesa->hw.vpp. + cmd[R300_VPP_PARAM_0]); bump_vpu_count(rmesa->hw.vpp.cmd, param_count); param_count /= 4; - setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(prog->program)); -#if 0 - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1)); - setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2)); -#endif - - inst_count = prog->program.length / 4 - 1; + r300SetupVertexProgramFragment(rmesa, VSF_DEST_PROGRAM, &(prog->program)); + inst_count = (prog->program.length / 4) - 1; R300_STATECHANGE(rmesa, pvs); rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] = @@ -1618,7 +1586,7 @@ static void r300SetupVertexProgram(r300ContextPtr rmesa) (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT); } -static void r300SetupVertexShader(r300ContextPtr rmesa) +static void r300SetupVertexProgram(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; @@ -1632,10 +1600,10 @@ static void r300SetupVertexShader(r300ContextPtr rmesa) 0x406 is set to { 0.0, 0.0, 1.0, 0.0 } most of the time but should change with smooth points and in other rare cases. */ //setup_vertex_shader_fragment(rmesa, 0x406, &unk4); if (hw_tcl_on && ((struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx))->translated) { - r300SetupVertexProgram(rmesa); + r300SetupRealVertexProgram(rmesa); } else { /* FIXME: This needs to be replaced by vertex shader generation code. */ - r300GenerateSimpleVertexShader(rmesa); + r300SetupDefaultVertexProgram(rmesa); } @@ -2046,7 +2014,6 @@ void r300UpdateShaders(r300ContextPtr rmesa) } r300UpdateStateParameters(ctx, _NEW_PROGRAM); } - } static void r300SetupPixelShader(r300ContextPtr rmesa) @@ -2133,7 +2100,7 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) r300SetupTextures(ctx); if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) - r300SetupVertexShader(rmesa); + r300SetupVertexProgram(rmesa); r300SetupRSUnit(ctx); } -- cgit v1.2.3 From 369d6654d4cdac7bf964918b2412c71d977bcbf5 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 Jun 2007 07:12:55 -0600 Subject: added comment, remove dead code --- src/mesa/swrast_setup/ss_context.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 50b93b36c2b..f8a1cadfa5a 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -288,13 +288,11 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) dest->attrib[FRAG_ATTRIB_VAR0 + i] ); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, tmp ); + /* XXX need float color FRAG_ATTRIB_COL0?? */ UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, tmp ); COPY_4V(dest->attrib[FRAG_ATTRIB_COL1], tmp); - /* - UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->specular, tmp ); - */ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp ); dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0]; -- cgit v1.2.3 From 3156854c25cb41d7651a992cf30d42bfce04d593 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 Jun 2007 07:13:20 -0600 Subject: XXX comment about point clamping --- src/mesa/main/points.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 8674c7299c5..0f562420b08 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -57,6 +57,7 @@ _mesa_PointSize( GLfloat size ) FLUSH_VERTICES(ctx, _NEW_POINT); ctx->Point.Size = size; + /* XXX correct clamp limits? */ ctx->Point._Size = CLAMP(ctx->Point.Size, ctx->Point.MinSize, ctx->Point.MaxSize); -- cgit v1.2.3 From 1a55e97c9c1734f0808e4ed570be3826dba24417 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 Jun 2007 07:13:39 -0600 Subject: increase MAX_POINT_SIZE to 60 --- src/mesa/main/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 55199245568..cebef1c3832 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -82,7 +82,7 @@ /** Minimum point size */ #define MIN_POINT_SIZE 1.0 /** Maximum point size */ -#define MAX_POINT_SIZE 20.0 +#define MAX_POINT_SIZE 60.0 /** Point size granularity */ #define POINT_SIZE_GRANULARITY 0.1 -- cgit v1.2.3 From 2233d4c1ee53f1cfd016b68d8249b8d934ef17ee Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 Jun 2007 07:15:37 -0600 Subject: remove obsolete t_save_api.c --- src/mesa/tnl/t_save_api.c | 1834 --------------------------------------------- 1 file changed, 1834 deletions(-) delete mode 100644 src/mesa/tnl/t_save_api.c (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c deleted file mode 100644 index b08f05374e4..00000000000 --- a/src/mesa/tnl/t_save_api.c +++ /dev/null @@ -1,1834 +0,0 @@ -/************************************************************************** - -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 -TUNGSTEN GRAPHICS 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: - * Keith Whitwell - */ - - - -/** - * The display list compiler attempts to store lists of vertices with the - * same vertex layout. Additionally it attempts to minimize the need - * for execute-time fixup of these vertex lists, allowing them to be - * cached on hardware. - * - * There are still some circumstances where this can be thwarted, for - * example by building a list that consists of one very long primitive - * (eg Begin(Triangles), 1000 vertices, End), and calling that list - * from inside a different begin/end object (Begin(Lines), CallList, - * End). - * - * In that case the code will have to replay the list as individual - * commands through the Exec dispatch table, or fix up the copied - * vertices at execute-time. - * - * The other case where fixup is required is when a vertex attribute - * is introduced in the middle of a primitive. Eg: - * Begin(Lines) - * TexCoord1f() Vertex2f() - * TexCoord1f() Color3f() Vertex2f() - * End() - * - * If the current value of Color isn't known at compile-time, this - * primitive will require fixup. - * - * - * The list compiler currently doesn't attempt to compile lists - * containing EvalCoord or EvalPoint commands. On encountering one of - * these, compilation falls back to opcodes. - * - * This could be improved to fallback only when a mix of EvalCoord and - * Vertex commands are issued within a single primitive. - */ - - -#include "glheader.h" -#include "context.h" -#include "dlist.h" -#include "enums.h" -#include "macros.h" -#include "api_validate.h" -#include "api_arrayelt.h" -#include "vtxfmt.h" -#include "t_save_api.h" -#include "dispatch.h" - -/* - * NOTE: Old 'parity' issue is gone, but copying can still be - * wrong-footed on replay. - */ -static GLuint _save_copy_vertices( GLcontext *ctx, - const struct tnl_vertex_list *node ) -{ - TNLcontext *tnl = TNL_CONTEXT( ctx ); - const struct tnl_prim *prim = &node->prim[node->prim_count-1]; - GLuint nr = prim->count; - GLuint sz = tnl->save.vertex_size; - const GLfloat *src = node->buffer + prim->start * sz; - GLfloat *dst = tnl->save.copied.buffer; - GLuint ovf, i; - - if (prim->mode & PRIM_END) - return 0; - - switch( prim->mode & PRIM_MODE_MASK ) - { - case GL_POINTS: - return 0; - case GL_LINES: - ovf = nr&1; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - case GL_TRIANGLES: - ovf = nr%3; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - case GL_QUADS: - ovf = nr&3; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - case GL_LINE_STRIP: - if (nr == 0) - return 0; - else { - _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); - return 1; - } - case GL_LINE_LOOP: - case GL_TRIANGLE_FAN: - case GL_POLYGON: - if (nr == 0) - return 0; - else if (nr == 1) { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); - return 1; - } else { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); - _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) ); - return 2; - } - case GL_TRIANGLE_STRIP: - case GL_QUAD_STRIP: - switch (nr) { - case 0: ovf = 0; break; - case 1: ovf = 1; break; - default: ovf = 2 + (nr&1); break; - } - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - default: - assert(0); - return 0; - } -} - - -static void -build_normal_lengths( struct tnl_vertex_list *node ) -{ - GLuint i; - GLfloat *len; - GLfloat *n = node->buffer; - GLuint stride = node->vertex_size; - GLuint count = node->count; - - len = node->normal_lengths = (GLfloat *) MALLOC( count * sizeof(GLfloat) ); - if (!len) - return; - - /* Find the normal of the first vertex: - */ - for (i = 0 ; i < _TNL_ATTRIB_NORMAL ; i++) - n += node->attrsz[i]; - - for (i = 0 ; i < count ; i++, n += stride) { - len[i] = LEN_3FV( n ); - if (len[i] > 0.0F) len[i] = 1.0F / len[i]; - } -} - -static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx ) -{ - struct tnl_vertex_store *store = MALLOC_STRUCT(tnl_vertex_store); - (void) ctx; - store->used = 0; - store->refcount = 1; - return store; -} - -static struct tnl_primitive_store *alloc_prim_store( GLcontext *ctx ) -{ - struct tnl_primitive_store *store = MALLOC_STRUCT(tnl_primitive_store); - (void) ctx; - store->used = 0; - store->refcount = 1; - return store; -} - -static void _save_reset_counters( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - tnl->save.prim = tnl->save.prim_store->buffer + tnl->save.prim_store->used; - tnl->save.buffer = (tnl->save.vertex_store->buffer + - tnl->save.vertex_store->used); - - if (tnl->save.vertex_size) - tnl->save.initial_counter = ((SAVE_BUFFER_SIZE - - tnl->save.vertex_store->used) / - tnl->save.vertex_size); - else - tnl->save.initial_counter = 0; - - if (tnl->save.initial_counter > ctx->Const.MaxArrayLockSize ) - tnl->save.initial_counter = ctx->Const.MaxArrayLockSize; - - tnl->save.counter = tnl->save.initial_counter; - tnl->save.prim_count = 0; - tnl->save.prim_max = SAVE_PRIM_SIZE - tnl->save.prim_store->used; - tnl->save.copied.nr = 0; - tnl->save.dangling_attr_ref = 0; -} - - -/* Insert the active immediate struct onto the display list currently - * being built. - */ -static void _save_compile_vertex_list( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct tnl_vertex_list *node; - - /* Allocate space for this structure in the display list currently - * being compiled. - */ - node = (struct tnl_vertex_list *) - _mesa_alloc_instruction(ctx, tnl->save.opcode_vertex_list, sizeof(*node)); - - if (!node) - return; - - /* Duplicate our template, increment refcounts to the storage structs: - */ - _mesa_memcpy(node->attrsz, tnl->save.attrsz, sizeof(node->attrsz)); - node->vertex_size = tnl->save.vertex_size; - node->buffer = tnl->save.buffer; - node->count = tnl->save.initial_counter - tnl->save.counter; - node->wrap_count = tnl->save.copied.nr; - node->have_materials = tnl->save.have_materials; - node->dangling_attr_ref = tnl->save.dangling_attr_ref; - node->normal_lengths = NULL; - node->prim = tnl->save.prim; - node->prim_count = tnl->save.prim_count; - node->vertex_store = tnl->save.vertex_store; - node->prim_store = tnl->save.prim_store; - - node->vertex_store->refcount++; - node->prim_store->refcount++; - - assert(node->attrsz[_TNL_ATTRIB_POS] != 0 || - node->count == 0); - - if (tnl->save.dangling_attr_ref) - ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS; - - /* Maybe calculate normal lengths: - */ - if (tnl->CalcDListNormalLengths && - node->attrsz[_TNL_ATTRIB_NORMAL] == 3 && - !(ctx->ListState.CurrentList->flags & MESA_DLIST_DANGLING_REFS)) - build_normal_lengths( node ); - - - tnl->save.vertex_store->used += tnl->save.vertex_size * node->count; - tnl->save.prim_store->used += node->prim_count; - - /* Decide whether the storage structs are full, or can be used for - * the next vertex lists as well. - */ - if (tnl->save.vertex_store->used > - SAVE_BUFFER_SIZE - 16 * (tnl->save.vertex_size + 4)) { - - tnl->save.vertex_store->refcount--; - assert(tnl->save.vertex_store->refcount != 0); - tnl->save.vertex_store = alloc_vertex_store( ctx ); - tnl->save.vbptr = tnl->save.vertex_store->buffer; - } - - if (tnl->save.prim_store->used > SAVE_PRIM_SIZE - 6) { - tnl->save.prim_store->refcount--; - assert(tnl->save.prim_store->refcount != 0); - tnl->save.prim_store = alloc_prim_store( ctx ); - } - - /* Reset our structures for the next run of vertices: - */ - _save_reset_counters( ctx ); - - /* Copy duplicated vertices - */ - tnl->save.copied.nr = _save_copy_vertices( ctx, node ); - - - /* Deal with GL_COMPILE_AND_EXECUTE: - */ - if (ctx->ExecuteFlag) { - _tnl_playback_vertex_list( ctx, (void *) node ); - } -} - - -/* TODO -- If no new vertices have been stored, don't bother saving - * it. - */ -static void _save_wrap_buffers( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLint i = tnl->save.prim_count - 1; - GLenum mode; - - assert(i < (GLint) tnl->save.prim_max); - assert(i >= 0); - - /* Close off in-progress primitive. - */ - tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) - - tnl->save.prim[i].start); - mode = tnl->save.prim[i].mode & ~(PRIM_BEGIN|PRIM_END); - - /* store the copied vertices, and allocate a new list. - */ - _save_compile_vertex_list( ctx ); - - /* Restart interrupted primitive - */ - tnl->save.prim[0].mode = mode; - tnl->save.prim[0].start = 0; - tnl->save.prim[0].count = 0; - tnl->save.prim_count = 1; -} - - - -/* Called only when buffers are wrapped as the result of filling the - * vertex_store struct. - */ -static void _save_wrap_filled_vertex( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLfloat *data = tnl->save.copied.buffer; - GLuint i; - - /* Emit a glEnd to close off the last vertex list. - */ - _save_wrap_buffers( ctx ); - - /* Copy stored stored vertices to start of new list. - */ - assert(tnl->save.counter > tnl->save.copied.nr); - - for (i = 0 ; i < tnl->save.copied.nr ; i++) { - _mesa_memcpy( tnl->save.vbptr, data, tnl->save.vertex_size * sizeof(GLfloat)); - data += tnl->save.vertex_size; - tnl->save.vbptr += tnl->save.vertex_size; - tnl->save.counter--; - } -} - - -static void _save_copy_to_current( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint i; - - /* XXX Use _TNL_FIRST_* and _TNL_LAST_* values instead? */ - for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++) { - if (tnl->save.attrsz[i]) { - tnl->save.currentsz[i][0] = tnl->save.attrsz[i]; - COPY_CLEAN_4V(tnl->save.current[i], - tnl->save.attrsz[i], - tnl->save.attrptr[i]); - } - } - - /* Edgeflag requires special treatment: - * - * TODO: change edgeflag to GLfloat in Mesa. - */ - if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) { - ctx->ListState.ActiveEdgeFlag = 1; - tnl->save.CurrentFloatEdgeFlag = - tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0]; - ctx->ListState.CurrentEdgeFlag = - (tnl->save.CurrentFloatEdgeFlag == 1.0); - } -} - - -static void _save_copy_from_current( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLint i; - - for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++) - switch (tnl->save.attrsz[i]) { - case 4: tnl->save.attrptr[i][3] = tnl->save.current[i][3]; - case 3: tnl->save.attrptr[i][2] = tnl->save.current[i][2]; - case 2: tnl->save.attrptr[i][1] = tnl->save.current[i][1]; - case 1: tnl->save.attrptr[i][0] = tnl->save.current[i][0]; - case 0: break; - } - - /* Edgeflag requires special treatment: - */ - if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) { - tnl->save.CurrentFloatEdgeFlag = (GLfloat)ctx->ListState.CurrentEdgeFlag; - tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] = tnl->save.CurrentFloatEdgeFlag; - } -} - - - - -/* Flush existing data, set new attrib size, replay copied vertices. - */ -static void _save_upgrade_vertex( GLcontext *ctx, - GLuint attr, - GLuint newsz ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldsz; - GLuint i; - GLfloat *tmp; - - /* Store the current run of vertices, and emit a GL_END. Emit a - * BEGIN in the new buffer. - */ - if (tnl->save.initial_counter != tnl->save.counter) - _save_wrap_buffers( ctx ); - else - assert( tnl->save.copied.nr == 0 ); - - /* Do a COPY_TO_CURRENT to ensure back-copying works for the case - * when the attribute already exists in the vertex and is having - * its size increased. - */ - _save_copy_to_current( ctx ); - - /* Fix up sizes: - */ - oldsz = tnl->save.attrsz[attr]; - tnl->save.attrsz[attr] = newsz; - - tnl->save.vertex_size += newsz - oldsz; - tnl->save.counter = ((SAVE_BUFFER_SIZE - tnl->save.vertex_store->used) / - tnl->save.vertex_size); - if (tnl->save.counter > ctx->Const.MaxArrayLockSize ) - tnl->save.counter = ctx->Const.MaxArrayLockSize; - tnl->save.initial_counter = tnl->save.counter; - - /* Recalculate all the attrptr[] values: - */ - for (i = 0, tmp = tnl->save.vertex ; i < _TNL_ATTRIB_MAX ; i++) { - if (tnl->save.attrsz[i]) { - tnl->save.attrptr[i] = tmp; - tmp += tnl->save.attrsz[i]; - } - else - tnl->save.attrptr[i] = NULL; /* will not be dereferenced. */ - } - - /* Copy from current to repopulate the vertex with correct values. - */ - _save_copy_from_current( ctx ); - - /* Replay stored vertices to translate them to new format here. - * - * If there are copied vertices and the new (upgraded) attribute - * has not been defined before, this list is somewhat degenerate, - * and will need fixup at runtime. - */ - if (tnl->save.copied.nr) - { - GLfloat *data = tnl->save.copied.buffer; - GLfloat *dest = tnl->save.buffer; - GLuint j; - - /* Need to note this and fix up at runtime (or loopback): - */ - if (tnl->save.currentsz[attr][0] == 0) { - assert(oldsz == 0); - tnl->save.dangling_attr_ref = GL_TRUE; - -/* _mesa_debug(NULL, "_save_upgrade_vertex: dangling reference attr %d\n", */ -/* attr); */ - -#if 0 - /* The current strategy is to punt these degenerate cases - * through _tnl_loopback_vertex_list(), a lower-performance - * option. To minimize the impact of this, artificially - * reduce the size of this vertex_list. - */ - if (t->save.counter > 10) { - t->save.initial_counter = 10; - t->save.counter = 10; - } -#endif - } - - for (i = 0 ; i < tnl->save.copied.nr ; i++) { - for (j = 0 ; j < _TNL_ATTRIB_MAX ; j++) { - if (tnl->save.attrsz[j]) { - if (j == attr) { - if (oldsz) { - COPY_CLEAN_4V( dest, oldsz, data ); - data += oldsz; - dest += newsz; - } - else { - COPY_SZ_4V( dest, newsz, tnl->save.current[attr] ); - dest += newsz; - } - } - else { - GLint sz = tnl->save.attrsz[j]; - COPY_SZ_4V( dest, sz, data ); - data += sz; - dest += sz; - } - } - } - } - - tnl->save.vbptr = dest; - tnl->save.counter -= tnl->save.copied.nr; - } -} - - - - -/* Helper function for 'CHOOSE' macro. Do what's necessary when an - * entrypoint is called for the first time. - */ -static void do_choose( GLuint attr, GLuint sz, - void (*attr_func)( const GLfloat *), - void (*choose1)( const GLfloat *), - void (*choose2)( const GLfloat *), - void (*choose3)( const GLfloat *), - void (*choose4)( const GLfloat *), - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - static GLfloat id[4] = { 0, 0, 0, 1 }; - int i; - - if (tnl->save.attrsz[attr] < sz) { - /* New size is larger. Need to flush existing vertices and get - * an enlarged vertex format. - */ - _save_upgrade_vertex( ctx, attr, sz ); - } - else { - /* New size is equal or smaller - just need to fill in some - * zeros. - */ - for (i = sz ; i <= tnl->save.attrsz[attr] ; i++) - tnl->save.attrptr[attr][i-1] = id[i-1]; - } - - /* Reset any active pointers for this attribute - */ - tnl->save.tabfv[attr][0] = choose1; - tnl->save.tabfv[attr][1] = choose2; - tnl->save.tabfv[attr][2] = choose3; - tnl->save.tabfv[attr][3] = choose4; - - /* Update the secondary dispatch table with the new function - */ - tnl->save.tabfv[attr][sz-1] = attr_func; - - (*attr_func)(v); -} - - - -/* Only one size for each attribute may be active at once. Eg. if - * Color3f is installed/active, then Color4f may not be, even if the - * vertex actually contains 4 color coordinates. This is because the - * 3f version won't otherwise set color[3] to 1.0 -- this is the job - * of the chooser function when switching between Color4f and Color3f. - */ -#define ATTRFV( ATTR, N ) \ -static void save_choose_##ATTR##_##N( const GLfloat *v ); \ - \ -static void save_attrib_##ATTR##_##N( const GLfloat *v ) \ -{ \ - GET_CURRENT_CONTEXT( ctx ); \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - \ - if ((ATTR) == 0) { \ - GLuint i; \ - \ - if (N>0) tnl->save.vbptr[0] = v[0]; \ - if (N>1) tnl->save.vbptr[1] = v[1]; \ - if (N>2) tnl->save.vbptr[2] = v[2]; \ - if (N>3) tnl->save.vbptr[3] = v[3]; \ - \ - for (i = N; i < tnl->save.vertex_size; i++) \ - tnl->save.vbptr[i] = tnl->save.vertex[i]; \ - \ - tnl->save.vbptr += tnl->save.vertex_size; \ - \ - if (--tnl->save.counter == 0) \ - _save_wrap_filled_vertex( ctx ); \ - } \ - else { \ - GLfloat *dest = tnl->save.attrptr[ATTR]; \ - if (N>0) dest[0] = v[0]; \ - if (N>1) dest[1] = v[1]; \ - if (N>2) dest[2] = v[2]; \ - if (N>3) dest[3] = v[3]; \ - } \ -} - -#define CHOOSE( ATTR, N ) \ -static void save_choose_##ATTR##_##N( const GLfloat *v ) \ -{ \ - do_choose(ATTR, N, \ - save_attrib_##ATTR##_##N, \ - save_choose_##ATTR##_1, \ - save_choose_##ATTR##_2, \ - save_choose_##ATTR##_3, \ - save_choose_##ATTR##_4, \ - v ); \ -} - -#define INIT(ATTR) \ -static void save_init_##ATTR( TNLcontext *tnl ) \ -{ \ - tnl->save.tabfv[ATTR][0] = save_choose_##ATTR##_1; \ - tnl->save.tabfv[ATTR][1] = save_choose_##ATTR##_2; \ - tnl->save.tabfv[ATTR][2] = save_choose_##ATTR##_3; \ - tnl->save.tabfv[ATTR][3] = save_choose_##ATTR##_4; \ -} - -#define ATTRS( ATTRIB ) \ - ATTRFV( ATTRIB, 1 ) \ - ATTRFV( ATTRIB, 2 ) \ - ATTRFV( ATTRIB, 3 ) \ - ATTRFV( ATTRIB, 4 ) \ - CHOOSE( ATTRIB, 1 ) \ - CHOOSE( ATTRIB, 2 ) \ - CHOOSE( ATTRIB, 3 ) \ - CHOOSE( ATTRIB, 4 ) \ - INIT( ATTRIB ) \ - - -/* Generate a lot of functions. These are the actual worker - * functions, which are equivalent to those generated via codegen - * elsewhere. - */ -ATTRS( 0 ) -ATTRS( 1 ) -ATTRS( 2 ) -ATTRS( 3 ) -ATTRS( 4 ) -ATTRS( 5 ) -ATTRS( 6 ) -ATTRS( 7 ) -ATTRS( 8 ) -ATTRS( 9 ) -ATTRS( 10 ) -ATTRS( 11 ) -ATTRS( 12 ) -ATTRS( 13 ) -ATTRS( 14 ) -ATTRS( 15 ) - -ATTRS( 16 ) -ATTRS( 17 ) -ATTRS( 18 ) -ATTRS( 19 ) -ATTRS( 20 ) -ATTRS( 21 ) -ATTRS( 22 ) -ATTRS( 23 ) -ATTRS( 24 ) -ATTRS( 25 ) -ATTRS( 26 ) -ATTRS( 27 ) -ATTRS( 28 ) -ATTRS( 29 ) -ATTRS( 30 ) -ATTRS( 31 ) - - -static void _save_reset_vertex( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint i; - - /* conventional attributes */ - save_init_0( tnl ); - save_init_1( tnl ); - save_init_2( tnl ); - save_init_3( tnl ); - save_init_4( tnl ); - save_init_5( tnl ); - save_init_6( tnl ); - save_init_7( tnl ); - save_init_8( tnl ); - save_init_9( tnl ); - save_init_10( tnl ); - save_init_11( tnl ); - save_init_12( tnl ); - save_init_13( tnl ); - save_init_14( tnl ); - save_init_15( tnl ); - - /* generic attributes */ - save_init_16( tnl ); - save_init_17( tnl ); - save_init_18( tnl ); - save_init_19( tnl ); - save_init_20( tnl ); - save_init_21( tnl ); - save_init_22( tnl ); - save_init_23( tnl ); - save_init_24( tnl ); - save_init_25( tnl ); - save_init_26( tnl ); - save_init_27( tnl ); - save_init_28( tnl ); - save_init_29( tnl ); - save_init_30( tnl ); - save_init_31( tnl ); - - for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) - tnl->save.attrsz[i] = 0; - - tnl->save.vertex_size = 0; - tnl->save.have_materials = 0; - - _save_reset_counters( ctx ); -} - - - -/* Cope with aliasing of classic Vertex, Normal, etc. and the fan-out - * of glMultTexCoord and glProgramParamterNV by routing all these - * through a second level dispatch table. - */ -#define DISPATCH_ATTRFV( ATTR, COUNT, P ) \ -do { \ - GET_CURRENT_CONTEXT( ctx ); \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - tnl->save.tabfv[ATTR][COUNT-1]( P ); \ -} while (0) - -#define DISPATCH_ATTR1FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 1, V ) -#define DISPATCH_ATTR2FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 2, V ) -#define DISPATCH_ATTR3FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 3, V ) -#define DISPATCH_ATTR4FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 4, V ) - -#define DISPATCH_ATTR1F( ATTR, S ) DISPATCH_ATTRFV( ATTR, 1, &(S) ) - -#if defined(USE_X86_ASM) && 0 /* will break register calling convention */ -/* Naughty cheat: - */ -#define DISPATCH_ATTR2F( ATTR, S,T ) DISPATCH_ATTRFV( ATTR, 2, &(S) ) -#define DISPATCH_ATTR3F( ATTR, S,T,R ) DISPATCH_ATTRFV( ATTR, 3, &(S) ) -#define DISPATCH_ATTR4F( ATTR, S,T,R,Q ) DISPATCH_ATTRFV( ATTR, 4, &(S) ) -#else -/* Safe: - */ -#define DISPATCH_ATTR2F( ATTR, S,T ) \ -do { \ - GLfloat v[2]; \ - v[0] = S; v[1] = T; \ - DISPATCH_ATTR2FV( ATTR, v ); \ -} while (0) -#define DISPATCH_ATTR3F( ATTR, S,T,R ) \ -do { \ - GLfloat v[3]; \ - v[0] = S; v[1] = T; v[2] = R; \ - DISPATCH_ATTR3FV( ATTR, v ); \ -} while (0) -#define DISPATCH_ATTR4F( ATTR, S,T,R,Q ) \ -do { \ - GLfloat v[4]; \ - v[0] = S; v[1] = T; v[2] = R; v[3] = Q; \ - DISPATCH_ATTR4FV( ATTR, v ); \ -} while (0) -#endif - - -static void enum_error( void ) -{ - GET_CURRENT_CONTEXT( ctx ); - _mesa_compile_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" ); -} - -static void GLAPIENTRY _save_Vertex2f( GLfloat x, GLfloat y ) -{ - DISPATCH_ATTR2F( _TNL_ATTRIB_POS, x, y ); -} - -static void GLAPIENTRY _save_Vertex2fv( const GLfloat *v ) -{ - DISPATCH_ATTR2FV( _TNL_ATTRIB_POS, v ); -} - -static void GLAPIENTRY _save_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) -{ - DISPATCH_ATTR3F( _TNL_ATTRIB_POS, x, y, z ); -} - -static void GLAPIENTRY _save_Vertex3fv( const GLfloat *v ) -{ - DISPATCH_ATTR3FV( _TNL_ATTRIB_POS, v ); -} - -static void GLAPIENTRY _save_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - DISPATCH_ATTR4F( _TNL_ATTRIB_POS, x, y, z, w ); -} - -static void GLAPIENTRY _save_Vertex4fv( const GLfloat *v ) -{ - DISPATCH_ATTR4FV( _TNL_ATTRIB_POS, v ); -} - -static void GLAPIENTRY _save_TexCoord1f( GLfloat x ) -{ - DISPATCH_ATTR1F( _TNL_ATTRIB_TEX0, x ); -} - -static void GLAPIENTRY _save_TexCoord1fv( const GLfloat *v ) -{ - DISPATCH_ATTR1FV( _TNL_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY _save_TexCoord2f( GLfloat x, GLfloat y ) -{ - DISPATCH_ATTR2F( _TNL_ATTRIB_TEX0, x, y ); -} - -static void GLAPIENTRY _save_TexCoord2fv( const GLfloat *v ) -{ - DISPATCH_ATTR2FV( _TNL_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY _save_TexCoord3f( GLfloat x, GLfloat y, GLfloat z ) -{ - DISPATCH_ATTR3F( _TNL_ATTRIB_TEX0, x, y, z ); -} - -static void GLAPIENTRY _save_TexCoord3fv( const GLfloat *v ) -{ - DISPATCH_ATTR3FV( _TNL_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY _save_TexCoord4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - DISPATCH_ATTR4F( _TNL_ATTRIB_TEX0, x, y, z, w ); -} - -static void GLAPIENTRY _save_TexCoord4fv( const GLfloat *v ) -{ - DISPATCH_ATTR4FV( _TNL_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY _save_Normal3f( GLfloat x, GLfloat y, GLfloat z ) -{ - DISPATCH_ATTR3F( _TNL_ATTRIB_NORMAL, x, y, z ); -} - -static void GLAPIENTRY _save_Normal3fv( const GLfloat *v ) -{ - DISPATCH_ATTR3FV( _TNL_ATTRIB_NORMAL, v ); -} - -static void GLAPIENTRY _save_FogCoordfEXT( GLfloat x ) -{ - DISPATCH_ATTR1F( _TNL_ATTRIB_FOG, x ); -} - -static void GLAPIENTRY _save_FogCoordfvEXT( const GLfloat *v ) -{ - DISPATCH_ATTR1FV( _TNL_ATTRIB_FOG, v ); -} - -static void GLAPIENTRY _save_Color3f( GLfloat x, GLfloat y, GLfloat z ) -{ - DISPATCH_ATTR3F( _TNL_ATTRIB_COLOR0, x, y, z ); -} - -static void GLAPIENTRY _save_Color3fv( const GLfloat *v ) -{ - DISPATCH_ATTR3FV( _TNL_ATTRIB_COLOR0, v ); -} - -static void GLAPIENTRY _save_Color4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - DISPATCH_ATTR4F( _TNL_ATTRIB_COLOR0, x, y, z, w ); -} - -static void GLAPIENTRY _save_Color4fv( const GLfloat *v ) -{ - DISPATCH_ATTR4FV( _TNL_ATTRIB_COLOR0, v ); -} - -static void GLAPIENTRY _save_SecondaryColor3fEXT( GLfloat x, GLfloat y, GLfloat z ) -{ - DISPATCH_ATTR3F( _TNL_ATTRIB_COLOR1, x, y, z ); -} - -static void GLAPIENTRY _save_SecondaryColor3fvEXT( const GLfloat *v ) -{ - DISPATCH_ATTR3FV( _TNL_ATTRIB_COLOR1, v ); -} - -static void GLAPIENTRY _save_MultiTexCoord1f( GLenum target, GLfloat x ) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR1F( attr, x ); -} - -static void GLAPIENTRY _save_MultiTexCoord1fv( GLenum target, const GLfloat *v ) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR1FV( attr, v ); -} - -static void GLAPIENTRY _save_MultiTexCoord2f( GLenum target, GLfloat x, GLfloat y ) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR2F( attr, x, y ); -} - -static void GLAPIENTRY _save_MultiTexCoord2fv( GLenum target, const GLfloat *v ) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR2FV( attr, v ); -} - -static void GLAPIENTRY _save_MultiTexCoord3f( GLenum target, GLfloat x, GLfloat y, - GLfloat z) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR3F( attr, x, y, z ); -} - -static void GLAPIENTRY _save_MultiTexCoord3fv( GLenum target, const GLfloat *v ) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR3FV( attr, v ); -} - -static void GLAPIENTRY _save_MultiTexCoord4f( GLenum target, GLfloat x, GLfloat y, - GLfloat z, GLfloat w ) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR4F( attr, x, y, z, w ); -} - -static void GLAPIENTRY _save_MultiTexCoord4fv( GLenum target, const GLfloat *v ) -{ - GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; - DISPATCH_ATTR4FV( attr, v ); -} - - - -static void GLAPIENTRY -_save_VertexAttrib1fNV(GLuint index, GLfloat x) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR1F( index, x ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib1fvNV(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR1FV( index, v ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR2F( index, x, y ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib2fvNV(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR2FV( index, v ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR3F( index, x, y, z ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib3fvNV(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR3FV( index, v ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, - GLfloat z, GLfloat w) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR4F( index, x, y, z, w ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib4fvNV(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR4FV( index, v ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib1fARB(GLuint index, GLfloat x) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR1F( index, x ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib1fvARB(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR1FV( index, v ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR2F( index, x, y ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib2fvARB(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR2FV( index, v ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR3F( index, x, y, z ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib3fvARB(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR3FV( index, v ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, - GLfloat z, GLfloat w) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR4F( index, x, y, z, w ); - } - else - enum_error(); -} - -static void GLAPIENTRY -_save_VertexAttrib4fvARB(GLuint index, const GLfloat *v) -{ - if (index < MAX_VERTEX_ATTRIBS) { - if (index > 0) - index += VERT_ATTRIB_GENERIC0; - DISPATCH_ATTR4FV( index, v ); - } - else - enum_error(); -} - - -/* Materials: - * - * These are treated as per-vertex attributes, at indices above where - * the NV_vertex_program leaves off. There are a lot of good things - * about treating materials this way. - * - * However: I don't want to double the number of generated functions - * just to cope with this, so I unroll the 'C' varients of CHOOSE and - * ATTRF into this function, and dispense with codegen and - * second-level dispatch. - * - * There is no aliasing of material attributes with other entrypoints. - */ -#define MAT_ATTR( A, N, params ) \ -do { \ - if (tnl->save.attrsz[A] < N) { \ - _save_upgrade_vertex( ctx, A, N ); \ - tnl->save.have_materials = GL_TRUE; \ - } \ - \ - { \ - GLfloat *dest = tnl->save.attrptr[A]; \ - if (N>0) dest[0] = params[0]; \ - if (N>1) dest[1] = params[1]; \ - if (N>2) dest[2] = params[2]; \ - if (N>3) dest[3] = params[3]; \ - } \ -} while (0) - - -#define MAT( ATTR, N, face, params ) \ -do { \ - if (face != GL_BACK) \ - MAT_ATTR( ATTR, N, params ); /* front */ \ - if (face != GL_FRONT) \ - MAT_ATTR( ATTR + 1, N, params ); /* back */ \ -} while (0) - - -/* NOTE: Have to remove/deal-with colormaterial crossovers, probably - * later on - in the meantime just store everything. - */ -static void GLAPIENTRY _save_Materialfv( GLenum face, GLenum pname, - const GLfloat *params ) -{ - GET_CURRENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - - switch (pname) { - case GL_EMISSION: - MAT( _TNL_ATTRIB_MAT_FRONT_EMISSION, 4, face, params ); - break; - case GL_AMBIENT: - MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params ); - break; - case GL_DIFFUSE: - MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); - break; - case GL_SPECULAR: - MAT( _TNL_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params ); - break; - case GL_SHININESS: - MAT( _TNL_ATTRIB_MAT_FRONT_SHININESS, 1, face, params ); - break; - case GL_COLOR_INDEXES: - MAT( _TNL_ATTRIB_MAT_FRONT_INDEXES, 3, face, params ); - break; - case GL_AMBIENT_AND_DIFFUSE: - MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params ); - MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); - break; - default: - _mesa_compile_error( ctx, GL_INVALID_ENUM, "glMaterialfv" ); - return; - } -} - - -#define IDX_ATTR( A, IDX ) \ -do { \ - GET_CURRENT_CONTEXT( ctx ); \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - \ - if (tnl->save.attrsz[A] < 1) { \ - _save_upgrade_vertex( ctx, A, 1 ); \ - } \ - \ - { \ - GLfloat *dest = tnl->save.attrptr[A]; \ - dest[0] = IDX; \ - } \ -} while (0) - - -static void GLAPIENTRY _save_EdgeFlag( GLboolean b ) -{ - IDX_ATTR( _TNL_ATTRIB_EDGEFLAG, (GLfloat)b ); -} - - -static void GLAPIENTRY _save_Indexf( GLfloat f ) -{ - IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f ); -} - -static void GLAPIENTRY _save_Indexfv( const GLfloat *f ) -{ - IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f[0] ); -} - - - - -/* Cope with EvalCoord/CallList called within a begin/end object: - * -- Flush current buffer - * -- Fallback to opcodes for the rest of the begin/end object. - */ -#define FALLBACK(ctx) \ -do { \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - \ - if (tnl->save.initial_counter != tnl->save.counter || \ - tnl->save.prim_count) \ - _save_compile_vertex_list( ctx ); \ - \ - _save_copy_to_current( ctx ); \ - _save_reset_vertex( ctx ); \ - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); \ - ctx->Driver.SaveNeedFlush = 0; \ -} while (0) - -static void GLAPIENTRY _save_EvalCoord1f( GLfloat u ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_EvalCoord1f(ctx->Save, ( u )); -} - -static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_EvalCoord1fv(ctx->Save, ( v )); -} - -static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_EvalCoord2f(ctx->Save, ( u, v )); -} - -static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_EvalCoord2fv(ctx->Save, ( v )); -} - -static void GLAPIENTRY _save_EvalPoint1( GLint i ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_EvalPoint1(ctx->Save, ( i )); -} - -static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_EvalPoint2(ctx->Save, ( i, j )); -} - -static void GLAPIENTRY _save_CallList( GLuint l ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_CallList(ctx->Save, ( l )); -} - -static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v ) -{ - GET_CURRENT_CONTEXT(ctx); - FALLBACK(ctx); - CALL_CallLists(ctx->Save, ( n, type, v )); -} - - - - -/** - * Called via ctx->Driver.NotifySaveBegin(ctx, mode) when we get a - * glBegin() call while compiling a display list. - * See save_Begin() in dlist.c - * - * This plugs in our special TNL-related display list functions. - * All subsequent glBegin/glVertex/glEnd()s found while compiling a - * display list will get routed to the functions in this file. - * - * Updating of ctx->Driver.CurrentSavePrimitive is already taken care of. - */ -static GLboolean _save_NotifyBegin( GLcontext *ctx, GLenum mode ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - if (1) { - GLuint i = tnl->save.prim_count++; - - assert(i < tnl->save.prim_max); - tnl->save.prim[i].mode = mode | PRIM_BEGIN; - tnl->save.prim[i].start = tnl->save.initial_counter - tnl->save.counter; - tnl->save.prim[i].count = 0; - - _mesa_install_save_vtxfmt( ctx, &tnl->save_vtxfmt ); - ctx->Driver.SaveNeedFlush = 1; - return GL_TRUE; - } - else - return GL_FALSE; -} - - - -static void GLAPIENTRY _save_End( void ) -{ - GET_CURRENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLint i = tnl->save.prim_count - 1; - - ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; - if (ctx->ExecuteFlag) - ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; - - tnl->save.prim[i].mode |= PRIM_END; - tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) - - tnl->save.prim[i].start); - - if (i == (GLint) tnl->save.prim_max - 1) { - _save_compile_vertex_list( ctx ); - assert(tnl->save.copied.nr == 0); - } - - /* Swap out this vertex format while outside begin/end. Any color, - * etc. received between here and the next begin will be compiled - * as opcodes. - */ - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); -} - - -/* These are all errors as this vtxfmt is only installed inside - * begin/end pairs. - */ -static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) count; (void) type; (void) indices; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" ); -} - - -static void GLAPIENTRY _save_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" ); -} - -static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) start; (void) count; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" ); -} - -static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - GET_CURRENT_CONTEXT(ctx); - (void) x1; (void) y1; (void) x2; (void) y2; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" ); -} - -static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) i1; (void) i2; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" ); -} - -static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2, - GLint j1, GLint j2 ) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) i1; (void) i2; (void) j1; (void) j2; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" ); -} - -/** - * This is only called if someone tries to compile nested glBegin()s - * in their display list. - */ -static void GLAPIENTRY _save_Begin( GLenum mode ) -{ - GET_CURRENT_CONTEXT( ctx ); - (void) mode; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, - "glBegin(called inside glBegin/End)"); -} - - -/* Unlike the functions above, these are to be hooked into the vtxfmt - * maintained in ctx->ListState, active when the list is known or - * suspected to be outside any begin/end primitive. - */ -static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - GET_CURRENT_CONTEXT(ctx); - _save_NotifyBegin( ctx, GL_QUADS | PRIM_WEAK ); - CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 )); - CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 )); - CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 )); - CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 )); - CALL_End(GET_DISPATCH(), ()); -} - - -static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) - return; - - _ae_map_vbos( ctx ); - - _save_NotifyBegin( ctx, mode | PRIM_WEAK ); - for (i = 0; i < count; i++) - CALL_ArrayElement(GET_DISPATCH(), (start + i)); - CALL_End(GET_DISPATCH(), ()); - - _ae_unmap_vbos( ctx ); -} - - -static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) - return; - - _ae_map_vbos( ctx ); - - _save_NotifyBegin( ctx, mode | PRIM_WEAK ); - - switch (type) { - case GL_UNSIGNED_BYTE: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] )); - break; - case GL_UNSIGNED_SHORT: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] )); - break; - case GL_UNSIGNED_INT: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] )); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" ); - break; - } - - CALL_End(GET_DISPATCH(), ()); - - _ae_unmap_vbos( ctx ); -} - -static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - if (_mesa_validate_DrawRangeElements( ctx, mode, - start, end, - count, type, indices )) - _save_OBE_DrawElements( mode, count, type, indices ); -} - - - - - -static void _save_vtxfmt_init( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLvertexformat *vfmt = &tnl->save_vtxfmt; - - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ - vfmt->Begin = _save_Begin; - vfmt->Color3f = _save_Color3f; - vfmt->Color3fv = _save_Color3fv; - vfmt->Color4f = _save_Color4f; - vfmt->Color4fv = _save_Color4fv; - vfmt->EdgeFlag = _save_EdgeFlag; - vfmt->End = _save_End; - vfmt->FogCoordfEXT = _save_FogCoordfEXT; - vfmt->FogCoordfvEXT = _save_FogCoordfvEXT; - vfmt->Indexf = _save_Indexf; - vfmt->Indexfv = _save_Indexfv; - vfmt->Materialfv = _save_Materialfv; - vfmt->MultiTexCoord1fARB = _save_MultiTexCoord1f; - vfmt->MultiTexCoord1fvARB = _save_MultiTexCoord1fv; - vfmt->MultiTexCoord2fARB = _save_MultiTexCoord2f; - vfmt->MultiTexCoord2fvARB = _save_MultiTexCoord2fv; - vfmt->MultiTexCoord3fARB = _save_MultiTexCoord3f; - vfmt->MultiTexCoord3fvARB = _save_MultiTexCoord3fv; - vfmt->MultiTexCoord4fARB = _save_MultiTexCoord4f; - vfmt->MultiTexCoord4fvARB = _save_MultiTexCoord4fv; - vfmt->Normal3f = _save_Normal3f; - vfmt->Normal3fv = _save_Normal3fv; - vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT; - vfmt->TexCoord1f = _save_TexCoord1f; - vfmt->TexCoord1fv = _save_TexCoord1fv; - vfmt->TexCoord2f = _save_TexCoord2f; - vfmt->TexCoord2fv = _save_TexCoord2fv; - vfmt->TexCoord3f = _save_TexCoord3f; - vfmt->TexCoord3fv = _save_TexCoord3fv; - vfmt->TexCoord4f = _save_TexCoord4f; - vfmt->TexCoord4fv = _save_TexCoord4fv; - vfmt->Vertex2f = _save_Vertex2f; - vfmt->Vertex2fv = _save_Vertex2fv; - vfmt->Vertex3f = _save_Vertex3f; - vfmt->Vertex3fv = _save_Vertex3fv; - vfmt->Vertex4f = _save_Vertex4f; - vfmt->Vertex4fv = _save_Vertex4fv; - vfmt->VertexAttrib1fNV = _save_VertexAttrib1fNV; - vfmt->VertexAttrib1fvNV = _save_VertexAttrib1fvNV; - vfmt->VertexAttrib2fNV = _save_VertexAttrib2fNV; - vfmt->VertexAttrib2fvNV = _save_VertexAttrib2fvNV; - vfmt->VertexAttrib3fNV = _save_VertexAttrib3fNV; - vfmt->VertexAttrib3fvNV = _save_VertexAttrib3fvNV; - vfmt->VertexAttrib4fNV = _save_VertexAttrib4fNV; - vfmt->VertexAttrib4fvNV = _save_VertexAttrib4fvNV; - vfmt->VertexAttrib1fARB = _save_VertexAttrib1fARB; - vfmt->VertexAttrib1fvARB = _save_VertexAttrib1fvARB; - vfmt->VertexAttrib2fARB = _save_VertexAttrib2fARB; - vfmt->VertexAttrib2fvARB = _save_VertexAttrib2fvARB; - vfmt->VertexAttrib3fARB = _save_VertexAttrib3fARB; - vfmt->VertexAttrib3fvARB = _save_VertexAttrib3fvARB; - vfmt->VertexAttrib4fARB = _save_VertexAttrib4fARB; - vfmt->VertexAttrib4fvARB = _save_VertexAttrib4fvARB; - - /* This will all require us to fallback to saving the list as opcodes: - */ - vfmt->CallList = _save_CallList; /* inside begin/end */ - vfmt->CallLists = _save_CallLists; /* inside begin/end */ - vfmt->EvalCoord1f = _save_EvalCoord1f; - vfmt->EvalCoord1fv = _save_EvalCoord1fv; - vfmt->EvalCoord2f = _save_EvalCoord2f; - vfmt->EvalCoord2fv = _save_EvalCoord2fv; - vfmt->EvalPoint1 = _save_EvalPoint1; - vfmt->EvalPoint2 = _save_EvalPoint2; - - /* These are all errors as we at least know we are in some sort of - * begin/end pair: - */ - vfmt->EvalMesh1 = _save_EvalMesh1; - vfmt->EvalMesh2 = _save_EvalMesh2; - vfmt->Begin = _save_Begin; - vfmt->Rectf = _save_Rectf; - vfmt->DrawArrays = _save_DrawArrays; - vfmt->DrawElements = _save_DrawElements; - vfmt->DrawRangeElements = _save_DrawRangeElements; - -} - - -void _tnl_SaveFlushVertices( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - /* Noop when we are actually active: - */ - if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM || - ctx->Driver.CurrentSavePrimitive <= GL_POLYGON) - return; - - if (tnl->save.initial_counter != tnl->save.counter || - tnl->save.prim_count) - _save_compile_vertex_list( ctx ); - - _save_copy_to_current( ctx ); - _save_reset_vertex( ctx ); - ctx->Driver.SaveNeedFlush = 0; -} - -void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - (void) list; (void) mode; - - if (!tnl->save.prim_store) - tnl->save.prim_store = alloc_prim_store( ctx ); - - if (!tnl->save.vertex_store) { - tnl->save.vertex_store = alloc_vertex_store( ctx ); - tnl->save.vbptr = tnl->save.vertex_store->buffer; - } - - _save_reset_vertex( ctx ); - ctx->Driver.SaveNeedFlush = 0; -} - -void _tnl_EndList( GLcontext *ctx ) -{ - (void) ctx; - assert(TNL_CONTEXT(ctx)->save.vertex_size == 0); -} - -void _tnl_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->save.replay_flags |= dlist->flags; - tnl->save.replay_flags |= tnl->LoopbackDListCassettes; -} - -void _tnl_EndCallList( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - if (ctx->ListState.CallDepth == 1) - tnl->save.replay_flags = 0; -} - - -static void _tnl_destroy_vertex_list( GLcontext *ctx, void *data ) -{ - struct tnl_vertex_list *node = (struct tnl_vertex_list *)data; - (void) ctx; - - if ( --node->vertex_store->refcount == 0 ) - FREE( node->vertex_store ); - - if ( --node->prim_store->refcount == 0 ) - FREE( node->prim_store ); - - if ( node->normal_lengths ) - FREE( node->normal_lengths ); -} - - -static void _tnl_print_vertex_list( GLcontext *ctx, void *data ) -{ - struct tnl_vertex_list *node = (struct tnl_vertex_list *)data; - GLuint i; - (void) ctx; - - _mesa_debug(NULL, "TNL-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", - node->count, - node->prim_count, - node->vertex_size); - - for (i = 0 ; i < node->prim_count ; i++) { - struct tnl_prim *prim = &node->prim[i]; - _mesa_debug(NULL, " prim %d: %s %d..%d %s %s\n", - i, - _mesa_lookup_enum_by_nr(prim->mode & PRIM_MODE_MASK), - prim->start, - prim->start + prim->count, - (prim->mode & PRIM_BEGIN) ? "BEGIN" : "(wrap)", - (prim->mode & PRIM_END) ? "END" : "(wrap)"); - } -} - - -static void _save_current_init( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLint i; - - for (i = 0; i < _TNL_ATTRIB_MAT_FRONT_AMBIENT; i++) { - ASSERT(i < VERT_ATTRIB_MAX); - tnl->save.currentsz[i] = &ctx->ListState.ActiveAttribSize[i]; - tnl->save.current[i] = ctx->ListState.CurrentAttrib[i]; - } - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - const GLuint j = i - _TNL_FIRST_MAT; - ASSERT(j < MAT_ATTRIB_MAX); - tnl->save.currentsz[i] = &ctx->ListState.ActiveMaterialSize[j]; - tnl->save.current[i] = ctx->ListState.CurrentMaterial[j]; - } - - tnl->save.currentsz[_TNL_ATTRIB_EDGEFLAG] = &ctx->ListState.ActiveEdgeFlag; - tnl->save.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->save.CurrentFloatEdgeFlag; -} - -/** - * Initialize the display list compiler - */ -void _tnl_save_init( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct tnl_vertex_arrays *tmp = &tnl->save_inputs; - GLuint i; - - - for (i = 0; i < _TNL_ATTRIB_MAX; i++) - _mesa_vector4f_init( &tmp->Attribs[i], 0, NULL); - - tnl->save.opcode_vertex_list = - _mesa_alloc_opcode( ctx, - sizeof(struct tnl_vertex_list), - _tnl_playback_vertex_list, - _tnl_destroy_vertex_list, - _tnl_print_vertex_list ); - - ctx->Driver.NotifySaveBegin = _save_NotifyBegin; - - _save_vtxfmt_init( ctx ); - _save_current_init( ctx ); - - /* Hook our array functions into the outside-begin-end vtxfmt in - * ctx->ListState. - */ - ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf; - ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays; - ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements; - ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements; - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); -} - - -/** - * Deallocate the immediate-mode buffer for the given context, if - * its reference count goes to zero. - */ -void _tnl_save_destroy( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - /* Decrement the refcounts. References may still be held by - * display lists yet to be destroyed, so it may not yet be time to - * free these items. - */ - if (tnl->save.prim_store && - --tnl->save.prim_store->refcount == 0 ) - FREE( tnl->save.prim_store ); - - if (tnl->save.vertex_store && - --tnl->save.vertex_store->refcount == 0 ) - FREE( tnl->save.vertex_store ); -} -- cgit v1.2.3 From 37aca21129d87946d2dc6b45fa5bacd514921550 Mon Sep 17 00:00:00 2001 From: zhang Date: Thu, 28 Jun 2007 08:12:52 -0600 Subject: a variety of fixes for MingW --- Makefile.mgw | 25 +++- include/GL/glu.h | 13 +++ include/GL/glut.h | 8 +- src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h | 3 +- src/glut/glx/glut_input.c | 3 + src/glut/glx/glut_joy.c | 3 + src/glut/glx/win32_util.c | 1 + src/glut/glx/win32_x11.h | 10 +- src/mesa/drivers/windows/gdi/wgl.c | 6 + src/mesa/drivers/windows/gdi/wmesa.c | 132 +++++++++++----------- src/mesa/main/glheader.h | 3 + src/mesa/vbo/vbo_exec_api.c | 5 + src/mesa/vbo/vbo_save_api.c | 4 + 13 files changed, 136 insertions(+), 80 deletions(-) (limited to 'src/mesa') diff --git a/Makefile.mgw b/Makefile.mgw index 70c264a8d86..948860890c0 100644 --- a/Makefile.mgw +++ b/Makefile.mgw @@ -51,16 +51,23 @@ # realclean: remove all generated files # +# MinGW core makefile updated for Mesa 7.0 +# +# updated : by Heromyth, 2007-6-25 +# Email : zxpmyth@yahoo.com.cn +# Bug : All the default settings work fine. But the setting X86=1 can't work. +# The others havn't been tested yet. + .PHONY : all libgl clean realclean ifeq ($(ICD),1) # when -std=c99 mingw will not define WIN32 - CFLAGS = -Wall -W -Werror + CFLAGS = -Wall -Werror else # I love c89 - CFLAGS = -Wall -W -pedantic + CFLAGS = -Wall -pedantic endif CFLAGS += -O2 -ffast-math @@ -72,16 +79,28 @@ else UNLINK = $(RM) $(1) endif -all: libgl +all: libgl libglu libglut libgl: lib $(MAKE) -f Makefile.mgw -C src/mesa +libglu: libgl + $(MAKE) -f Makefile.mgw -C src/glu/sgi + +libglut: libglu + $(MAKE) -f Makefile.mgw -C src/glut/glx + +example: libglut + $(MAKE) -f Makefile.mgw star -C progs/samples + copy progs\samples\star.exe lib + lib: mkdir lib clean: $(MAKE) -f Makefile.mgw clean -C src/mesa + $(MAKE) -f Makefile.mgw clean -C src/glu/sgi + $(MAKE) -f Makefile.mgw clean -C src/glut/glx realclean: clean -$(call UNLINK,lib/*.a) diff --git a/include/GL/glu.h b/include/GL/glu.h index c0bac75a8cc..d82103d141a 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -44,6 +44,19 @@ #define GLAPIENTRYP GLAPIENTRY * #endif +#ifdef GLAPI +#undef GLAPI +#endif + +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32) +# define GLAPI __declspec(dllexport) +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# endif /* _STATIC_MESA support */ + + #ifndef GLAPI #define GLAPI #endif diff --git a/include/GL/glut.h b/include/GL/glut.h index 23c740ee117..e0fad6e5cb0 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -115,7 +115,7 @@ extern _CRTIMP void __cdecl exit(int); #endif /* GLUT API entry point declarations for Win32. */ -#if defined(GLUT_BUILDING_LIB) && defined(_DLL) +#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && defined(_DLL) # define GLUTAPI __declspec(dllexport) #elif defined(_DLL) # define GLUTAPI __declspec(dllimport) @@ -131,8 +131,10 @@ extern _CRTIMP void __cdecl exit(int); # endif # define CALLBACK __stdcall typedef int (GLUTAPIENTRY *PROC)(); -typedef void *HGLRC; -typedef void *HDC; +#if !defined(__MINGW32__) + typedef void *HGLRC; + typedef void *HDC; +#endif typedef unsigned long COLORREF; #endif diff --git a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h index 7ff77394341..002549ecbd7 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h +++ b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h @@ -43,10 +43,9 @@ #include "definitions.h" #include "primitiveStream.h" #include "directedLine.h" +#include "arc.h" class Backend; -class Arc; -typedef Arc *Arc_ptr; class reflexChain{ Real2 *queue; diff --git a/src/glut/glx/glut_input.c b/src/glut/glx/glut_input.c index add3df7c3fd..a76ff9a435e 100644 --- a/src/glut/glx/glut_input.c +++ b/src/glut/glx/glut_input.c @@ -23,6 +23,9 @@ #endif #include #else +#ifdef __MINGW32__ +#include +#endif #include #ifndef __CYGWIN32__ #include /* Win32 Multimedia API header. */ diff --git a/src/glut/glx/glut_joy.c b/src/glut/glx/glut_joy.c index a4528ae1ce4..5025607922c 100644 --- a/src/glut/glx/glut_joy.c +++ b/src/glut/glx/glut_joy.c @@ -6,6 +6,9 @@ implied. This program is -not- in the public domain. */ #ifdef _WIN32 +#ifdef __MINGW32__ +#include +#endif #include #ifndef __CYGWIN32__ #include /* Win32 Multimedia API header. */ diff --git a/src/glut/glx/win32_util.c b/src/glut/glx/win32_util.c index becd823a409..25af48a1125 100644 --- a/src/glut/glx/win32_util.c +++ b/src/glut/glx/win32_util.c @@ -15,6 +15,7 @@ /* The following added by Paul Garceau */ #if defined(__MINGW32__) +#include #include #include struct timeval; diff --git a/src/glut/glx/win32_x11.h b/src/glut/glx/win32_x11.h index 1d8d048b2e0..6f5c3a9aeaf 100644 --- a/src/glut/glx/win32_x11.h +++ b/src/glut/glx/win32_x11.h @@ -6,16 +6,14 @@ /* This program is freely distributable without licensing fees and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ - +#ifdef __MINGW32__ +#include +#endif #include #include /* These definitions are missing from windows.h */ -WINGDIAPI int WINAPI wglChoosePixelFormat(HDC, PIXELFORMATDESCRIPTOR *); -WINGDIAPI int WINAPI wglDescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); -WINGDIAPI int WINAPI wglGetPixelFormat(HDC); -WINGDIAPI BOOL WINAPI wglSetPixelFormat(HDC, int, PIXELFORMATDESCRIPTOR *); -WINGDIAPI BOOL WINAPI wglSwapBuffers(HDC); + /* Type definitions (conversions) */ typedef int Visual; /* Win32 equivalent of X11 type */ diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c index 197de0743c7..49b4ddbd1f9 100644 --- a/src/mesa/drivers/windows/gdi/wgl.c +++ b/src/mesa/drivers/windows/gdi/wgl.c @@ -32,8 +32,14 @@ /* We're essentially building part of GDI here, so define this so that * we get the right export linkage. */ +#ifdef __MINGW32__ +#include +#include +#else #define _GDI32_ +#endif #include + #include "glapi.h" #include "GL/wmesa.h" /* protos for wmesa* functions */ diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index c5cd2c615b7..2eec188912e 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -1404,70 +1404,70 @@ void WMesaSwapBuffers( HDC hdc ) * table entries. Hopefully, I'll find a better solution. The * dispatch table generation scripts ought to be making these dummy * stubs as well. */ -void gl_dispatch_stub_543(void){}; -void gl_dispatch_stub_544(void){}; -void gl_dispatch_stub_545(void){}; -void gl_dispatch_stub_546(void){}; -void gl_dispatch_stub_547(void){}; -void gl_dispatch_stub_548(void){}; -void gl_dispatch_stub_549(void){}; -void gl_dispatch_stub_550(void){}; -void gl_dispatch_stub_551(void){}; -void gl_dispatch_stub_552(void){}; -void gl_dispatch_stub_553(void){}; -void gl_dispatch_stub_554(void){}; -void gl_dispatch_stub_555(void){}; -void gl_dispatch_stub_556(void){}; -void gl_dispatch_stub_557(void){}; -void gl_dispatch_stub_558(void){}; -void gl_dispatch_stub_559(void){}; -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_577(void){}; -void gl_dispatch_stub_578(void){}; -void gl_dispatch_stub_603(void){}; -void gl_dispatch_stub_645(void){}; -void gl_dispatch_stub_646(void){}; -void gl_dispatch_stub_647(void){}; -void gl_dispatch_stub_648(void){}; -void gl_dispatch_stub_649(void){}; -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_734(void){}; -void gl_dispatch_stub_735(void){}; -void gl_dispatch_stub_736(void){}; -void gl_dispatch_stub_737(void){}; -void gl_dispatch_stub_738(void){}; -void gl_dispatch_stub_745(void){}; -void gl_dispatch_stub_746(void){}; -void gl_dispatch_stub_760(void){}; -void gl_dispatch_stub_761(void){}; -void gl_dispatch_stub_766(void){}; -void gl_dispatch_stub_767(void){}; -void gl_dispatch_stub_768(void){}; - -void gl_dispatch_stub_562(void){}; -void gl_dispatch_stub_563(void){}; -void gl_dispatch_stub_564(void){}; -void gl_dispatch_stub_567(void){}; -void gl_dispatch_stub_568(void){}; -void gl_dispatch_stub_569(void){}; -void gl_dispatch_stub_580(void){}; -void gl_dispatch_stub_581(void){}; -void gl_dispatch_stub_606(void){}; -void gl_dispatch_stub_654(void){}; -void gl_dispatch_stub_655(void){}; -void gl_dispatch_stub_656(void){}; -void gl_dispatch_stub_739(void){}; -void gl_dispatch_stub_740(void){}; -void gl_dispatch_stub_741(void){}; -void gl_dispatch_stub_748(void){}; -void gl_dispatch_stub_749(void){}; -void gl_dispatch_stub_769(void){}; -void gl_dispatch_stub_770(void){}; -void gl_dispatch_stub_771(void){}; +void gl_dispatch_stub_543(void){} +void gl_dispatch_stub_544(void){} +void gl_dispatch_stub_545(void){} +void gl_dispatch_stub_546(void){} +void gl_dispatch_stub_547(void){} +void gl_dispatch_stub_548(void){} +void gl_dispatch_stub_549(void){} +void gl_dispatch_stub_550(void){} +void gl_dispatch_stub_551(void){} +void gl_dispatch_stub_552(void){} +void gl_dispatch_stub_553(void){} +void gl_dispatch_stub_554(void){} +void gl_dispatch_stub_555(void){} +void gl_dispatch_stub_556(void){} +void gl_dispatch_stub_557(void){} +void gl_dispatch_stub_558(void){} +void gl_dispatch_stub_559(void){} +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_577(void){} +void gl_dispatch_stub_578(void){} +void gl_dispatch_stub_603(void){} +void gl_dispatch_stub_645(void){} +void gl_dispatch_stub_646(void){} +void gl_dispatch_stub_647(void){} +void gl_dispatch_stub_648(void){} +void gl_dispatch_stub_649(void){} +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_734(void){} +void gl_dispatch_stub_735(void){} +void gl_dispatch_stub_736(void){} +void gl_dispatch_stub_737(void){} +void gl_dispatch_stub_738(void){} +void gl_dispatch_stub_745(void){} +void gl_dispatch_stub_746(void){} +void gl_dispatch_stub_760(void){} +void gl_dispatch_stub_761(void){} +void gl_dispatch_stub_766(void){} +void gl_dispatch_stub_767(void){} +void gl_dispatch_stub_768(void){} + +void gl_dispatch_stub_562(void){} +void gl_dispatch_stub_563(void){} +void gl_dispatch_stub_564(void){} +void gl_dispatch_stub_567(void){} +void gl_dispatch_stub_568(void){} +void gl_dispatch_stub_569(void){} +void gl_dispatch_stub_580(void){} +void gl_dispatch_stub_581(void){} +void gl_dispatch_stub_606(void){} +void gl_dispatch_stub_654(void){} +void gl_dispatch_stub_655(void){} +void gl_dispatch_stub_656(void){} +void gl_dispatch_stub_739(void){} +void gl_dispatch_stub_740(void){} +void gl_dispatch_stub_741(void){} +void gl_dispatch_stub_748(void){} +void gl_dispatch_stub_749(void){} +void gl_dispatch_stub_769(void){} +void gl_dispatch_stub_770(void){} +void gl_dispatch_stub_771(void){} diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 5abea137d74..63dd002a412 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -91,6 +91,9 @@ # pragma disable_message(201) /* Disable unreachable code warnings */ #endif +#ifdef WGLAPI +#undef WGLAPI +#endif #if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP) # if !defined(__GNUC__) /* mingw environment */ diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 8d13ef9d081..2d4ded0f984 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -43,6 +43,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vbo_context.h" +#ifdef ERROR +#undef ERROR +#endif + + static void reset_attrfv( struct vbo_exec_context *exec ); diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index c08fd1fe555..e7794c2a6cc 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -80,6 +80,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vbo_context.h" +#ifdef ERROR +#undef ERROR +#endif + /* * NOTE: Old 'parity' issue is gone, but copying can still be -- cgit v1.2.3 From 767cac149441ee0a8423713a9817c7ac154cbf9e Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 Jun 2007 16:34:40 -0600 Subject: Add a few missing GL 2.0 entrypoints, regenerate related files. Specifically: glVertexAttrib4bv glVertexAttrib4iv glVertexAttrib4ubv glVertexAttrib4uiv glVertexAttrib4usv --- src/mesa/drivers/dri/common/extension_helper.h | 20 +- src/mesa/glapi/gl_API.xml | 21 +- src/mesa/glapi/glapitemp.h | 30 +++ src/mesa/glapi/glprocs.h | 282 +++++++++++++------------ src/mesa/sparc/glapi_sparc.S | 5 + src/mesa/x86-64/glapi_x86-64.S | 5 + src/mesa/x86/glapi_x86.S | 6 + 7 files changed, 227 insertions(+), 142 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index 10f75edaaa4..bf103a3931f 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -1478,9 +1478,10 @@ static const char ImageTransformParameterfvHP_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4ivARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4iv\0" "glVertexAttrib4ivARB\0" ""; #endif @@ -1586,9 +1587,10 @@ static const char PixelTransformParameterfvEXT_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4bvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4bv\0" "glVertexAttrib4bvARB\0" ""; #endif @@ -2391,9 +2393,10 @@ static const char GetAttribLocationARB_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4ubvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4ubv\0" "glVertexAttrib4ubvARB\0" ""; #endif @@ -2910,9 +2913,10 @@ static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4usvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4usv\0" "glVertexAttrib4usvARB\0" ""; #endif @@ -4393,9 +4397,10 @@ static const char WindowPos4iMESA_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4uivARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4uiv\0" "glVertexAttrib4uivARB\0" ""; #endif @@ -6257,6 +6262,8 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = { { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, { CreateProgram_names, CreateProgram_remap_index, -1 }, { StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 }, + { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 }, + { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 }, { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, @@ -6270,6 +6277,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = { { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, + { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 }, { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, @@ -6282,6 +6290,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = { { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, + { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, @@ -6311,6 +6320,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = { { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, + { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 }, { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, { GetShaderiv_names, GetShaderiv_remap_index, -1 }, { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index c7b48c45b51..4bd3b2f0fb7 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -5605,7 +5605,10 @@ - + + + + @@ -5628,6 +5631,10 @@ + + + + @@ -5639,6 +5646,18 @@ + + + + + + + + + + + + diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 2a2fe2a35df..10af9b30858 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -3284,6 +3284,11 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v) +{ + DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v) { DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v)); @@ -3329,6 +3334,11 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v) DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v) +{ + DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v) { DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v)); @@ -3354,16 +3364,31 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v) DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v) +{ + DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v) { DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v) +{ + DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v) { DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v) +{ + DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v) { DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v)); @@ -6464,12 +6489,17 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(VertexAttrib4Nubv), TABLE_ENTRY(VertexAttrib4Nuiv), TABLE_ENTRY(VertexAttrib4Nusv), + TABLE_ENTRY(VertexAttrib4bv), TABLE_ENTRY(VertexAttrib4d), TABLE_ENTRY(VertexAttrib4dv), TABLE_ENTRY(VertexAttrib4f), TABLE_ENTRY(VertexAttrib4fv), + TABLE_ENTRY(VertexAttrib4iv), TABLE_ENTRY(VertexAttrib4s), TABLE_ENTRY(VertexAttrib4sv), + TABLE_ENTRY(VertexAttrib4ubv), + TABLE_ENTRY(VertexAttrib4uiv), + TABLE_ENTRY(VertexAttrib4usv), TABLE_ENTRY(VertexAttribPointer), TABLE_ENTRY(BindBuffer), TABLE_ENTRY(BufferData), diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index b6651a6bf4b..c461333c51e 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -958,12 +958,17 @@ static const char gl_string_table[] = "glVertexAttrib4Nubv\0" "glVertexAttrib4Nuiv\0" "glVertexAttrib4Nusv\0" + "glVertexAttrib4bv\0" "glVertexAttrib4d\0" "glVertexAttrib4dv\0" "glVertexAttrib4f\0" "glVertexAttrib4fv\0" + "glVertexAttrib4iv\0" "glVertexAttrib4s\0" "glVertexAttrib4sv\0" + "glVertexAttrib4ubv\0" + "glVertexAttrib4uiv\0" + "glVertexAttrib4usv\0" "glVertexAttribPointer\0" "glBindBuffer\0" "glBufferData\0" @@ -2102,142 +2107,147 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET(16297, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), NAME_FUNC_OFFSET(16317, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), NAME_FUNC_OFFSET(16337, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(16357, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(16374, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(16392, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(16409, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(16427, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(16444, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(16462, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(16484, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(16497, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(16510, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(16526, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(16542, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(16555, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(16578, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(16598, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(16617, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(16628, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(16640, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(16654, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(16667, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(16683, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(16694, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(16707, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(16726, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(16746, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(16759, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(16769, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(16785, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(16804, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(16822, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(16843, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(16858, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(16873, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(16887, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(16902, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(16914, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(16927, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(16939, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(16952, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(16964, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(16977, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(16989, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(17002, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(17014, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(17027, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17039, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17052, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17064, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(17077, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(17089, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(17102, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(17121, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(17140, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(17159, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(17172, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(17190, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(17211, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(17229, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(17249, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17263, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17280, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(17296, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(17315, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17333, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17354, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17376, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17395, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17417, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17440, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(17459, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(17479, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(17498, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(17518, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(17537, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(17557, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(17576, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(17596, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(17615, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(17635, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(17655, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(17676, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(17696, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(17717, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(17737, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(17758, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(17782, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(17800, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(17820, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(17838, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(17850, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(17863, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(17875, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(17888, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(17908, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(17932, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(17946, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(17963, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(17978, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(17996, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18010, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18027, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18042, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18060, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18074, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18091, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18106, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18124, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18138, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18155, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18170, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18188, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18202, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18219, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18234, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18252, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18266, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18283, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18298, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18316, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18330, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18347, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18362, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18380, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18394, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18411, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18426, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18444, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(18461, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(18481, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(18498, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18524, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18553, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(18568, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(18586, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(18605, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(18629, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(16357, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), + NAME_FUNC_OFFSET(16375, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(16392, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(16410, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(16427, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(16445, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), + NAME_FUNC_OFFSET(16463, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(16480, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(16498, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), + NAME_FUNC_OFFSET(16517, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), + NAME_FUNC_OFFSET(16536, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), + NAME_FUNC_OFFSET(16555, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(16577, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(16590, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(16603, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(16619, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(16635, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(16648, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(16671, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(16691, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(16710, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(16721, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(16733, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(16747, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(16760, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(16776, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(16787, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(16800, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(16819, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(16839, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(16852, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(16862, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(16878, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(16897, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(16915, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(16936, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(16951, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(16966, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(16980, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(16995, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(17007, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(17020, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(17032, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(17045, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(17057, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(17070, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(17082, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(17095, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(17107, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(17120, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(17132, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(17145, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(17157, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(17170, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(17182, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(17195, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(17214, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(17233, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(17252, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(17265, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(17283, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(17304, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(17322, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(17342, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17356, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17373, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(17389, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(17408, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17426, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17447, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17469, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17488, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17510, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17533, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(17552, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(17572, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(17591, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(17611, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(17630, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(17650, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(17669, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(17689, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(17708, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(17728, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(17748, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(17769, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(17789, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(17810, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(17830, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(17851, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(17875, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(17893, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(17913, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(17931, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(17943, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(17956, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(17968, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(17981, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18001, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18025, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18039, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18056, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18071, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18089, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18103, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18120, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18135, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18153, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18167, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18184, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18199, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18217, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18231, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18248, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18263, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18281, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18295, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18312, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18327, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18345, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18359, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18376, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18391, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18409, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18423, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18440, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18455, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18473, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18487, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18504, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18519, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18537, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(18554, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(18574, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(18591, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(18617, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(18646, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(18661, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(18679, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(18698, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(18722, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index d4ea12870fe..8725c7ee4d3 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -1733,12 +1733,17 @@ _mesa_sparc_glapi_end: .globl glVertexAttrib4Nubv ; .type glVertexAttrib4Nubv,#function ; glVertexAttrib4Nubv = glVertexAttrib4NubvARB .globl glVertexAttrib4Nuiv ; .type glVertexAttrib4Nuiv,#function ; glVertexAttrib4Nuiv = glVertexAttrib4NuivARB .globl glVertexAttrib4Nusv ; .type glVertexAttrib4Nusv,#function ; glVertexAttrib4Nusv = glVertexAttrib4NusvARB + .globl glVertexAttrib4bv ; .type glVertexAttrib4bv,#function ; glVertexAttrib4bv = glVertexAttrib4bvARB .globl glVertexAttrib4d ; .type glVertexAttrib4d,#function ; glVertexAttrib4d = glVertexAttrib4dARB .globl glVertexAttrib4dv ; .type glVertexAttrib4dv,#function ; glVertexAttrib4dv = glVertexAttrib4dvARB .globl glVertexAttrib4f ; .type glVertexAttrib4f,#function ; glVertexAttrib4f = glVertexAttrib4fARB .globl glVertexAttrib4fv ; .type glVertexAttrib4fv,#function ; glVertexAttrib4fv = glVertexAttrib4fvARB + .globl glVertexAttrib4iv ; .type glVertexAttrib4iv,#function ; glVertexAttrib4iv = glVertexAttrib4ivARB .globl glVertexAttrib4s ; .type glVertexAttrib4s,#function ; glVertexAttrib4s = glVertexAttrib4sARB .globl glVertexAttrib4sv ; .type glVertexAttrib4sv,#function ; glVertexAttrib4sv = glVertexAttrib4svARB + .globl glVertexAttrib4ubv ; .type glVertexAttrib4ubv,#function ; glVertexAttrib4ubv = glVertexAttrib4ubvARB + .globl glVertexAttrib4uiv ; .type glVertexAttrib4uiv,#function ; glVertexAttrib4uiv = glVertexAttrib4uivARB + .globl glVertexAttrib4usv ; .type glVertexAttrib4usv,#function ; glVertexAttrib4usv = glVertexAttrib4usvARB .globl glVertexAttribPointer ; .type glVertexAttribPointer,#function ; glVertexAttribPointer = glVertexAttribPointerARB .globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB .globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index e62dde8a2f7..171e95d1b83 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -29398,12 +29398,17 @@ GL_PREFIX(_dispatch_stub_772): .globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB) .globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB) .globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB) + .globl GL_PREFIX(VertexAttrib4bv) ; .set GL_PREFIX(VertexAttrib4bv), GL_PREFIX(VertexAttrib4bvARB) .globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB) .globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB) .globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB) .globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB) + .globl GL_PREFIX(VertexAttrib4iv) ; .set GL_PREFIX(VertexAttrib4iv), GL_PREFIX(VertexAttrib4ivARB) .globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB) .globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB) + .globl GL_PREFIX(VertexAttrib4ubv) ; .set GL_PREFIX(VertexAttrib4ubv), GL_PREFIX(VertexAttrib4ubvARB) + .globl GL_PREFIX(VertexAttrib4uiv) ; .set GL_PREFIX(VertexAttrib4uiv), GL_PREFIX(VertexAttrib4uivARB) + .globl GL_PREFIX(VertexAttrib4usv) ; .set GL_PREFIX(VertexAttrib4usv), GL_PREFIX(VertexAttrib4usvARB) .globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB) .globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB) .globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB) diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 74e93721bc3..1d04779d148 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -63,6 +63,7 @@ #else # define CTX_INSNS NOP /* Pad for init_glapi_relocs() */ #endif + # define GL_STUB(fn,off,fn_alt) \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ @@ -1128,12 +1129,17 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8) GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8) GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8) + GL_STUB_ALIAS(VertexAttrib4bv, _gloffset_VertexAttrib4bvARB, VertexAttrib4bv@8, VertexAttrib4bvARB, VertexAttrib4bvARB@8) GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36) GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8) GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20) GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8) + GL_STUB_ALIAS(VertexAttrib4iv, _gloffset_VertexAttrib4ivARB, VertexAttrib4iv@8, VertexAttrib4ivARB, VertexAttrib4ivARB@8) GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20) GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8) + GL_STUB_ALIAS(VertexAttrib4ubv, _gloffset_VertexAttrib4ubvARB, VertexAttrib4ubv@8, VertexAttrib4ubvARB, VertexAttrib4ubvARB@8) + GL_STUB_ALIAS(VertexAttrib4uiv, _gloffset_VertexAttrib4uivARB, VertexAttrib4uiv@8, VertexAttrib4uivARB, VertexAttrib4uivARB@8) + GL_STUB_ALIAS(VertexAttrib4usv, _gloffset_VertexAttrib4usvARB, VertexAttrib4usv@8, VertexAttrib4usvARB, VertexAttrib4usvARB@8) GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24) GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8) GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16) -- cgit v1.2.3 From 17e81bda6ed1d2cc4e5c0fad895030911b4fa53c Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 8 Jun 2007 13:27:57 +1000 Subject: nouveau: NV30_TCL viewport/scissor fixes --- src/mesa/drivers/dri/nouveau/nouveau_buffers.c | 4 +++ src/mesa/drivers/dri/nouveau/nouveau_context.h | 2 +- src/mesa/drivers/dri/nouveau/nouveau_state.c | 4 +-- src/mesa/drivers/dri/nouveau/nv30_state.c | 50 ++++++++++++++++++-------- 4 files changed, 43 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c index b54f68f4023..e3968bd02fc 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c @@ -299,6 +299,8 @@ nouveau_cliprects_drawable_set(nouveauContextPtr nmesa, nmesa->pClipRects = dPriv->pClipRects; nmesa->drawX = dPriv->x; nmesa->drawY = dPriv->y; + nmesa->drawW = dPriv->w; + nmesa->drawH = dPriv->h; } static void @@ -313,6 +315,8 @@ nouveau_cliprects_renderbuffer_set(nouveauContextPtr nmesa, nmesa->osClipRect.y2 = nrb->mesa.Height; nmesa->drawX = 0; nmesa->drawY = 0; + nmesa->drawW = nrb->mesa.Width; + nmesa->drawH = nrb->mesa.Height; } void diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 87e4479da34..53f3393676f 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -150,7 +150,7 @@ typedef struct nouveau_context { GLuint numClipRects; drm_clip_rect_t *pClipRects; drm_clip_rect_t osClipRect; - GLuint drawX, drawY; + GLuint drawX, drawY, drawW, drawH; /* The rendering context information */ GLenum current_primitive; /* the current primitive enum */ diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e9fd188d73e..7cb805902a7 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c @@ -60,14 +60,14 @@ static void nouveauCalcViewport(GLcontext *ctx) nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); const GLfloat *v = ctx->Viewport._WindowMap.m; GLfloat *m = nmesa->viewport.m; - GLfloat xoffset = nmesa->drawX, yoffset = nmesa->drawY; + GLfloat xoffset = nmesa->drawX, yoffset = nmesa->drawY + nmesa->drawH; nmesa->depth_scale = 1.0 / ctx->DrawBuffer->_DepthMaxF; m[MAT_SX] = v[MAT_SX]; m[MAT_TX] = v[MAT_TX] + xoffset + SUBPIXEL_X; m[MAT_SY] = - v[MAT_SY]; - m[MAT_TY] = v[MAT_TY] + yoffset + SUBPIXEL_Y; + m[MAT_TY] = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y; m[MAT_SZ] = v[MAT_SZ] * nmesa->depth_scale; m[MAT_TZ] = v[MAT_TZ] * nmesa->depth_scale; diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c index ad21fa27302..d329071d1ee 100644 --- a/src/mesa/drivers/dri/nouveau/nv30_state.c +++ b/src/mesa/drivers/dri/nouveau/nv30_state.c @@ -639,25 +639,45 @@ void (*ReadBuffer)( GLcontext *ctx, GLenum buffer ); /** Set rasterization mode */ void (*RenderMode)(GLcontext *ctx, GLenum mode ); +/* Translate GL coords to window coords, clamping w/h to the + * dimensions of the window. + */ +static void nv30WindowCoords(nouveauContextPtr nmesa, + GLuint x, GLuint y, GLuint w, GLuint h, + GLuint *wX, GLuint *wY, GLuint *wW, GLuint *wH) +{ + if ((x+w) > nmesa->drawW) + w = nmesa->drawW - x; + (*wX) = x + nmesa->drawX; + (*wW) = w; + + if ((y+h) > nmesa->drawH) + h = nmesa->drawH - y; + (*wY) = (nmesa->drawH - y) - h + nmesa->drawY; + (*wH) = h; +} + /** Define the scissor box */ static void nv30Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); + GLuint wX, wY, wW, wH; /* There's no scissor enable bit, so adjust the scissor to cover the * maximum draw buffer bounds */ if (!ctx->Scissor.Enabled) { - x = y = 0; - w = h = 4095; + wX = nmesa->drawX; + wY = nmesa->drawY; + wW = nmesa->drawW; + wH = nmesa->drawH; } else { - x += nmesa->drawX; - y += nmesa->drawY; + nv30WindowCoords(nmesa, x, y, w, h, &wX, &wY, &wW, &wH); } BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2); - OUT_RING_CACHE(((w) << 16) | x); - OUT_RING_CACHE(((h) << 16) | y); + OUT_RING_CACHE ((wW << 16) | wX); + OUT_RING_CACHE ((wH << 16) | wY); } /** Select flat or smooth shading */ @@ -751,19 +771,21 @@ static void nv30WindowMoved(nouveauContextPtr nmesa) { GLcontext *ctx = nmesa->glCtx; GLfloat *v = nmesa->viewport.m; - GLuint w = ctx->Viewport.Width; - GLuint h = ctx->Viewport.Height; - GLuint x = ctx->Viewport.X + nmesa->drawX; - GLuint y = ctx->Viewport.Y + nmesa->drawY; + GLuint wX, wY, wW, wH; + nv30WindowCoords(nmesa, ctx->Viewport.X, ctx->Viewport.Y, + ctx->Viewport.Width, ctx->Viewport.Height, + &wX, &wY, &wW, &wH); BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_DIMS_0, 2); - OUT_RING_CACHE((w << 16) | x); - OUT_RING_CACHE((h << 16) | y); + OUT_RING_CACHE ((wW << 16) | wX); + OUT_RING_CACHE ((wH << 16) | wY); + /* something to do with clears, possibly doesn't belong here */ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_OFS0, 2); - OUT_RING_CACHE(((w+x) << 16) | x); - OUT_RING_CACHE(((h+y) << 16) | y); + OUT_RING_CACHE(((nmesa->drawX + nmesa->drawW) << 16) | nmesa->drawX); + OUT_RING_CACHE(((nmesa->drawY + nmesa->drawH) << 16) | nmesa->drawY); + /* viewport transform */ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_OX, 8); OUT_RING_CACHEf (v[MAT_TX]); -- cgit v1.2.3 From 5e4a0f42f243cd5fbc8718660d78705e8c70808f Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sun, 10 Jun 2007 03:05:05 +1000 Subject: nouveau: match drm changes (0.0.7) --- src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c | 6 +-- src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h | 2 +- src/mesa/drivers/dri/nouveau/nouveau_buffers.c | 6 +-- src/mesa/drivers/dri/nouveau/nouveau_context.c | 4 +- src/mesa/drivers/dri/nouveau/nouveau_context.h | 11 ++-- src/mesa/drivers/dri/nouveau/nouveau_fifo.c | 14 ++++- src/mesa/drivers/dri/nouveau/nouveau_object.c | 59 ++------------------- src/mesa/drivers/dri/nouveau/nouveau_object.h | 14 +---- src/mesa/drivers/dri/nouveau/nouveau_query.c | 9 ++-- src/mesa/drivers/dri/nouveau/nouveau_screen.c | 2 +- src/mesa/drivers/dri/nouveau/nouveau_span.c | 5 +- src/mesa/drivers/dri/nouveau/nouveau_sync.c | 67 ++++++++++++------------ src/mesa/drivers/dri/nouveau/nouveau_sync.h | 32 +++++------ src/mesa/drivers/dri/nouveau/nv30_state.c | 2 +- 14 files changed, 94 insertions(+), 139 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c index 684ed7b017d..fc14060c049 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c @@ -41,7 +41,7 @@ nouveau_bo_download_from_screen(GLcontext *ctx, GLuint offset, GLuint size, DEBUG("..sys_mem\n"); in_mem = nouveau_mem_alloc(ctx, NOUVEAU_MEM_AGP, size, 0); if (in_mem) { - DEBUG("....via AGP\n"); + DEBUG("....via GART\n"); /* otherwise, try blitting to faster memory and * copying from there */ @@ -86,7 +86,7 @@ nouveau_bo_upload_to_screen(GLcontext *ctx, GLuint offset, GLuint size, NOUVEAU_MEM_MAPPED, size, 0); if (out_mem) { - DEBUG("....via AGP\n"); + DEBUG("....via GART\n"); _mesa_memcpy(out_mem->map, nbo->cpu_mem_sys + offset, size); nouveau_memformat_flat_emit(ctx, nbo->gpu_mem, out_mem, @@ -511,7 +511,7 @@ nouveauBufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size, gpu_flags = 0; break; default: - gpu_flags = NOUVEAU_BO_VRAM_OK | NOUVEAU_BO_AGP_OK; + gpu_flags = NOUVEAU_BO_VRAM_OK | NOUVEAU_BO_GART_OK; break; } nouveau_bo_init_storage(ctx, gpu_flags, size, data, usage, obj); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h index 932450fd877..3439a35e7c8 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h @@ -5,7 +5,7 @@ #include "nouveau_buffers.h" #define NOUVEAU_BO_VRAM_OK (NOUVEAU_MEM_FB | NOUVEAU_MEM_FB_ACCEPTABLE) -#define NOUVEAU_BO_AGP_OK (NOUVEAU_MEM_AGP | NOUVEAU_MEM_AGP_ACCEPTABLE) +#define NOUVEAU_BO_GART_OK (NOUVEAU_MEM_AGP | NOUVEAU_MEM_AGP_ACCEPTABLE) typedef struct nouveau_bufferobj_region_t { uint32_t start; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c index e3968bd02fc..857cd30584c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c @@ -32,8 +32,8 @@ nouveau_memformat_flat_emit(GLcontext *ctx, return GL_FALSE; } - src_handle = (src->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP; - dst_handle = (dst->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP; + src_handle = (src->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaTT; + dst_handle = (dst->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaTT; src_offset += nouveau_mem_gpu_offset_get(ctx, src); dst_offset += nouveau_mem_gpu_offset_get(ctx, dst); @@ -138,7 +138,7 @@ nouveau_mem_gpu_offset_get(GLcontext *ctx, nouveau_mem *mem) if (mem->type & NOUVEAU_MEM_FB) return (uint32_t)mem->offset - nmesa->vram_phys; else if (mem->type & NOUVEAU_MEM_AGP) - return (uint32_t)mem->offset - nmesa->agp_phys; + return (uint32_t)mem->offset - nmesa->gart_phys; else return 0xDEADF00D; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 8e11eb61342..d96b00242cd 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -145,10 +145,10 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual, &nmesa->vram_size)) return GL_FALSE; if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_AGP_PHYSICAL, - &nmesa->agp_phys)) + &nmesa->gart_phys)) return GL_FALSE; if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_AGP_SIZE, - &nmesa->agp_size)) + &nmesa->gart_size)) return GL_FALSE; if (!nouveauFifoInit(nmesa)) return GL_FALSE; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 53f3393676f..10d2ed6e172 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -99,19 +99,22 @@ typedef struct nouveau_context { /* The read-only regs */ volatile unsigned char* mmio; + /* The per-channel notifier block */ + volatile void *notifier_block; + /* Physical addresses of AGP/VRAM apertures */ uint64_t vram_phys; uint64_t vram_size; - uint64_t agp_phys; - uint64_t agp_size; + uint64_t gart_phys; + uint64_t gart_size; /* Channel synchronisation */ - nouveau_notifier *syncNotifier; + drm_nouveau_notifier_alloc_t *syncNotifier; /* ARB_occlusion_query / EXT_timer_query */ GLuint query_object_max; GLboolean * query_alloc; - nouveau_notifier *queryNotifier; + drm_nouveau_notifier_alloc_t *queryNotifier; /* Additional hw-specific functions */ nouveau_hw_func hw_func; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c index bd2b2eddd08..e9320918f9f 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c @@ -99,13 +99,14 @@ void nouveauWaitForIdle(nouveauContextPtr nmesa) GLboolean nouveauFifoInit(nouveauContextPtr nmesa) { drm_nouveau_fifo_alloc_t fifo_init; - int i; + int i, ret; #ifdef NOUVEAU_RING_DEBUG return GL_TRUE; #endif - int ret; + fifo_init.fb_ctxdma_handle = NvDmaFB; + fifo_init.tt_ctxdma_handle = NvDmaTT; ret=drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_FIFO_ALLOC, &fifo_init, sizeof(fifo_init)); if (ret) { FATAL("Fifo initialization ioctl failed (returned %d)\n",ret); @@ -117,12 +118,21 @@ GLboolean nouveauFifoInit(nouveauContextPtr nmesa) FATAL("Unable to map the fifo (returned %d)\n",ret); return GL_FALSE; } + ret = drmMap(nmesa->driFd, fifo_init.ctrl, fifo_init.ctrl_size, &nmesa->fifo.mmio); if (ret) { FATAL("Unable to map the control regs (returned %d)\n",ret); return GL_FALSE; } + ret = drmMap(nmesa->driFd, fifo_init.notifier, + fifo_init.notifier_size, + &nmesa->notifier_block); + if (ret) { + FATAL("Unable to map the notifier block (returned %d)\n",ret); + return GL_FALSE; + } + /* Setup our initial FIFO tracking params */ nmesa->fifo.channel = fifo_init.channel; nmesa->fifo.put_base = fifo_init.put_base; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_object.c b/src/mesa/drivers/dri/nouveau/nouveau_object.c index b71acff4301..69f8dbf7946 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_object.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_object.c @@ -7,61 +7,18 @@ GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa, uint32_t handle, int class) { - drm_nouveau_object_init_t cto; + drm_nouveau_grobj_alloc_t cto; int ret; cto.channel = nmesa->fifo.channel; cto.handle = handle; cto.class = class; - ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_OBJECT_INIT, &cto, sizeof(cto)); + ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_GROBJ_ALLOC, + &cto, sizeof(cto)); return ret == 0; } -GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa, - uint32_t handle, - int class, - uint32_t offset, - uint32_t size, - int target, - int access) -{ - drm_nouveau_dma_object_init_t dma; - int ret; - - dma.channel = nmesa->fifo.channel; - dma.class = class; - dma.handle = handle; - dma.target = target; - dma.access = access; - dma.offset = offset; - dma.size = size; - ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_DMA_OBJECT_INIT, - &dma, sizeof(dma)); - return ret == 0; -} - -GLboolean nouveauCreateDmaObjectFromMem(nouveauContextPtr nmesa, - uint32_t handle, int class, - nouveau_mem *mem, - int access) -{ - uint32_t offset = mem->offset; - int target = mem->type & (NOUVEAU_MEM_FB | NOUVEAU_MEM_AGP); - - if (!target) - return GL_FALSE; - - if (target & NOUVEAU_MEM_FB) - offset -= nmesa->vram_phys; - else if (target & NOUVEAU_MEM_AGP) - offset -= nmesa->agp_phys; - - return nouveauCreateDmaObject(nmesa, handle, class, - offset, mem->size, - target, access); -} - void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, int handle) { BEGIN_RING_SIZE(subchannel, 0, 1); @@ -74,16 +31,6 @@ void nouveauObjectInit(nouveauContextPtr nmesa) return; #endif -/* We need to know vram size.. and AGP size (and even if the card is AGP..) */ - nouveauCreateDmaObject( nmesa, NvDmaFB, NV_DMA_IN_MEMORY, - 0, nmesa->vram_size, - NOUVEAU_MEM_FB, - NOUVEAU_MEM_ACCESS_RW); - nouveauCreateDmaObject( nmesa, NvDmaAGP, NV_DMA_IN_MEMORY, - 0, nmesa->agp_size, - NOUVEAU_MEM_AGP, - NOUVEAU_MEM_ACCESS_RW); - nouveauCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d); if (nmesa->screen->card->type>=NV_10) { nouveauCreateContextObject(nmesa, NvCtxSurf2D, NV10_CONTEXT_SURFACES_2D); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_object.h b/src/mesa/drivers/dri/nouveau/nouveau_object.h index 0be9b4309c6..8c72d014daa 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_object.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_object.h @@ -14,7 +14,7 @@ enum DMAObjects { NvMemFormat = 0x80000022, NvCtxSurf3D = 0x80000023, NvDmaFB = 0xD0FB0001, - NvDmaAGP = 0xD0AA0001, + NvDmaTT = 0xD0AA0001, NvSyncNotify = 0xD0000001, NvQueryNotify = 0xD0000002 }; @@ -31,17 +31,5 @@ extern void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, i extern GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa, uint32_t handle, int class); -extern GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa, - uint32_t handle, - int class, - uint32_t offset, - uint32_t size, - int target, - int access); -extern GLboolean nouveauCreateDmaObjectFromMem(nouveauContextPtr nmesa, - uint32_t handle, - int class, - nouveau_mem *mem, - int access); #endif diff --git a/src/mesa/drivers/dri/nouveau/nouveau_query.c b/src/mesa/drivers/dri/nouveau/nouveau_query.c index de3f5b0378b..01541400690 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_query.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_query.c @@ -68,7 +68,7 @@ nouveauBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); nouveau_query_object *nq = (nouveau_query_object *)q; - nouveau_notifier_reset(nmesa->queryNotifier, nq->notifier_id); + nouveau_notifier_reset(ctx, nmesa->queryNotifier, nq->notifier_id); switch (nmesa->screen->card->type) { case NV_20: @@ -105,12 +105,13 @@ nouveauUpdateQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) nouveau_query_object *nq = (nouveau_query_object *)q; int status; - status = nouveau_notifier_status(nmesa->queryNotifier, + status = nouveau_notifier_status(ctx, nmesa->queryNotifier, nq->notifier_id); q->Ready = (status == NV_NOTIFY_STATE_STATUS_COMPLETED); if (q->Ready) - q->Result = nouveau_notifier_return_val(nmesa->queryNotifier, + q->Result = nouveau_notifier_return_val(ctx, + nmesa->queryNotifier, nq->notifier_id); } @@ -120,7 +121,7 @@ nouveauWaitQueryResult(GLcontext *ctx, GLenum target, struct gl_query_object *q) nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); nouveau_query_object *nq = (nouveau_query_object *)q; - nouveau_notifier_wait_status(nmesa->queryNotifier, nq->notifier_id, + nouveau_notifier_wait_status(ctx, nmesa->queryNotifier, nq->notifier_id, NV_NOTIFY_STATE_STATUS_COMPLETED, 0); nouveauUpdateQuery(ctx, target, q); } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index 7a4b9f1cd00..bc7f39b042a 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -328,7 +328,7 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion ddx_expected = { 1, 2, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL }; -#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 6 +#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 7 #error nouveau_drm.h version doesn't match expected version #endif dri_interface = interface; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.c b/src/mesa/drivers/dri/nouveau/nouveau_span.c index 74dec66afcf..6e3f9fadf4e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_span.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_span.c @@ -37,6 +37,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define HAVE_HW_STENCIL_SPANS 0 #define HAVE_HW_STENCIL_PIXELS 0 +static char *fake_span[1280*1024*4]; + #define HW_CLIPLOOP() \ do { \ int _nc = nmesa->numClipRects; \ @@ -52,6 +54,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. GLuint height = nrb->mesa.Height; \ GLubyte *map = (GLubyte *)(nrb->map ? nrb->map : nrb->mem->map) + \ (nmesa->drawY * nrb->pitch) + (nmesa->drawX * nrb->cpp); \ + map = fake_span; \ GLuint p; \ (void) p; @@ -120,6 +123,6 @@ nouveauSpanSetFunctions(nouveau_renderbuffer *nrb, const GLvisual *vis) { if (nrb->mesa._ActualFormat == GL_RGBA8) nouveauInitPointers_ARGB8888(&nrb->mesa); - else if (nrb->mesa._ActualFormat == GL_RGB5) + else // if (nrb->mesa._ActualFormat == GL_RGB5) nouveauInitPointers_RGB565(&nrb->mesa); } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_sync.c b/src/mesa/drivers/dri/nouveau/nouveau_sync.c index 30e66962699..1d1eeede18b 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_sync.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_sync.c @@ -35,53 +35,51 @@ #include "nouveau_msg.h" #include "nouveau_sync.h" -nouveau_notifier * +#define NOTIFIER(__v) \ + nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); \ + volatile uint32_t *__v = (void*)nmesa->notifier_block + notifier->offset + +drm_nouveau_notifier_alloc_t * nouveau_notifier_new(GLcontext *ctx, GLuint handle, GLuint count) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); - nouveau_notifier *notifier; + drm_nouveau_notifier_alloc_t *notifier; + int ret; #ifdef NOUVEAU_RING_DEBUG return NULL; #endif - notifier = CALLOC_STRUCT(nouveau_notifier_t); + notifier = CALLOC_STRUCT(drm_nouveau_notifier_alloc); if (!notifier) return NULL; - notifier->mem = nouveau_mem_alloc(ctx, - NOUVEAU_MEM_FB | NOUVEAU_MEM_MAPPED, - count * NV_NOTIFIER_SIZE, - 0); - if (!notifier->mem) { - FREE(notifier); - return NULL; - } - - if (!nouveauCreateDmaObjectFromMem(nmesa, handle, NV_DMA_IN_MEMORY, - notifier->mem, - NOUVEAU_MEM_ACCESS_RW)) { - nouveau_mem_free(ctx, notifier->mem); + notifier->channel = nmesa->fifo.channel; + notifier->handle = handle; + notifier->count = count; + ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_NOTIFIER_ALLOC, + notifier, sizeof(*notifier)); + if (ret) { + MESSAGE("Failed to create notifier 0x%08x: %d\n", handle, ret); FREE(notifier); return NULL; } - notifier->handle = handle; return notifier; } void -nouveau_notifier_destroy(GLcontext *ctx, nouveau_notifier *notifier) +nouveau_notifier_destroy(GLcontext *ctx, drm_nouveau_notifier_alloc_t *notifier) { - /*XXX: free DMA object.. */ - nouveau_mem_free(ctx, notifier->mem); + /*XXX: free notifier object.. */ FREE(notifier); } void -nouveau_notifier_reset(nouveau_notifier *notifier, GLuint id) +nouveau_notifier_reset(GLcontext *ctx, drm_nouveau_notifier_alloc_t *notifier, + GLuint id) { - volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE); + NOTIFIER(n); #ifdef NOUVEAU_RING_DEBUG return; @@ -95,26 +93,29 @@ nouveau_notifier_reset(nouveau_notifier *notifier, GLuint id) } GLuint -nouveau_notifier_status(nouveau_notifier *notifier, GLuint id) +nouveau_notifier_status(GLcontext *ctx, drm_nouveau_notifier_alloc_t *notifier, + GLuint id) { - volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE); + NOTIFIER(n); return n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT; } GLuint -nouveau_notifier_return_val(nouveau_notifier *notifier, GLuint id) +nouveau_notifier_return_val(GLcontext *ctx, + drm_nouveau_notifier_alloc_t *notifier, GLuint id) { - volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE); + NOTIFIER(n); return n[NV_NOTIFY_RETURN_VALUE/4]; } GLboolean -nouveau_notifier_wait_status(nouveau_notifier *notifier, GLuint id, +nouveau_notifier_wait_status(GLcontext *ctx, + drm_nouveau_notifier_alloc_t *notifier, GLuint id, GLuint status, GLuint timeout) { - volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE); + NOTIFIER(n); unsigned int time = 0; #ifdef NOUVEAU_RING_DEBUG @@ -144,13 +145,13 @@ nouveau_notifier_wait_status(nouveau_notifier *notifier, GLuint id, } void -nouveau_notifier_wait_nop(GLcontext *ctx, nouveau_notifier *notifier, - GLuint subc) +nouveau_notifier_wait_nop(GLcontext *ctx, + drm_nouveau_notifier_alloc_t *notifier, GLuint subc) { - nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); + NOTIFIER(n); GLboolean ret; - nouveau_notifier_reset(notifier, 0); + nouveau_notifier_reset(ctx, notifier, 0); BEGIN_RING_SIZE(subc, NV_NOTIFY, 1); OUT_RING (NV_NOTIFY_STYLE_WRITE_ONLY); @@ -158,7 +159,7 @@ nouveau_notifier_wait_nop(GLcontext *ctx, nouveau_notifier *notifier, OUT_RING (0); FIRE_RING(); - ret = nouveau_notifier_wait_status(notifier, 0, + ret = nouveau_notifier_wait_status(ctx, notifier, 0, NV_NOTIFY_STATE_STATUS_COMPLETED, 0 /* no timeout */); if (ret == GL_FALSE) MESSAGE("wait on notifier failed\n"); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_sync.h b/src/mesa/drivers/dri/nouveau/nouveau_sync.h index 019d5f6629b..b56cc5fb544 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_sync.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_sync.h @@ -47,21 +47,23 @@ #define NV_NOTIFY 0x00000104 #define NV_NOTIFY_STYLE_WRITE_ONLY 0 -typedef struct nouveau_notifier_t { - GLuint handle; - nouveau_mem *mem; -} nouveau_notifier; - -extern nouveau_notifier *nouveau_notifier_new(GLcontext *, GLuint handle, - GLuint count); -extern void nouveau_notifier_destroy(GLcontext *, nouveau_notifier *); -extern void nouveau_notifier_reset(nouveau_notifier *, GLuint id); -extern GLuint nouveau_notifier_status(nouveau_notifier *, GLuint id); -extern GLuint nouveau_notifier_return_val(nouveau_notifier *, GLuint id); -extern GLboolean nouveau_notifier_wait_status(nouveau_notifier *r, GLuint id, - GLuint status, GLuint timeout); -extern void nouveau_notifier_wait_nop(GLcontext *ctx, - nouveau_notifier *, GLuint subc); +extern drm_nouveau_notifier_alloc_t * +nouveau_notifier_new(GLcontext *, GLuint handle, GLuint count); +extern void +nouveau_notifier_destroy(GLcontext *, drm_nouveau_notifier_alloc_t *); +extern void +nouveau_notifier_reset(GLcontext *, drm_nouveau_notifier_alloc_t *, GLuint id); +extern GLuint +nouveau_notifier_status(GLcontext *, drm_nouveau_notifier_alloc_t *, GLuint id); +extern GLuint +nouveau_notifier_return_val(GLcontext *, drm_nouveau_notifier_alloc_t *, + GLuint id); +extern GLboolean +nouveau_notifier_wait_status(GLcontext *, drm_nouveau_notifier_alloc_t *, + GLuint id, GLuint status, GLuint timeout); +extern void +nouveau_notifier_wait_nop(GLcontext *ctx, drm_nouveau_notifier_alloc_t *, + GLuint subc); extern GLboolean nouveauSyncInitFuncs(GLcontext *ctx); #endif diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c index d329071d1ee..9b010954b33 100644 --- a/src/mesa/drivers/dri/nouveau/nv30_state.c +++ b/src/mesa/drivers/dri/nouveau/nv30_state.c @@ -808,7 +808,7 @@ static GLboolean nv30InitCard(nouveauContextPtr nmesa) BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT1, 3); OUT_RING(NvDmaFB); - OUT_RING(NvDmaAGP); + OUT_RING(NvDmaTT); OUT_RING(NvDmaFB); BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT8, 1); OUT_RING(NvDmaFB); -- cgit v1.2.3 From fc5bf536440efeb9766cc1fd6e69642bc27afbd8 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 29 Jun 2007 21:12:46 -0600 Subject: overhaul point rasterization, no longer use s_pointtemp.h --- src/mesa/swrast/s_points.c | 657 ++++++++++++++++++++++++++++++++------------- 1 file changed, 465 insertions(+), 192 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index b91ce73d7a3..ade1eab8917 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -34,134 +34,493 @@ #include "s_span.h" -#define RGBA 0x1 -#define INDEX 0x2 -#define SMOOTH 0x4 -#define ATTRIBS 0x8 -#define SPECULAR 0x10 -#define LARGE 0x20 -#define ATTENUATE 0x40 -#define SPRITE 0x80 - - -/* - * CI points with size == 1.0 - */ -#define FLAGS (INDEX) -#define NAME size1_ci_point -#include "s_pointtemp.h" - - -/* - * General CI points. +/** + * Used to cull points with invalid coords */ -#define FLAGS (INDEX | LARGE) -#define NAME general_ci_point -#include "s_pointtemp.h" +#define CULL_INVALID(V) \ + do { \ + float tmp = (V)->attrib[FRAG_ATTRIB_WPOS][0] \ + + (V)->attrib[FRAG_ATTRIB_WPOS][1]; \ + if (IS_INF_OR_NAN(tmp)) \ + return; \ + } while(0) -/* - * Antialiased CI points. +/** + * Draw a point sprite */ -#define FLAGS (INDEX | SMOOTH) -#define NAME antialiased_ci_point -#include "s_pointtemp.h" +static void +sprite_point(GLcontext *ctx, const SWvertex *vert) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + SWspan span; + GLfloat size; + GLuint tCoords[MAX_TEXTURE_COORD_UNITS]; + GLuint numTcoords = 0; + GLfloat t0, dtdy; + + CULL_INVALID(vert); + + /* z coord */ + if (ctx->DrawBuffer->Visual.depthBits <= 16) + span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); + else + span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); + span.zStep = 0; + + /* compute size */ + if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { + /* use vertex's point size */ + /* first, clamp attenuated size to the user-specifed range */ + size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize); + } + else { + /* use constant point size */ + size = ctx->Point._Size; /* already clamped to user range */ + } + /* clamp to non-AA implementation limits */ + size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); + + /* span init */ + INIT_SPAN(span, GL_POINT, 0, 0, 0); + span.interpMask = SPAN_Z | SPAN_RGBA; + + span.red = ChanToFixed(vert->color[0]); + span.green = ChanToFixed(vert->color[1]); + span.blue = ChanToFixed(vert->color[2]); + span.alpha = ChanToFixed(vert->color[3]); + span.redStep = 0; + span.greenStep = 0; + span.blueStep = 0; + span.alphaStep = 0; + + /* need these for fragment programs */ + span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; + span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; + span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; + + ATTRIB_LOOP_BEGIN + if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) { + const GLuint u = attr - FRAG_ATTRIB_TEX0; + /* a texcoord */ + if (ctx->Point.CoordReplace[u]) { + GLfloat s, r, dsdx; + + s = 0.0; + dsdx = 1.0 / size; + + if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) { + t0 = 0.0; + dtdy = 1.0 / size; + } + else { + /* GL_UPPER_LEFT */ + t0 = 1.0; + dtdy = -1.0 / size; + } + tCoords[numTcoords++] = attr; + + if (ctx->Point.SpriteRMode == GL_ZERO) + r = 0.0F; + else if (ctx->Point.SpriteRMode == GL_S) + r = vert->attrib[attr][0]; + else /* GL_R */ + r = vert->attrib[attr][2]; + + span.attrStart[attr][0] = s; + span.attrStart[attr][1] = 0.0; /* overwritten below */ + span.attrStart[attr][2] = r; + span.attrStart[attr][3] = 1.0; + + span.attrStepX[attr][0] = dsdx; + span.attrStepX[attr][1] = 0.0; + span.attrStepX[attr][2] = 0.0; + span.attrStepX[attr][3] = 0.0; + + span.attrStepY[attr][0] = 0.0; + span.attrStepY[attr][1] = dtdy; + span.attrStepY[attr][2] = 0.0; + span.attrStepY[attr][3] = 0.0; + + continue; + } + } + /* use vertex's texcoord/attrib */ + COPY_4V(span.attrStart[attr], vert->attrib[attr]); + ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0); + ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0); + ATTRIB_LOOP_END + + /* compute pos, bounds and render */ + { + const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; + const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; + GLint iSize = (GLint) (size + 0.5F); + GLint xmin, xmax, ymin, ymax, iy; + GLint iRadius; + GLfloat tcoord = t0; + + iSize = MAX2(1, iSize); + iRadius = iSize / 2; + + if (iSize & 1) { + /* odd size */ + xmin = (GLint) (x - iRadius); + xmax = (GLint) (x + iRadius); + ymin = (GLint) (y - iRadius); + ymax = (GLint) (y + iRadius); + } + else { + /* even size */ + xmin = (GLint) x - iRadius + 1; + xmax = xmin + iSize - 1; + ymin = (GLint) y - iRadius + 1; + ymax = ymin + iSize - 1; + } + /* render spans */ + for (iy = ymin; iy <= ymax; iy++) { + GLuint i; + /* setup texcoord T for this row */ + for (i = 0; i < numTcoords; i++) { + span.attrStart[tCoords[i]][1] = tcoord; + } -/* - * Distance attenuated, general CI points. - */ -#define FLAGS (INDEX | ATTENUATE) -#define NAME atten_general_ci_point -#include "s_pointtemp.h" + /* these might get changed by span clipping */ + span.x = xmin; + span.y = iy; + span.end = xmax - xmin + 1; + _swrast_write_rgba_span(ctx, &span); -/* - * RGBA points with size == 1.0 - */ -#define FLAGS (RGBA) -#define NAME size1_rgba_point -#include "s_pointtemp.h" + tcoord += dtdy; + } + } +} -/* - * General RGBA points. +/** + * Draw smooth/antialiased point. RGB or CI mode. */ -#define FLAGS (RGBA | LARGE) -#define NAME general_rgba_point -#include "s_pointtemp.h" - +static void +smooth_point(GLcontext *ctx, const SWvertex *vert) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLboolean ciMode = !ctx->Visual.rgbMode; + SWspan span; + GLfloat size, alphaAtten; + + CULL_INVALID(vert); + + /* z coord */ + if (ctx->DrawBuffer->Visual.depthBits <= 16) + span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); + else + span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); + span.zStep = 0; + + /* compute size */ + if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { + /* use vertex's point size */ + /* first, clamp attenuated size to the user-specifed range */ + size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize); + } + else { + /* use constant point size */ + size = ctx->Point._Size; /* this is already clamped */ + } + /* clamp to AA implementation limits */ + size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA); -/* - * Antialiased RGBA points. - */ -#define FLAGS (RGBA | SMOOTH) -#define NAME antialiased_rgba_point -#include "s_pointtemp.h" + /* alpha attenuation / fade factor */ + if (ctx->Multisample.Enabled) { + if (vert->pointSize >= ctx->Point.Threshold) { + alphaAtten = 1.0F; + } + else { + GLfloat dsize = vert->pointSize / ctx->Point.Threshold; + alphaAtten = dsize * dsize; + } + } + else { + alphaAtten = 1.0; + } + (void) alphaAtten; /* not used */ + + /* span init */ + INIT_SPAN(span, GL_POINT, 0, 0, 0); + span.interpMask = SPAN_Z | SPAN_RGBA; + span.arrayMask = SPAN_COVERAGE | SPAN_MASK; + + span.red = ChanToFixed(vert->color[0]); + span.green = ChanToFixed(vert->color[1]); + span.blue = ChanToFixed(vert->color[2]); + span.alpha = ChanToFixed(vert->color[3]); + span.redStep = 0; + span.greenStep = 0; + span.blueStep = 0; + span.alphaStep = 0; + + /* need these for fragment programs */ + span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; + span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; + span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; + + ATTRIB_LOOP_BEGIN + COPY_4V(span.attrStart[attr], vert->attrib[attr]); + ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0); + ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0); + ATTRIB_LOOP_END + + /* compute pos, bounds and render */ + { + const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; + const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; + const GLfloat radius = 0.5F * size; + const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */ + const GLfloat rmax = radius + 0.7071F; + const GLfloat rmin2 = MAX2(0.0F, rmin * rmin); + const GLfloat rmax2 = rmax * rmax; + const GLfloat cscale = 1.0F / (rmax2 - rmin2); + const GLint xmin = (GLint) (x - radius); + const GLint xmax = (GLint) (x + radius); + const GLint ymin = (GLint) (y - radius); + const GLint ymax = (GLint) (y + radius); + GLint ix, iy; + + for (iy = ymin; iy <= ymax; iy++) { + + /* these might get changed by span clipping */ + span.x = xmin; + span.y = iy; + span.end = xmax - xmin + 1; + + /* compute coverage for each pixel in span */ + for (ix = xmin; ix <= xmax; ix++) { + const GLfloat dx = ix - x + 0.5F; + const GLfloat dy = iy - y + 0.5F; + const GLfloat dist2 = dx * dx + dy * dy; + GLfloat coverage; + + if (dist2 < rmax2) { + if (dist2 >= rmin2) { + /* compute partial coverage */ + coverage = 1.0F - (dist2 - rmin2) * cscale; + if (ciMode) { + /* coverage in [0,15] */ + coverage *= 15.0; + } + } + else { + /* full coverage */ + coverage = 1.0F; + } + span.array->mask[ix - xmin] = 1; + } + else { + /* zero coverage - fragment outside the radius */ + coverage = 0.0; + span.array->mask[ix - xmin] = 0; + } + span.array->coverage[ix - xmin] = coverage; + } + /* render span */ + _swrast_write_rgba_span(ctx, &span); -/* - * Textured RGBA points. - */ -#define FLAGS (RGBA | LARGE | ATTRIBS | SPECULAR) -#define NAME textured_rgba_point -#include "s_pointtemp.h" + } + } +} -/* - * Antialiased points with texture mapping. +/** + * Draw large (size >= 1) non-AA point. RGB or CI mode. */ -#define FLAGS (RGBA | SMOOTH | ATTRIBS | SPECULAR) -#define NAME antialiased_tex_rgba_point -#include "s_pointtemp.h" +static void +large_point(GLcontext *ctx, const SWvertex *vert) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLboolean ciMode = !ctx->Visual.rgbMode; + SWspan span; + GLfloat size; + + CULL_INVALID(vert); + + /* z coord */ + if (ctx->DrawBuffer->Visual.depthBits <= 16) + span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); + else + span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); + span.zStep = 0; + + /* compute size */ + if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { + /* use vertex's point size */ + /* first, clamp attenuated size to the user-specifed range */ + size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize); + } + else { + /* use constant point size */ + size = ctx->Point._Size; /* already clamped to user range */ + } + /* clamp to non-AA implementation limits */ + size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); + /* span init */ + INIT_SPAN(span, GL_POINT, 0, 0, 0); + span.arrayMask = SPAN_XY; -/* - * Distance attenuated, general RGBA points. - */ -#define FLAGS (RGBA | ATTENUATE) -#define NAME atten_general_rgba_point -#include "s_pointtemp.h" + if (ciMode) { + span.interpMask = SPAN_Z | SPAN_INDEX; + span.index = FloatToFixed(vert->attrib[FRAG_ATTRIB_CI][0]); + span.indexStep = 0; + } + else { + span.interpMask = SPAN_Z | SPAN_RGBA; + span.red = ChanToFixed(vert->color[0]); + span.green = ChanToFixed(vert->color[1]); + span.blue = ChanToFixed(vert->color[2]); + span.alpha = ChanToFixed(vert->color[3]); + span.redStep = 0; + span.greenStep = 0; + span.blueStep = 0; + span.alphaStep = 0; + } + /* need these for fragment programs */ + span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; + span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; + span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; + + ATTRIB_LOOP_BEGIN + COPY_4V(span.attrStart[attr], vert->attrib[attr]); + ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0); + ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0); + ATTRIB_LOOP_END + + /* compute pos, bounds and render */ + { + const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; + const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; + GLint iSize = (GLint) (size + 0.5F); + GLint xmin, xmax, ymin, ymax, ix, iy; + GLint iRadius; + + iSize = MAX2(1, iSize); + iRadius = iSize / 2; + + if (iSize & 1) { + /* odd size */ + xmin = (GLint) (x - iRadius); + xmax = (GLint) (x + iRadius); + ymin = (GLint) (y - iRadius); + ymax = (GLint) (y + iRadius); + } + else { + /* even size */ + xmin = (GLint) x - iRadius + 1; + xmax = xmin + iSize - 1; + ymin = (GLint) y - iRadius + 1; + ymax = ymin + iSize - 1; + } -/* - * Distance attenuated, textured RGBA points. - */ -#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SPECULAR) -#define NAME atten_textured_rgba_point -#include "s_pointtemp.h" + /* generate fragments */ + span.end = 0; + for (iy = ymin; iy <= ymax; iy++) { + for (ix = xmin; ix <= xmax; ix++) { + span.array->x[span.end] = ix; + span.array->y[span.end] = iy; + span.end++; + } + } + assert(span.end <= MAX_WIDTH); + _swrast_write_rgba_span(ctx, &span); + } +} -/* - * Distance attenuated, antialiased points with or without texture mapping. +/** + * Draw size=1, single-pixel point */ -#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SMOOTH) -#define NAME atten_antialiased_rgba_point -#include "s_pointtemp.h" +static void +pixel_point(GLcontext *ctx, const SWvertex *vert) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLboolean ciMode = !ctx->Visual.rgbMode; + /* + * Note that unlike the other functions, we put single-pixel points + * into a special span array in order to render as many points as + * possible with a single _swrast_write_rgba_span() call. + */ + SWspan *span = &(swrast->PointSpan); + GLuint count; + + CULL_INVALID(vert); + + /* Span init */ + span->interpMask = 0; + span->arrayMask = SPAN_XY | SPAN_Z; + if (ciMode) + span->arrayMask |= SPAN_INDEX; + else + span->arrayMask |= SPAN_RGBA; + /*span->arrayMask |= SPAN_LAMBDA;*/ + span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */ + + /* need these for fragment programs */ + span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; + span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; + span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; + + /* check if we need to flush */ + if (span->end >= MAX_WIDTH || + (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) { + if (ciMode) + _swrast_write_index_span(ctx, span); + else + _swrast_write_rgba_span(ctx, span); + span->end = 0; + } + count = span->end; -/* - * Sprite (textured point) - */ -#define FLAGS (RGBA | SPRITE | SPECULAR) -#define NAME sprite_point -#include "s_pointtemp.h" + /* fragment attributes */ + if (ciMode) { + span->array->index[count] = (GLuint) vert->attrib[FRAG_ATTRIB_CI][0]; + } + else { + span->array->rgba[count][RCOMP] = vert->color[0]; + span->array->rgba[count][GCOMP] = vert->color[1]; + span->array->rgba[count][BCOMP] = vert->color[2]; + span->array->rgba[count][ACOMP] = vert->color[3]; + } + ATTRIB_LOOP_BEGIN + COPY_4V(span->array->attribs[attr][count], vert->attrib[attr]); + ATTRIB_LOOP_END + /* fragment position */ + span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0]; + span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1]; + span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); -#define FLAGS (RGBA | SPRITE | SPECULAR | ATTENUATE) -#define NAME atten_sprite_point -#include "s_pointtemp.h" + span->end = count + 1; + ASSERT(span->end <= MAX_WIDTH); +} +/** + * Add specular color to primary color, draw point, restore original + * primary color. + */ void _swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0) { - SWvertex *ncv0 = (SWvertex *) v0; + SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */ GLfloat rSum, gSum, bSum; GLchan cSave[4]; /* save */ - COPY_CHAN4( cSave, ncv0->color ); + COPY_CHAN4(cSave, ncv0->color); /* sum */ rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; @@ -176,121 +535,35 @@ _swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0) } - -/* record the current point function name */ -#ifdef DEBUG - -static const char *pntFuncName = NULL; - -#define USE(pntFunc) \ -do { \ - pntFuncName = #pntFunc; \ - /*printf("%s\n", pntFuncName);*/ \ - swrast->Point = pntFunc; \ -} while (0) - -#else - -#define USE(pntFunc) swrast->Point = pntFunc - -#endif - - -/* - * Examine the current context to determine which point drawing function - * should be used. +/** + * Examine current state to determine which point drawing function to use. */ void -_swrast_choose_point( GLcontext *ctx ) +_swrast_choose_point(GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLboolean rgbMode = ctx->Visual.rgbMode; - GLboolean specular = (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); - GLboolean attribs = (ctx->FragmentProgram._Current || - ctx->Texture._EnabledCoordUnits || - swrast->_FogEnabled || - specular); - /* - * XXX this is a mess that should be cleaned up someday - */ - - if (ctx->RenderMode==GL_RENDER) { + if (ctx->RenderMode == GL_RENDER) { if (ctx->Point.PointSprite) { - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - /* XXX this might not be good enough */ - if (ctx->Point._Attenuated) - USE(atten_sprite_point); - else - USE(sprite_point); - } - else if (ctx->Point.SmoothFlag && !attribs) { - /* Smooth points */ - if (rgbMode) { - if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { - USE(atten_antialiased_rgba_point); - } - else if (ctx->Texture._EnabledCoordUnits) { - USE(antialiased_tex_rgba_point); - } - else { - USE(antialiased_rgba_point); - } - } - else { - USE(antialiased_ci_point); - } + swrast->Point = sprite_point; } - else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { - if (rgbMode) { - if (attribs) { - if (ctx->Point.SmoothFlag) { - USE(atten_antialiased_rgba_point); - } - else { - USE(atten_textured_rgba_point); - } - } - else { - USE(atten_general_rgba_point); - } - } - else { - /* ci, atten */ - USE(atten_general_ci_point); - } + else if (ctx->Point.SmoothFlag) { + swrast->Point = smooth_point; } - else if (attribs && rgbMode) { - /* textured, fogged */ - USE(textured_rgba_point); - } - else if (ctx->Point._Size != 1.0) { - /* large points */ - if (rgbMode) { - USE(general_rgba_point); - } - else { - USE(general_ci_point); - } + else if (ctx->Point._Size > 1.0 || + ctx->Point._Attenuated || + ctx->VertexProgram.PointSizeEnabled) { + swrast->Point = large_point; } else { - /* single pixel points */ - if (rgbMode) { - assert((swrast->_ActiveAttribMask & FRAG_BIT_COL1) == 0); - USE(size1_rgba_point); - } - else { - USE(size1_ci_point); - } + swrast->Point = pixel_point; } } - else if (ctx->RenderMode==GL_FEEDBACK) { - USE(_swrast_feedback_point); + else if (ctx->RenderMode == GL_FEEDBACK) { + swrast->Point = _swrast_feedback_point; } else { /* GL_SELECT mode */ - USE(_swrast_select_point); + swrast->Point = _swrast_select_point; } } -- cgit v1.2.3 From fb4f4e2d186fac24cafa5e637461042706d4a123 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 29 Jun 2007 21:13:20 -0600 Subject: Obsolete --- src/mesa/swrast/s_pointtemp.h | 406 ------------------------------------------ 1 file changed, 406 deletions(-) delete mode 100644 src/mesa/swrast/s_pointtemp.h (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h deleted file mode 100644 index 206085b5b87..00000000000 --- a/src/mesa/swrast/s_pointtemp.h +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 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. - */ - -/* - * Regarding GL_NV_point_sprite: - * - * Portions of this software may use or implement intellectual - * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims - * any and all warranties with respect to such intellectual property, - * including any use thereof or modifications thereto. - */ - - -/* - * Point rendering template code. - * - * Set FLAGS = bitwise-OR of the following tokens: - * - * RGBA = do rgba instead of color index - * SMOOTH = do antialiasing - * ATTRIBS = general attributes (texcoords, etc) - * LARGE = do points with diameter > 1 pixel - * ATTENUATE = compute point size attenuation - * SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite - * - * Notes: LARGE and ATTENUATE are exclusive of each other. - * ATTRIBS requires RGBA - */ - - -/* - * NOTES on antialiased point rasterization: - * - * Let d = distance of fragment center from vertex. - * if d < rmin2 then - * fragment has 100% coverage - * else if d > rmax2 then - * fragment has 0% coverage - * else - * fragment has % coverage = (d - rmin2) / (rmax2 - rmin2) - */ - - -static void -NAME ( GLcontext *ctx, const SWvertex *vert ) -{ -#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE) - GLfloat size; -#endif -#if FLAGS & RGBA -#if (FLAGS & ATTENUATE) && (FLAGS & SMOOTH) - GLfloat alphaAtten; -#endif - const GLchan red = vert->color[0]; - const GLchan green = vert->color[1]; - const GLchan blue = vert->color[2]; - const GLchan alpha = vert->color[3]; -#endif -#if FLAGS & INDEX - const GLuint colorIndex = (GLuint) vert->attrib[FRAG_ATTRIB_CI][0]; /* XXX round? */ -#endif -#if FLAGS & ATTRIBS - GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */ -#endif - SWcontext *swrast = SWRAST_CONTEXT(ctx); - SWspan *span = &(swrast->PointSpan); - - /* - printf("%s %g %g %g %g\n", __FUNCTION__, - vert->attrib[FRAG_ATTRIB_COL1][0], - vert->attrib[FRAG_ATTRIB_COL1][1], - vert->attrib[FRAG_ATTRIB_COL1][2], - vert->attrib[FRAG_ATTRIB_COL1][3]); - if ( vert->attrib[FRAG_ATTRIB_COL1][0] == 0.0 && - vert->attrib[FRAG_ATTRIB_COL1][1] == 1.0 && - vert->attrib[FRAG_ATTRIB_COL1][2] == 0.0) - foo(); - */ - - /* Cull primitives with malformed coordinates. - */ - { - float tmp = vert->attrib[FRAG_ATTRIB_WPOS][0] + vert->attrib[FRAG_ATTRIB_WPOS][1]; - if (IS_INF_OR_NAN(tmp)) - return; - } - - /* - * Span init - */ - span->interpMask = 0; - span->arrayMask = SPAN_XY | SPAN_Z; -#if FLAGS & RGBA - span->arrayMask |= SPAN_RGBA; -#endif -#if FLAGS & INDEX - span->arrayMask |= SPAN_INDEX; -#endif -#if FLAGS & ATTRIBS - span->arrayMask |= SPAN_LAMBDA; - - /* we're filling in the attrib arrays: */ - span->arrayAttribs = swrast->_ActiveAttribMask; - - ATTRIB_LOOP_BEGIN - COPY_4V(attrib[attr], vert->attrib[attr]); - ATTRIB_LOOP_END - - /* need these for fragment programs */ - span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; - span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; - span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; -#else - assert((swrast->_ActiveAttribMask & FRAG_BIT_COL1) == 0); -#endif - -#if FLAGS & SMOOTH - span->arrayMask |= SPAN_COVERAGE; -#endif -#if FLAGS & SPRITE - span->arrayMask |= SPAN_LAMBDA; -#endif - - /* Compute point size if not known to be one */ -#if FLAGS & ATTENUATE - /* first, clamp attenuated size to the user-specifed range */ - size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize); -#if (FLAGS & RGBA) && (FLAGS & SMOOTH) - /* only if multisampling, compute the fade factor */ - if (ctx->Multisample.Enabled) { - if (vert->pointSize >= ctx->Point.Threshold) { - alphaAtten = 1.0F; - } - else { - GLfloat dsize = vert->pointSize / ctx->Point.Threshold; - alphaAtten = dsize * dsize; - } - } - else { - alphaAtten = 1.0; - } -#endif -#elif FLAGS & (LARGE | SMOOTH | SPRITE) - /* constant, non-attenuated size */ - size = ctx->Point._Size; /* this is already clamped */ -#endif - - -#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE) - /*** - *** Multi-pixel points - ***/ - - /* do final clamping now */ - if (ctx->Point.SmoothFlag) { - size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA); - } - else { - size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); - } - - {{ - GLint x, y; - const GLfloat radius = 0.5F * size; - const GLuint z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - GLuint count; -#if FLAGS & SMOOTH - const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */ - const GLfloat rmax = radius + 0.7071F; - const GLfloat rmin2 = MAX2(0.0F, rmin * rmin); - const GLfloat rmax2 = rmax * rmax; - const GLfloat cscale = 1.0F / (rmax2 - rmin2); - const GLint xmin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] - radius); - const GLint xmax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] + radius); - const GLint ymin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] - radius); - const GLint ymax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] + radius); -#else - /* non-smooth */ - GLint xmin, xmax, ymin, ymax; - GLint iSize = (GLint) (size + 0.5F); - GLint iRadius; - iSize = MAX2(1, iSize); - iRadius = iSize / 2; - if (iSize & 1) { - /* odd size */ - xmin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] - iRadius); - xmax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] + iRadius); - ymin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] - iRadius); - ymax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] + iRadius); - } - else { - /* even size */ - xmin = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0] - iRadius + 1; - xmax = xmin + iSize - 1; - ymin = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1] - iRadius + 1; - ymax = ymin + iSize - 1; - } -#endif /*SMOOTH*/ - - /* check if we need to flush */ - if (span->end + (xmax-xmin+1) * (ymax-ymin+1) >= MAX_WIDTH || - (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) { - if (span->end > 0) { -#if FLAGS & RGBA - _swrast_write_rgba_span(ctx, span); -#else - _swrast_write_index_span(ctx, span); -#endif - span->end = 0; - } - } - - /* - * OK, generate fragments - */ - count = span->end; - (void) radius; - for (y = ymin; y <= ymax; y++) { - /* check if we need to flush */ - if (count + (xmax-xmin+1) >= MAX_WIDTH) { - span->end = count; -#if FLAGS & RGBA - _swrast_write_rgba_span(ctx, span); -#else - _swrast_write_index_span(ctx, span); -#endif - count = span->end = 0; - } - for (x = xmin; x <= xmax; x++) { -#if FLAGS & SPRITE - GLuint u; -#endif - -#if FLAGS & RGBA - span->array->rgba[count][RCOMP] = red; - span->array->rgba[count][GCOMP] = green; - span->array->rgba[count][BCOMP] = blue; - span->array->rgba[count][ACOMP] = alpha; -#endif -#if FLAGS & INDEX - span->array->index[count] = colorIndex; -#endif -#if FLAGS & ATTRIBS - ATTRIB_LOOP_BEGIN - COPY_4V(span->array->attribs[attr][count], attrib[attr]); - /** - if (attr < FRAG_ATTRIB_VAR0) { - const GLuint u = attr - FRAG_ATTRIB_TEX0; - span->array->lambda[u][count] = 0.0; - } - **/ - ATTRIB_LOOP_END -#endif - -#if FLAGS & SMOOTH - /* compute coverage */ - { - const GLfloat dx = x - vert->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F; - const GLfloat dy = y - vert->attrib[FRAG_ATTRIB_WPOS][1] + 0.5F; - const GLfloat dist2 = dx * dx + dy * dy; - if (dist2 < rmax2) { - if (dist2 >= rmin2) { - /* compute partial coverage */ - span->array->coverage[count] = 1.0F - (dist2 - rmin2) * cscale; -#if FLAGS & INDEX - /* coverage in [0,15] */ - span->array->coverage[count] *= 15.0; -#endif - } - else { - /* full coverage */ - span->array->coverage[count] = 1.0F; - } - - span->array->x[count] = x; - span->array->y[count] = y; - span->array->z[count] = z; - -#if (FLAGS & ATTENUATE) && (FLAGS & RGBA) - span->array->rgba[count][ACOMP] = (GLchan) (alpha * alphaAtten); -#elif FLAGS & RGBA - span->array->rgba[count][ACOMP] = alpha; -#endif /*ATTENUATE*/ - count++; - } /*if*/ - } - -#else /*SMOOTH*/ - - /* not smooth (square points) */ - span->array->x[count] = x; - span->array->y[count] = y; - span->array->z[count] = z; - -#if FLAGS & SPRITE - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - GLuint attr = FRAG_ATTRIB_TEX0 + u; - if (ctx->Texture.Unit[u]._ReallyEnabled) { - if (ctx->Point.CoordReplace[u]) { - GLfloat s = 0.5F + (x + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][0]) / size; - GLfloat t, r; - if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) - t = 0.5F + (y + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][1]) / size; - else /* GL_UPPER_LEFT */ - t = 0.5F - (y + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][1]) / size; - if (ctx->Point.SpriteRMode == GL_ZERO) - r = 0.0F; - else if (ctx->Point.SpriteRMode == GL_S) - r = vert->attrib[attr][0]; - else /* GL_R */ - r = vert->attrib[attr][2]; - span->array->attribs[attr][count][0] = s; - span->array->attribs[attr][count][1] = t; - span->array->attribs[attr][count][2] = r; - span->array->attribs[attr][count][3] = 1.0F; - span->array->lambda[u][count] = 0.0; /* XXX fix? */ - } - else { - COPY_4V(span->array->attribs[attr][count], - vert->attrib[attr]); - } - } - } -#endif /*SPRITE*/ - - count++; /* square point */ - -#endif /*SMOOTH*/ - - } /*for x*/ - } /*for y*/ - span->end = count; - }} - -#else /* LARGE | ATTENUATE | SMOOTH | SPRITE */ - - /*** - *** Single-pixel points - ***/ - {{ - GLuint count; - - /* check if we need to flush */ - if (span->end >= MAX_WIDTH || - (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) { -#if FLAGS & RGBA - _swrast_write_rgba_span(ctx, span); -#else - _swrast_write_index_span(ctx, span); -#endif - span->end = 0; - } - - count = span->end; - -#if FLAGS & RGBA - span->array->rgba[count][RCOMP] = red; - span->array->rgba[count][GCOMP] = green; - span->array->rgba[count][BCOMP] = blue; - span->array->rgba[count][ACOMP] = alpha; -#endif -#if FLAGS & INDEX - span->array->index[count] = colorIndex; -#endif -#if FLAGS & ATTRIBS - ATTRIB_LOOP_BEGIN - COPY_4V(span->array->attribs[attr][count], attribs[attr]); - ATTRIB_LOOP_END -#endif - - span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0]; - span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1]; - span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - - span->end = count + 1; - }} - -#endif /* LARGE || ATTENUATE || SMOOTH */ - - ASSERT(span->end <= MAX_WIDTH); -} - - -#undef FLAGS -#undef NAME -- cgit v1.2.3 From 9dca42a4a10acbf1980c0f2eafb3e28e11ca1bf3 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 29 Jun 2007 21:29:30 -0600 Subject: Undo some prev glDraw/CopyPixel changes which fixed a bug in which colors were overwritten by interpolating attributes. Now just set the span->arrayAttribs mask in glDraw/CopyPixels and be sure we don't overwrite the values in interpolate_active_attribs(). --- src/mesa/swrast/s_copypix.c | 17 +++++------------ src/mesa/swrast/s_drawpix.c | 15 ++++----------- src/mesa/swrast/s_span.c | 8 +++++--- src/mesa/swrast/s_zoom.c | 1 + 4 files changed, 15 insertions(+), 26 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 2383015000a..9cd6ca20a9d 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -156,7 +156,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* write the new image */ for (row = 0; row < height; row++) { const GLfloat *src = convImage + row * width * 4; - GLvoid *rgba = (GLvoid *) span.array->attribs[FRAG_ATTRIB_COL0]; + GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; /* copy convolved colors into span array */ _mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat)); @@ -188,8 +188,6 @@ static void copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLbitfield prevActiveAttribs = swrast->_ActiveAttribMask; GLfloat *tmpImage, *p; GLint sy, dy, stepy, row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; @@ -199,15 +197,12 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (!ctx->ReadBuffer->_ColorReadBuffer) { /* no readbuffer - OK */ - goto end; + return; } - /* don't interpolate COL0 and overwrite the glDrawPixel colors! */ - swrast->_ActiveAttribMask &= ~FRAG_BIT_COL0; - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty); - goto end; + return; } else if (ctx->Pixel.Convolution1DEnabled) { /* make sure we don't apply 1D convolution */ @@ -239,12 +234,13 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); _swrast_span_default_attribs(ctx, &span); + span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ if (overlapping) { tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - goto end; + return; } /* read the source image as RGBA/float */ p = tmpImage; @@ -299,9 +295,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) _mesa_free(tmpImage); - -end: - swrast->_ActiveAttribMask = prevActiveAttribs; } diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 925358d77eb..b5388745bab 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -532,25 +532,21 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLbitfield prevActiveAttribs = swrast->_ActiveAttribMask; const GLint imgX = x, imgY = y; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLfloat *convImage = NULL; GLbitfield transferOps = ctx->_ImageTransferState; SWspan span; - /* don't interpolate COL0 and overwrite the glDrawPixel colors! */ - swrast->_ActiveAttribMask &= ~FRAG_BIT_COL0; - /* Try an optimized glDrawPixels first */ if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels)) { - goto end; + return; } INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA); _swrast_span_default_attribs(ctx, &span); + span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */ if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { /* Convolution has to be handled specially. We'll create an @@ -565,13 +561,13 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - goto end; + return; } convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { _mesa_free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - goto end; + return; } /* Unpack the image and apply transfer ops up to convolution */ @@ -675,9 +671,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, if (convImage) { _mesa_free(convImage); } - -end: - swrast->_ActiveAttribMask = prevActiveAttribs; } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 4ab6e2e9fbf..f23272c2bee 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -171,10 +171,11 @@ interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); - /* for glDraw/CopyPixels() we may have turned off some bits in - * the _ActiveAttribMask - be sure to obey that mask now. + /* + * Don't overwrite existing array values, such as colors that may have + * been produced by glDraw/CopyPixels. */ - attrMask &= swrast->_ActiveAttribMask; + attrMask &= ~span->arrayAttribs; ATTRIB_LOOP_BEGIN if (attrMask & (1 << attr)) { @@ -201,6 +202,7 @@ interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask) v3 += dv3dx; w += dwdx; } + ASSERT((span->arrayAttribs & (1 << attr)) == 0); span->arrayAttribs |= (1 << attr); } ATTRIB_LOOP_END diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index ab02e3fbb35..5f495e36c12 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -175,6 +175,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, /* we'll generate an array of colorss */ zoomed.interpMask = span->interpMask & ~SPAN_RGBA; zoomed.arrayMask |= SPAN_RGBA; + zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */ ASSERT(span->arrayMask & SPAN_RGBA); } else if (format == GL_COLOR_INDEX) { -- cgit v1.2.3 From fcc77d3ece160743e3f0f034ce2e130030c6386d Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 29 Jun 2007 21:33:59 -0600 Subject: s/SPAN_RGBA/SPAN_INDEX/ in clear_ci_buffer_with_masking() --- src/mesa/swrast/s_buffers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 35f2dd64909..bd66cf125b5 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -119,7 +119,7 @@ clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) ASSERT(rb->DataType == GL_UNSIGNED_INT); /* Initialize index span with clear index */ - INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA); + INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_INDEX); for (i = 0; i < width;i++) { span.array->index[i] = ctx->Color.ClearIndex; } -- cgit v1.2.3 From f4b103dc993491355ec3e3640d9cb060138175c2 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 29 Jun 2007 21:52:18 -0600 Subject: simplify INIT_SPAN code --- src/mesa/swrast/s_aalinetemp.h | 4 ++-- src/mesa/swrast/s_aatritemp.h | 3 ++- src/mesa/swrast/s_accum.c | 4 +++- src/mesa/swrast/s_bitmap.c | 8 ++++++-- src/mesa/swrast/s_buffers.c | 8 ++++++-- src/mesa/swrast/s_copypix.c | 13 +++++++++---- src/mesa/swrast/s_drawpix.c | 13 +++++++++---- src/mesa/swrast/s_linetemp.h | 5 ++++- src/mesa/swrast/s_points.c | 6 +++--- src/mesa/swrast/s_span.h | 18 +++++++++--------- src/mesa/swrast/s_tritemp.h | 2 +- src/mesa/swrast/s_zoom.c | 2 +- 12 files changed, 55 insertions(+), 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 3d3511823d7..69a1f0cd396 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -137,8 +137,8 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) if (line.len == 0.0 || IS_INF_OR_NAN(line.len)) return; - INIT_SPAN(line.span, GL_LINE, 0, 0, SPAN_XY | SPAN_COVERAGE); - + INIT_SPAN(line.span, GL_LINE); + line.span.arrayMask = SPAN_XY | SPAN_COVERAGE; line.xAdj = line.dx / line.len * line.halfWidth; line.yAdj = line.dy / line.len * line.halfWidth; diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 34a2305b393..42d74a16328 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -69,7 +69,8 @@ (void) swrast; - INIT_SPAN(span, GL_POLYGON, 0, 0, SPAN_COVERAGE); + INIT_SPAN(span, GL_POLYGON); + span.arrayMask = SPAN_COVERAGE; /* determine bottom to top order of vertices */ { diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index f53e7f52c5e..3c45dee3998 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -474,7 +474,9 @@ accum_return(GLcontext *ctx, GLfloat value, SWspan span; /* init color span */ - INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA); + INIT_SPAN(span, GL_BITMAP); + span.end = width; + span.arrayMask = SPAN_RGBA; span.x = xpos; span.y = ypos + i; diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 563b5fe602c..1e7f6c18e6a 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -82,7 +82,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, if (SWRAST_CONTEXT(ctx)->NewState) _swrast_validate_derived( ctx ); - INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY); + INIT_SPAN(span, GL_BITMAP); + span.end = width; + span.arrayMask = SPAN_XY; _swrast_span_default_attribs(ctx, &span); for (row = 0; row < height; row++) { @@ -180,7 +182,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, if (SWRAST_CONTEXT(ctx)->NewState) _swrast_validate_derived( ctx ); - INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_MASK); + INIT_SPAN(span, GL_BITMAP); + span.end = width; + span.arrayMask = SPAN_MASK; _swrast_span_default_attribs(ctx, &span); /*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */ diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index bd66cf125b5..90a56284c51 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -55,7 +55,9 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) /* Initialize color span with clear color */ /* XXX optimize for clearcolor == black/zero (bzero) */ - INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA); + INIT_SPAN(span, GL_BITMAP); + span.end = width; + span.arrayMask = SPAN_RGBA; span.array->ChanType = rb->DataType; if (span.array->ChanType == GL_UNSIGNED_BYTE) { GLubyte clearColor[4]; @@ -119,7 +121,9 @@ clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) ASSERT(rb->DataType == GL_UNSIGNED_INT); /* Initialize index span with clear index */ - INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_INDEX); + INIT_SPAN(span, GL_BITMAP); + span.end = width; + span.arrayMask = SPAN_INDEX; for (i = 0; i < width;i++) { span.array->index[i] = ctx->Color.ClearIndex; } diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 9cd6ca20a9d..bbe1081860d 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -102,8 +102,10 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLfloat *dest, *tmpImage, *convImage; SWspan span; - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); + INIT_SPAN(span, GL_BITMAP); _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_RGBA; + span.arrayAttribs = FRAG_BIT_COL0; /* allocate space for GLfloat image */ tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); @@ -232,8 +234,9 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, stepy = 1; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); + INIT_SPAN(span, GL_BITMAP); _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_RGBA; span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ if (overlapping) { @@ -315,8 +318,9 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, return; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX); + INIT_SPAN(span, GL_BITMAP); _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_INDEX; if (ctx->DrawBuffer == ctx->ReadBuffer) { overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, @@ -449,8 +453,9 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, return; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); + INIT_SPAN(span, GL_BITMAP); _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_Z; if (ctx->DrawBuffer == ctx->ReadBuffer) { overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index b5388745bab..b8b452e33dd 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -70,7 +70,9 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, return GL_FALSE; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); + INIT_SPAN(span, GL_BITMAP); + span.arrayMask = SPAN_RGBA; + span.arrayAttribs = FRAG_BIT_COL0; _swrast_span_default_attribs(ctx, &span); /* copy input params since clipping may change them */ @@ -332,7 +334,8 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y, GLint row, skipPixels; SWspan span; - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX); + INIT_SPAN(span, GL_BITMAP); + span.arrayMask = SPAN_INDEX; _swrast_span_default_attribs(ctx, &span); /* @@ -427,7 +430,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; SWspan span; - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); + INIT_SPAN(span, GL_BITMAP); + span.arrayMask = SPAN_Z; _swrast_span_default_attribs(ctx, &span); if (type == GL_UNSIGNED_SHORT @@ -544,8 +548,9 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, return; } - INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA); + INIT_SPAN(span, GL_BITMAP); _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_RGBA; span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */ if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 55548f27b08..1accfc67e2c 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -303,7 +303,10 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) } #endif - INIT_SPAN(span, GL_LINE, numPixels, interpFlags, SPAN_XY); + INIT_SPAN(span, GL_LINE); + span.end = numPixels; + span.interpMask = interpFlags; + span.arrayMask = SPAN_XY; /* * Draw diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index ade1eab8917..8eba53c8076 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -82,7 +82,7 @@ sprite_point(GLcontext *ctx, const SWvertex *vert) size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); /* span init */ - INIT_SPAN(span, GL_POINT, 0, 0, 0); + INIT_SPAN(span, GL_POINT); span.interpMask = SPAN_Z | SPAN_RGBA; span.red = ChanToFixed(vert->color[0]); @@ -248,7 +248,7 @@ smooth_point(GLcontext *ctx, const SWvertex *vert) (void) alphaAtten; /* not used */ /* span init */ - INIT_SPAN(span, GL_POINT, 0, 0, 0); + INIT_SPAN(span, GL_POINT); span.interpMask = SPAN_Z | SPAN_RGBA; span.arrayMask = SPAN_COVERAGE | SPAN_MASK; @@ -367,7 +367,7 @@ large_point(GLcontext *ctx, const SWvertex *vert) size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); /* span init */ - INIT_SPAN(span, GL_POINT, 0, 0, 0); + INIT_SPAN(span, GL_POINT); span.arrayMask = SPAN_XY; if (ciMode) { diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 585cce91ee9..512134db0f8 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -159,15 +159,15 @@ typedef struct sw_span -#define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \ -do { \ - (S).primitive = (PRIMITIVE); \ - (S).interpMask = (INTERP_MASK); \ - (S).arrayMask = (ARRAY_MASK); \ - (S).arrayAttribs = 0x0; \ - (S).end = (END); \ - (S).facing = 0; \ - (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \ +#define INIT_SPAN(S, PRIMITIVE) \ +do { \ + (S).primitive = (PRIMITIVE); \ + (S).interpMask = 0x0; \ + (S).arrayMask = 0x0; \ + (S).arrayAttribs = 0x0; \ + (S).end = 0; \ + (S).facing = 0; \ + (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \ } while (0) diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index 2a90ffd85f8..f5bc03e81e4 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -144,7 +144,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, (void) swrast; - INIT_SPAN(span, GL_POLYGON, 0, 0, 0); + INIT_SPAN(span, GL_POLYGON); span.y = 0; /* silence warnings */ #ifdef INTERP_Z diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 5f495e36c12..9f1a4c6f0a7 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -148,7 +148,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, ASSERT((span->arrayMask & SPAN_XY) == 0); ASSERT(span->primitive == GL_BITMAP); - INIT_SPAN(zoomed, GL_BITMAP, 0, 0, 0); + INIT_SPAN(zoomed, GL_BITMAP); zoomed.x = x0; zoomed.end = zoomedWidth; zoomed.array = &zoomed_arrays; -- cgit v1.2.3 From 885c1326c3ae10b7196d2f7e95f1b6400fe29e12 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 17:15:50 +1000 Subject: r300: fix tabbing --- src/mesa/drivers/dri/r300/r300_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 1001c4ec073..90f5027c9ad 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -414,7 +414,7 @@ void r300Flush(GLcontext * ctx) fprintf(stderr, "%s\n", __FUNCTION__); if (rmesa->dma.flush) - rmesa->dma.flush( rmesa ); + rmesa->dma.flush( rmesa ); if (rmesa->cmdbuf.count_used > rmesa->cmdbuf.count_reemit) r300FlushCmdBuf(rmesa, __FUNCTION__); -- cgit v1.2.3 From 8f7478e5cb28912f81ec302a3c1b80733a3a6df3 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 18:29:23 +1000 Subject: r300: fixup manytex, we needed to emit the vic/vir/vof every time --- src/mesa/drivers/dri/r300/r300_swtcl.c | 98 ++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 46 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index e340f0b6e33..ef3f3b347c9 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -104,9 +104,9 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, static GLuint r300VAPInputRoute1Swizzle(int swizzle[4]) { return (swizzle[0] << R300_INPUT_ROUTE_X_SHIFT) | - (swizzle[1] << R300_INPUT_ROUTE_Y_SHIFT) | - (swizzle[2] << R300_INPUT_ROUTE_Z_SHIFT) | - (swizzle[3] << R300_INPUT_ROUTE_W_SHIFT); + (swizzle[1] << R300_INPUT_ROUTE_Y_SHIFT) | + (swizzle[2] << R300_INPUT_ROUTE_Z_SHIFT) | + (swizzle[3] << R300_INPUT_ROUTE_W_SHIFT); } static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) @@ -237,10 +237,14 @@ static void r300SetVertexFormat( GLcontext *ctx ) /* EMIT_ATTR's must be in order as they tell t_vertex.c how to * build up a hardware vertex. */ - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F ); - vap_vte_cntl |= R300_VTX_W0_FMT; - InputsRead |= 1 << VERT_ATTRIB_POS; - OutputsWritten |= 1 << VERT_RESULT_HPOS; + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POS)) { + vap_vte_cntl |= R300_VTX_W0_FMT; + InputsRead |= 1 << VERT_ATTRIB_POS; + OutputsWritten |= 1 << VERT_RESULT_HPOS; + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F ); + } else + EMIT_PAD(4 * sizeof(float)); + offset = 4; if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { @@ -250,10 +254,13 @@ static void r300SetVertexFormat( GLcontext *ctx ) } rmesa->swtcl.coloroffset = offset; - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); + if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR0)) { + InputsRead |= 1 << VERT_ATTRIB_COLOR0; + OutputsWritten |= 1 << VERT_RESULT_COL0; + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); + } else + EMIT_PAD(4*sizeof(float)); - InputsRead |= 1 << VERT_ATTRIB_COLOR0; - OutputsWritten |= 1 << VERT_RESULT_COL0; offset += 4; rmesa->swtcl.specoffset = 0; @@ -314,40 +321,38 @@ static void r300SetVertexFormat( GLcontext *ctx ) } } - if (!RENDERINPUTS_EQUAL( rmesa->tnl_index_bitset, index_bitset)) { - R300_NEWPRIM(rmesa); - R300_STATECHANGE(rmesa, vir[0]); - ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = - r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], - VB->AttribPtr, inputs, tab, nr); - R300_STATECHANGE(rmesa, vir[1]); - ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = - r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, - nr); - - R300_STATECHANGE(rmesa, vic); - rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); - rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); - - R300_STATECHANGE(rmesa, vof); - rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); - rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); - - rmesa->swtcl.vertex_size = - _tnl_install_attrs( ctx, - rmesa->swtcl.vertex_attrs, - rmesa->swtcl.vertex_attr_count, - NULL, 0 ); - - rmesa->swtcl.vertex_size /= 4; - - RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); - - vte = rmesa->hw.vte.cmd[1]; - R300_STATECHANGE(rmesa, vte); - rmesa->hw.vte.cmd[1] = vte; - rmesa->hw.vte.cmd[2] = rmesa->swtcl.vertex_size; - } + R300_NEWPRIM(rmesa); + R300_STATECHANGE(rmesa, vir[0]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = + r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], + VB->AttribPtr, inputs, tab, nr); + R300_STATECHANGE(rmesa, vir[1]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = + r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, + nr); + + R300_STATECHANGE(rmesa, vic); + rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); + rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); + + R300_STATECHANGE(rmesa, vof); + rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); + + rmesa->swtcl.vertex_size = + _tnl_install_attrs( ctx, + rmesa->swtcl.vertex_attrs, + rmesa->swtcl.vertex_attr_count, + NULL, 0 ); + + rmesa->swtcl.vertex_size /= 4; + + RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); + + vte = rmesa->hw.vte.cmd[1]; + R300_STATECHANGE(rmesa, vte); + rmesa->hw.vte.cmd[1] = vte; + rmesa->hw.vte.cmd[2] = rmesa->swtcl.vertex_size; } @@ -371,6 +376,9 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) if (rmesa->dma.current.start != rmesa->dma.current.ptr) { r300EnsureCmdBufSpace( rmesa, rmesa->hw.max_state_size + (12*sizeof(int)), __FUNCTION__); + + r300EmitState(rmesa); + r300EmitVertexAOS( rmesa, rmesa->swtcl.vertex_size, current_offset); @@ -798,8 +806,6 @@ void r300EmitVbufPrim(r300ContextPtr rmesa, GLuint primitive, GLuint vertex_nr) type = r300PrimitiveType(rmesa, primitive); num_verts = r300NumVerts(rmesa, vertex_nr, primitive); - r300EmitState(rmesa); - start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0), 0); e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (num_verts << 16) | type); } -- cgit v1.2.3 From b691d460465f992dc3febde06593341f192be970 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 18:40:26 +1000 Subject: r300: cleanup some of the swtcl code --- src/mesa/drivers/dri/r300/r300_context.c | 2 +- src/mesa/drivers/dri/r300/r300_emit.c | 10 +-- src/mesa/drivers/dri/r300/r300_emit.h | 7 +++ src/mesa/drivers/dri/r300/r300_render.c | 5 ++ src/mesa/drivers/dri/r300/r300_swtcl.c | 101 +------------------------------ 5 files changed, 19 insertions(+), 106 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 311d003633a..04e3fffa5df 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -165,7 +165,7 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = { /* Else do them here. */ - // &_r300_render_stage, + &_r300_render_stage, &_tnl_render_stage, /* FALLBACK */ 0, }; diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index a7763bd76e6..229439dfa87 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -239,7 +239,7 @@ static GLuint r300VAPInputRoute1Swizzle(int swizzle[4]) (swizzle[3] << R300_INPUT_ROUTE_W_SHIFT); } -static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) +GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) { GLuint i; @@ -255,14 +255,14 @@ static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) return (nr + 1) >> 1; } -static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) +GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) { /* No idea what this value means. I have seen other values written to * this register... */ return 0x5555; } -static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) +GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) { r300ContextPtr rmesa = R300_CONTEXT(ctx); GLuint i, vic_1 = 0; @@ -286,7 +286,7 @@ static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) return vic_1; } -static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten) +GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten) { GLuint ret = 0; @@ -315,7 +315,7 @@ static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten) return ret; } -static GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten) +GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten) { GLuint i, ret = 0; diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 400e97f6f85..a6d69ec5ff8 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -229,4 +229,11 @@ extern int r300PrimitiveType(r300ContextPtr rmesa, int prim); extern int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim); extern void r300EmitCacheFlush(r300ContextPtr rmesa); + +extern GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr); +extern GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead); +extern GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead); +extern GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten); +extern GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten); + #endif diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index db935795c79..7d8defd1cd8 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -371,12 +371,17 @@ static int r300Fallback(GLcontext * ctx) static GLboolean r300RunNonTCLRender(GLcontext * ctx, struct tnl_pipeline_stage *stage) { + r300ContextPtr rmesa = R300_CONTEXT(ctx); + if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); if (r300Fallback(ctx) >= R300_FALLBACK_RAST) return GL_TRUE; + if (rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL) + return GL_TRUE; + return r300RunRender(ctx, stage); } diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index ef3f3b347c9..3fc229807f5 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -77,6 +77,7 @@ do { \ rmesa->swtcl.vertex_attr_count++; \ } while (0) +/* this differs from the VIR0 in emit.c - TODO merge them using another option */ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, int *inputs, GLint * tab, GLuint nr) { @@ -101,103 +102,6 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, return (nr + 1) >> 1; } -static GLuint r300VAPInputRoute1Swizzle(int swizzle[4]) -{ - return (swizzle[0] << R300_INPUT_ROUTE_X_SHIFT) | - (swizzle[1] << R300_INPUT_ROUTE_Y_SHIFT) | - (swizzle[2] << R300_INPUT_ROUTE_Z_SHIFT) | - (swizzle[3] << R300_INPUT_ROUTE_W_SHIFT); -} - -static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr) -{ - GLuint i; - - for (i = 0; i + 1 < nr; i += 2) { - dst[i >> 1] = r300VAPInputRoute1Swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE; - dst[i >> 1] |= (r300VAPInputRoute1Swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16; - } - - if (nr & 1) { - dst[nr >> 1] = r300VAPInputRoute1Swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; - } - - return (nr + 1) >> 1; -} - -static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) -{ - /* No idea what this value means. I have seen other values written to - * this register... */ - return 0x5555; -} - -static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - GLuint i, vic_1 = 0; - - if (InputsRead & (1 << VERT_ATTRIB_POS)) - vic_1 |= R300_INPUT_CNTL_POS; - - if (InputsRead & (1 << VERT_ATTRIB_NORMAL)) - vic_1 |= R300_INPUT_CNTL_NORMAL; - - if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) - vic_1 |= R300_INPUT_CNTL_COLOR; - - rmesa->state.texture.tc_count = 0; - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) - if (InputsRead & (1 << (VERT_ATTRIB_TEX0 + i))) { - rmesa->state.texture.tc_count++; - vic_1 |= R300_INPUT_CNTL_TC0 << i; - } - - return vic_1; -} - -static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten) -{ - GLuint ret = 0; - - if (OutputsWritten & (1 << VERT_RESULT_HPOS)) - ret |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_COL0)) - ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_COL1)) - ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT; - -#if 0 - if (OutputsWritten & (1 << VERT_RESULT_BFC0)) - ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_BFC1)) - ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT; - - if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ; -#endif - - if (OutputsWritten & (1 << VERT_RESULT_PSIZ)) - ret |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; - - return ret; -} - -static GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten) -{ - GLuint i, ret = 0; - - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (OutputsWritten & (1 << (VERT_RESULT_TEX0 + i))) { - ret |= (4 << (3 * i)); - } - } - - return ret; -} - static void r300SetVertexFormat( GLcontext *ctx ) { r300ContextPtr rmesa = R300_CONTEXT( ctx ); @@ -659,9 +563,6 @@ static void r300ChooseRenderState( GLcontext *ctx ) GLuint index = 0; GLuint flags = ctx->_TriangleCaps; - // if (!rmesa->TclFallback || rmesa->Fallback) -// return; - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R300_TWOSIDE_BIT; if (flags & DD_TRI_UNFILLED) index |= R300_UNFILLED_BIT; -- cgit v1.2.3 From 2d5313db72354ef52e5d041c8c2efac52efc12a9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 18:42:27 +1000 Subject: r300: remove some unused code --- src/mesa/drivers/dri/r300/r300_swtcl.h | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.h b/src/mesa/drivers/dri/r300/r300_swtcl.h index 92362b745bc..8e56c5d9b2f 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.h +++ b/src/mesa/drivers/dri/r300/r300_swtcl.h @@ -41,35 +41,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern void r300InitSwtcl( GLcontext *ctx ); extern void r300DestroySwtcl( GLcontext *ctx ); -#if 0 -extern void r200ChooseRenderState( GLcontext *ctx ); -extern void r200ChooseVertexState( GLcontext *ctx ); - -extern void r200CheckTexSizes( GLcontext *ctx ); - -extern void r200BuildVertices( GLcontext *ctx, GLuint start, GLuint count, - GLuint newinputs ); - -extern void r200PrintSetupFlags(char *msg, GLuint flags ); - - -extern void r200_emit_indexed_verts( GLcontext *ctx, - GLuint start, - GLuint count ); - -extern void r200_translate_vertex( GLcontext *ctx, - const r200Vertex *src, - SWvertex *dst ); - -extern void r200_print_vertex( GLcontext *ctx, const r200Vertex *v ); - -extern void r200_import_float_colors( GLcontext *ctx ); -extern void r200_import_float_spec_colors( GLcontext *ctx ); - -extern void r200PointsBitmap( GLcontext *ctx, GLint px, GLint py, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap ); -#endif - #endif -- cgit v1.2.3 From 6564e4bffac60a500ac55b6b5ff01919fa28ca0b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 18:43:22 +1000 Subject: r300: add authorship --- src/mesa/drivers/dri/r300/r300_swtcl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.h b/src/mesa/drivers/dri/r300/r300_swtcl.h index 8e56c5d9b2f..2ea6ceded7b 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.h +++ b/src/mesa/drivers/dri/r300/r300_swtcl.h @@ -28,7 +28,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: - * Keith Whitwell + * Keith Whitwell - original r200 code + * Dave Airlie */ #ifndef __R300_SWTCL_H__ -- cgit v1.2.3 From 646ed82e6b2c092c6db364bf87d6881f39e83eec Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 18:46:39 +1000 Subject: fix tabbing --- src/mesa/drivers/dri/r300/r300_swtcl.c | 457 ++++++++++++++++----------------- 1 file changed, 226 insertions(+), 231 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 3fc229807f5..48122546c26 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -104,159 +104,156 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, static void r300SetVertexFormat( GLcontext *ctx ) { - r300ContextPtr rmesa = R300_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - DECLARE_RENDERINPUTS(index_bitset); - GLuint InputsRead = 0, OutputsWritten = 0; - int vap_fmt_0 = 0; - int vap_vte_cntl = 0; - int offset = 0; - int vte = 0; - GLint inputs[VERT_ATTRIB_MAX]; - GLint tab[VERT_ATTRIB_MAX]; - int swizzle[VERT_ATTRIB_MAX][4]; - GLuint i, nr; - - DECLARE_RENDERINPUTS(render_inputs_bitset); - - RENDERINPUTS_COPY(render_inputs_bitset, tnl->render_inputs_bitset); - - RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - - RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, render_inputs_bitset); - - /* Important: - */ - if ( VB->NdcPtr != NULL ) { - VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; - } - else { - VB->AttribPtr[VERT_ATTRIB_POS] = VB->ClipPtr; - } - - assert( VB->AttribPtr[VERT_ATTRIB_POS] != NULL ); - rmesa->swtcl.vertex_attr_count = 0; - - /* EMIT_ATTR's must be in order as they tell t_vertex.c how to - * build up a hardware vertex. - */ - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POS)) { - vap_vte_cntl |= R300_VTX_W0_FMT; - InputsRead |= 1 << VERT_ATTRIB_POS; - OutputsWritten |= 1 << VERT_RESULT_HPOS; - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F ); - } else - EMIT_PAD(4 * sizeof(float)); - - offset = 4; - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { - EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F ); - vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; - offset += 1; - } - - rmesa->swtcl.coloroffset = offset; - if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR0)) { - InputsRead |= 1 << VERT_ATTRIB_COLOR0; - OutputsWritten |= 1 << VERT_RESULT_COL0; - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); - } else - EMIT_PAD(4*sizeof(float)); - - offset += 4; - - rmesa->swtcl.specoffset = 0; - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { - rmesa->swtcl.specoffset = offset; - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F ); - InputsRead |= 1 << VERT_ATTRIB_COLOR1; - OutputsWritten |= 1 << VERT_RESULT_COL1; - } - - if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { - int i; - - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { - InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); - OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); - EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_4F ); - } - } - } - - for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { - if (InputsRead & (1 << i)) { - inputs[i] = nr++; - } else { - inputs[i] = -1; - } - } - - /* Fixed, apply to vir0 only */ - if (InputsRead & VERT_ATTRIB_POS) - inputs[VERT_ATTRIB_POS] = 0; - if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) - inputs[VERT_ATTRIB_COLOR0] = 2; - if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) - inputs[VERT_ATTRIB_COLOR1] = 3; - for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) - if (InputsRead & (1 << i)) - inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); - - for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { - if (InputsRead & (1 << i)) { - tab[nr++] = i; - } - } - - for (i = 0; i < nr; i++) { - int ci; - - swizzle[i][0] = SWIZZLE_ZERO; - swizzle[i][1] = SWIZZLE_ZERO; - swizzle[i][2] = SWIZZLE_ZERO; - swizzle[i][3] = SWIZZLE_ONE; - - for (ci = 0; ci < VB->AttribPtr[tab[i]]->size; ci++) { - swizzle[i][ci] = ci; - } - } - - R300_NEWPRIM(rmesa); - R300_STATECHANGE(rmesa, vir[0]); - ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = - r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], - VB->AttribPtr, inputs, tab, nr); - R300_STATECHANGE(rmesa, vir[1]); - ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = - r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, - nr); - - R300_STATECHANGE(rmesa, vic); - rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); - rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); - - R300_STATECHANGE(rmesa, vof); - rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); - rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); - - rmesa->swtcl.vertex_size = - _tnl_install_attrs( ctx, - rmesa->swtcl.vertex_attrs, - rmesa->swtcl.vertex_attr_count, - NULL, 0 ); + r300ContextPtr rmesa = R300_CONTEXT( ctx ); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + DECLARE_RENDERINPUTS(index_bitset); + GLuint InputsRead = 0, OutputsWritten = 0; + int vap_fmt_0 = 0; + int vap_vte_cntl = 0; + int offset = 0; + int vte = 0; + GLint inputs[VERT_ATTRIB_MAX]; + GLint tab[VERT_ATTRIB_MAX]; + int swizzle[VERT_ATTRIB_MAX][4]; + GLuint i, nr; + + DECLARE_RENDERINPUTS(render_inputs_bitset); + RENDERINPUTS_COPY(render_inputs_bitset, tnl->render_inputs_bitset); + RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); + RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, render_inputs_bitset); + + /* Important: + */ + if ( VB->NdcPtr != NULL ) { + VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; + } + else { + VB->AttribPtr[VERT_ATTRIB_POS] = VB->ClipPtr; + } + + assert( VB->AttribPtr[VERT_ATTRIB_POS] != NULL ); + rmesa->swtcl.vertex_attr_count = 0; + + /* EMIT_ATTR's must be in order as they tell t_vertex.c how to + * build up a hardware vertex. + */ + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POS)) { + vap_vte_cntl |= R300_VTX_W0_FMT; + InputsRead |= 1 << VERT_ATTRIB_POS; + OutputsWritten |= 1 << VERT_RESULT_HPOS; + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F ); + } else + EMIT_PAD(4 * sizeof(float)); + + offset = 4; + + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { + EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F ); + vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; + offset += 1; + } + + rmesa->swtcl.coloroffset = offset; + if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR0)) { + InputsRead |= 1 << VERT_ATTRIB_COLOR0; + OutputsWritten |= 1 << VERT_RESULT_COL0; + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); + } else + EMIT_PAD(4*sizeof(float)); + + offset += 4; + + rmesa->swtcl.specoffset = 0; + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { + rmesa->swtcl.specoffset = offset; + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F ); + InputsRead |= 1 << VERT_ATTRIB_COLOR1; + OutputsWritten |= 1 << VERT_RESULT_COL1; + } + + if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { + int i; + + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { + InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); + OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); + EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_4F ); + } + } + } + + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { + if (InputsRead & (1 << i)) { + inputs[i] = nr++; + } else { + inputs[i] = -1; + } + } + + /* Fixed, apply to vir0 only */ + if (InputsRead & VERT_ATTRIB_POS) + inputs[VERT_ATTRIB_POS] = 0; + if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) + inputs[VERT_ATTRIB_COLOR0] = 2; + if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) + inputs[VERT_ATTRIB_COLOR1] = 3; + for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) + if (InputsRead & (1 << i)) + inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); + + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) { + if (InputsRead & (1 << i)) { + tab[nr++] = i; + } + } + + for (i = 0; i < nr; i++) { + int ci; + + swizzle[i][0] = SWIZZLE_ZERO; + swizzle[i][1] = SWIZZLE_ZERO; + swizzle[i][2] = SWIZZLE_ZERO; + swizzle[i][3] = SWIZZLE_ONE; + + for (ci = 0; ci < VB->AttribPtr[tab[i]]->size; ci++) { + swizzle[i][ci] = ci; + } + } + + R300_NEWPRIM(rmesa); + R300_STATECHANGE(rmesa, vir[0]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[0].cmd)->packet0.count = + r300VAPInputRoute0(&rmesa->hw.vir[0].cmd[R300_VIR_CNTL_0], + VB->AttribPtr, inputs, tab, nr); + R300_STATECHANGE(rmesa, vir[1]); + ((drm_r300_cmd_header_t *) rmesa->hw.vir[1].cmd)->packet0.count = + r300VAPInputRoute1(&rmesa->hw.vir[1].cmd[R300_VIR_CNTL_0], swizzle, + nr); - rmesa->swtcl.vertex_size /= 4; + R300_STATECHANGE(rmesa, vic); + rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); + rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); - RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); + R300_STATECHANGE(rmesa, vof); + rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); - vte = rmesa->hw.vte.cmd[1]; - R300_STATECHANGE(rmesa, vte); - rmesa->hw.vte.cmd[1] = vte; - rmesa->hw.vte.cmd[2] = rmesa->swtcl.vertex_size; + rmesa->swtcl.vertex_size = + _tnl_install_attrs( ctx, + rmesa->swtcl.vertex_attrs, + rmesa->swtcl.vertex_attr_count, + NULL, 0 ); + + rmesa->swtcl.vertex_size /= 4; + + RENDERINPUTS_COPY( rmesa->tnl_index_bitset, index_bitset ); + + vte = rmesa->hw.vte.cmd[1]; + R300_STATECHANGE(rmesa, vte); + rmesa->hw.vte.cmd[1] = vte; + rmesa->hw.vte.cmd[2] = rmesa->swtcl.vertex_size; } @@ -264,39 +261,39 @@ static void r300SetVertexFormat( GLcontext *ctx ) */ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) { - if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s\n", __FUNCTION__); - - rmesa->dma.flush = NULL; - - if (rmesa->dma.current.buf) { - struct r300_dma_region *current = &rmesa->dma.current; - GLuint current_offset = GET_START(current); - - assert (current->start + - rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == - current->ptr); - - if (rmesa->dma.current.start != rmesa->dma.current.ptr) { - - r300EnsureCmdBufSpace( rmesa, rmesa->hw.max_state_size + (12*sizeof(int)), __FUNCTION__); - - r300EmitState(rmesa); - - r300EmitVertexAOS( rmesa, - rmesa->swtcl.vertex_size, - current_offset); + if (RADEON_DEBUG & DEBUG_IOCTL) + fprintf(stderr, "%s\n", __FUNCTION__); - r300EmitVbufPrim( rmesa, - rmesa->swtcl.hw_primitive, - rmesa->swtcl.numverts); - - r300EmitCacheFlush(rmesa); - } - - rmesa->swtcl.numverts = 0; - current->start = current->ptr; - } + rmesa->dma.flush = NULL; + + if (rmesa->dma.current.buf) { + struct r300_dma_region *current = &rmesa->dma.current; + GLuint current_offset = GET_START(current); + + assert (current->start + + rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == + current->ptr); + + if (rmesa->dma.current.start != rmesa->dma.current.ptr) { + + r300EnsureCmdBufSpace( rmesa, rmesa->hw.max_state_size + (12*sizeof(int)), __FUNCTION__); + + r300EmitState(rmesa); + + r300EmitVertexAOS( rmesa, + rmesa->swtcl.vertex_size, + current_offset); + + r300EmitVbufPrim( rmesa, + rmesa->swtcl.hw_primitive, + rmesa->swtcl.numverts); + + r300EmitCacheFlush(rmesa); + } + + rmesa->swtcl.numverts = 0; + current->start = current->ptr; + } } /* Alloc space in the current dma region. @@ -304,30 +301,28 @@ static void flush_last_swtcl_prim( r300ContextPtr rmesa ) static void * r300AllocDmaLowVerts( r300ContextPtr rmesa, int nverts, int vsize ) { - GLuint bytes = vsize * nverts; - - if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end ) - r300RefillCurrentDmaRegion( rmesa, bytes); + GLuint bytes = vsize * nverts; - if (!rmesa->dma.flush) { - rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; - rmesa->dma.flush = flush_last_swtcl_prim; - } + if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end ) + r300RefillCurrentDmaRegion( rmesa, bytes); - ASSERT( vsize == rmesa->swtcl.vertex_size * 4 ); - ASSERT( rmesa->dma.flush == flush_last_swtcl_prim ); - ASSERT( rmesa->dma.current.start + - rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == - rmesa->dma.current.ptr ); - - - { - GLubyte *head = (GLubyte *) (rmesa->dma.current.address + rmesa->dma.current.ptr); - rmesa->dma.current.ptr += bytes; - rmesa->swtcl.numverts += nverts; - return head; - } + if (!rmesa->dma.flush) { + rmesa->radeon.glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; + rmesa->dma.flush = flush_last_swtcl_prim; + } + ASSERT( vsize == rmesa->swtcl.vertex_size * 4 ); + ASSERT( rmesa->dma.flush == flush_last_swtcl_prim ); + ASSERT( rmesa->dma.current.start + + rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == + rmesa->dma.current.ptr ); + + { + GLubyte *head = (GLubyte *) (rmesa->dma.current.address + rmesa->dma.current.ptr); + rmesa->dma.current.ptr += bytes; + rmesa->swtcl.numverts += nverts; + return head; + } } static GLuint reduced_prim[] = { @@ -558,33 +553,33 @@ static void init_rast_tab( void ) /**********************************************************************/ static void r300ChooseRenderState( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); - r300ContextPtr rmesa = R300_CONTEXT(ctx); - GLuint index = 0; - GLuint flags = ctx->_TriangleCaps; - - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R300_TWOSIDE_BIT; - if (flags & DD_TRI_UNFILLED) index |= R300_UNFILLED_BIT; - - if (index != rmesa->swtcl.RenderIndex) { - tnl->Driver.Render.Points = rast_tab[index].points; - tnl->Driver.Render.Line = rast_tab[index].line; - tnl->Driver.Render.ClippedLine = rast_tab[index].line; - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (index == 0) { - tnl->Driver.Render.PrimTabVerts = r300_render_tab_verts; - tnl->Driver.Render.PrimTabElts = r300_render_tab_elts; - tnl->Driver.Render.ClippedPolygon = r300_fast_clipped_poly; - } else { - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; - } - - rmesa->swtcl.RenderIndex = index; - } + TNLcontext *tnl = TNL_CONTEXT(ctx); + r300ContextPtr rmesa = R300_CONTEXT(ctx); + GLuint index = 0; + GLuint flags = ctx->_TriangleCaps; + + if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R300_TWOSIDE_BIT; + if (flags & DD_TRI_UNFILLED) index |= R300_UNFILLED_BIT; + + if (index != rmesa->swtcl.RenderIndex) { + tnl->Driver.Render.Points = rast_tab[index].points; + tnl->Driver.Render.Line = rast_tab[index].line; + tnl->Driver.Render.ClippedLine = rast_tab[index].line; + tnl->Driver.Render.Triangle = rast_tab[index].triangle; + tnl->Driver.Render.Quad = rast_tab[index].quad; + + if (index == 0) { + tnl->Driver.Render.PrimTabVerts = r300_render_tab_verts; + tnl->Driver.Render.PrimTabElts = r300_render_tab_elts; + tnl->Driver.Render.ClippedPolygon = r300_fast_clipped_poly; + } else { + tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; + tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; + tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; + } + + rmesa->swtcl.RenderIndex = index; + } } @@ -602,7 +597,7 @@ static void r300RenderStart(GLcontext *ctx) if (rmesa->dma.flush != 0 && rmesa->dma.flush != flush_last_swtcl_prim) - rmesa->dma.flush( rmesa ); + rmesa->dma.flush( rmesa ); } -- cgit v1.2.3 From 0caee6b006aa2982f743bd60391d2c5406e167b7 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 18:52:47 +1000 Subject: r300: oops turn back off cmd buf debugging --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 6adf1413219..9eca41fa38c 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -54,7 +54,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_state.h" // Set this to 1 for extremely verbose debugging of command buffers -#define DEBUG_CMDBUF 1 +#define DEBUG_CMDBUF 0 /** * Send the current command buffer via ioctl to the hardware. -- cgit v1.2.3 From ad1903808037b21eda002857a478c68399ba4519 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 1 Jul 2007 19:27:26 +1000 Subject: r300: oops wrong logic for swtcl --- src/mesa/drivers/dri/r300/r300_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 7d8defd1cd8..eee1e803a00 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -379,7 +379,7 @@ static GLboolean r300RunNonTCLRender(GLcontext * ctx, if (r300Fallback(ctx) >= R300_FALLBACK_RAST) return GL_TRUE; - if (rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL) + if (!(rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) return GL_TRUE; return r300RunRender(ctx, stage); -- cgit v1.2.3 From 33da6cb133dfcfa434a1360123ecf683af329fa0 Mon Sep 17 00:00:00 2001 From: Claudio Ciccani Date: Sun, 1 Jul 2007 12:23:12 +0200 Subject: Fixed initialization of render buffer and deinitialization of context. --- src/mesa/drivers/directfb/idirectfbgl_mesa.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c index 88ac4bb31d5..694eeb054df 100644 --- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c +++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c @@ -134,7 +134,6 @@ static bool directfbgl_init_visual ( GLvisual *visual, static bool directfbgl_create_context ( GLcontext *context, GLframebuffer *framebuffer, GLvisual *visual, - DFBSurfacePixelFormat format, IDirectFBGL_data *data ); static void directfbgl_destroy_context( GLcontext *context, GLframebuffer *framebuffer ); @@ -340,8 +339,9 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) } /* Create context. */ - if (!directfbgl_create_context( &data->context, &data->framebuffer, - &data->visual, data->format, data )) { + if (!directfbgl_create_context( &data->context, + &data->framebuffer, + &data->visual, data )) { D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" ); IDirectFBGL_Mesa_Destruct( thiz ); return DFB_UNSUPPORTED; @@ -762,11 +762,10 @@ directfbgl_init_visual( GLvisual *visual, } static bool -directfbgl_create_context( GLcontext *context, - GLframebuffer *framebuffer, - GLvisual *visual, - DFBSurfacePixelFormat format, - IDirectFBGL_data *data ) +directfbgl_create_context( GLcontext *context, + GLframebuffer *framebuffer, + GLvisual *visual, + IDirectFBGL_data *data ) { struct dd_function_table functions; @@ -800,7 +799,7 @@ directfbgl_create_context( GLcontext *context, data->render.Delete = dfbDeleteRenderbuffer; data->render.AllocStorage = dfbRenderbufferStorage; - switch (format) { + switch (data->format) { case DSPF_RGB332: data->render.GetRow = get_row_RGB332; data->render.GetValues = get_values_RGB332; @@ -887,6 +886,9 @@ directfbgl_create_context( GLcontext *context, return false; } + data->render.Width = data->width; + data->render.Height = data->height; + _mesa_add_renderbuffer( framebuffer, BUFFER_FRONT_LEFT, &data->render ); _mesa_add_soft_renderbuffers( framebuffer, @@ -908,8 +910,11 @@ static void directfbgl_destroy_context( GLcontext *context, GLframebuffer *framebuffer ) { - _mesa_free_framebuffer_data( framebuffer ); - _mesa_notifyDestroy( context ); + _swsetup_DestroyContext( context ); + _swrast_DestroyContext( context ); + _tnl_DestroyContext( context ); + _vbo_DestroyContext( context ); + //_mesa_free_framebuffer_data( framebuffer ); _mesa_free_context_data( context ); } -- cgit v1.2.3 From 6257ed8663eddb4ebdf99ba69cfe2ced82182ed3 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jul 2007 17:21:45 +1000 Subject: r300: fix compiz crash on swtcl - doesn't fix compiz though. Compiz for some reason looks like ass, everything with textures looks like it has a 2x width/height multiplier on the texture coords... --- src/mesa/drivers/dri/r300/r300_swtcl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 48122546c26..7aea063447a 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -154,13 +154,12 @@ static void r300SetVertexFormat( GLcontext *ctx ) offset += 1; } - rmesa->swtcl.coloroffset = offset; if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR0)) { + rmesa->swtcl.coloroffset = offset; InputsRead |= 1 << VERT_ATTRIB_COLOR0; OutputsWritten |= 1 << VERT_RESULT_COL0; EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F ); - } else - EMIT_PAD(4*sizeof(float)); + } offset += 4; @@ -193,7 +192,7 @@ static void r300SetVertexFormat( GLcontext *ctx ) } /* Fixed, apply to vir0 only */ - if (InputsRead & VERT_ATTRIB_POS) + if (InputsRead & (1 << VERT_ATTRIB_POS)) inputs[VERT_ATTRIB_POS] = 0; if (InputsRead & (1 << VERT_ATTRIB_COLOR0)) inputs[VERT_ATTRIB_COLOR0] = 2; -- cgit v1.2.3 From 06542019a86d4b9e4f4dfb7a73aa131910465230 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 2 Jul 2007 08:46:57 -0600 Subject: avoid unnecessary clamping of depth values (bug 11448) --- src/mesa/main/image.c | 79 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index caaf2816571..e2e7f806ab1 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.0 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -3878,7 +3878,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, SWAP4BYTE(value); \ } \ } \ - depthValues[i] = CLAMP(GLTYPE2FLOAT(value), 0.0F, 1.0F); \ + depthValues[i] = GLTYPE2FLOAT(value); \ } \ } while (0) @@ -3889,6 +3889,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, const struct gl_pixelstore_attrib *srcPacking ) { GLfloat depthTemp[MAX_WIDTH], *depthValues; + GLboolean needClamp = GL_FALSE; /* Look for special cases first. * Not only are these faster, they're less prone to numeric conversion @@ -3918,7 +3919,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, /* XXX may want to add additional cases here someday */ } - /* general case path */ + /* general case path follows */ if (dstType == GL_FLOAT) { depthValues = (GLfloat *) dest; @@ -3927,29 +3928,31 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, depthValues = depthTemp; } - /* XXX we need to obey srcPacking->SwapBytes here!!! */ - (void) srcPacking; - - /* convert incoming values to GLfloat */ + /* Convert incoming values to GLfloat. Some conversions will require + * clamping, below. + */ switch (srcType) { case GL_BYTE: - DEPTH_VALUES(GLbyte, BYTE_TO_FLOAT); - break; + DEPTH_VALUES(GLbyte, BYTE_TO_FLOAT); + needClamp = GL_TRUE; + break; case GL_UNSIGNED_BYTE: - DEPTH_VALUES(GLubyte, UBYTE_TO_FLOAT); - break; + DEPTH_VALUES(GLubyte, UBYTE_TO_FLOAT); + break; case GL_SHORT: - DEPTH_VALUES(GLshort, SHORT_TO_FLOAT); - break; + DEPTH_VALUES(GLshort, SHORT_TO_FLOAT); + needClamp = GL_TRUE; + break; case GL_UNSIGNED_SHORT: - DEPTH_VALUES(GLushort, USHORT_TO_FLOAT); - break; + DEPTH_VALUES(GLushort, USHORT_TO_FLOAT); + break; case GL_INT: - DEPTH_VALUES(GLint, INT_TO_FLOAT); - break; + DEPTH_VALUES(GLint, INT_TO_FLOAT); + needClamp = GL_TRUE; + break; case GL_UNSIGNED_INT: - DEPTH_VALUES(GLuint, UINT_TO_FLOAT); - break; + DEPTH_VALUES(GLuint, UINT_TO_FLOAT); + break; case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */ if (dstType == GL_UNSIGNED_INT && depthScale == (GLfloat) 0xffffff && @@ -3981,19 +3984,21 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, } break; case GL_FLOAT: - DEPTH_VALUES(GLfloat, 1*); - break; + DEPTH_VALUES(GLfloat, 1*); + needClamp = GL_TRUE; + break; case GL_HALF_FLOAT_ARB: { GLuint i; const GLhalfARB *src = (const GLhalfARB *) source; for (i = 0; i < n; i++) { - GLhalfARB value = src[i]; - if (srcPacking->SwapBytes) { - SWAP2BYTE(value); - } + GLhalfARB value = src[i]; + if (srcPacking->SwapBytes) { + SWAP2BYTE(value); + } depthValues[i] = _mesa_half_to_float(value); } + needClamp = GL_TRUE; } break; default: @@ -4001,12 +4006,30 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, return; } + /* apply depth scale and bias */ + { + const GLfloat scale = ctx->Pixel.DepthScale; + const GLfloat bias = ctx->Pixel.DepthBias; + if (scale != 1.0 || bias != 0.0) { + GLuint i; + for (i = 0; i < n; i++) { + depthValues[i] = depthValues[i] * scale + bias; + } + needClamp = GL_TRUE; + } + } - /* apply depth scale and bias and clamp to [0,1] */ - if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { - _mesa_scale_and_bias_depth(ctx, n, depthValues); + /* clamp to [0, 1] */ + if (needClamp) { + GLuint i; + for (i = 0; i < n; i++) { + depthValues[i] = CLAMP(depthValues[i], 0.0, 1.0); + } } + /* + * Convert values to dstType + */ if (dstType == GL_UNSIGNED_INT) { GLuint *zValues = (GLuint *) dest; GLuint i; -- cgit v1.2.3 From 9220255d75f14e8bea0c4e677d138f002aec55eb Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 2 Jul 2007 10:16:02 -0600 Subject: add const to wglSetPixelFormat() to match .h declaration --- src/mesa/drivers/windows/gdi/wgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c index 49b4ddbd1f9..fb23d210db7 100644 --- a/src/mesa/drivers/windows/gdi/wgl.c +++ b/src/mesa/drivers/windows/gdi/wgl.c @@ -339,7 +339,7 @@ WINGDIAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc) } WINGDIAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, - PIXELFORMATDESCRIPTOR *ppfd) + const PIXELFORMATDESCRIPTOR *ppfd) { (void) hdc; -- cgit v1.2.3 From 9a45176dd85a1cd523498efeebd0481950a1bf58 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 3 Jul 2007 14:27:41 +0200 Subject: fix GL_DOT3_RGBA texture combiner mode in generated fragment programs (bug #11030) --- src/mesa/main/texenvprogram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 0c6fa82f112..1a46c10ffa3 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -871,7 +871,7 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) key->unit[unit].OptRGB); } else if (key->unit[unit].ModeRGB == MODE_DOT3_RGBA_EXT || - key->unit[unit].ModeA == MODE_DOT3_RGBA) { + key->unit[unit].ModeRGB == MODE_DOT3_RGBA) { out = emit_combine( p, dest, WRITEMASK_XYZW, saturate, unit, -- cgit v1.2.3 From f9b53f648d12ef7e4505d8303e14b90ebd444872 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 3 Jul 2007 08:53:49 -0600 Subject: use _mesa_unpack_stencil_span() in draw_stencil_pixels(), bug 11457 --- src/mesa/swrast/s_drawpix.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index b8b452e33dd..1c9f64b275e 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -398,10 +398,9 @@ draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, width, height, GL_COLOR_INDEX, type, row, skipPixels); - _mesa_unpack_index_span(ctx, spanWidth, destType, values, - type, source, unpack, - ctx->_ImageTransferState); - _mesa_apply_stencil_transfer_ops(ctx, spanWidth, values); + _mesa_unpack_stencil_span(ctx, spanWidth, destType, values, + type, source, unpack, + ctx->_ImageTransferState); if (zoom) { _swrast_write_zoomed_stencil_span(ctx, x, y, spanWidth, spanX, spanY, values); -- cgit v1.2.3 From 3d04682b7a729ff4471528a57a6bdf64d235a43e Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 3 Jul 2007 10:06:13 -0600 Subject: fix StepX/StepY typo --- src/mesa/swrast/s_tritemp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index f5bc03e81e4..cded4a6c1c4 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -393,7 +393,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, span.greenStep = 0; span.blueStep = 0; # ifdef INTERP_ALPHA - span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepX[FRAG_ATTRIB_COL0][3] = 0.0F; + span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepY[FRAG_ATTRIB_COL0][3] = 0.0F; span.alphaStep = 0; # endif } -- cgit v1.2.3 From a36b5c6d4700a0eaa8c2430f1121babafe9294ed Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 3 Jul 2007 11:41:21 -0600 Subject: add code for stpq, rgba writemasks in make_writemask(), bug 11404 --- src/mesa/shader/slang/slang_codegen.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 02260d3422e..f3a6d04428f 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1261,15 +1261,23 @@ make_writemask(const char *field) while (*field) { switch (*field) { case 'x': + case 's': + case 'r': mask |= WRITEMASK_X; break; case 'y': + case 't': + case 'g': mask |= WRITEMASK_Y; break; case 'z': + case 'p': + case 'b': mask |= WRITEMASK_Z; break; case 'w': + case 'q': + case 'a': mask |= WRITEMASK_W; break; default: -- cgit v1.2.3 From 7ff4359a3be1278b26950f96ab23014a667af838 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 3 Jul 2007 11:41:56 -0600 Subject: added vec2(vec4) constructor, bug 11404 --- src/mesa/shader/slang/library/slang_core.gc | 5 ++ src/mesa/shader/slang/library/slang_core_gc.h | 109 +++++++++++++------------- 2 files changed, 60 insertions(+), 54 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc index e398eabb15d..2e7ebc347a6 100644 --- a/src/mesa/shader/slang/library/slang_core.gc +++ b/src/mesa/shader/slang/library/slang_core.gc @@ -181,6 +181,11 @@ vec2 __constructor(const vec3 v) __retVal.xy = v.xy; } +vec2 __constructor(const vec4 v) +{ + __retVal.st = v.xy; +} + //// vec3 constructors diff --git a/src/mesa/shader/slang/library/slang_core_gc.h b/src/mesa/shader/slang/library/slang_core_gc.h index dcd39a0e28d..f2b4fd6464b 100644 --- a/src/mesa/shader/slang/library/slang_core_gc.h +++ b/src/mesa/shader/slang/library/slang_core_gc.h @@ -18,59 +18,60 @@ 20,0,0,1,0,10,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,105,0,59, 120,120,0,20,0,0,1,0,10,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98, 0,59,120,120,0,20,0,0,1,0,10,1,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121, -0,18,118,0,59,120,121,0,20,0,0,1,0,11,1,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,122,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1,0,11,1,1,1,0,9,102,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,102,0,59,120,120,120,0,20,0,0,1,0,11,1, -1,1,0,5,105,0,0,0,1,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,105,0,59,120,120,120,0,0,0,0,1,0,11,1,1,1,0,1,98,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,11,1,1,1,0,12,118,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,0,59,120,121,122,0,20,0,0,1,0,12,1, -1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,122,0,0,1,1,0,9,119,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,119, -0,20,0,0,1,0,12,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0,59,120,120,120, -120,0,20,0,0,1,0,12,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,59,120,120, -120,120,0,20,0,0,1,0,12,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,98,0,59,120,120, -120,120,0,20,0,0,1,0,12,1,1,1,0,11,118,51,0,0,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,102,0,20,0,0,1, -0,6,1,1,1,0,5,105,0,0,1,1,0,5,106,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,105,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,0,1,0,6,1,1,1,0,5,105,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,121,0,18,105,0,59,120,120,0,20,0,0,1,0,6,1,1,1,0,9,102,0,0,0,1,4, -102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -102,0,59,120,120,0,0,0,0,1,0,6,1,1,1,0,1,98,0,0,0,1,4,102,108,111,97,116,95,116,111,95,105,110,116, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,7,1,1,1,0,5,105,0, -0,1,1,0,5,106,0,0,1,1,0,5,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,105,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, -0,18,107,0,20,0,0,1,0,7,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -18,105,0,59,120,120,120,0,20,0,0,1,0,7,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,18,102,0,59,120,120,120,0,20,0,0,1,0,7,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,8,1,1,1,0,5,120,0,0,1,1,0,5,121,0, -0,1,1,0,5,122,0,0,1,1,0,5,119,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, -0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,119,0,20,0,0,1,0,8,1,1,1,0,5,105,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,59,120,120,120,120,0,20,0,0,1,0,8,1,1,1,0,9,102, -0,0,0,1,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,102, -0,59,120,120,120,120,0,0,0,0,1,0,8,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,98,0, -59,120,120,120,120,0,20,0,0,1,0,2,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,0, -1,0,2,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98,0,59,120,120,0,20, -0,0,1,0,2,1,1,1,0,9,102,0,0,0,1,3,2,1,10,1,122,101,114,111,0,2,58,118,101,99,50,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,0,0,0,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,102,0,59,120,120,0,0,18,122,101,114,111,0,0,0,0,1,0,2,1,1,1,0,5,105,0,0,0,1,3,2,1,6,1, -122,101,114,111,0,2,58,105,118,101,99,50,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101,99,52,95,115, -101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,59,120,120,0,0,18,122,101,114, -111,0,0,0,0,1,0,3,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98,51,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,0,1,0,3,1,1,1,0,1,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,3,1,1,1,0,9,102,0, -0,0,1,3,2,1,11,1,122,101,114,111,0,2,58,118,101,99,51,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0, -48,0,0,0,0,0,0,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,102,0,59,120,120,120,0,0,18,122,101,114,111,0,0,0,0,1,0,3,1,1,1,0,5,105,0,0,0,1,3,2,1,7,1,122, -101,114,111,0,2,58,105,118,101,99,51,0,16,8,48,0,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101,99,52, -95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,59,120,120,120,0,0, -18,122,101,114,111,0,0,0,0,1,0,4,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98,51,0,0,1,1,0,1, -98,52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116, +0,18,118,0,59,120,121,0,20,0,0,1,0,10,1,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +115,116,0,18,118,0,59,120,121,0,20,0,0,1,0,11,1,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,122,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1,0,11,1,1,1,0,9, +102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,102,0,59,120,120,120,0,20,0,0,1, +0,11,1,1,1,0,5,105,0,0,0,1,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,122,0,0,18,105,0,59,120,120,120,0,0,0,0,1,0,11,1,1,1,0,1,98,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,11,1,1,1,0,12,118, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,0,59,120,121,122,0,20,0,0,1,0, +12,1,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,122,0,0,1,1,0,9,119,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18, +119,0,20,0,0,1,0,12,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0,59,120,120, +120,120,0,20,0,0,1,0,12,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,59,120, +120,120,120,0,20,0,0,1,0,12,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,98,0,59,120, +120,120,120,0,20,0,0,1,0,12,1,1,1,0,11,118,51,0,0,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,102,0,20,0, +0,1,0,6,1,1,1,0,5,105,0,0,1,1,0,5,106,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,105,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,0,1,0,6,1,1,1,0,5,105,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,121,0,18,105,0,59,120,120,0,20,0,0,1,0,6,1,1,1,0,9,102,0,0,0, +1,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,102,0,59,120,120,0,0,0,0,1,0,6,1,1,1,0,1,98,0,0,0,1,4,102,108,111,97,116,95,116,111,95,105,110, +116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,7,1,1,1,0,5, +105,0,0,1,1,0,5,106,0,0,1,1,0,5,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,105,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,122,0,18,107,0,20,0,0,1,0,7,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,18,105,0,59,120,120,120,0,20,0,0,1,0,7,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,121,122,0,18,102,0,59,120,120,120,0,20,0,0,1,0,7,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,8,1,1,1,0,5,120,0,0,1,1,0, +5,121,0,0,1,1,0,5,122,0,0,1,1,0,5,119,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,119,0,20,0,0,1,0,8,1,1,1,0,5, +105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,59,120,120,120,120,0,20,0,0,1,0,8,1,1,1,0, +9,102,0,0,0,1,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0, +18,102,0,59,120,120,120,120,0,0,0,0,1,0,8,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +18,98,0,59,120,120,120,120,0,20,0,0,1,0,2,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50, +0,20,0,0,1,0,2,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98,0,59,120, +120,0,20,0,0,1,0,2,1,1,1,0,9,102,0,0,0,1,3,2,1,10,1,122,101,114,111,0,2,58,118,101,99,50,0,17,48,0, +48,0,0,0,17,48,0,48,0,0,0,0,0,0,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,0,0,18,102,0,59,120,120,0,0,18,122,101,114,111,0,0,0,0,1,0,2,1,1,1,0,5,105,0,0,0,1,3,2, +1,6,1,122,101,114,111,0,2,58,105,118,101,99,50,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101,99,52,95, +115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,59,120,120,0,0,18,122,101, +114,111,0,0,0,0,1,0,3,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98,51,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,0,1,0,3,1,1,1,0,1,98,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,3,1,1,1,0,9, +102,0,0,0,1,3,2,1,11,1,122,101,114,111,0,2,58,118,101,99,51,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17, +48,0,48,0,0,0,0,0,0,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,102,0,59,120,120,120,0,0,18,122,101,114,111,0,0,0,0,1,0,3,1,1,1,0,5,105,0,0,0,1,3,2,1,7, +1,122,101,114,111,0,2,58,105,118,101,99,51,0,16,8,48,0,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101, +99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,59,120,120,120, +0,0,18,122,101,114,111,0,0,0,0,1,0,4,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98,51,0,0,1,1,0, +1,98,52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116, 86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,9, 18,95,95,114,101,116,86,97,108,0,59,119,0,18,98,52,0,20,0,0,1,0,4,1,1,1,0,1,98,0,0,0,1,9,18,95,95, 114,101,116,86,97,108,0,59,120,121,122,119,0,18,98,0,59,120,120,120,120,0,20,0,0,1,0,4,1,1,1,0,9, @@ -646,7 +647,7 @@ 1,0,12,2,21,1,1,0,15,109,0,0,1,1,0,12,118,0,0,0,1,2,3,2,0,12,1,114,48,0,0,0,9,18,114,48,0,59,120,0, 18,109,0,16,8,48,0,57,59,120,0,20,0,9,18,114,48,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,20,0,9, 18,114,48,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,20,0,9,18,114,48,0,59,119,0,18,109,0,16,10,51, -0,57,59,120,0,20,0,4,118,101,99,52,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +0,57,59,120,0,20,0,4,118,101,99,52,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,115,0,0,18, 114,48,0,0,18,118,0,0,0,0,2,3,2,0,12,1,114,49,0,0,0,9,18,114,49,0,59,120,0,18,109,0,16,8,48,0,57, 59,121,0,20,0,9,18,114,49,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,20,0,9,18,114,49,0,59,122,0, 18,109,0,16,10,50,0,57,59,121,0,20,0,9,18,114,49,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,20,0,4, -- cgit v1.2.3 From 5657fc5b4c6581166430f1a5144f1f8b7e4e78eb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 4 Jul 2007 15:29:31 +1000 Subject: r300: only init swtcl on tcl-less cards --- src/mesa/drivers/dri/r300/r300_context.c | 23 +++++++++++++---------- src/mesa/drivers/dri/r300/r300_swtcl.c | 5 +++++ 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 04e3fffa5df..14e0f052fd5 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -318,15 +318,17 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, _tnl_allow_vertex_fog(ctx, GL_TRUE); /* currently bogus data */ - ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4; - ctx->Const.VertexProgram.MaxNativeInstructions = - VSF_MAX_FRAGMENT_LENGTH / 4; - ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */ - ctx->Const.VertexProgram.MaxTemps = 32; - ctx->Const.VertexProgram.MaxNativeTemps = - /*VSF_MAX_FRAGMENT_TEMPS */ 32; - ctx->Const.VertexProgram.MaxNativeParameters = 256; /* r420 */ - ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; + if (screen->chip_flags & RADEON_CHIPSET_TCL) { + ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4; + ctx->Const.VertexProgram.MaxNativeInstructions = + VSF_MAX_FRAGMENT_LENGTH / 4; + ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */ + ctx->Const.VertexProgram.MaxTemps = 32; + ctx->Const.VertexProgram.MaxNativeTemps = + /*VSF_MAX_FRAGMENT_TEMPS */ 32; + ctx->Const.VertexProgram.MaxNativeParameters = 256; /* r420 */ + ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; + } ctx->Const.FragmentProgram.MaxNativeTemps = PFS_NUM_TEMP_REGS; ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ @@ -364,7 +366,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, radeonInitSpanFuncs(ctx); r300InitCmdBuf(r300); r300InitState(r300); - r300InitSwtcl(ctx); + if (!(screen->chip_flags & RADEON_CHIPSET_TCL)) + r300InitSwtcl(ctx); TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 7aea063447a..c949f33bf33 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -668,6 +668,11 @@ void r300InitSwtcl(GLcontext *ctx) _tnl_need_projected_coords( ctx, GL_FALSE ); r300ChooseRenderState(ctx); + + _mesa_validate_all_lighting_tables( ctx ); + + tnl->Driver.NotifyMaterialChange = + _mesa_validate_all_lighting_tables; } void r300DestroySwtcl(GLcontext *ctx) -- cgit v1.2.3 From bd9db5eed2cca6cd394c88adf09c70204be9da33 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Jul 2007 07:37:14 -0600 Subject: fix LogicOp/bitmap problem, bug 11133 --- src/mesa/drivers/dri/i965/intel_blit.c | 7 +++++-- src/mesa/drivers/dri/i965/intel_blit.h | 3 ++- src/mesa/drivers/dri/i965/intel_pixel_bitmap.c | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c index 173d1d5b6c2..f88cbb2328d 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.c +++ b/src/mesa/drivers/dri/i965/intel_blit.c @@ -532,12 +532,15 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, GLuint dst_offset, GLboolean dst_tiled, GLshort x, GLshort y, - GLshort w, GLshort h) + GLshort w, GLshort h, + GLenum logic_op) { struct xy_setup_blit setup; struct xy_text_immediate_blit text; int dwords = ((src_size + 7) & ~7) / 4; + assert( logic_op - GL_CLEAR >= 0 ); + assert( logic_op - GL_CLEAR < 0x10 ); if (w < 0 || h < 0) return; @@ -561,7 +564,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, setup.br0.length = (sizeof(setup) / sizeof(int)) - 2; setup.br13.dest_pitch = dst_pitch; - setup.br13.rop = 0xcc; + setup.br13.rop = translate_raster_op(logic_op); setup.br13.color_depth = (cpp == 4) ? BR13_8888 : BR13_565; setup.br13.clipping_enable = 0; setup.br13.mono_source_transparency = 1; diff --git a/src/mesa/drivers/dri/i965/intel_blit.h b/src/mesa/drivers/dri/i965/intel_blit.h index 8b0cc65243c..e361545c8fa 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.h +++ b/src/mesa/drivers/dri/i965/intel_blit.h @@ -72,6 +72,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, GLuint dst_offset, GLboolean dst_tiled, GLshort dst_x, GLshort dst_y, - GLshort w, GLshort h); + GLshort w, GLshort h, + GLenum logic_op ); #endif diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c index 5841afaa3ef..421fcc5e511 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c @@ -260,7 +260,9 @@ do_blit_bitmap( GLcontext *ctx, int h = MIN2(DY, box_h - py); int w = MIN2(DX, box_w - px); GLuint sz = align(align(w,8) * h, 64)/8; - + GLenum logic_op = ctx->Color.ColorLogicOpEnabled ? + ctx->Color.LogicOp : GL_COPY; + assert(sz <= sizeof(stipple)); memset(stipple, 0, sz); @@ -288,7 +290,8 @@ do_blit_bitmap( GLcontext *ctx, dst->tiled, rect.x1 + px, rect.y2 - (py + h), - w, h); + w, h, + logic_op); } } } -- cgit v1.2.3 From 9aa8223605989eec99bc58a7e69ef2f7a9f7f15d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 4 Jul 2007 09:22:15 -0600 Subject: assorted clean-ups --- src/mesa/drivers/fbdev/glfbdev.c | 103 +++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 54 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 6c6511b7e53..e95a424698c 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -63,6 +63,9 @@ #include "drivers/common/driverfuncs.h" +/** + * Pixel formats we support: + */ #define PF_B8G8R8 1 #define PF_B8G8R8A8 2 #define PF_B5G6R5 3 @@ -70,7 +73,7 @@ #define PF_CI8 5 -/* +/** * Derived from Mesa's GLvisual class. */ struct GLFBDevVisualRec { @@ -80,7 +83,7 @@ struct GLFBDevVisualRec { int pixelFormat; }; -/* +/** * Derived from Mesa's GLframebuffer class. */ struct GLFBDevBufferRec { @@ -92,7 +95,7 @@ struct GLFBDevBufferRec { GLuint bytesPerPixel; }; -/* +/** * Derived from Mesa's GLcontext class. */ struct GLFBDevContextRec { @@ -103,7 +106,7 @@ struct GLFBDevContextRec { GLFBDevBufferPtr curBuffer; }; -/* +/** * Derived from Mesa's gl_renderbuffer class. */ struct GLFBDevRenderbufferRec { @@ -114,11 +117,6 @@ struct GLFBDevRenderbufferRec { }; - -#define GLFBDEV_CONTEXT(CTX) ((GLFBDevContextPtr) (CTX)) -#define GLFBDEV_BUFFER(BUF) ((GLFBDevBufferPtr) (BUF)) - - /**********************************************************************/ /* Internal device driver functions */ /**********************************************************************/ @@ -151,7 +149,7 @@ update_state( GLcontext *ctx, GLuint new_state ) static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) { - const GLFBDevBufferPtr fbdevbuffer = GLFBDEV_BUFFER(buffer); + const GLFBDevBufferPtr fbdevbuffer = (GLFBDevBufferPtr) buffer; *width = fbdevbuffer->var.xres; *height = fbdevbuffer->var.yres; } @@ -389,8 +387,8 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, /* ignored for now */ break; case GLFBDEV_MULTISAMPLE: - numSamples = attrib[1]; - attrib++; + numSamples = attrib[1]; + attrib++; break; default: /* unexpected token */ @@ -406,36 +404,36 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, alphaBits = varInfo->transp.length; if (fixInfo->visual == FB_VISUAL_TRUECOLOR || - fixInfo->visual == FB_VISUAL_DIRECTCOLOR) { - if(varInfo->bits_per_pixel == 24 - && varInfo->red.offset == 16 - && varInfo->green.offset == 8 - && varInfo->blue.offset == 0) - vis->pixelFormat = PF_B8G8R8; - - else if(varInfo->bits_per_pixel == 32 - && varInfo->red.offset == 16 - && varInfo->green.offset == 8 - && varInfo->blue.offset == 0) - vis->pixelFormat = PF_B8G8R8A8; - - else if(varInfo->bits_per_pixel == 16 - && varInfo->red.offset == 11 - && varInfo->green.offset == 5 - && varInfo->blue.offset == 0) - vis->pixelFormat = PF_B5G6R5; - - else if(varInfo->bits_per_pixel == 16 - && varInfo->red.offset == 10 - && varInfo->green.offset == 5 - && varInfo->blue.offset == 0) - vis->pixelFormat = PF_B5G5R5; - - else { - _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); - _mesa_free(vis); - return NULL; - } + fixInfo->visual == FB_VISUAL_DIRECTCOLOR) { + if (varInfo->bits_per_pixel == 24 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B8G8R8; + } + else if (varInfo->bits_per_pixel == 32 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B8G8R8A8; + } + else if (varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 11 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G6R5; + } + else if (varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 10 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G5R5; + } + else { + _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); + _mesa_free(vis); + return NULL; + } } } else { @@ -578,7 +576,7 @@ new_glfbdev_renderbuffer(void *bufferStart, const GLFBDevVisualPtr visual) rb->rowStride = visual->var.xres_virtual * visual->var.bits_per_pixel / 8; rb->bottom = (GLubyte *) bufferStart - + (visual->var.yres - 1) * rb->rowStride; + + (visual->var.yres - 1) * rb->rowStride; rb->Base.Width = visual->var.xres; rb->Base.Height = visual->var.yres; @@ -635,7 +633,7 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, &frontrb->Base); /* add back renderbuffer */ if (visual->glvisual.doubleBufferMode) { - int malloced = !backBuffer; + const int malloced = !backBuffer; if (malloced) { /* malloc a back buffer */ backBuffer = _mesa_malloc(size); @@ -647,8 +645,11 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, } backrb = new_glfbdev_renderbuffer(backBuffer, visual); - if(malloced) - backrb->mallocedBuffer = GL_TRUE; + if (!backrb) { + /* out of mem */ + return NULL; + } + backrb->mallocedBuffer = malloced; _mesa_add_renderbuffer(&buf->glframebuffer, BUFFER_BACK_LEFT, &backrb->Base); @@ -682,16 +683,10 @@ glFBDevDestroyBuffer( GLFBDevBufferPtr buffer ) if (buffer == curDraw || buffer == curRead) { glFBDevMakeCurrent( NULL, NULL, NULL); } -#if 0 - /* free the software depth, stencil, accum buffers */ - _mesa_free_framebuffer_data(&buffer->glframebuffer); - _mesa_free(buffer); -#else { struct gl_framebuffer *fb = &buffer->glframebuffer; _mesa_unreference_framebuffer(&fb); } -#endif } } -- cgit v1.2.3 From c223c6b663cd5db39ba19c2be74b88cc3b8f53f3 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 4 Jul 2007 13:15:20 -0600 Subject: Be more consistant with paths in #includes. Eventually, eliminate a bunch of -I flags. --- src/mesa/main/api_arrayelt.c | 4 ++-- src/mesa/main/api_loopback.c | 8 ++++---- src/mesa/main/api_noop.c | 2 +- src/mesa/main/arrayobj.c | 2 +- src/mesa/main/context.c | 14 +++++++------- src/mesa/main/context.h | 2 +- src/mesa/main/dlist.c | 18 +++++++++--------- src/mesa/main/execmem.c | 2 +- src/mesa/main/hash.c | 2 +- src/mesa/main/mtypes.h | 4 ++-- src/mesa/main/state.c | 12 ++++++------ src/mesa/main/texenvprogram.c | 8 ++++---- src/mesa/main/varray.c | 2 +- src/mesa/main/vtxfmt_tmp.h | 4 ++-- src/mesa/math/m_eval.c | 4 ++-- src/mesa/math/m_eval.h | 2 +- src/mesa/math/m_translate.h | 4 ++-- src/mesa/math/m_xform.c | 4 ++-- src/mesa/shader/arbprogparse.c | 8 ++++---- src/mesa/shader/prog_execute.c | 2 +- src/mesa/shader/shader_api.c | 7 +++---- src/mesa/shader/slang/slang_builtin.c | 16 ++++++++-------- src/mesa/shader/slang/slang_builtin.h | 2 +- src/mesa/shader/slang/slang_codegen.c | 14 +++++++------- src/mesa/shader/slang/slang_compile.c | 10 +++++----- src/mesa/shader/slang/slang_emit.c | 14 +++++++------- src/mesa/shader/slang/slang_ir.c | 2 +- src/mesa/shader/slang/slang_label.h | 6 +++--- src/mesa/shader/slang/slang_link.c | 20 ++++++++++---------- src/mesa/shader/slang/slang_preprocess.c | 2 +- src/mesa/shader/slang/slang_typeinfo.c | 4 ++-- src/mesa/shader/slang/slang_vartable.c | 4 ++-- src/mesa/swrast/s_atifragshader.c | 7 +++---- src/mesa/swrast/s_context.c | 2 +- src/mesa/swrast/s_context.h | 4 ++-- src/mesa/swrast/s_fragprog.c | 10 +++++----- src/mesa/swrast/swrast.h | 2 +- src/mesa/tnl/t_context.c | 12 ++++++------ src/mesa/tnl/t_context.h | 4 ++-- src/mesa/tnl/t_pipeline.c | 10 +++++----- src/mesa/tnl/t_vb_program.c | 10 +++++----- src/mesa/tnl/t_vp_build.c | 10 +++++----- src/mesa/tnl/tnl.h | 2 +- src/mesa/vbo/vbo.h | 2 +- src/mesa/vbo/vbo_context.c | 6 +++--- src/mesa/vbo/vbo_exec.c | 16 ++++++++-------- src/mesa/vbo/vbo_exec.h | 2 +- src/mesa/vbo/vbo_exec_api.c | 20 ++++++++++---------- src/mesa/vbo/vbo_exec_array.c | 12 ++++++------ src/mesa/vbo/vbo_exec_draw.c | 10 +++++----- src/mesa/vbo/vbo_exec_eval.c | 10 +++++----- src/mesa/vbo/vbo_rebase.c | 6 +++--- src/mesa/vbo/vbo_save.c | 8 ++++---- src/mesa/vbo/vbo_save.h | 2 +- src/mesa/vbo/vbo_save_api.c | 18 +++++++++--------- src/mesa/vbo/vbo_save_draw.c | 14 +++++++------- src/mesa/vbo/vbo_save_loopback.c | 16 ++++++++-------- src/mesa/vbo/vbo_split.c | 6 +++--- src/mesa/vbo/vbo_split_copy.c | 10 +++++----- src/mesa/vbo/vbo_split_inplace.c | 6 +++--- 60 files changed, 222 insertions(+), 224 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 1899975213f..72091b0789c 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -31,8 +31,8 @@ #include "context.h" #include "imports.h" #include "macros.h" -#include "glapioffsets.h" -#include "dispatch.h" +#include "glapi/glapioffsets.h" +#include "glapi/dispatch.h" typedef void (GLAPIENTRY *array_func)( const void * ); diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index efe5a77d581..924d7134a27 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -30,14 +30,14 @@ #include "glheader.h" -#include "glapi.h" -#include "glapitable.h" #include "macros.h" #include "colormac.h" #include "api_loopback.h" -#include "glthread.h" #include "mtypes.h" -#include "dispatch.h" +#include "glapi/glapi.h" +#include "glapi/glapitable.h" +#include "glapi/glthread.h" +#include "glapi/dispatch.h" /* KW: A set of functions to convert unusual Color/Normal/Vertex/etc * calls to a smaller set of driver-provided formats. Currently just diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 0c1a35361f1..3df64362eab 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -31,7 +31,7 @@ #include "light.h" #include "macros.h" #include "dlist.h" -#include "dispatch.h" +#include "glapi/dispatch.h" /** diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index d601ee461e6..f08f99d8e17 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -46,7 +46,7 @@ #include "bufferobj.h" #endif #include "arrayobj.h" -#include "dispatch.h" +#include "glapi/dispatch.h" /** diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 255023c0fa9..21adcf32106 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -97,12 +97,9 @@ #include "fog.h" #include "framebuffer.h" #include "get.h" -#include "glthread.h" -#include "glapioffsets.h" #include "histogram.h" #include "hint.h" #include "hash.h" -#include "atifragshader.h" #include "light.h" #include "lines.h" #include "macros.h" @@ -110,9 +107,6 @@ #include "pixel.h" #include "points.h" #include "polygon.h" -#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program -#include "program.h" -#endif #include "queryobj.h" #include "rastpos.h" #include "simple_list.h" @@ -126,13 +120,19 @@ #include "varray.h" #include "version.h" #include "vtxfmt.h" +#include "glapi/glthread.h" +#include "glapi/glapioffsets.h" +#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program +#include "shader/program.h" +#endif +#include "shader/shader_api.h" +#include "shader/atifragshader.h" #if _HAVE_FULL_GL #include "math/m_translate.h" #include "math/m_matrix.h" #include "math/m_xform.h" #include "math/mathmod.h" #endif -#include "shader_api.h" #ifdef USE_SPARC_ASM #include "sparc/sparc.h" diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index b6a9d131493..099912aa152 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -49,7 +49,7 @@ #define CONTEXT_H -#include "glapi.h" +#include "glapi/glapi.h" #include "imports.h" #include "mtypes.h" diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 91ddcbf9ed6..293ee5fa349 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -33,10 +33,6 @@ #include "api_arrayelt.h" #include "api_loopback.h" #include "config.h" -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program -#include "arbprogram.h" -#include "program.h" -#endif #include "attrib.h" #include "blend.h" #include "buffers.h" @@ -57,7 +53,7 @@ #include "extensions.h" #include "feedback.h" #include "get.h" -#include "glapi.h" +#include "glapi/glapi.h" #include "hash.h" #include "histogram.h" #include "image.h" @@ -76,18 +72,22 @@ #include "texstate.h" #include "mtypes.h" #include "varray.h" +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program +#include "shader/arbprogram.h" +#include "shader/program.h" +#endif #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program -#include "nvprogram.h" -#include "program.h" +#include "shader/nvprogram.h" +#include "shader/program.h" #endif #if FEATURE_ATI_fragment_shader -#include "atifragshader.h" +#include "shader/atifragshader.h" #endif #include "math/m_matrix.h" #include "math/m_xform.h" -#include "dispatch.h" +#include "glapi/dispatch.h" /** diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index df3095232de..40f66d7da2d 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -32,7 +32,7 @@ #include "imports.h" -#include "glthread.h" +#include "glapi/glthread.h" diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index 2d5bcc3e01e..ffb2c4d946e 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -37,7 +37,7 @@ #include "glheader.h" #include "imports.h" -#include "glthread.h" +#include "glapi/glthread.h" #include "hash.h" diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 05c08c19fec..709b88d2ef5 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -38,8 +38,8 @@ #include "glheader.h" #include /* __GLcontextModes (GLvisual) */ #include "config.h" /* Hardwired parameters */ -#include "glapitable.h" -#include "glthread.h" +#include "glapi/glapitable.h" +#include "glapi/glthread.h" #include "math/m_matrix.h" /* GLmatrix */ #include "bitset.h" diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 0a83abc7dda..66f8ac64088 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -35,10 +35,10 @@ #include "accum.h" #include "api_loopback.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program -#include "arbprogram.h" +#include "shader/arbprogram.h" #endif #if FEATURE_ATI_fragment_shader -#include "atifragshader.h" +#include "shader/atifragshader.h" #endif #include "attrib.h" #include "blend.h" @@ -85,18 +85,18 @@ #include "mtypes.h" #include "varray.h" #if FEATURE_NV_vertex_program -#include "nvprogram.h" +#include "shader/nvprogram.h" #endif #if FEATURE_NV_fragment_program -#include "nvprogram.h" -#include "program.h" +#include "shader/nvprogram.h" +#include "shader/program.h" #include "texenvprogram.h" #endif #if FEATURE_ARB_shader_objects #include "shaders.h" #endif #include "debug.h" -#include "dispatch.h" +#include "glapi/dispatch.h" diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 1a46c10ffa3..72b54b27d9a 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -28,10 +28,10 @@ #include "glheader.h" #include "macros.h" #include "enums.h" -#include "prog_parameter.h" -#include "prog_instruction.h" -#include "prog_print.h" -#include "prog_statevars.h" +#include "shader/prog_parameter.h" +#include "shader/prog_instruction.h" +#include "shader/prog_print.h" +#include "shader/prog_statevars.h" #include "texenvprogram.h" /** diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index bf1ad0165e6..fe4a7c684f6 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -32,7 +32,7 @@ #include "mtypes.h" #include "varray.h" #include "arrayobj.h" -#include "dispatch.h" +#include "glapi/dispatch.h" /** diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h index 783b06558d5..6f5d01e40f2 100644 --- a/src/mesa/main/vtxfmt_tmp.h +++ b/src/mesa/main/vtxfmt_tmp.h @@ -29,8 +29,8 @@ #define PRE_LOOPBACK( FUNC ) #endif -#include "dispatch.h" -#include "glapioffsets.h" +#include "glapi/dispatch.h" +#include "glapi/glapioffsets.h" static void GLAPIENTRY TAG(ArrayElement)( GLint i ) { diff --git a/src/mesa/math/m_eval.c b/src/mesa/math/m_eval.c index 42ffd4133d3..d324673c5d7 100644 --- a/src/mesa/math/m_eval.c +++ b/src/mesa/math/m_eval.c @@ -37,8 +37,8 @@ */ -#include "glheader.h" -#include "config.h" +#include "main/glheader.h" +#include "main/config.h" #include "m_eval.h" static GLfloat inv_tab[MAX_EVAL_ORDER]; diff --git a/src/mesa/math/m_eval.h b/src/mesa/math/m_eval.h index a23cbd402e6..d73ecaafb28 100644 --- a/src/mesa/math/m_eval.h +++ b/src/mesa/math/m_eval.h @@ -26,7 +26,7 @@ #ifndef _M_EVAL_H #define _M_EVAL_H -#include "glheader.h" +#include "main/glheader.h" void _math_init_eval( void ); diff --git a/src/mesa/math/m_translate.h b/src/mesa/math/m_translate.h index 0bcf96005c7..c677682d506 100644 --- a/src/mesa/math/m_translate.h +++ b/src/mesa/math/m_translate.h @@ -26,8 +26,8 @@ #ifndef _M_TRANSLATE_H_ #define _M_TRANSLATE_H_ -#include "config.h" -#include "mtypes.h" /* hack for GLchan */ +#include "main/config.h" +#include "main/mtypes.h" /* hack for GLchan */ /** diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index fa3f57a8e5a..901ae5b416a 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -33,8 +33,8 @@ * 3. Transformation of a point p by a matrix M is: p' = M * p */ -#include "glheader.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/macros.h" #include "m_eval.h" #include "m_matrix.h" diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 5d8f763741f..9a5290d920e 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -30,10 +30,10 @@ * \author Karl Rasche */ -#include "glheader.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "shader/grammar/grammar_mesa.h" #include "arbprogparse.h" -#include "grammar_mesa.h" #include "program.h" #include "prog_parameter.h" #include "prog_statevars.h" @@ -3573,7 +3573,7 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst, /* XXX temporary */ LONGSTRING static char core_grammar_text[] = -#include "grammar_syn.h" +#include "shader/grammar/grammar_syn.h" ; diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 9faf9d86134..28d195d0ee9 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -43,7 +43,7 @@ #include "prog_instruction.h" #include "prog_parameter.h" #include "prog_print.h" -#include "slang_library_noise.h" +#include "shader/slang/slang_library_noise.h" /* See comments below for info about this */ diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 3a54e68d0de..66509d56db1 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -43,10 +43,9 @@ #include "prog_parameter.h" #include "prog_print.h" #include "prog_statevars.h" -#include "shader_api.h" - -#include "slang_compile.h" -#include "slang_link.h" +#include "shader/shader_api.h" +#include "shader/slang/slang_compile.h" +#include "shader/slang/slang_link.h" diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 6ee0fd33b6a..1081d8ff8db 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -28,14 +28,14 @@ * \author Brian Paul */ -#include "imports.h" -#include "slang_builtin.h" -#include "slang_ir.h" -#include "mtypes.h" -#include "program.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_statevars.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "shader/program.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" +#include "shader/prog_statevars.h" +#include "shader/slang/slang_ir.h" +#include "shader/slang/slang_builtin.h" /** diff --git a/src/mesa/shader/slang/slang_builtin.h b/src/mesa/shader/slang/slang_builtin.h index ae20c844d58..58629f4f7fe 100644 --- a/src/mesa/shader/slang/slang_builtin.h +++ b/src/mesa/shader/slang/slang_builtin.h @@ -26,7 +26,7 @@ #ifndef SLANG_BUILTIN_H #define SLANG_BUILTIN_H -#include "prog_parameter.h" +#include "shader/prog_parameter.h" #include "slang_utility.h" #include "slang_ir.h" diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index f3a6d04428f..2b5196f095f 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -37,13 +37,13 @@ -#include "imports.h" -#include "macros.h" -#include "mtypes.h" -#include "program.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_statevars.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "shader/program.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" +#include "shader/prog_statevars.h" #include "slang_typeinfo.h" #include "slang_codegen.h" #include "slang_compile.h" diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index a4dd5b8b4ae..70f5aac16d4 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -28,11 +28,11 @@ * \author Michal Krol */ -#include "imports.h" -#include "context.h" -#include "program.h" -#include "prog_parameter.h" -#include "grammar_mesa.h" +#include "main/imports.h" +#include "main/context.h" +#include "shader/program.h" +#include "shader/prog_parameter.h" +#include "shader/grammar/grammar_mesa.h" #include "slang_codegen.h" #include "slang_compile.h" #include "slang_preprocess.h" diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 7804e192360..02c74095a9e 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -36,13 +36,13 @@ ***/ -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "program.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_print.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "shader/program.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" +#include "shader/prog_print.h" #include "slang_builtin.h" #include "slang_emit.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index a6903cc8b62..a29f3026873 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -27,7 +27,7 @@ #include "context.h" #include "slang_ir.h" #include "slang_mem.h" -#include "prog_print.h" +#include "shader/prog_print.h" static const slang_ir_info IrInfo[] = { diff --git a/src/mesa/shader/slang/slang_label.h b/src/mesa/shader/slang/slang_label.h index 0f1a45b30f9..87068ae7a7f 100644 --- a/src/mesa/shader/slang/slang_label.h +++ b/src/mesa/shader/slang/slang_label.h @@ -1,9 +1,9 @@ #ifndef SLANG_LABEL_H #define SLANG_LABEL_H 1 -#include "imports.h" -#include "mtypes.h" -#include "prog_instruction.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "shader/prog_instruction.h" struct slang_label_ diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index d6d1c7523e5..eaa29ba094e 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -28,16 +28,16 @@ * \author Brian Paul */ -#include "imports.h" -#include "context.h" -#include "hash.h" -#include "macros.h" -#include "program.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_print.h" -#include "prog_statevars.h" -#include "shader_api.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/macros.h" +#include "shader/program.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" +#include "shader/prog_print.h" +#include "shader/prog_statevars.h" +#include "shader/shader_api.h" #include "slang_link.h" diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index 72281eda57d..076e982f8f2 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -29,7 +29,7 @@ */ #include "imports.h" -#include "grammar_mesa.h" +#include "shader/grammar/grammar_mesa.h" #include "slang_preprocess.h" LONGSTRING static const char *slang_pp_directives_syn = diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index da0b32bc444..8a1c3abf480 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -28,12 +28,12 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" +#include "shader/prog_instruction.h" #include "slang_typeinfo.h" #include "slang_compile.h" #include "slang_log.h" #include "slang_mem.h" -#include "prog_instruction.h" /** diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index 8a3c299d19c..1d817000c60 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -1,11 +1,11 @@ -#include "imports.h" +#include "main/imports.h" +#include "shader/prog_instruction.h" #include "slang_compile.h" #include "slang_compile_variable.h" #include "slang_mem.h" #include "slang_vartable.h" #include "slang_ir.h" -#include "prog_instruction.h" static int dbg = 0; diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 947054faa30..55ec757ee06 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -23,11 +23,10 @@ #include "glheader.h" #include "colormac.h" #include "context.h" -#include "atifragshader.h" #include "macros.h" -#include "program.h" - -#include "s_atifragshader.h" +#include "shader/program.h" +#include "shader/atifragshader.h" +#include "swrast/s_atifragshader.h" /** diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 791850cb502..39569256514 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -31,9 +31,9 @@ #include "context.h" #include "colormac.h" #include "mtypes.h" -#include "prog_statevars.h" #include "teximage.h" #include "swrast.h" +#include "shader/prog_statevars.h" #include "s_blend.h" #include "s_context.h" #include "s_lines.h" diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index f118eb92ca4..daa07e15783 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -43,10 +43,10 @@ #ifndef S_CONTEXT_H #define S_CONTEXT_H -#include "mtypes.h" +#include "main/mtypes.h" +#include "shader/prog_execute.h" #include "swrast.h" #include "s_span.h" -#include "prog_execute.h" typedef void (*texture_sample_func)(GLcontext *ctx, diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 923b67e78e6..14c9868c180 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -22,11 +22,11 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "prog_instruction.h" -#include "texstate.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/texstate.h" +#include "shader/prog_instruction.h" #include "s_fragprog.h" #include "s_span.h" diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index d101a9e2ae2..85a27fd55bf 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -32,7 +32,7 @@ #ifndef SWRAST_H #define SWRAST_H -#include "mtypes.h" +#include "main/mtypes.h" /** * \struct SWvertex diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 3017c73cf1f..3b8dd18bbb2 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" -#include "light.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/light.h" #include "tnl.h" #include "t_context.h" diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 31b89aca41f..baf283ef0f6 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -49,8 +49,8 @@ #ifndef _T_CONTEXT_H #define _T_CONTEXT_H -#include "glheader.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/mtypes.h" #include "math/m_matrix.h" #include "math/m_vector.h" diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index c7188da34aa..2a0ed8852a2 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -25,11 +25,11 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "state.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/state.h" +#include "main/mtypes.h" #include "t_context.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 9961af70ce7..f8e561ac57e 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -35,16 +35,16 @@ #include "context.h" #include "macros.h" #include "imports.h" -#include "prog_instruction.h" -#include "prog_statevars.h" -#include "prog_execute.h" +#include "shader/prog_instruction.h" +#include "shader/prog_statevars.h" +#include "shader/prog_execute.h" +#include "swrast/s_context.h" +#include "swrast/s_texfilter.h" #include "tnl.h" #include "t_context.h" #include "t_pipeline.h" -#include "swrast/s_context.h" -#include "swrast/s_texfilter.h" /** * XXX the texture sampling code in this module is a bit of a hack. diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 2a1cae77f29..ee1a2498b32 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -33,11 +33,11 @@ #include "glheader.h" #include "macros.h" #include "enums.h" -#include "program.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_print.h" -#include "prog_statevars.h" +#include "shader/program.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" +#include "shader/prog_print.h" +#include "shader/prog_statevars.h" #include "t_context.h" /* NOTE: very light dependency on this */ #include "t_vp_build.h" diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h index 20bed5546de..047b764dcba 100644 --- a/src/mesa/tnl/tnl.h +++ b/src/mesa/tnl/tnl.h @@ -29,7 +29,7 @@ #ifndef _TNL_H #define _TNL_H -#include "mtypes.h" +#include "main/mtypes.h" diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 874a5f9e0e2..04c59c05b27 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -32,7 +32,7 @@ #ifndef _VBO_H #define _VBO_H -#include "mtypes.h" +#include "main/mtypes.h" struct _mesa_prim { GLuint mode:8; diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index f64f59d11ec..ad4556c500b 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -25,11 +25,11 @@ * Keith Whitwell */ -#include "mtypes.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/api_arrayelt.h" #include "vbo.h" #include "vbo_context.h" -#include "imports.h" -#include "api_arrayelt.h" /* Reach out and grab this to use as the default: */ diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c index 7d958732479..1efa74945dd 100644 --- a/src/mesa/vbo/vbo_exec.c +++ b/src/mesa/vbo/vbo_exec.c @@ -26,14 +26,14 @@ */ -#include "api_arrayelt.h" -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" -#include "dlist.h" -#include "vtxfmt.h" +#include "main/api_arrayelt.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/dlist.h" +#include "main/vtxfmt.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index a9b01e08e6a..b7e8c9fe79f 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -34,7 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __VBO_EXEC_H__ #define __VBO_EXEC_H__ -#include "mtypes.h" +#include "main/mtypes.h" #include "vbo.h" #include "vbo_attrib.h" diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 2d4ded0f984..7f56b3b6293 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -30,16 +30,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "vtxfmt.h" -#include "dlist.h" -#include "state.h" -#include "light.h" -#include "api_arrayelt.h" -#include "api_noop.h" -#include "dispatch.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/vtxfmt.h" +#include "main/dlist.h" +#include "main/state.h" +#include "main/light.h" +#include "main/api_arrayelt.h" +#include "main/api_noop.h" +#include "glapi/dispatch.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 1e4c310203b..77f3cf1455b 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -25,12 +25,12 @@ * **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "state.h" -#include "api_validate.h" -#include "api_noop.h" -#include "dispatch.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/state.h" +#include "main/api_validate.h" +#include "main/api_noop.h" +#include "glapi/dispatch.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index d8f167b3577..0ef26cdfe36 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -25,11 +25,11 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "enums.h" -#include "state.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/state.h" +#include "main/macros.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c index fe533290bd1..0ba5585d246 100644 --- a/src/mesa/vbo/vbo_exec_eval.c +++ b/src/mesa/vbo/vbo_exec_eval.c @@ -25,13 +25,13 @@ * Keith Whitwell */ -#include "glheader.h" -#include "api_eval.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/api_eval.h" +#include "main/context.h" +#include "main/macros.h" #include "math/m_eval.h" +#include "glapi/dispatch.h" #include "vbo_exec.h" -#include "dispatch.h" static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index bc4211d8529..dae778e741e 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -46,9 +46,9 @@ * of zero. */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "vbo.h" diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c index e7f46879639..87248e10f3b 100644 --- a/src/mesa/vbo/vbo_save.c +++ b/src/mesa/vbo/vbo_save.c @@ -26,10 +26,10 @@ */ -#include "mtypes.h" -#include "dlist.h" -#include "vtxfmt.h" -#include "imports.h" +#include "main/mtypes.h" +#include "main/dlist.h" +#include "main/vtxfmt.h" +#include "main/imports.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h index b81f275a602..b7e9baabf81 100644 --- a/src/mesa/vbo/vbo_save.h +++ b/src/mesa/vbo/vbo_save.h @@ -34,7 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef VBO_SAVE_H #define VBO_SAVE_H -#include "mtypes.h" +#include "main/mtypes.h" #include "vbo.h" #include "vbo_attrib.h" diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index e7794c2a6cc..aded7381436 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -67,15 +67,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "context.h" -#include "dlist.h" -#include "enums.h" -#include "macros.h" -#include "api_validate.h" -#include "api_arrayelt.h" -#include "vtxfmt.h" -#include "dispatch.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/dlist.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/api_validate.h" +#include "main/api_arrayelt.h" +#include "main/vtxfmt.h" +#include "glapi/dispatch.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 8940551d08b..3c6f0fccd98 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -26,13 +26,13 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "mtypes.h" -#include "macros.h" -#include "light.h" -#include "state.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/light.h" +#include "main/state.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c index 430333b84dd..f2cef698fbe 100644 --- a/src/mesa/vbo/vbo_save_loopback.c +++ b/src/mesa/vbo/vbo_save_loopback.c @@ -28,17 +28,17 @@ #include "swrast_setup/swrast_setup.h" #include "swrast/swrast.h" #include "tnl/tnl.h" -#include "context.h" +#include "main/context.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "glapi/dispatch.h" +#include "glapi/glapi.h" #include "vbo_context.h" -#include "glheader.h" -#include "enums.h" -#include "glapi.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" -#include "dispatch.h" typedef void (*attr_func)( GLcontext *ctx, GLint target, const GLfloat * ); diff --git a/src/mesa/vbo/vbo_split.c b/src/mesa/vbo/vbo_split.c index ef205a3bb1f..58e879628de 100644 --- a/src/mesa/vbo/vbo_split.c +++ b/src/mesa/vbo/vbo_split.c @@ -47,9 +47,9 @@ * limitations on drivers which want to use it as a fallback path. */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "vbo_split.h" #include "vbo.h" diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index e142dde6803..e5c4429350e 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -29,11 +29,11 @@ /* Split indexed primitives with per-vertex copying. */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "enums.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/mtypes.h" #include "vbo_split.h" #include "vbo.h" diff --git a/src/mesa/vbo/vbo_split_inplace.c b/src/mesa/vbo/vbo_split_inplace.c index ea62866e7c9..958afccd0c0 100644 --- a/src/mesa/vbo/vbo_split_inplace.c +++ b/src/mesa/vbo/vbo_split_inplace.c @@ -27,9 +27,9 @@ */ -#include "mtypes.h" -#include "macros.h" -#include "enums.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/enums.h" #include "vbo_split.h" -- cgit v1.2.3 From ffa2659204121f703208782ff225a22e0c21b173 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 5 Jul 2007 09:37:46 -0600 Subject: stencil pixel map didn't work in _mesa_unpack_stencil_span(), bug 11475 --- src/mesa/main/image.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index e2e7f806ab1..e874719e645 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -3648,11 +3648,13 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, * Try simple cases first */ if (transferOps == 0 && + !ctx->Pixel.MapStencilFlag && srcType == GL_UNSIGNED_BYTE && dstType == GL_UNSIGNED_BYTE) { _mesa_memcpy(dest, source, n * sizeof(GLubyte)); } else if (transferOps == 0 && + !ctx->Pixel.MapStencilFlag && srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) { @@ -3668,19 +3670,17 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source, srcPacking); - if (transferOps) { - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - /* shift and offset indexes */ - shift_and_offset_ci(ctx, n, indexes); - } + if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { + /* shift and offset indexes */ + shift_and_offset_ci(ctx, n, indexes); + } - if (ctx->Pixel.MapStencilFlag) { - /* Apply stencil lookup table */ - GLuint mask = ctx->PixelMaps.StoS.Size - 1; - GLuint i; - for (i=0;iPixelMaps.StoS.Map[ indexes[i] & mask ]; - } + if (ctx->Pixel.MapStencilFlag) { + /* Apply stencil lookup table */ + const GLuint mask = ctx->PixelMaps.StoS.Size - 1; + GLuint i; + for (i = 0; i < n; i++) { + indexes[i] = ctx->PixelMaps.StoS.Map[ indexes[i] & mask ]; } } -- cgit v1.2.3